diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h
index 8f02c5b83f783f6411589c72e097534943809b6c..e2290dbd3b6a693da4bd2235578fab2f9987042e 100644
--- a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h
@@ -29,7 +29,6 @@ class CaloAlignCondAlg final : public AthAlgorithm
 
   virtual StatusCode initialize() override;
   virtual StatusCode execute() override;
-  virtual StatusCode finalize() override {return StatusCode::SUCCESS;};
 
  private:
   SG::ReadCondHandleKey<GeoAlignmentStore>  m_readKeyGeoAlign {this
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloSuperCellAlignCondAlg.cxx b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloSuperCellAlignCondAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..f992cd5e923511bbadf28cb0313b177ba0ffac15
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloSuperCellAlignCondAlg.cxx
@@ -0,0 +1,68 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "CaloSuperCellAlignCondAlg.h"
+
+#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloDetDescrUtils/CaloSuperCellUtils.h"
+#include "AthenaKernel/getMessageSvc.h"
+
+#include <memory>
+
+StatusCode CaloSuperCellAlignCondAlg::initialize()
+{
+  ATH_MSG_DEBUG("initialize " << name());
+  
+  ATH_CHECK(m_condSvc.retrieve());
+  ATH_CHECK(m_scidTool.retrieve());
+  ATH_CHECK(m_readCaloMgrKey.initialize());
+  ATH_CHECK(m_writeCaloSuperCellMgrKey.initialize());
+  // Register Write Cond Handle
+  if(m_condSvc->regHandle(this, m_writeCaloSuperCellMgrKey).isFailure()) {
+    ATH_MSG_ERROR("unable to register WriteCondHandle " << m_writeCaloSuperCellMgrKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+  
+  return StatusCode::SUCCESS;
+}
+
+StatusCode CaloSuperCellAlignCondAlg::execute()
+{
+  const EventContext& ctx = Gaudi::Hive::currentContext();
+  // ____________ Construct Write Cond Handle and check its validity ____________
+  SG::WriteCondHandle<CaloSuperCellDetDescrManager> writeCaloSuperCellMgrHandle{m_writeCaloSuperCellMgrKey,ctx};
+  if (writeCaloSuperCellMgrHandle.isValid()) {
+    ATH_MSG_DEBUG("Found valid write handle");
+    return StatusCode::SUCCESS;
+  }
+  
+  // ____________ Get Read Cond Object ____________
+  SG::ReadCondHandle<CaloDetDescrManager> readCaloMgrHandle{m_readCaloMgrKey,ctx};
+  ATH_CHECK(readCaloMgrHandle.isValid());
+  ATH_MSG_DEBUG("Retrieved CaloDetDescrManager object form the Condition Store");
+  writeCaloSuperCellMgrHandle.addDependency(readCaloMgrHandle);
+  
+  // ____________ Build new CaloSuperCellDetDescrManager _________________
+  std::unique_ptr<CaloSuperCellDetDescrManager> mgr = std::make_unique<CaloSuperCellDetDescrManager>();
+
+  const CaloIdManager* caloId_mgr{nullptr};
+  ATH_CHECK(detStore()->retrieve(caloId_mgr, "CaloIdManager"));
+ 
+  mgr->set_helper(caloId_mgr->getCaloCell_SuperCell_ID());
+  mgr->set_helper(caloId_mgr);
+  mgr->initialize();
+ 
+  createDescriptors(mgr.get());
+  createElements(mgr.get());
+
+  // ____________ Apply Alignment Corrections ____________________________
+  ATH_CHECK(updateElements(mgr.get(),*readCaloMgrHandle,m_scidTool.get()));
+  updateDescriptors(mgr.get(),*readCaloMgrHandle,m_scidTool.get());
+
+  ATH_CHECK(writeCaloSuperCellMgrHandle.record(std::move(mgr)));
+  ATH_MSG_INFO("recorded new CaloSuperCellDetDescr Manager condition object with key " << writeCaloSuperCellMgrHandle.key() 
+	       << " and range " << writeCaloSuperCellMgrHandle.getRange());
+  
+  return StatusCode::SUCCESS;
+}
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloSuperCellAlignCondAlg.h b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloSuperCellAlignCondAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e6aa97a1239442dea3f0607aed3cf00e7d98758
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloSuperCellAlignCondAlg.h
@@ -0,0 +1,52 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef CALOALIGNMENTALGS_CALOSUPERCELLALIGNCONDALG_H
+#define CALOALIGNMENTALGS_CALOSUPERCELLALIGNCONDALG_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "GaudiKernel/ToolHandle.h"
+
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "CaloDetDescr/ICaloSuperCellIDTool.h"
+
+/**
+ * @class CaloSuperCellAlignCondAlg
+ *
+ * @brief Condition Algorithm for making CaloSuperCellDetDescrManager condition object
+ *
+ **/
+
+class CaloSuperCellAlignCondAlg final : public AthAlgorithm
+{
+ public:
+  using AthAlgorithm::AthAlgorithm;
+  virtual ~CaloSuperCellAlignCondAlg() = default;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+
+ private:
+  SG::ReadCondHandleKey<CaloDetDescrManager>  m_readCaloMgrKey {this
+      , "CaloDetDescrManager"
+      , "CaloDetDescrManager"
+      , "SG key of the resulting CaloDetDescrManager" };
+
+  SG::WriteCondHandleKey<CaloSuperCellDetDescrManager>  m_writeCaloSuperCellMgrKey {this
+      , "CaloSuperCellDetDescrManager"
+      , "CaloSuperCellDetDescrManager"
+      , "SG key of the resulting CaloSuperCellDetDescrManager" };
+
+  ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"};
+
+  ToolHandle<ICaloSuperCellIDTool> m_scidTool {this
+      , "CaloSuperCellIDTool"
+      , "CaloSuperCellIDTool"
+      , "Offline / SuperCell ID mapping tool" };
+};
+
+#endif
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx
index 70dea40d86b336a40ee263882b9ff10926389ed5..e7df30eeb67f474dfd5f8881c44c17715be5f3cb 100644
--- a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx
@@ -1,3 +1,5 @@
 #include "../CaloAlignCondAlg.h"
+#include "../CaloSuperCellAlignCondAlg.h"
 
 DECLARE_COMPONENT( CaloAlignCondAlg )
+DECLARE_COMPONENT( CaloSuperCellAlignCondAlg )
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentTools/CMakeLists.txt b/Calorimeter/CaloAlignment/CaloAlignmentTools/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..084618e17e0332a40a6e66bed1d3ed5a0cad24df
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentTools/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# Declare the package name:
+atlas_subdir( CaloAlignmentTools )
+
+atlas_add_component( CaloAlignmentTools
+                     src/*.cxx
+		     src/components/*.cxx
+                     LINK_LIBRARIES GaudiKernel AthenaBaseComps AthenaKernel GeoModelUtilities
+		                    CaloConditions CaloDetDescrLib CaloDetDescrUtils GeoModelInterfaces )
diff --git a/Calorimeter/CaloDetDescr/src/CaloAlignTool.cxx b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloAlignTool.cxx
similarity index 99%
rename from Calorimeter/CaloDetDescr/src/CaloAlignTool.cxx
rename to Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloAlignTool.cxx
index 83e93a22d8843e45ca516dd556d23ff2b154ed1b..525348e2eb96d906a21d2a98136a1904b1b251a5 100755
--- a/Calorimeter/CaloDetDescr/src/CaloAlignTool.cxx
+++ b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloAlignTool.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "CaloDetDescr/CaloAlignTool.h"
+#include "CaloAlignTool.h"
 
 #include "GeoModelInterfaces/IGeoModelSvc.h"
 #include "GeoModelInterfaces/IGeoModelTool.h"
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloAlignTool.h b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloAlignTool.h
similarity index 83%
rename from Calorimeter/CaloDetDescr/CaloDetDescr/CaloAlignTool.h
rename to Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloAlignTool.h
index 7cabd7e10bee60812a26005648e70bef9cbf3774..5df9d35f64ff2aca0e523134c40bcd0f6060bcff 100755
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloAlignTool.h
+++ b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloAlignTool.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
 */
 
 /**
@@ -12,8 +12,8 @@
  * $Id: CaloAlignTool.h,v 1.3 2008-12-11 16:46:46 tsulaia Exp $
  */
 
-#ifndef CALODETDESCR_CALOALIGNTOOL_H
-#define CALODETDESCR_CALOALIGNTOOL_H
+#ifndef CALOALIGNMENTTOOLS_CALOALIGNTOOL_H
+#define CALOALIGNMENTTOOLS_CALOALIGNTOOL_H
 
 #include "GeoModelInterfaces/IGeoAlignTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
@@ -23,8 +23,6 @@
 
 #include "CxxUtils/checker_macros.h"
 
-class CaloDetDescrManager;
-
 /**
  * @class CaloAlignTool
  *
@@ -71,16 +69,17 @@ class ATLAS_NOT_THREAD_SAFE CaloAlignTool : public AthAlgTool, virtual public IG
    */
   virtual StatusCode align(IOVSVC_CALLBACK_ARGS);
 
- protected:
-   CaloAlignTool(); //> not implemented
-   CaloAlignTool (const CaloAlignTool&); //> not implemented
-   CaloAlignTool& operator= (const CaloAlignTool&); //> not implemented
-
  private:
   /**
    * @brief handle on the IOVDbSvc for releasing conditions objects from memory
    */
   ServiceHandle<IIOVDbSvc>  m_IOVDbSvc; 
+
+  /// Not implemented.
+  CaloAlignTool() = delete;
+  CaloAlignTool (const CaloAlignTool&) = delete;
+  CaloAlignTool& operator= (const CaloAlignTool&) = delete;
+
 };
 
 #endif
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloSuperCellAlignTool.cxx b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloSuperCellAlignTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..adb0623485edcacda0de1f2e78e046c1ea76eaf8
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloSuperCellAlignTool.cxx
@@ -0,0 +1,135 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id$
+/**
+ * @file CaloDetDescr/src/CaloSuperCellAlignTool.cxx
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Sep, 2012
+ * @brief Propagate alignent changes to supercell geometry.
+ */
+
+
+#undef NDEBUG
+
+
+#include "CaloSuperCellAlignTool.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "CaloDetDescr/CaloDetDescriptor.h"
+#include "CaloDetDescr/CaloDetDescrElement.h"
+#include "CaloDetDescr/CaloDetectorElements.h"
+#include "CaloDetDescr/ICaloSuperCellIDTool.h"
+#include "CaloDetDescrUtils/CaloSuperCellUtils.h"
+#include "CaloIdentifier/CaloCell_SuperCell_ID.h"
+#include "AthenaKernel/errorcheck.h"
+
+/**
+ * @brief Standard Gaudi tool constructor.
+ * @param type The name of the tool type.
+ * @param name The tool name.
+ * @param parent The tool's Gaudi parent.
+ */
+CaloSuperCellAlignTool::CaloSuperCellAlignTool (const std::string& type,
+                                                const std::string& name,
+                                                const IInterface* parent)
+  : base_class (type, name, parent),
+    m_caloAlignTool ("CaloAlignTool"),
+    m_scidTool ("CaloSuperCellIDTool")
+{
+  declareProperty ("CaloAlignTool", m_caloAlignTool,
+                   "Offline geometry alignment tool.");
+  declareProperty ("CaloSuperCellIDTool", m_scidTool,
+                   "Offline / SuperCell ID mapping tool.");
+
+  declareProperty ("SCMgrKey", m_scMgrKey = "CaloSuperCellMgr",
+                   "SG key for the supercell geometry manager.");
+  declareProperty ("MgrKey", m_mgrKey = "CaloMgr",
+                   "SG key for the offline geometry manager.");
+}
+
+
+/**
+ * @brief Standard Gaudi initialize method.
+ */
+StatusCode CaloSuperCellAlignTool::initialize()
+{
+  CHECK( base_class::initialize() );
+  CHECK( m_scidTool.retrieve() );
+
+  if (!m_caloAlignTool.retrieve().isSuccess()) {
+    REPORT_MESSAGE (MSG::WARNING)
+      << "Cannot find " << m_caloAlignTool.typeAndName()
+      << "; no supercell alignments will be propagated.";
+    return StatusCode::SUCCESS;
+  }
+
+  CHECK( detStore()->regFcn (&IGeoAlignTool::align,
+                             &*m_caloAlignTool,
+                             &IGeoAlignTool::align,
+                             static_cast<IGeoAlignTool*>(this)) );
+
+  return StatusCode::SUCCESS;
+}
+
+
+
+/**
+ * @brief Callback function triggered when alignment constants are updated
+ * in StoreGate.  It is called after CaloAlignTool to propagate
+ * geometry changes from the offline to supercell versions.
+ */
+StatusCode CaloSuperCellAlignTool::align(IOVSVC_CALLBACK_ARGS)
+{
+  // Get the managers.
+  const CaloSuperCellDetDescrManager* scmgr = nullptr;
+  const CaloDetDescrManager* mgr = nullptr;
+
+  CHECK( detStore()->retrieve (scmgr, m_scMgrKey) );
+  CHECK( detStore()->retrieve (mgr,   m_mgrKey) );
+
+  // FIXME: This tool changes the content of the (const) CaloSuperCellDetDescrManager
+  // recorded in the detector store.  Need to get rid of this for MT.
+  // This should go away with the new scheme for dealing with alignments.
+  CHECK( doUpdate (const_cast<CaloSuperCellDetDescrManager*>(scmgr), mgr) );
+  return StatusCode::SUCCESS;
+}
+
+
+/**
+ * @brief Update supercell geometry from the offline geometry.
+ * @param mgr The supercell geometry manager.
+ * @param cellmgr The offline geometry manager.
+ */
+StatusCode CaloSuperCellAlignTool::doUpdate(CaloSuperCellDetDescrManager* mgr,
+					    const CaloDetDescrManager* cellmgr)
+{
+  CHECK( updateElements    (mgr, cellmgr, m_scidTool.get()) );
+  updateDescriptors(mgr, cellmgr, m_scidTool.get());
+  return StatusCode::SUCCESS;
+}
+
+
+/**
+ * @brief Standard Gaudi @c queryInterface method.
+ *
+ * We need do implement this by hand because 
+ * @c IGeoAlignTool doesn't use @c DeclareInterfaceID.
+ */
+StatusCode
+CaloSuperCellAlignTool::queryInterface (const InterfaceID& riid, void** ppvIf)
+{
+  if ( riid == IGeoAlignTool::interfaceID() )  {
+    *ppvIf = static_cast<IGeoAlignTool*> (this);
+    addRef();
+    return StatusCode::SUCCESS;
+  }
+  if ( riid == ICaloSuperCellAlignTool::interfaceID() )  {
+    *ppvIf = static_cast<ICaloSuperCellAlignTool*> (this);
+    addRef();
+    return StatusCode::SUCCESS;
+  }
+
+  return AthAlgTool::queryInterface( riid, ppvIf );
+}
+
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloSuperCellAlignTool.h b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloSuperCellAlignTool.h
similarity index 62%
rename from Calorimeter/CaloDetDescr/CaloDetDescr/CaloSuperCellAlignTool.h
rename to Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloSuperCellAlignTool.h
index 5d5b187cbd2dfb12f206f69d641ec53a0bbc3ecc..a7d788c960e1c818f3877ca688082d0ecb449767 100644
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloSuperCellAlignTool.h
+++ b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/CaloSuperCellAlignTool.h
@@ -1,7 +1,7 @@
 // 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
 */
 
 // $Id$
@@ -13,12 +13,13 @@
  */
 
 
-#ifndef CALODETDESCR_CALOSUPERCELLALIGNTOOL_H
-#define CALODETDESCR_CALOSUPERCELLALIGNTOOL_H
+#ifndef CALOALIGNMENTTOOLS_CALOSUPERCELLALIGNTOOL_H
+#define CALOALIGNMENTTOOLS_CALOSUPERCELLALIGNTOOL_H
 
 
 #include "GeoModelInterfaces/IGeoAlignTool.h"
 #include "CaloDetDescr/ICaloSuperCellAlignTool.h"
+#include "CaloDetDescr/ICaloSuperCellIDTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "CxxUtils/checker_macros.h"
@@ -26,8 +27,6 @@
 class CaloSuperCellDetDescrManager;
 class CaloDetDescrManager;
 class CaloDetDescriptor;
-class ICaloSuperCellIDTool;
-
 
 /**
  * @brief Propagate alignent changes to supercell geometry.
@@ -78,60 +77,6 @@ public:
 
 
 private:
-  /// Helper for finding region range limits.
-  struct MinMax {
-    MinMax() : min(99999), max(-999999) {}
-    void add (double x, double dx)
-    {
-      if (x - dx < min) min = x - dx;
-      if (x + dx > max) max = x + dx;
-    }
-    double min;
-    double max;
-  };
-
-
-  /// Helper for finding region range limits.
-  struct DescrMinMax {
-    MinMax eta;
-    MinMax phi;
-    MinMax r;
-    MinMax z;
-  };
-
-
-  /**
-   * @brief Update the supercell element geometry.
-   * @param mgr The supercell geometry manager.
-   * @param cellmgr The offline geometry manager.
-   *
-   * The geometry information of the supercell elements is updated
-   * based on the provided offline geometry.
-   */
-  StatusCode updateElements (CaloSuperCellDetDescrManager* mgr,
-                             const CaloDetDescrManager* cellmgr);
-
-
-  /**
-   * @brief Update the supercell descriptor geometry.
-   * @param mgr The supercell geometry manager.
-   * @param cellmgr The offline geometry manager.
-   *
-   * The geometry information of the supercell descriptors is updated
-   * based on the provided offline geometry.
-   */
-  StatusCode updateDescriptors (CaloSuperCellDetDescrManager* mgr,
-                                const CaloDetDescrManager* cellmgr);
-
-  /**
-   * @brief Update a single descriptor.
-   */
-  void
-  updateDescriptor (CaloDetDescriptor* desc,
-                    const DescrMinMax& mm,
-                    const CaloDetDescrManager* cellmgr);
-
-
   /// Property: The CaloAlignTool that triggers us.
   ToolHandle<IGeoAlignTool> m_caloAlignTool;
 
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentTools/src/components/CaloAlignmentTools_entries.cxx b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/components/CaloAlignmentTools_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..6237da4f9ba8886290d5d9a8961a6c39bc2c10ed
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentTools/src/components/CaloAlignmentTools_entries.cxx
@@ -0,0 +1,7 @@
+
+#include "../CaloAlignTool.h"
+#include "../CaloSuperCellAlignTool.h"
+
+DECLARE_COMPONENT( CaloAlignTool )
+DECLARE_COMPONENT( CaloSuperCellAlignTool )
+
diff --git a/Calorimeter/CaloClusterCorrection/test/CaloScaleCluster_test.py b/Calorimeter/CaloClusterCorrection/test/CaloScaleCluster_test.py
index 74a5a11b21fa2fcab5e4963c12da46a6d1bff1ff..a04083bf63b4be0709a1f46fc69ea17dc0498d83 100644
--- a/Calorimeter/CaloClusterCorrection/test/CaloScaleCluster_test.py
+++ b/Calorimeter/CaloClusterCorrection/test/CaloScaleCluster_test.py
@@ -100,6 +100,7 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 
 ConfigFlags.LAr.doAlign = False
+ConfigFlags.Detector.GeometryTile = False
 ConfigFlags.Input.Files = defaultTestFiles.AOD_MC
 
 ConfigFlags.lock()
diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.cxx b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.cxx
index ecd0852cc9e5afd5fd866bb66099ebf7ffe6f029..e59b801ca7f1618131082f32a3b35b7fb9de5398 100755
--- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.cxx
+++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.cxx
@@ -22,6 +22,7 @@
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloDetDescr/CaloDetectorElements.h"
 #include "CaloDetDescr/ICaloSuperCellAlignTool.h"
+#include "CaloDetDescrUtils/CaloSuperCellUtils.h"
 #include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_SuperCell_ID.h"
 #include "GeoModelInterfaces/IGeoAlignTool.h"
@@ -32,36 +33,6 @@
 #include <cassert>
 
 
-namespace {
-
-
-const
-CaloDetDescriptor* get_descriptor (Identifier cell_id,
-                                   const CaloDetDescrManager_Base* mgr)
-{
-  const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
-  Identifier reg_id = calo_helper->region_id (cell_id);
-  if (!calo_helper->is_tile (cell_id)) {
-    assert (reg_id.is_valid());
-    return mgr->get_descriptor (reg_id);
-  }
-
-  int clayer = calo_helper->sample (cell_id);
-  bool is_sc = calo_helper->is_supercell (cell_id);
-  for (const CaloDetDescriptor* d : mgr->tile_descriptors_range()) {
-    if (d->identify() != reg_id) continue;
-    int dlayer = d->layer();
-    if (clayer == dlayer) return d;
-    if (is_sc && dlayer == 0 && clayer != 2) return d;
-  }
-  return 0;
-}
-
-
-} // anonymous namespace
-
-
-
 /**
  * @brief Return the service type.  Required by the base class.
  */
@@ -200,8 +171,8 @@ CaloSuperCellMgrDetDescrCnv::createManager(const std::string& /*mgrKey*/,
   pObj = SG::asStorable (mgr);
 
   // Create descriptors / elements (with null geometry).
-  CHECK( createDescriptors (mgr) );
-  CHECK( createElements (mgr) );
+  createDescriptors (mgr);
+  createElements (mgr);
 
   // Update the geometry from the offline manager.
   const CaloDetDescrManager* cellmgr = 0;
@@ -213,54 +184,3 @@ CaloSuperCellMgrDetDescrCnv::createManager(const std::string& /*mgrKey*/,
   return StatusCode::SUCCESS;
 }
 
-
-/**
- * @brief Create the descriptors for the supercell geometry.
- * @param mgr The supercell geometry manager.
- */
-StatusCode
-CaloSuperCellMgrDetDescrCnv::createDescriptors (CaloSuperCellDetDescrManager* mgr)
-{
-  const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
-  for (Identifier reg_id : calo_helper->reg_range()) {
-    if (! calo_helper->is_tile (reg_id)) {
-      mgr->add (new CaloDetDescriptor (reg_id, 0, calo_helper));
-    }
-    else {
-      mgr->add_tile (new CaloDetDescriptor
-                     (reg_id, calo_helper->tile_idHelper(), calo_helper,
-                      (CaloCell_ID::CaloSample)calo_helper->calo_sample(reg_id), 0));
-      // NB. CaloDetDescrElement::getSampling adds the tile cell sampling
-      //     index to the descriptor's sampling, so don't add 2 here
-      //     to calo_sample.
-      mgr->add_tile (new CaloDetDescriptor
-                     (reg_id, calo_helper->tile_idHelper(), calo_helper,
-                      (CaloCell_ID::CaloSample)(calo_helper->calo_sample(reg_id)), 2));
-    }
-  }
-  return StatusCode::SUCCESS;
-}
-
-
-
-/**
- * @brief Create the elements for the supercell geometry.
- * @param mgr The supercell geometry manager.
- */
-StatusCode
-CaloSuperCellMgrDetDescrCnv::createElements (CaloSuperCellDetDescrManager* mgr)
-{
-  const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
-  for (Identifier cell_id : calo_helper->cell_range()) {
-    int subCalo = -1;
-    IdentifierHash subCaloHash =
-      calo_helper->subcalo_cell_hash (cell_id, subCalo);
-
-    const CaloDetDescriptor* desc = get_descriptor (cell_id, mgr);
-    assert (desc);
-    mgr->add (new CaloSuperCellDetectorElement (subCaloHash, desc));
-  }
-  return StatusCode::SUCCESS;
-}
-
-
diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.h b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.h
index 1a46a9e465bbfb8aaee864f870e10a24bf27a04e..94384637832ed7ec7b6ca6fbd0f6c4f91e6e9cbc 100755
--- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.h
+++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloSuperCellMgrDetDescrCnv.h
@@ -1,7 +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$
@@ -103,19 +103,6 @@ private:
                               CaloSuperCellDetDescrManager* & mgr,
                               DataObject*& pObj);
 
-
-  /**
-   * @brief Create the descriptors for the supercell geometry.
-   * @param mgr The supercell geometry manager.
-   */
-  StatusCode createDescriptors (CaloSuperCellDetDescrManager* mgr);
-
-
-  /**
-   * @brief Create the elements for the supercell geometry.
-   * @param mgr The supercell geometry manager.
-   */
-  StatusCode createElements (CaloSuperCellDetDescrManager* mgr);
 };
 
 
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrDict.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrDict.h
index 52588cdee88940cd30f34075bbce2cd3cfbbfb4d..65fa92e66f9e19abf2ef08efdaa64b253de2cba9 100644
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrDict.h
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrDict.h
@@ -1,12 +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 "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloDetDescr/CaloDetectorElements.h"
 #include "CaloDetDescr/CaloDetDescriptor.h"
-#include "CaloDetDescr/CaloAlignTool.h"
 #include "CaloDetDescr/CaloDepthTool.h"
 #include "CaloDetDescr/CaloDescriptors.h"
 #include "CaloDetDescr/CaloSubdetNames.h"
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h
index 83338fa26d56bacf6c456ac93d5b917532119d4f..0e2c2f99929d322e50eb5b06fbbfbdd641e8ff0b 100755
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h
@@ -505,7 +505,7 @@ public:
 
 
 CLASS_DEF( CaloSuperCellDetDescrManager , 241807251 , 1 )
-
+CONDCONT_DEF( CaloSuperCellDetDescrManager , 70344197 );
 
 inline  const CaloDetDescrElement*			
 CaloDetDescrManager_Base::get_element (IdentifierHash caloCellHash) const
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/selection.xml b/Calorimeter/CaloDetDescr/CaloDetDescr/selection.xml
index 8dc81b36916e9b3c114d81fcc6ccc15a79b61980..cc0d29233c67febf74705437ae8a5f54fb66cdc1 100644
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/selection.xml
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/selection.xml
@@ -12,7 +12,6 @@
   <class name="DummyDetDescrElement"/>
   <class name="CaloDetDescriptor"/>
   <class name="CaloDepthTool"/>
-  <class name="CaloAlignTool"/>
   <class name="EMBDescriptor"/>
   <class name="EMECDescriptor"/>
   <class name="FCALDescriptor"/>
diff --git a/Calorimeter/CaloDetDescr/src/CaloSuperCellAlignTool.cxx b/Calorimeter/CaloDetDescr/src/CaloSuperCellAlignTool.cxx
deleted file mode 100644
index 9908e799f9f40a680d0b83f45e410f2c7c7b9535..0000000000000000000000000000000000000000
--- a/Calorimeter/CaloDetDescr/src/CaloSuperCellAlignTool.cxx
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id$
-/**
- * @file CaloDetDescr/src/CaloSuperCellAlignTool.cxx
- * @author scott snyder <snyder@bnl.gov>
- * @date Sep, 2012
- * @brief Propagate alignent changes to supercell geometry.
- */
-
-
-#undef NDEBUG
-
-
-#include "CaloDetDescr/CaloSuperCellAlignTool.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
-#include "CaloDetDescr/CaloDetDescriptor.h"
-#include "CaloDetDescr/CaloDetDescrElement.h"
-#include "CaloDetDescr/CaloDetectorElements.h"
-#include "CaloDetDescr/ICaloSuperCellIDTool.h"
-#include "CaloIdentifier/CaloCell_SuperCell_ID.h"
-#include "AthenaKernel/errorcheck.h"
-
-namespace {
-
-
-int descr_index (const CaloDetDescriptor* desc,
-                 const CaloDetDescrManager_Base* mgr)
-{
-  if (desc->is_tile()) {
-    int i= 0;
-    for (const CaloDetDescriptor* d : mgr->tile_descriptors_range()) {
-      if (d == desc) return mgr->calo_descriptors_size() + i;
-      ++i;
-    }
-    return -1;
-  }
-  else
-    return desc->calo_hash();
-}
-
-
-const CaloDetDescriptor* get_descriptor (Identifier reg_id,
-                                         const CaloDetDescrManager_Base* mgr)
-{
-  const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
-  if (!calo_helper->is_tile (reg_id)) {
-    assert (reg_id.is_valid());
-    return mgr->get_descriptor (reg_id);
-  }
-
-  for (const CaloDetDescriptor* d : mgr->tile_descriptors_range()) {
-    if (d->identify() == reg_id) return d;
-  }
-  return nullptr;
-}
-
-
-} // anonymous namespace
-
-
-/**
- * @brief Standard Gaudi tool constructor.
- * @param type The name of the tool type.
- * @param name The tool name.
- * @param parent The tool's Gaudi parent.
- */
-CaloSuperCellAlignTool::CaloSuperCellAlignTool (const std::string& type,
-                                                const std::string& name,
-                                                const IInterface* parent)
-  : base_class (type, name, parent),
-    m_caloAlignTool ("CaloAlignTool"),
-    m_scidTool ("CaloSuperCellIDTool")
-{
-  declareProperty ("CaloAlignTool", m_caloAlignTool,
-                   "Offline geometry alignment tool.");
-  declareProperty ("CaloSuperCellIDTool", m_scidTool,
-                   "Offline / SuperCell ID mapping tool.");
-
-  declareProperty ("SCMgrKey", m_scMgrKey = "CaloSuperCellMgr",
-                   "SG key for the supercell geometry manager.");
-  declareProperty ("MgrKey", m_mgrKey = "CaloMgr",
-                   "SG key for the offline geometry manager.");
-}
-
-
-/**
- * @brief Standard Gaudi initialize method.
- */
-StatusCode CaloSuperCellAlignTool::initialize()
-{
-  CHECK( base_class::initialize() );
-  CHECK( m_scidTool.retrieve() );
-
-  if (!m_caloAlignTool.retrieve().isSuccess()) {
-    REPORT_MESSAGE (MSG::WARNING)
-      << "Cannot find " << m_caloAlignTool.typeAndName()
-      << "; no supercell alignments will be propagated.";
-    return StatusCode::SUCCESS;
-  }
-
-  CHECK( detStore()->regFcn (&IGeoAlignTool::align,
-                             &*m_caloAlignTool,
-                             &IGeoAlignTool::align,
-                             static_cast<IGeoAlignTool*>(this)) );
-
-  return StatusCode::SUCCESS;
-}
-
-
-
-/**
- * @brief Callback function triggered when alignment constants are updated
- * in StoreGate.  It is called after CaloAlignTool to propagate
- * geometry changes from the offline to supercell versions.
- */
-StatusCode CaloSuperCellAlignTool::align(IOVSVC_CALLBACK_ARGS)
-{
-  // Get the managers.
-  const CaloSuperCellDetDescrManager* scmgr = nullptr;
-  const CaloDetDescrManager* mgr = nullptr;
-
-  CHECK( detStore()->retrieve (scmgr, m_scMgrKey) );
-  CHECK( detStore()->retrieve (mgr,   m_mgrKey) );
-
-  // FIXME: This tool changes the content of the (const) CaloSuperCellDetDescrManager
-  // recorded in the detector store.  Need to get rid of this for MT.
-  // This should go away with the new scheme for dealing with alignments.
-  CHECK( doUpdate (const_cast<CaloSuperCellDetDescrManager*>(scmgr), mgr) );
-  return StatusCode::SUCCESS;
-}
-
-
-/**
- * @brief Update supercell geometry from the offline geometry.
- * @param mgr The supercell geometry manager.
- * @param cellmgr The offline geometry manager.
- */
-StatusCode CaloSuperCellAlignTool::doUpdate(CaloSuperCellDetDescrManager* mgr,
-                                                                   const CaloDetDescrManager* cellmgr)
-{
-  CHECK( updateElements    (mgr, cellmgr) );
-  CHECK( updateDescriptors (mgr, cellmgr) );
-  return StatusCode::SUCCESS;
-}
-
-
-/**
- * @brief Standard Gaudi @c queryInterface method.
- *
- * We need do implement this by hand because 
- * @c IGeoAlignTool doesn't use @c DeclareInterfaceID.
- */
-StatusCode
-CaloSuperCellAlignTool::queryInterface (const InterfaceID& riid, void** ppvIf)
-{
-  if ( riid == IGeoAlignTool::interfaceID() )  {
-    *ppvIf = static_cast<IGeoAlignTool*> (this);
-    addRef();
-    return StatusCode::SUCCESS;
-  }
-  if ( riid == ICaloSuperCellAlignTool::interfaceID() )  {
-    *ppvIf = static_cast<ICaloSuperCellAlignTool*> (this);
-    addRef();
-    return StatusCode::SUCCESS;
-  }
-
-  return AthAlgTool::queryInterface( riid, ppvIf );
-}
-
-
-/**
- * @brief Update the supercell element geometry.
- * @param mgr The supercell geometry manager.
- * @param cellmgr The offline geometry manager.
- *
- * The geometry information of the supercell elements is updated
- * based on the provided offline geometry.
- */
-StatusCode
-CaloSuperCellAlignTool::updateElements (CaloSuperCellDetDescrManager* mgr,
-                                        const CaloDetDescrManager* cellmgr)
-{
-  // For each supercell, we make a list of the corresponding cells.
-  // Then we pass that list to the supercell's @c update method.
-
-  for (CaloDetDescrElement* elt : mgr->element_range_nonconst()) {
-    if (!elt) continue;
-    CaloSuperCellDetectorElement* selt =
-      dynamic_cast<CaloSuperCellDetectorElement*> (elt);
-    if (!selt) continue;
-
-    std::vector<Identifier> ids =
-      m_scidTool->superCellToOfflineID (elt->identify());
-    assert (!ids.empty());
-
-    const CaloCell_Base_ID* idhelper      = mgr->getCaloCell_ID();
-    const CaloCell_Base_ID* cell_idhelper = cellmgr->getCaloCell_ID();
-
-    std::vector<const CaloDetDescrElement*> fromelts;
-    fromelts.reserve (ids.size());
-    for (Identifier id : ids) {
-      // For tile tower sums, exclude D-layer cells
-      // (they have a different size).
-      if (cell_idhelper->sub_calo(id) == CaloCell_Base_ID::TILE &&
-          cell_idhelper->sample(id) == 2 &&
-          idhelper->sample(elt->identify()) != 2)
-        continue;
-      const CaloDetDescrElement* fromelt = cellmgr->get_element (id);
-      assert (fromelt != nullptr);
-      fromelts.push_back (fromelt);
-    }
-    CHECK( selt->update (fromelts) );
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-
-namespace {
-
-/**
- * @brief Helper: Convert to descriptor phi convention.
- *
- * Descriptors use a 0..2pi phi convention; this helper converts a standard
- * ATLAS phi (-pi..pi) to the descriptor convention.
- */
-inline
-double phi_for_descr (double phi)
-{
-  if (phi < 0)
-    phi += 2*M_PI;
-  return phi;
-}
-} // anonymous namespace
-
-
-/**
- * @brief Update the supercell descriptor geometry.
- * @param mgr The supercell geometry manager.
- * @param cellmgr The offline geometry manager.
- *
- * The geometry information of the supercell descriptors is updated
- * based on the provided offline geometry.
- */
-StatusCode
-CaloSuperCellAlignTool::updateDescriptors(CaloSuperCellDetDescrManager* mgr,
-                                          const CaloDetDescrManager* cellmgr)
-{
-  size_t maxdesc = mgr->calo_descriptors_size() + mgr->tile_descriptors_size();
-  std::vector<DescrMinMax> descr_minmax (maxdesc);
-
-  // Loop over cells and record range limits for each descriptor.
-  for (const CaloDetDescrElement* elt : mgr->element_range()) {
-    if (!elt) continue;
-    CaloDetDescriptor* desc = const_cast<CaloDetDescriptor*>(elt->descriptor());
-    int ndx = descr_index (desc, mgr);
-    assert (ndx >= 0 && ndx < (int)descr_minmax.size());
-    DescrMinMax& mm = descr_minmax[ndx];
-
-    int dz_den = desc->is_lar_hec() ? 1 : 2;
-
-    mm.eta.add (std::abs(elt->eta_raw()), elt->deta()/2);
-    mm.phi.add (phi_for_descr (elt->phi_raw()), elt->dphi()/2);
-    mm.r.add (elt->r(), elt->dr()/2);
-    mm.z.add (std::abs(elt->z_raw()), elt->dz()/dz_den);
-  }
-
-  // Loop over each descriptor and update.
-  size_t i = 0;
-  for (CaloDetDescriptor* desc : mgr->calo_descriptors_range_nonconst()) {
-    updateDescriptor (desc, descr_minmax[i], cellmgr);
-    ++i;
-  }
-  for (CaloDetDescriptor* desc : mgr->tile_descriptors_range_nonconst()) {
-    updateDescriptor (desc, descr_minmax[i], cellmgr);
-    ++i;
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-
-/**
- * @brief Update a single descriptor.
- */
-void
-CaloSuperCellAlignTool::updateDescriptor
-  (CaloDetDescriptor* desc,
-   const DescrMinMax& mm,
-   const CaloDetDescrManager* cellmgr)
-{
-  if (!desc) return;
-
-  if (desc->calo_eta_max() == 0) {
-    // Only do this the first time.
-    desc->setCaloEtaMin (mm.eta.min);
-    desc->setCaloEtaMax (mm.eta.max);
-    desc->setCaloPhiMin (mm.phi.min);
-    desc->setCaloPhiMax (mm.phi.max);
-    desc->setCaloRMin (mm.r.min);
-    desc->setCaloRMax (mm.r.max);
-    desc->setCaloZMin (mm.z.min);
-    desc->setCaloZMax (mm.z.max);
-
-    std::vector<Identifier> cell_regions =
-      m_scidTool->superCellToOfflineRegion (desc->identify());
-    assert (!cell_regions.empty());
-
-    const CaloDetDescriptor* celldesc =
-      get_descriptor (cell_regions[0], cellmgr);
-
-    if (celldesc) {
-      if (desc->is_tile()) {
-        desc->set_eta_phi_granularity (celldesc->n_eta(),
-                                       celldesc->deta(),
-                                       celldesc->n_phi(),
-                                       celldesc->dphi());
-      }
-
-      std::vector<double> depths;
-      desc->set_n_calo_depth (celldesc->n_calo_depth());
-      celldesc->get_depth_in (depths);
-      desc->set_depth_in (depths);
-      celldesc->get_depth_out (depths);
-      desc->set_depth_out (depths);
-
-      desc->set_transform (celldesc->transform());
-    }
-  }
-
-  // Do this each realignment.
-  desc->setLArEtaMin (mm.eta.min);
-  desc->setLArPhiMin (mm.phi.min);
-  if (desc->calo_sign() > 0) {
-    desc->setLArRegMin (mm.eta.min);
-    desc->setLArRegMax (mm.eta.max);
-  }
-  else {
-    desc->setLArRegMin (-mm.eta.max);
-    desc->setLArRegMax (-mm.eta.min);
-  }
-}
diff --git a/Calorimeter/CaloDetDescr/src/components/CaloDetDescr_entries.cxx b/Calorimeter/CaloDetDescr/src/components/CaloDetDescr_entries.cxx
index 9c5213c7e0c0724f1f8da45ad55fd7e99f743584..2748fd9cb16e7bd563335b6db1faa2895bf247cb 100644
--- a/Calorimeter/CaloDetDescr/src/components/CaloDetDescr_entries.cxx
+++ b/Calorimeter/CaloDetDescr/src/components/CaloDetDescr_entries.cxx
@@ -1,13 +1,9 @@
 
 #include "CaloDetDescr/CaloDepthTool.h"
-#include "CaloDetDescr/CaloAlignTool.h"
-#include "CaloDetDescr/CaloSuperCellAlignTool.h"
 #include "../CaloSuperCellIDTool.h"
 #include "../CaloTowerGeometryCondAlg.h"
 
 DECLARE_COMPONENT( CaloDepthTool )
-DECLARE_COMPONENT( CaloAlignTool )
-DECLARE_COMPONENT( CaloSuperCellAlignTool )
 DECLARE_COMPONENT( CaloSuperCellIDTool )
 DECLARE_COMPONENT( CaloTowerGeometryCondAlg )
 
diff --git a/Calorimeter/CaloDetDescrUtils/CaloDetDescrUtils/CaloSuperCellUtils.h b/Calorimeter/CaloDetDescrUtils/CaloDetDescrUtils/CaloSuperCellUtils.h
new file mode 100644
index 0000000000000000000000000000000000000000..9b82b9f989295a3b83d5634a8267f44e4c22874a
--- /dev/null
+++ b/Calorimeter/CaloDetDescrUtils/CaloDetDescrUtils/CaloSuperCellUtils.h
@@ -0,0 +1,38 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef CALODETDESCRUTILS_CALOSUPERCELLUTILS_H
+#define CALODETDESCRUTILS_CALOSUPERCELLUTILS_H
+
+/**
+ *  @file CaloSuperCellUtils.h
+ *
+ *  @brief This is a collection of helper functions for building Calo Super Cell 
+ *         detector manager, and for updating it with alignment corrections.
+ *         The functions previously existed in two packages: 
+ *         CaloSuperCellMgrDetDescrCnv and CaloDetDescr.
+ *         They have been moved over to the CaloDetDescrUtils so that now they
+ *         can also be used by the CaloSuperCellAlignCondAlg.
+ */
+
+#include "GaudiKernel/StatusCode.h"
+#include "CxxUtils/checker_macros.h"
+
+class CaloSuperCellDetDescrManager;
+class CaloDetDescrManager;
+class ICaloSuperCellIDTool;
+
+void createDescriptors(CaloSuperCellDetDescrManager* mgr);
+
+void createElements(CaloSuperCellDetDescrManager* mgr);
+
+StatusCode updateElements(CaloSuperCellDetDescrManager* mgr
+			  , const CaloDetDescrManager* cellmgr
+			  , const ICaloSuperCellIDTool* scidTool);
+
+void updateDescriptors ATLAS_NOT_CONST_THREAD_SAFE (CaloSuperCellDetDescrManager* mgr
+		       , const CaloDetDescrManager* cellmgr
+		       , const ICaloSuperCellIDTool* scidTool);
+
+#endif
diff --git a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
index b908294b12e49fda73e3ca1e7bf568567fc5fc84..5077abebeccf08ccda14c8fa68a46772bf72ede5 100644
--- a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
+++ b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
@@ -1,5 +1,5 @@
-/*                                                                                                                                                    
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration                                                                             
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "CaloDetDescrUtils/CaloDetDescrBuilder.h"
diff --git a/Calorimeter/CaloDetDescrUtils/src/CaloSuperCellUtils.cxx b/Calorimeter/CaloDetDescrUtils/src/CaloSuperCellUtils.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..71809d1ec75b8547de42683397f5be8a4cf9e124
--- /dev/null
+++ b/Calorimeter/CaloDetDescrUtils/src/CaloSuperCellUtils.cxx
@@ -0,0 +1,263 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "CaloDetDescrUtils/CaloSuperCellUtils.h"
+
+#include "CaloIdentifier/CaloCell_ID.h"
+#include "CaloIdentifier/CaloCell_SuperCell_ID.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "CaloDetDescr/CaloDetDescriptor.h"
+#include "CaloDetDescr/CaloDetDescrElement.h"
+#include "CaloDetDescr/CaloDetectorElements.h"
+#include "CaloDetDescr/ICaloSuperCellIDTool.h"
+
+namespace {
+
+  struct MinMax {
+    MinMax() : min(99999), max(-999999) {}
+    void add (double x, double dx)
+    {
+      if (x - dx < min) min = x - dx;
+      if (x + dx > max) max = x + dx;
+    }
+    double min;
+    double max;
+  };
+
+  struct DescrMinMax {
+    MinMax eta;
+    MinMax phi;
+    MinMax r;
+    MinMax z;
+  };
+
+  inline
+  double phi_for_descr (double phi)
+  {
+    if (phi < 0)
+      phi += 2*M_PI;
+    return phi;
+  }
+  
+  int descr_index (const CaloDetDescriptor* desc,
+		   const CaloDetDescrManager_Base* mgr)
+  {
+    if (desc->is_tile()) {
+      int i= 0;
+      for (const CaloDetDescriptor* d : mgr->tile_descriptors_range()) {
+	if (d == desc) return mgr->calo_descriptors_size() + i;
+	++i;
+      }
+      return -1;
+   }
+    else
+      return desc->calo_hash();
+  }
+  
+  const  CaloDetDescriptor* get_cell_descriptor (Identifier cell_id,
+						 const CaloDetDescrManager_Base* mgr)
+  {
+    const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
+    Identifier reg_id = calo_helper->region_id (cell_id);
+    if (!calo_helper->is_tile (cell_id)) {
+      assert (reg_id.is_valid());
+      return mgr->get_descriptor (reg_id);
+   }
+    
+    int clayer = calo_helper->sample (cell_id);
+    bool is_sc = calo_helper->is_supercell (cell_id);
+    for (const CaloDetDescriptor* d : mgr->tile_descriptors_range()) {
+      if (d->identify() != reg_id) continue;
+     int dlayer = d->layer();
+     if (clayer == dlayer) return d;
+     if (is_sc && dlayer == 0 && clayer != 2) return d;
+    }
+    return nullptr;
+  }
+  
+  const CaloDetDescriptor* get_reg_descriptor (Identifier reg_id,
+					       const CaloDetDescrManager_Base* mgr)
+  {
+    const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
+    if (!calo_helper->is_tile (reg_id)) {
+      assert (reg_id.is_valid());
+      return mgr->get_descriptor (reg_id);
+    }
+    
+    for (const CaloDetDescriptor* d : mgr->tile_descriptors_range()) {
+      if (d->identify() == reg_id) return d;
+    }
+    return nullptr;
+  }
+
+  void updateDescriptor(CaloDetDescriptor* desc
+			, const DescrMinMax& mm
+			, const CaloDetDescrManager* cellmgr
+			, const ICaloSuperCellIDTool* scidTool)
+  {
+    if (!desc) return;
+  
+    if (desc->calo_eta_max() == 0) {
+      // Only do this the first time.
+      desc->setCaloEtaMin (mm.eta.min);
+      desc->setCaloEtaMax (mm.eta.max);
+      desc->setCaloPhiMin (mm.phi.min);
+      desc->setCaloPhiMax (mm.phi.max);
+      desc->setCaloRMin (mm.r.min);
+      desc->setCaloRMax (mm.r.max);
+      desc->setCaloZMin (mm.z.min);
+      desc->setCaloZMax (mm.z.max);
+      
+      std::vector<Identifier> cell_regions =
+	scidTool->superCellToOfflineRegion (desc->identify());
+      assert (!cell_regions.empty());
+      
+      const CaloDetDescriptor* celldesc =
+	get_reg_descriptor (cell_regions[0], cellmgr);
+      
+      if (celldesc) {
+	if (desc->is_tile()) {
+	  desc->set_eta_phi_granularity (celldesc->n_eta(),
+					 celldesc->deta(),
+					 celldesc->n_phi(),
+					 celldesc->dphi());
+	}
+	
+	std::vector<double> depths;
+	desc->set_n_calo_depth (celldesc->n_calo_depth());
+	celldesc->get_depth_in (depths);
+	desc->set_depth_in (depths);
+	celldesc->get_depth_out (depths);
+	desc->set_depth_out (depths);
+	
+	desc->set_transform (celldesc->transform());
+      }
+    }
+  
+    // Do this each realignment.
+    desc->setLArEtaMin (mm.eta.min);
+    desc->setLArPhiMin (mm.phi.min);
+    if (desc->calo_sign() > 0) {
+      desc->setLArRegMin (mm.eta.min);
+      desc->setLArRegMax (mm.eta.max);
+    }
+    else {
+      desc->setLArRegMin (-mm.eta.max);
+      desc->setLArRegMax (-mm.eta.min);
+    }
+  }
+  
+  
+} // anonymous namespace
+
+
+void createDescriptors(CaloSuperCellDetDescrManager* mgr)
+{
+  const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
+  for (Identifier reg_id : calo_helper->reg_range()) {
+    if (! calo_helper->is_tile (reg_id)) {
+      mgr->add (new CaloDetDescriptor (reg_id, 0, calo_helper));
+    }
+    else {
+      mgr->add_tile (new CaloDetDescriptor
+                     (reg_id, calo_helper->tile_idHelper(), calo_helper,
+                      (CaloCell_ID::CaloSample)calo_helper->calo_sample(reg_id), 0));
+      // NB. CaloDetDescrElement::getSampling adds the tile cell sampling                                                                                                 
+      //     index to the descriptor's sampling, so don't add 2 here                                                                                                      
+      //     to calo_sample.                                                                                                                                              
+      mgr->add_tile (new CaloDetDescriptor
+                     (reg_id, calo_helper->tile_idHelper(), calo_helper,
+                      (CaloCell_ID::CaloSample)(calo_helper->calo_sample(reg_id)), 2));
+    }
+  }
+}
+
+void createElements(CaloSuperCellDetDescrManager* mgr)
+{
+  const CaloCell_Base_ID* calo_helper = mgr->getCaloCell_ID();
+  for (Identifier cell_id : calo_helper->cell_range()) {
+    int subCalo = -1;
+    IdentifierHash subCaloHash =
+      calo_helper->subcalo_cell_hash (cell_id, subCalo);
+
+    const CaloDetDescriptor* desc = get_cell_descriptor (cell_id, mgr);
+    assert (desc);
+    mgr->add (new CaloSuperCellDetectorElement (subCaloHash, desc));
+  }
+}
+
+StatusCode updateElements(CaloSuperCellDetDescrManager* mgr
+			  , const CaloDetDescrManager* cellmgr
+			  , const ICaloSuperCellIDTool* scidTool)
+{
+  // For each supercell, we make a list of the corresponding cells.                                                                                                       
+  // Then we pass that list to the supercell's @c update method.                                                                                                         
+
+  for (CaloDetDescrElement* elt : mgr->element_range_nonconst()) {
+    if (!elt) continue;
+     CaloSuperCellDetectorElement* selt =
+       dynamic_cast<CaloSuperCellDetectorElement*> (elt);
+     if (!selt) continue;
+
+     std::vector<Identifier> ids =
+       scidTool->superCellToOfflineID (elt->identify());
+     assert (!ids.empty());
+
+     const CaloCell_Base_ID* idhelper      = mgr->getCaloCell_ID();
+     const CaloCell_Base_ID* cell_idhelper = cellmgr->getCaloCell_ID();
+
+     std::vector<const CaloDetDescrElement*> fromelts;
+     fromelts.reserve (ids.size());
+     for (Identifier id : ids) {
+       // For tile tower sums, exclude D-layer cells                                                                                                                      
+       // (they have a different size).                                                                                                                                   
+       if (cell_idhelper->sub_calo(id) == CaloCell_Base_ID::TILE &&
+           cell_idhelper->sample(id) == 2 &&
+           idhelper->sample(elt->identify()) != 2)
+         continue;
+       const CaloDetDescrElement* fromelt = cellmgr->get_element (id);
+       assert (fromelt != nullptr);
+       fromelts.push_back (fromelt);
+     }
+     if(selt->update(fromelts).isFailure()) {
+       return StatusCode::FAILURE;
+     }
+  }
+  return StatusCode::SUCCESS;
+}
+
+void updateDescriptors(CaloSuperCellDetDescrManager* mgr
+		       , const CaloDetDescrManager* cellmgr
+		       , const ICaloSuperCellIDTool* scidTool)
+{
+  size_t maxdesc = mgr->calo_descriptors_size() + mgr->tile_descriptors_size();
+  std::vector<DescrMinMax> descr_minmax (maxdesc);
+
+  // Loop over cells and record range limits for each descriptor.                                                                                                         
+  for (const CaloDetDescrElement* elt : mgr->element_range()) {
+    if (!elt) continue;
+    CaloDetDescriptor* desc = const_cast<CaloDetDescriptor*>(elt->descriptor());
+    int ndx = descr_index (desc, mgr);
+    assert (ndx >= 0 && ndx < (int)descr_minmax.size());
+    DescrMinMax& mm = descr_minmax[ndx];
+
+    int dz_den = desc->is_lar_hec() ? 1 : 2;
+
+    mm.eta.add (std::abs(elt->eta_raw()), elt->deta()/2);
+    mm.phi.add (phi_for_descr (elt->phi_raw()), elt->dphi()/2);
+    mm.r.add (elt->r(), elt->dr()/2);
+    mm.z.add (std::abs(elt->z_raw()), elt->dz()/dz_den);
+  }
+
+  // Loop over each descriptor and update.                                                                                                                                
+  size_t i = 0;
+  for (CaloDetDescriptor* desc : mgr->calo_descriptors_range_nonconst()) {
+    updateDescriptor (desc, descr_minmax[i], cellmgr, scidTool);
+    ++i;
+  }
+  for (CaloDetDescriptor* desc : mgr->tile_descriptors_range_nonconst()) {
+    updateDescriptor (desc, descr_minmax[i], cellmgr, scidTool);
+    ++i;
+  }
+}
diff --git a/Calorimeter/CaloLocalHadCalib/src/CaloHadDMCoeffFit.cxx b/Calorimeter/CaloLocalHadCalib/src/CaloHadDMCoeffFit.cxx
index 8548857d5d944be0869edd537a91c8f00a555f0c..b3979ac045dc3bf29caf6a4bdaffa485c857d446 100644
--- a/Calorimeter/CaloLocalHadCalib/src/CaloHadDMCoeffFit.cxx
+++ b/Calorimeter/CaloLocalHadCalib/src/CaloHadDMCoeffFit.cxx
@@ -1006,6 +1006,7 @@ void CaloHadDMCoeffFit::clear()
   int i_size=0;
   for (TProfile2D* h : m_hp2_DmWeight) {
     if( i_size==getFirstEnerLambdaBin(i_size) ) delete h;
+    i_size++;
   }
   m_hp2_DmWeight.clear();
 
diff --git a/Calorimeter/CaloRec/python/CaloConfigFlags.py b/Calorimeter/CaloRec/python/CaloConfigFlags.py
index ac73c3e9645060bde7f296eff82413dd83008c9f..be2d3c498f5a5a0d0205223b95fae21e6df719bc 100644
--- a/Calorimeter/CaloRec/python/CaloConfigFlags.py
+++ b/Calorimeter/CaloRec/python/CaloConfigFlags.py
@@ -77,4 +77,10 @@ def createCaloConfigFlags():
     # name of a local sqlite file to force reading COOL information from there.
     ccf.addFlag ('Calo.ClusterCorrection.dbSubdetName', {None : 'CALO'})
 
+    # Flags from Forward Towers:
+    ccf.addFlag('Calo.FwdTower.prepareLCW',True)
+    ccf.addFlag('Calo.FwdTower.clusterRange',2.5)
+
+    
+    
     return ccf
diff --git a/Calorimeter/CaloRec/python/CaloFwdTopoTowerConfig.py b/Calorimeter/CaloRec/python/CaloFwdTopoTowerConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..777cb267731b8caf62e2e433837c9faf07f92802
--- /dev/null
+++ b/Calorimeter/CaloRec/python/CaloFwdTopoTowerConfig.py
@@ -0,0 +1,167 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+from   AthenaCommon.Logging import logging
+
+def CaloFwdTopoTowerCfg(flags,**kwargs):
+
+    mlog = logging.getLogger('MakeFwdTopoTowerCfg')
+
+    result=ComponentAccumulator()
+
+    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+    from TileGeoModel.TileGMConfig import TileGMCfg
+
+    result.merge(LArGMCfg(flags))
+    result.merge(TileGMCfg(flags))
+
+
+    result.addCondAlgo(CompFactory.CaloTowerGeometryCondAlg(TowerEtaBins = 100,
+                                                            TowerEtaMin  = -5,
+                                                            TowerEtaMax  =  5.,))
+
+
+    kwargs.setdefault("PrepareLCW",flags.Calo.FwdTower.prepareLCW)
+    kwargs.setdefault("TopoClusterRange",flags.Calo.FwdTower.clusterRange)
+
+    #This property is for the algorithm, not for tool doing most of the work
+    towerContainerKey=kwargs.pop('towerContainerKey','CaloCalFwdTopoTowers')
+
+    #instatiate tool using kwargs
+    towerBuilder=CompFactory.CaloTopoTowerFromClusterMaker(**kwargs)
+
+    #Remember oderedByPt to (possibly) apply later:
+    orderbyPt=towerBuilder.OrderClusterByPt
+
+    if flags.Calo.FwdTower.prepareLCW:
+        ## order by pt after LCW calibration!
+        towerBuilder.OrderClusterByPt=False
+                
+    mlog.info('Consistency check')
+    if towerBuilder.PrepareLCW and not towerBuilder.BuildTopoTowers:
+        raise RuntimeError('{0}[inconsistent configuration] applying LCW requires to build topo-towers'.format(towerBuilder.name()))
+    if towerBuilder.BuildCombinedTopoSignal and not towerBuilder.BuildTopoTowers:
+        raise RuntimeError('{0}[inconsistent configuration] building combined topo-cluster/topo-tower signals requires to build topo-towers'.format(towerBuilder.name()))
+    if towerBuilder.ApplyCellEnergyThreshold and towerBuilder.BuildTopoTowers:
+        raise RuntimeError('{0}[inconsistent configuration] applying cell energy thresholds for topo-towers not yet implemented'.format(towerBuilder.name()))
+
+    ''' Tower converter configuration summary
+    '''
+    if towerBuilder.BuildTopoTowers:
+        if towerBuilder.PrepareLCW:
+            ''' LCW topo-towers
+            '''
+            mlog.info('################################################')
+            mlog.info('## Produce LCW calibrated topo-tower clusters ##')
+            mlog.info('################################################')
+            mlog.info('CaloTopoClusterContainerKey .. {0}'.format(towerBuilder.CaloTopoClusterContainerKey))
+            #mlog.info('CellClusterWeightKey ......... {0}'.format(towerBuilder.CellClusterWeightKey))
+        else:
+            ''' EM topo-towers
+            '''
+            mlog.info('###############################################')
+            mlog.info('## Produce EM calibrated topo-tower clusters ##')
+            mlog.info('###############################################')
+            mlog.info('CaloTopoClusterContainerKey .. {0}'.format(towerBuilder.CaloTopoClusterContainerKey))
+
+        if towerBuilder.BuildCombinedTopoSignal:
+            mlog.info(' ')
+            mlog.info('Combined topo-cluster/topo-towermode with y_max = {0}'.format(towerBuilder.TopoClusterRange))
+    else:    
+        ''' EM towers
+        '''
+        mlog.info('########################################')
+        mlog.info('## Produce EM standard tower clusters ##')
+        mlog.info('########################################')
+
+    #Configure moments maker (requires noise ...) 
+    from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
+    result.merge(CaloNoiseCondAlgCfg(flags, noisetype="totalNoise"))
+   
+    baseName=towerBuilder.name.replace("Builder","").replace("Maker","")
+    from AthenaCommon.SystemOfUnits   import deg
+
+    clusterMoments                  = CompFactory.CaloClusterMomentsMaker (baseName+'MomentMaker')
+    clusterMoments.MaxAxisAngle     = 20*deg
+    clusterMoments.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
+    clusterMoments.MinBadLArQuality = 4000
+    clusterMoments.MomentsNames     = [
+        # "CENTER_LAMBDA", 
+        # "CENTER_MAG",
+        "LONGITUDINAL",
+        # "FIRST_ENG_DENS",
+        # "ENG_FRAC_MAX",
+        "ENG_FRAC_EM",
+        # "PTD",
+        "SIGNIFICANCE",
+        # "ENG_POS",
+    ]
+
+    if not flags.Common.isOnline:
+        from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDbCfg
+        result.merge(LArElecCalibDbCfg(flags,["HVScaleCorr"]))
+        if flags.Input.isMC:
+            clusterMoments.LArHVFraction=CompFactory.LArHVFraction(HVScaleCorrKey="LArHVScaleCorr")
+        else:
+            clusterMoments.LArHVFraction=CompFactory.LArHVFraction(HVScaleCorrKey="LArHVScaleCorrRecomputed")
+
+        clusterMoments.MomentsNames       += ["ENG_BAD_HV_CELLS","N_BAD_HV_CELLS"]
+       
+    #instantiate Algorithm:
+    towerMaker                    = CompFactory.CaloTopoTowerMaker(baseName+"Alg")
+    towerMaker.TowersOutputName   = towerContainerKey
+    towerMaker.TowerMakerTool     = towerBuilder
+
+    from CaloBadChannelTool.CaloBadChanToolConfig import CaloBadChanToolCfg
+    caloBadChanTool = result.popToolsAndMerge( CaloBadChanToolCfg(flags) )
+    CaloClusterBadChannelList=CompFactory.CaloClusterBadChannelList
+    BadChannelListCorr = CaloClusterBadChannelList(badChannelTool = caloBadChanTool)
+
+
+    towerMaker.TowerCorrectionTools += [BadChannelListCorr,clusterMoments]
+    
+    if towerBuilder.PrepareLCW:
+        ''' Configure name for calibration tool
+        '''
+        towerCalName    = baseName+'Calibrator'
+        towerCalibrator = CompFactory.CaloTopoTowerFromClusterCalibrator(towerCalName)
+        towerCalibrator.OrderClusterByPt = orderbyPt
+
+    towerMaker.TowerCalibratorTool = towerCalibrator
+
+    result.addEventAlgo(towerMaker)
+
+    #merging
+    caloTowerMerger                         = CompFactory.CaloTopoClusterTowerMerger("CaloTopoSignalMaker")
+    caloTowerMerger.TopoClusterRange        = towerBuilder.TopoClusterRange                       #### caloTowerAlgo.CaloFwdTopoTowerBuilder.TopoClusterRange
+    caloTowerMerger.TopoClusterContainerKey = towerBuilder.CaloTopoClusterContainerKey
+    caloTowerMerger.TopoTowerContainerKey   = towerMaker.TowersOutputName
+    caloTowerMerger.TopoSignalContainerKey  = 'CaloCalTopoSignals'
+    
+    result.addEventAlgo(caloTowerMerger)
+    return result
+
+
+if __name__=="__main__":
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior=1
+
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
+    ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc20e_13TeV/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.ESD.e4993_s3227_r12689/myESD.pool.root"]  
+    ConfigFlags.Output.ESDFileName="esdOut.pool.root"
+
+    ConfigFlags.lock()
+
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+
+    cfg=MainServicesCfg(ConfigFlags)
+    cfg.merge(PoolReadCfg(ConfigFlags))
+
+    towerAcc=CaloFwdTopoTowerCfg(ConfigFlags,towerContainerKey="NewTowers",CaloTopoClusterContainerKey="CaloCalTopoClusters")
+
+    cfg.merge(towerAcc)
+
+    cfg.run(10)
diff --git a/Calorimeter/CaloRec/python/CaloRecoConfig.py b/Calorimeter/CaloRec/python/CaloRecoConfig.py
index dc8ffd7f183c7eb646fd3a129c6f28017b6e91a4..bd59901c90a4823b1b633abb40b88ccb44a6d847 100644
--- a/Calorimeter/CaloRec/python/CaloRecoConfig.py
+++ b/Calorimeter/CaloRec/python/CaloRecoConfig.py
@@ -35,6 +35,11 @@ def CaloRecoCfg(configFlags, clustersname=None,doLCCalib=None):
     from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
     result.merge(CaloTopoClusterCfg(configFlags, clustersname=clustersname, doLCCalib=doLCCalib))
 
+    #Configure forward towers:
+    from CaloRec.CaloFwdTopoTowerConfig import CaloFwdTopoTowerCfg
+    result.merge(CaloFwdTopoTowerCfg(configFlags,CaloTopoClusterContainerKey="CaloTopoClusters"))
+
+
     return result
 
 
diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index 721203a80b95dc335acf8d6027c70852eb260b10..b76e4a4de1e0df7e94784231e511109bc3ad6e97 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-16"
+   ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-17"
    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 10c6f613c6b68972aebcf4372727ff6c16ba41a6..18138f453864041959a3613e3f3516c11ef467e6 100644
--- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
+++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
@@ -1,16 +1,21 @@
-Sat Aug 21 21:42:33 CEST 2021
+Mon Nov  1 22:34:52 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.42] [x86_64-centos7-gcc8-opt] [master-calo-ctests/ec2fa09c9e3] -- built on [2021-08-21T2138]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "CaloUtils/CaloTowerStore_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5069 configurables from 8 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.42
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py"
 Py:Athena            INFO including file "CaloConditions/CaloConditions_jobOptions.py"
@@ -20,21 +25,21 @@ Py:Athena            INFO including file "TileIdCnv/TileIdCnv_jobOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on aibuild028.cern.ch on Sat Aug 21 21:42:47 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 3377 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3378 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -154,7 +159,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 6320 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6066 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -172,7 +177,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -184,17 +189,18 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 CondInputLoader      INFO Adding base classes:
   +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' )   -> no bases
@@ -202,8 +208,24 @@ CondInputLoader      INFO Adding base classes:
 CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
     +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 ApplicationMgr       INFO Application Manager Initialized successfully
-ClassIDSvc           INFO getRegistryEntries: read 2125 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2146 CLIDRegistry entries for module ALL
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
 ApplicationMgr       INFO Application Manager Started successfully
@@ -222,7 +244,7 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 207 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -232,20 +254,6 @@ AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -256,6 +264,7 @@ 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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...
@@ -267,25 +276,25 @@ Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All]
 ApplicationMgr       INFO Application Manager Stopped successfully
 CondInputLoader      INFO Finalizing CondInputLoader...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.07 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.07 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
 IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.02 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      0.16 ))s
+IOVDbSvc             INFO  bytes in ((      0.07 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 3 ReadTime: ((     0.16 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 3 ReadTime: ((     0.07 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  150 [ms] Ave/Min/Max=    37.5(+-    59.3)/       0/     140 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  200 [ms] Ave/Min/Max=      50(+-    70.4)/       0/     170 [ms] #=  4
-ChronoStatSvc        INFO Time User   : Tot= 2.04  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  110 [ms] Ave/Min/Max=    27.5(+-    42.1)/       0/     100 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  140 [ms] Ave/Min/Max=      35(+-    49.7)/       0/     120 [ms] #=  4
+ChronoStatSvc        INFO Time User   : Tot= 1.62  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts.py b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts.py
index 164922805bb8ba58b3f3481d107e59dadc5cda25..3125e5e4282b30088d17d3ece727cde085dfd351 100644
--- a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts.py
+++ b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 
diff --git a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py
index 28729b5d9791f092057a5685a113847c011ecb76..4beb3ef5b6a68591669beb3dc9b5294de8e29b1d 100644
--- a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py
+++ b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_MP.py
@@ -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
 #
 
 import AthenaCommon.AtlasUnixGeneratorJob
diff --git a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py
index e4244f80db6c6941341eb8da83d5e0ea8e030fe1..497c211a539073d8863aa050455210cd9b347cf0 100644
--- a/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py
+++ b/Control/AthenaExamples/AthExHive/share/AthExHiveOpts_Serial.py
@@ -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
 #
 
 import AthenaCommon.AtlasUnixGeneratorJob
diff --git a/Control/AthenaExamples/AthExHive/share/CircDataDep.py b/Control/AthenaExamples/AthExHive/share/CircDataDep.py
index da6d56d07467123d4b6633b57ec6962bd14f912c..fa8a5b8ea70e027995be6c9dcabe203aec772c93 100644
--- a/Control/AthenaExamples/AthExHive/share/CircDataDep.py
+++ b/Control/AthenaExamples/AthExHive/share/CircDataDep.py
@@ -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/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py b/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py
index 6fbf464efbc6b1dea0d462bd84bc6213569bf8c6..3c54c0f5c4b25cfdd0b5246c8bbb58eafd74c5c9 100644
--- a/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py
+++ b/Control/AthenaExamples/AthExHive/share/CondAlgsOpts.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
 
diff --git a/Control/AthenaExamples/AthExHive/share/DataLoopTest.py b/Control/AthenaExamples/AthExHive/share/DataLoopTest.py
index cc280a86dccb41c8fc92383f52f27780d5d6b623..d0ab2037b5604a124b64cc55a925b1d4dc9f2ae0 100644
--- a/Control/AthenaExamples/AthExHive/share/DataLoopTest.py
+++ b/Control/AthenaExamples/AthExHive/share/DataLoopTest.py
@@ -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/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py b/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py
index 6ed65225017f8e297d0737a8cacaa0c14dd7a955..5bcdab814f6290ad56a6f64cea358790630d7cd0 100644
--- a/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py
+++ b/Control/AthenaExamples/AthExHive/share/RAthExHiveOpts.py
@@ -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/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx
index 4f5347bfe694ad55d9ac0477d0272bf949ae1f00..e160cd3538f96fa3ab6d45f56199fff86567b82c 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgA.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 "HiveAlgA.h"
@@ -53,19 +53,14 @@ StatusCode HiveAlgA::execute() {
   unsigned int i = Gaudi::Hive::currentContextEvt();
 
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >
-    ( HiveDataObj(10000 + evt->eventNumber()*100 + i) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(10000 + evt->eventNumber()*100 + i)));
 
   SG::WriteHandle<HiveDataObj> wrh2( m_wrh2 );
-  wrh2 = std::make_unique< HiveDataObj >( HiveDataObj(10050+i) );
+  ATH_CHECK(wrh2.record(std::make_unique< HiveDataObj >(10050+i)));
   
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
   ATH_MSG_INFO("  write: " << wrh2.key() << " = " << wrh2->val() );
   
-  ATH_CHECK(wrh1.isValid());
-  ATH_CHECK(wrh2.isValid());
-
   return StatusCode::SUCCESS;
-
 }
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgA.h b/Control/AthenaExamples/AthExHive/src/HiveAlgA.h
index c1ab3c334d19abada40030af91e558fadf71a781..aad991ffa38f88161c84291c8fb1c961525e2d5d 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgA.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgA.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
 */
 
 /**
@@ -31,9 +31,9 @@ public:
   
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx
index 1345cda2edfa8dc18524a04f23f445f5cd11a66b..6f19a6b2ee3064d927d552e92ad693f11d6026d0 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgB.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 "HiveAlgB.h"
@@ -62,7 +62,8 @@ StatusCode HiveAlgB::execute() {
   m_di = s;
 
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(20000) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(20000)));
+
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
 
   return StatusCode::SUCCESS;
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgB.h b/Control/AthenaExamples/AthExHive/src/HiveAlgB.h
index bc5678fa8344e0345622826ffaf20d153df35506..cae0185f9ffdd8fd03b18121d151019f39d159e0 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgB.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgB.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
 */
 
 /**
@@ -31,9 +31,9 @@ public:
   
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
   
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx
index 5311891410fe4cb6dff9211e2985555c3e5bd902..01838248c87bb6fb4306d1d605aba33196bdd256 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgBase.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 "HiveAlgBase.h"
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgBase.h b/Control/AthenaExamples/AthExHive/src/HiveAlgBase.h
index d8b3a62641753ff854cef54eb663fb033347dea2..7409ec00c37b00074e3ea08dcca74ec160c445ec 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgBase.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgBase.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
 */
 
 /**
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx
index d16a50af37657fa486c3b7f08bb83a747863f25f..fd495d17ee7b475f60a33191a593d44f9175aaa0 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgC.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 "HiveAlgC.h"
@@ -47,10 +47,10 @@ StatusCode HiveAlgC::execute() {
   ATH_MSG_INFO("  read: " << rdh1.key() << " = " << rdh1->val() );
   
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(30000 + rdh1->val() ) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(30000 + rdh1->val() )));
 
   SG::WriteHandle<HiveDataObj> wrh2( m_wrh2 );
-  wrh2 = std::make_unique< HiveDataObj >( HiveDataObj(30001) );
+  ATH_CHECK(wrh2.record(std::make_unique< HiveDataObj >(30001)));
   
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
   ATH_MSG_INFO("  write: " << wrh2.key() << " = " << wrh2->val() );
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgC.h b/Control/AthenaExamples/AthExHive/src/HiveAlgC.h
index 32f6b2eec36a3d780f4b7f1755224a65c96ddec8..c314889d60ff29c53211e9eac939740a74480ab3 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgC.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgC.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
 */
 
 /**
@@ -29,9 +29,9 @@ public:
   
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx
index 9279e3dc37d8430c8b505e6c06636b53a8ac337f..a33db5e43ba2640f025195f485296064d913da73 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgD.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 "HiveAlgD.h"
@@ -46,7 +46,8 @@ StatusCode HiveAlgD::execute() {
   ATH_MSG_INFO("  read: " << rdh1.key() << " = " << rdh1->val() );
   
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(40000) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(40000)));
+
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
 
   return StatusCode::SUCCESS;
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgD.h b/Control/AthenaExamples/AthExHive/src/HiveAlgD.h
index 0673432d2aaec73cc6a2fd80db889537df9af1ea..c7f33816526d2918705cef112f8f6f1abd75e8d4 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgD.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgD.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
 */
 
 /**
@@ -29,9 +29,9 @@ public:
 
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx
index ff2d3b7b56870c7b52fb037f6d31aef487b4c79b..35867a9f09ee6f8c9b7e5d7fe2f4c647857ef2fd 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgE.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 "HiveAlgE.h"
@@ -54,7 +54,7 @@ StatusCode HiveAlgE::execute() {
   ATH_MSG_INFO("  read: " << rdh2.key() << " = " << rdh2->val() );
   
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(500000 + rdh1->val() + rdh2->val()/10) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(500000 + rdh1->val() + rdh2->val()/10)));
   
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgE.h b/Control/AthenaExamples/AthExHive/src/HiveAlgE.h
index 1a3acdc6cf903911971616cf8c86e6236e2e6a34..d87959fa343f5d906d516e8b925ff5aa1755dbd3 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgE.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgE.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
 */
 
 /**
@@ -29,9 +29,9 @@ public:
   
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx
index 395fac7b5bf36dcbd27bc9d0ad51898206d2c9a3..547a9affa00cc0abb409bf5f1b15a840b98e0d63 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgF.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 "HiveAlgF.h"
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgF.h b/Control/AthenaExamples/AthExHive/src/HiveAlgF.h
index e82f638010bcb24d4e2ab284deac84dabd6e13b8..15bfd2c9321e957dc44d1a5b4e6d2ca197d4982d 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgF.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgF.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
 */
 
 /**
@@ -28,9 +28,9 @@ public:
 
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
   
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx
index 40258e092ab6f5ab86b97ee51831c8b6b9447c81..75d721ec877e3cb36a949ca454f1e49f95e3d0ff 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgG.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 "HiveAlgG.h"
@@ -46,7 +46,8 @@ StatusCode HiveAlgG::execute() {
   ATH_MSG_INFO("  read: " << rdh1.key() << " = " << rdh1->val() );
   
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(70000) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(70000)));
+
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
 
   return StatusCode::SUCCESS;
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgG.h b/Control/AthenaExamples/AthExHive/src/HiveAlgG.h
index 77d45e8a09f891487a78a8d958ad10932198a195..a4583e468ff4d92a03270179921c67cecd4a166c 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgG.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgG.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
 */
 
 /**
@@ -29,9 +29,9 @@ public:
 
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx
index 57e471a074e815043919e5d3208eb2fb3f13cecb..c115a594dcea0aee108e44b710cc05299ab42ff2 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx
@@ -1,9 +1,7 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifdef REENTRANT_GAUDI
-
 #include "HiveAlgR.h"
 #include "GaudiKernel/ServiceHandle.h"
 
@@ -37,19 +35,16 @@ StatusCode HiveAlgR::execute(const EventContext& ctx) const {
 
   info() << "execute: " << index() << " on " << ctx << endmsg;
 
-  SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
+  SG::ReadHandle<xAOD::EventInfo> evt(m_evt,ctx);
   ATH_MSG_INFO("   EventInfo:  r: " << evt->runNumber()
                << " e: " << evt->eventNumber() );
 
-  SG::WriteHandle<HiveDataObj> wh1(m_wrh1);
-  ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> 
-                         ( HiveDataObj(10000 + 
-                                       evt->event_ID()->event_number()*100 )))
-             );
+  SG::WriteHandle<HiveDataObj> wh1(m_wrh1,ctx);
+  ATH_CHECK(wh1.record(std::make_unique<HiveDataObj>(10000 +evt->eventNumber()*100)));
+
   ATH_MSG_INFO("  write: " << wh1.key() << " = " << wh1->val() );
 
   return StatusCode::SUCCESS;
 
 }
 
-#endif // REENTRANT_GAUDI
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgR.h b/Control/AthenaExamples/AthExHive/src/HiveAlgR.h
index bbb1a4e328d23a2ec7c9f4fd88167b041bbf9b6d..3991a5df2c7453f50d2327974f7bf233ce8e2ca2 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgR.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgR.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
 */
 
 /**
@@ -30,11 +30,11 @@ public:
   ~HiveAlgR ();
   
   // Define the initialize, execute and finalize methods: 
-  StatusCode initialize();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
 
   // Re-entrant version of execute is const and takes an EventContext param
-  StatusCode execute(const EventContext&) const;
+  virtual StatusCode execute(const EventContext&) const override;
   
 private:
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx
index f0ca2e51c718a5791ced6c0d3de3a8e51bcf66a1..910d4c7c7e98a4a8963d9dc48dbea1225a9aef45 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgV.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 "HiveAlgV.h"
@@ -40,17 +40,15 @@ StatusCode HiveAlgV::execute() {
  
   sleep();
 
-  StatusCode sc { StatusCode::SUCCESS };
-
   if (m_writeFirst) {
-    write();
-    sc = read();
+    ATH_CHECK(write());
+    ATH_CHECK(read());
   } else {
-    sc = read();
-    write();
+    ATH_CHECK(read());
+    ATH_CHECK(write());
   }
 
-  return sc;
+  return StatusCode::SUCCESS;
 }
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -70,12 +68,13 @@ HiveAlgV::read() const {
 }
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void
+StatusCode
 HiveAlgV::write() {
   std::vector< SG::WriteHandle<HiveDataObj> > whv = m_whv.makeHandles();
   for (auto &hnd : whv) {
-    hnd = std::make_unique<HiveDataObj> ( HiveDataObj( 10101 ) );
+    ATH_CHECK(hnd.record(std::make_unique<HiveDataObj>( 10101 )));
     ATH_MSG_INFO("  write: " << hnd.key() << " = " << hnd->val() );
   }
+  return StatusCode::SUCCESS;
 }
 
diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgV.h b/Control/AthenaExamples/AthExHive/src/HiveAlgV.h
index fbb45c459699da0b5e58f13d445f85b1f1949ace..4f9aa282a1b1d60257e372616e2d34b553fdead4 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveAlgV.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveAlgV.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
 */
 
 /**
@@ -29,9 +29,9 @@ public:
 
   // Define the initialize, execute and finalize methods:
   
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
   
@@ -49,7 +49,7 @@ private:
   StatusCode read() const;
 
   // do the actual writing of the ReadHandleArray
-  void write();
+  StatusCode write();
    
 };
 #endif
diff --git a/Control/AthenaExamples/AthExHive/src/HiveExSvc.cxx b/Control/AthenaExamples/AthExHive/src/HiveExSvc.cxx
index d66b52db8251de2bf99631291e69d7ca0e765e9a..7fe2b104e89e761e664a5737d3d0fb6239c6116a 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveExSvc.cxx
+++ b/Control/AthenaExamples/AthExHive/src/HiveExSvc.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 "HiveExSvc.h"
diff --git a/Control/AthenaExamples/AthExHive/src/HiveExSvc.h b/Control/AthenaExamples/AthExHive/src/HiveExSvc.h
index ac18a81467247bfe79438da431b956be86fe4492..646241e5c8dbbc3f1377b4adaee43c174b7cfcef 100644
--- a/Control/AthenaExamples/AthExHive/src/HiveExSvc.h
+++ b/Control/AthenaExamples/AthExHive/src/HiveExSvc.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
 */
 
 /**
@@ -27,8 +27,8 @@ public:
   HiveExSvc(const std::string& name, ISvcLocator* svc);
   virtual ~HiveExSvc();
   
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
   
   void add(const std::string&, const unsigned int&);
 
diff --git a/Control/AthenaExamples/AthExHive/src/ThreadInitTool.cxx b/Control/AthenaExamples/AthExHive/src/ThreadInitTool.cxx
index 19fd09682394c05c523c6fed1b6136fccb66cdc1..df8fe289b32c5c7ebb8998cbcc8c60fe067482e5 100644
--- a/Control/AthenaExamples/AthExHive/src/ThreadInitTool.cxx
+++ b/Control/AthenaExamples/AthExHive/src/ThreadInitTool.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 "ThreadInitTool.h"
diff --git a/Control/AthenaExamples/AthExHive/src/ThreadInitTool.h b/Control/AthenaExamples/AthExHive/src/ThreadInitTool.h
index 08c44b9b2bc55940364635c73bb08bb5dff1ced6..2b972cc1d740d0200b0b158d358ae299c4b3751f 100644
--- a/Control/AthenaExamples/AthExHive/src/ThreadInitTool.h
+++ b/Control/AthenaExamples/AthExHive/src/ThreadInitTool.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 ATHEXHIVE_THREADINITTOOL_H
@@ -33,10 +33,10 @@ public:
   ThreadInitTool( const std::string&, const std::string&, const IInterface* );
 
 
-  virtual void initThread();
-  virtual void terminateThread();
+  virtual void initThread() override;
+  virtual void terminateThread() override;
 
-  virtual unsigned int nInit() const { return m_nInitThreads; }
+  virtual unsigned int nInit() const override { return m_nInitThreads; }
 
 private:
   // Number of threads that have been initialized
diff --git a/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx b/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx
index f0378c1c8b885ac75d7035d01a90482151881c3c..8b688abea5334c7627f98a3046ba698cbd00c99f 100644
--- a/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx
+++ b/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx
@@ -6,6 +6,7 @@
 #include "../HiveAlgF.h"
 #include "../HiveAlgG.h"
 #include "../HiveAlgV.h"
+#include "../HiveAlgR.h"
 
 #include "../HiveExSvc.h"
 
@@ -15,10 +16,6 @@
 #include "../loopTest/HiveAlgM.h"
 #include "../loopTest/HiveTool.h"
 
-#ifdef REENTRANT_GAUDI
-  #include "../HiveAlgR.h"
-#endif
-
 #include "../condEx/AlgA.h"
 #include "../condEx/AlgB.h"
 #include "../condEx/AlgC.h"
@@ -45,10 +42,7 @@ DECLARE_COMPONENT( HiveAlgL2 )
 DECLARE_COMPONENT( HiveAlgL3 )
 DECLARE_COMPONENT( HiveAlgM )
 DECLARE_COMPONENT( HiveAlgV )
-
-#ifdef REENTRANT_GAUDI
-  DECLARE_COMPONENT( HiveAlgR )
-#endif
+DECLARE_COMPONENT( HiveAlgR )
 
 DECLARE_COMPONENT( AlgA )
 DECLARE_COMPONENT( AlgB )
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.cxx b/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.cxx
index ca5c469dc13d7d4c73aec28af91b61dba79866bb..685c23163a01152b3412c21d1bb8413c4bb80415 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.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 "ASCIICondDbSvc.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.h b/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.h
index d96a51d0605fbe8c46ae713f27ce7d4ad974a6cf..ba503fa95a2c15623d9913e07f0bd5e08ca9cf0d 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/ASCIICondDbSvc.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 ATHEXHIVE_ASCIICONDDBSVC_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgA.cxx b/Control/AthenaExamples/AthExHive/src/condEx/AlgA.cxx
index 215fa3e7e5bc277f01967673b5912cb325b2f787..338825b48b353960c55ea189e747316f5bfcb097 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgA.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgA.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 "AlgA.h"
@@ -56,15 +56,15 @@ StatusCode AlgA::execute() {
 
   SG::WriteHandle<HiveDataObj> wh1(m_wrh1);
   ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> 
-                         ( HiveDataObj(10000 + 
-                                       evt->eventNumber()*100 + 
-                                       i) ) )
+                         ( 10000 + 
+			   evt->eventNumber()*100 + 
+			   i)  )
              );
   ATH_MSG_INFO("  write: " << wh1.key() << " = " << wh1->val() );
 
 
   SG::WriteHandle<HiveDataObj> wh2(m_wrh2);
-  ATH_CHECK( wh2.record( std::make_unique< HiveDataObj >( HiveDataObj(10050+i) ) ) );
+  ATH_CHECK( wh2.record( std::make_unique< HiveDataObj >( 10050+i ) ) );
   ATH_MSG_INFO("  write: " << wh2.key() << " = " << wh2->val() );
     
   return StatusCode::SUCCESS;
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgA.h b/Control/AthenaExamples/AthExHive/src/condEx/AlgA.h
index 3942de84a098830bff66aada11104f5670368b25..317fdd202ca40abdbc646b5f6fc3ad185e3f5bff 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgA.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgA.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 CONDALGS_ALGA_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgB.cxx b/Control/AthenaExamples/AthExHive/src/condEx/AlgB.cxx
index 0b9eabae4e48da932ffee3e2fda4bf24fbafcda6..a7f5a45288f2d5f05d4e4b37607b644be1dd7310 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgB.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgB.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 "AlgB.h"
@@ -45,7 +45,7 @@ StatusCode AlgB::execute() {
 
   SG::WriteHandle<HiveDataObj> wh1(m_wrh1);
   ATH_CHECK( wh1.record( std::make_unique< HiveDataObj >
-                         ( HiveDataObj(3300 + rh1->val()) ) ) );
+                         ( 3300 + rh1->val() ) ) );
 
   ATH_MSG_INFO("  write: " << wh1.key() << " = " << wh1->val() );
   ATH_CHECK(wh1.isValid());
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgB.h b/Control/AthenaExamples/AthExHive/src/condEx/AlgB.h
index eb4d2e7a23f3a48076928d1d8a7e30ba6e6667c3..c59600517ec73432d5e655e6926aa8aef6c700db 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgB.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgB.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 CONDALGS_ALGB_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgC.cxx b/Control/AthenaExamples/AthExHive/src/condEx/AlgC.cxx
index c5a0954dfa020d8dcf5dc7dfdcb3e5b878932c8a..d3e518f1a934b1c3560492c4510329be1ee46072 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgC.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgC.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 "AlgC.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgC.h b/Control/AthenaExamples/AthExHive/src/condEx/AlgC.h
index 4b922675fc25b3f4a044dfa94b03d09d403faa4c..ac98df2863008794d172a1ea4978f7f21d6e60e4 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgC.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgC.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 CONDALGS_ALGC_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgD.cxx b/Control/AthenaExamples/AthExHive/src/condEx/AlgD.cxx
index 50f3c0d370cfab97bedb9b89029d46e6f1a93873..eba30c1ec7798bc792cd9aeadd9bef46faefb0d6 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgD.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgD.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 "AlgD.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgD.h b/Control/AthenaExamples/AthExHive/src/condEx/AlgD.h
index 2cfb201cf8468d76578305ff6e654790fc770486..d91c4d70df091ae8f677f1361bd96894a4e28df0 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgD.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgD.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 CONDALGS_ALGD_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgE.cxx b/Control/AthenaExamples/AthExHive/src/condEx/AlgE.cxx
index c334250e455744a947a8b49e4f7bf7586aa4b8da..f80ec689d7fb1d883e288262d85bbe7c4448018e 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgE.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgE.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 "AlgE.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgE.h b/Control/AthenaExamples/AthExHive/src/condEx/AlgE.h
index 88452b01d98fd463d2c09c294ed55cc18a1fb57e..5c45ce46fadc685e5cb156f48f976632b18bd1c7 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgE.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgE.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 CONDALGS_ALGE_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgT.cxx b/Control/AthenaExamples/AthExHive/src/condEx/AlgT.cxx
index f42088c636e581ca6e179057619003d38faaa3fc..81c633084af2278ec6ea25b05cd6df03002a4933 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgT.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgT.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 "AlgT.h"
@@ -81,10 +81,8 @@ StatusCode AlgT::execute() {
 
 
   SG::WriteHandle<HiveDataObj> wh1(m_wrh1);
-  ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> 
-                         ( HiveDataObj(10000 + 
-                                       evt->eventNumber()) ) )
-             );
+  ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> (10000 + evt->eventNumber())));
+
   ATH_MSG_INFO("  write: " << wh1.key() << " = " << wh1->val() );
 
 
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/AlgT.h b/Control/AthenaExamples/AthExHive/src/condEx/AlgT.h
index 831e092dca4dc1b50b2de5bc775e48ad23cd90af..a52f96c02956081bf641f692b253e55a4ca67349 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/AlgT.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/AlgT.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 CONDALGS_ALGT_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.cxx b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.cxx
index 65fc457ee0e4c0b7a1d7113d3f8c4cb159dff495..9b56ae266fd0be164b01b9d48123bad3dcac282f 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.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 "CondAlgX.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.h b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.h
index eef112e5a1b343402553198cd2c4607fcdf82b84..5efda52398af47b869ce879bc8139d6d009f7314 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgX.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 CONDALGS_CONDALGX_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.cxx b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.cxx
index 8343b61f0757a04360a3a5411da07ddb44cccca9..5ea755d3b3a6b54d95048d44d92b9c0a566d3993 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.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 "CondAlgY.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.h b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.h
index 7ff8f362478cfeb17424936eb9336910c36e9de5..b11399a95382e66ff6e486e5d188d9c36af277ee 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgY.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 CONDALGS_CONDALGY_H
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.cxx b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.cxx
index 04d420dae8df20f9f0a6d1d43cc33228e89eed7b..562f6e576e5dc47bb84c013b66228b68bcef7845 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.cxx
+++ b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.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 "CondAlgZ.h"
diff --git a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.h b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.h
index 08a7c50c352b384472b4c1b11699cd8e20d0d6f8..78c6a568b640625dc0794f2dbd0ac16ce874ed72 100644
--- a/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.h
+++ b/Control/AthenaExamples/AthExHive/src/condEx/CondAlgZ.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 CONDALGS_CONDALGZ_H
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.cxx b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.cxx
index 0599d3965aca33a4a6d435464e5d66d32aa01515..282d535c6aa389e03ff033b1d59605e969e1fabd 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.cxx
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.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 "HiveAlgL1.h"
@@ -44,7 +44,7 @@ StatusCode HiveAlgL1::execute() {
   ATH_MSG_INFO("  read: " << rdh1.key() << " = " << rdh1->val() );
   
   SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-  wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(rdh1->val()+1) );
+  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(rdh1->val()+1)));
   
   ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
 
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.h b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.h
index 693e9c592ea05d163a5ab4b1a1c607e562ed54c2..12d86ba1637b778844767e908eb731231ad2e354 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.h
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL1.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 ATHEXHIVE_ALGL1_H
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.cxx b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.cxx
index c32e2826b77872f5dafd96c7bea8f9af7b99104a..8e5c3eb3420db5d923b09e833f171975d9ce2c0e 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.cxx
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.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 "HiveAlgL2.h"
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.h b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.h
index 7f14cb3385155607a1712a66a5d0e7c8b0a9ccf6..9a4714cb26691fd2e90e01d2a220818e2886860b 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.h
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL2.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 ATHEXHIVE_ALGL2_H
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.cxx b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.cxx
index 5b4c3f18e293cdc7d77682d5ef6abb8376c74b7f..f142551330a3808ec0ea56c1faf04eb50658bcb2 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.cxx
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.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 "HiveAlgL3.h"
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.h b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.h
index 42db5bdcb9f1f8cc89efd7f343f9e1ddcc19df7c..23a53f1b4891b519e4bfb0770347fe7c63da1ab7 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.h
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgL3.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 ATHEXHIVE_ALGL3_H
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.cxx b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.cxx
index 08eb9d273d7d3e381461c38dd2567cb4d3320f08..d9f60988998fc6b86b46f93ef7c16912ed3c3f8c 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.cxx
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.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 "HiveAlgM.h"
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.h b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.h
index 48dd70de35b0eb9797eb5b0550c35c7f2d61634b..dc1c41aa3ee453d2dec81254d37311c43b81c5fe 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.h
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveAlgM.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 ATHEXHIVE_ALGM_H
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.cxx b/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.cxx
index 8d544b1ec4937fe47907ea145bf1ed1e18e9ac5d..553686472716d2715107b6891960b1d8b02dfd28 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.cxx
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.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 "HiveTool.h"
@@ -66,8 +66,8 @@ StatusCode HiveTool::doSomething() const {
     ATH_MSG_INFO("WH not valid - not writing");
   } else {
     SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 );
-    wrh1 = std::make_unique< HiveDataObj >
-      ( HiveDataObj(val + 666) );
+    ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(val + 666)));
+
     ATH_MSG_INFO("  write: " << wrh1.key() << " = " << wrh1->val() );
   }
 
diff --git a/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.h b/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.h
index 94eb5c5974ddfa2f055b2cfbc87ba51faff62690..75889d51dcc743bfaf9072cd2a6891bd7b0eced6 100644
--- a/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.h
+++ b/Control/AthenaExamples/AthExHive/src/loopTest/HiveTool.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 ATHEXHIVE_HIVETOOL_H
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
index b1d4ca1a5d92eea629ec6ad39d10f7efbdb59938..7b5f8d810243c40e2fc830e7b599622b30545e52 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
@@ -31,7 +31,7 @@ def PoolWriteCfg(flags, forceTreeAutoFlush=-1):
 
     if flags.Output.EVNT_TRFileName:
         # Use LZMA w/ Level 1
-        comp_alg = 1 if flags.Output.HITSFileName.endswith('_000') or flags.Output.HITSFileName.startswith('tmp.') else 2
+        comp_alg = 1 if flags.Output.EVNT_TRFileName.endswith('_000') or flags.Output.EVNT_TRFileName.startswith('tmp.') 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 ) ]
@@ -53,7 +53,7 @@ def PoolWriteCfg(flags, forceTreeAutoFlush=-1):
 
     if flags.Output.RDOFileName:
         # Use LZMA w/ Level 1
-        comp_alg = 1 if flags.Output.HITSFileName.endswith('_000') or flags.Output.HITSFileName.startswith('tmp.') else 2
+        comp_alg = 1 if flags.Output.RDOFileName.endswith('_000') or flags.Output.RDOFileName.startswith('tmp.') 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 ) ]
@@ -64,7 +64,7 @@ def PoolWriteCfg(flags, forceTreeAutoFlush=-1):
 
     if flags.Output.ESDFileName:
         # Use LZMA w/ Level 1
-        comp_alg = 1 if flags.Output.HITSFileName.endswith('_000') or flags.Output.HITSFileName.startswith('tmp.') else 2
+        comp_alg = 1 if flags.Output.ESDFileName.endswith('_000') or flags.Output.ESDFileName.startswith('tmp.') 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 ) ]
@@ -75,7 +75,7 @@ def PoolWriteCfg(flags, forceTreeAutoFlush=-1):
 
     if flags.Output.AODFileName:
         # Use LZMA w/ Level 1
-        comp_alg = 1 if flags.Output.HITSFileName.endswith('_000') or flags.Output.HITSFileName.startswith('tmp.') else 2
+        comp_alg = 1 if flags.Output.AODFileName.endswith('_000') or flags.Output.AODFileName.startswith('tmp.') 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 ) ]
diff --git a/Generators/Starlight_i/src/Starlight_i.cxx b/Generators/Starlight_i/src/Starlight_i.cxx
index 67d33df1ecc939ac585fda5240c5c09f4f853c8b..17a73d65d039dfe44c3c50c529ddb0c126d18c75 100644
--- a/Generators/Starlight_i/src/Starlight_i.cxx
+++ b/Generators/Starlight_i/src/Starlight_i.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
 */
 
 // ------------------------------------------------------------- 
@@ -124,6 +124,7 @@ StatusCode Starlight_i::genInitialize()
     m_starlight = new starlight();
     // Set random generator to prevent crash in tests.
     m_randomGenerator = std::make_shared<randomGenerator>();
+    m_randomGenerator->SetSeed(m_randomSeed);
     m_starlight->setRandomGenerator(m_randomGenerator.get());
     // set input parameters
     m_starlight->setInputParameters(&m_inputParameters);
diff --git a/HLT/Trigger/TrigControl/TrigExamples/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/python/MTCalibPebConfig.py
index 871e2bce5970ada5bb244029631579eb1506442e..743dad054df03c9cbdf79b4c95e6097d9db5c2e9 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/python/MTCalibPebConfig.py
+++ b/HLT/Trigger/TrigControl/TrigExamples/python/MTCalibPebConfig.py
@@ -134,6 +134,10 @@ def l1_seq_cfg(flags, options=default_options):
     l1_decoder_alg = acc.getEventAlgo('HLTSeeding')
     l1_decoder_alg.prescaler = CompFactory.PrescalingEmulationTool()
 
+    # Generate L1 menu
+    from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
+    generateL1Menu(flags)
+
     # Need to set HLT menu file name here to avoid conflict when merging with HLT sequence CA
     acc.getService("HLTConfigSvc").JsonFileName = _menu_file_name
 
diff --git a/LArCalorimeter/LArBadChannelTool/python/LArBadFebAccess.py b/LArCalorimeter/LArBadChannelTool/python/LArBadFebAccess.py
index 116560844870f9e538bac043af9f940c72098821..2efca4f02a729b6f4a077ede00e6a483f680a6c2 100644
--- a/LArCalorimeter/LArBadChannelTool/python/LArBadFebAccess.py
+++ b/LArCalorimeter/LArBadChannelTool/python/LArBadFebAccess.py
@@ -13,7 +13,7 @@ def LArBadFebAccess(algname="LArBadFebCondAlg", dbString=None):
     from IOVDbSvc.CondDB import conddb
 
     if dbString is not None:
-        #foldername=conddb.extractFolder(dbString)
+        foldername=conddb.extractFolder(dbString)
         conddb.addFolder("",dbString,className='AthenaAttributeList')
     #else:
     #    if conddb.isOnline or conddb.isMC:
@@ -29,6 +29,6 @@ def LArBadFebAccess(algname="LArBadFebCondAlg", dbString=None):
 
     from LArBadChannelTool.LArBadChannelToolConf import LArBadFebCondAlg
     theLArBadFebCondAlg=LArBadFebCondAlg(algname)
-    theLArBadFebCondAlg.ReadKey="/LAR/BadChannels/MissingFEBs"
+    theLArBadFebCondAlg.ReadKey=foldername
     condSeq+=theLArBadFebCondAlg
     return
diff --git a/LArCalorimeter/LArBadChannelTool/share/LArBadChannel2Ascii.py b/LArCalorimeter/LArBadChannelTool/share/LArBadChannel2Ascii.py
index 87605f3ae4d6c4754067209a4e39c54214335a1b..cfe76bb5025482e159841841edb21dbb9cdce1b5 100644
--- a/LArCalorimeter/LArBadChannelTool/share/LArBadChannel2Ascii.py
+++ b/LArCalorimeter/LArBadChannelTool/share/LArBadChannel2Ascii.py
@@ -112,4 +112,4 @@ theLArBadChannels2Ascii.WithMissing=False
 theLArBadChannels2Ascii.ExecutiveSummaryFile=ExecutiveSummaryFile
 topSequence+=theLArBadChannels2Ascii
 
-svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2014-01" 
+svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2018-06" 
diff --git a/LArCalorimeter/LArBadChannelTool/share/LArBuildMissingFebDB.sh b/LArCalorimeter/LArBadChannelTool/share/LArBuildMissingFebDB.sh
index f7b83fc1e68c8865fcf7109a1fcebf18313add9d..0798dd23f92e446757602dac37cb85ff2291706e 100755
--- a/LArCalorimeter/LArBadChannelTool/share/LArBuildMissingFebDB.sh
+++ b/LArCalorimeter/LArBadChannelTool/share/LArBuildMissingFebDB.sh
@@ -12,7 +12,7 @@ outputSqlite="MissingFEBs.db"
 outputSqliteOnl="MissingFEBsOnl.db"
 oldTextFile="mf_previous.txt"
 diffTextFile="mf_diff.txt"
-
+BaseTagName="LARBadChannelsOflMissingFEBs-RUN2-UPD3-01"
 
 if [ $1 == "-append" ]
 then
@@ -137,7 +137,7 @@ echo "Found $upd4TagName"
 
 
 echo "Running athena to read current database content..."
-athena.py -c "OutputFile=\"${oldTextFile}\"" LArBadChannelTool/LArMissingFebs2Ascii.py > oracle2ascii.log 2>&1
+athena.py -c "OutputFile=\"${oldTextFile}\";tag=\"${BaseTagName}\";" LArBadChannelTool/LArMissingFebs2Ascii.py > oracle2ascii.log 2>&1
 if [ $? -ne 0 ];  then
     echo "Athena reported an error reading back sqlite file ! Please check oracle2ascii.log!"
     exit
@@ -187,7 +187,7 @@ if [ $onerun -eq 1 ]; then
 else   
    pref=""
 fi
-pref="${pref}sqlite=\"${outputSqlite}\";OutputFile=\"${outputTextFile}\""
+pref="${pref}sqlite=\"${outputSqlite}\";OutputFile=\"${outputTextFile}\";tag=\"${BaseTagName}\";"
 echo "Running athena to test readback of sqlite database file"
 athena.py  -c ${pref} LArBadChannelTool/LArMissingFebs2Ascii.py > sqlite2ascii.log 2>&1
 
@@ -214,7 +214,7 @@ if [ $online -eq 1 ]; then
 fi
 
 echo "Copying UPD3 to UPD4 tag..."
-AtlCoolCopy "sqlite://;schema=${outputSqlite}.tmp;dbname=CONDBR2" "sqlite://;schema=${outputSqlite};dbname=CONDBR2" -f /LAR/BadChannelsOfl/MissingFEBs -t LARBadChannelsOflMissingFEBs-RUN2-UPD3-01 -ot LARBadChannelsOflMissingFEBs-RUN2-$upd4TagName  > AtlCoolCopy.upd4.log 2>&1
+AtlCoolCopy "sqlite://;schema=${outputSqlite}.tmp;dbname=CONDBR2" "sqlite://;schema=${outputSqlite};dbname=CONDBR2" -f /LAR/BadChannelsOfl/MissingFEBs -t LARBadChannelsOflMissingFEBs-RUN2-UPD3-01 -ot LARBadChannelsOflMissingFEBs-$upd4TagName  > AtlCoolCopy.upd4.log 2>&1
 
 if [ $? -ne 0 ];  then
     echo "AtlCoolCopy reported an error! Please check AtlCoolCopy.upd4.log!"
diff --git a/LArCalorimeter/LArBadChannelTool/share/LArMissingFebs2Ascii.py b/LArCalorimeter/LArBadChannelTool/share/LArMissingFebs2Ascii.py
index d8f767d1a060b70263d17c2ad40ad10f0a4bb183..b53665f9d13c07c5251b53846c9e6d0107a8b77a 100644
--- a/LArCalorimeter/LArBadChannelTool/share/LArMissingFebs2Ascii.py
+++ b/LArCalorimeter/LArBadChannelTool/share/LArMissingFebs2Ascii.py
@@ -67,17 +67,20 @@ from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr)
 from AthenaCommon.AlgSequence import AthSequencer
 condSeq = AthSequencer("AthCondSeq")
 
-from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
-condSeq+=xAODMaker__EventInfoCnvAlg()
+if not hasattr(condSeq,"xAODMaker::EventInfoCnvAlg"):
+   from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
+   condSeq+=xAODMaker__EventInfoCnvAlg()
 
-from IOVSvc.IOVSvcConf import CondInputLoader
-theCLI=CondInputLoader( "CondInputLoader")
-condSeq += theCLI 
+if not hasattr(condSeq,"CondInputLoader"):
+   from IOVSvc.IOVSvcConf import CondInputLoader
+   theCLI=CondInputLoader( "CondInputLoader")
+   condSeq += theCLI 
 
-import StoreGate.StoreGateConf as StoreGateConf
-svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")
+if not hasattr(svcMgr,"ConditionStore"):
+   import StoreGate.StoreGateConf as StoreGateConf
+   svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")
 
-svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2017-04" 
+svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2018-06" 
 
 from LArBadChannelTool.LArBadFebAccess import LArBadFebAccess
 LArBadFebAccess(dbString="/LAR/BadChannelsOfl/MissingFEBs"+dbStr+tagStr)
diff --git a/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py
index bba67009f41ecee6dc71e40032cf1c58d1396aa8..af7c03719e06755a0559f6031ec77eb5ccdac6af 100644
--- a/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py
+++ b/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py
@@ -1,4 +1,4 @@
-import commands
+import os
 ###########################################################################
 
 include("LArCalibProcessing/LArCalib_Flags.py")
@@ -9,7 +9,7 @@ include("LArCalibProcessing/GetInputFiles.py")
 #######################################################
 
 if not 'RunNumber' in dir():
-   RunNumber = 88237
+   RunNumber = 500000
    
 if not ' GainList' in dir():
     GainList = ["HIGH", "MEDIUM", "LOW"]
@@ -17,17 +17,8 @@ if not ' GainList' in dir():
 if not 'ChannelSelection' in dir():
    ChannelSelection=""
 
-if not 'Partition' in dir():
-      Partition = "EB-EMB"
-
-if not 'LArCaliInputKey' in dir():
-   LArCaliInputKey = ""
-
-if not 'LArDetInputKey' in dir():
-   LArDetInputKey = ""
-
-if not 'LArParamsTag' in dir():
-   LArParamsTag = ""
+if not 'LArInputTag' in dir():
+   LArInputTag = "-UPD3-00"
 
 if not 'LArInputKey' in dir():
    LArInputKey = [""]
@@ -35,15 +26,8 @@ if not 'LArInputKey' in dir():
 if not 'AllChannels2Ntuple' in dir():
    AllChannels2Ntuple = False
 
-#######################################################
-#      Delay output name
-#######################################################
-
-if not 'WriteNtuple' in dir():
-   WriteNtuple = LArCalib_Flags.WriteNtuple
-
 if not 'DBConnectionCOOL' in dir():  
-   DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200"
+   DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2"
 
 if not 'DBConnection' in dir():
    DBConnection = DBConnectionCOOL   
@@ -51,15 +35,12 @@ if not 'DBConnection' in dir():
 ## Output
 
 if not 'OutputRootFileDir' in dir():
-   OutputRootFileDir  = commands.getoutput("pwd")      
+   OutputRootFileDir  =  os.getcwd()     
 
-if not 'KeyOutput' in dir():  
-   KeyOutput = "" # Key of LArPhysWaveContainer saved in Pool file
-   
 if not 'BaseFileName' in dir():
    BaseFileName = "LArParams"
    
-BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","")
+BaseFileName = BaseFileName+"_"+str(RunNumber)
 
 if not 'OutputRootFileName' in dir():
    OutputRootFileName = BaseFileName+".root"
@@ -72,10 +53,6 @@ if not 'OutputRootFileName' in dir():
 
 include("AthenaCommon/Atlas_Gen.UnixStandardJob.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()
@@ -90,33 +67,38 @@ include("LArCalibProcessing/LArCalib_MinimalSetup.py")
 svcMgr.IOVDbSvc.GlobalTag   = LArCalib_Flags.globalFlagDB
 svcMgr.IOVDbSvc.DBInstance=""
 
-from IOVDbSvc.CondDB import conddb
+if conddb.isMC:
+   include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" )
+   conddb.addFolder("LAR_OFL","/LAR/BadChannels/BadChannels<tag>LArBadChannelsBadChannels-IOVDEP-06</tag>",className="CondAttrListCollection")
+else:
+   include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" )
+   conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>",className="CondAttrListCollection")
 
-conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>")
-conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>")
+from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg
+theLArBadChannelCondAlg=LArBadChannelCondAlg()
+theLArBadChannelCondAlg.ReadKey="/LAR/BadChannels/BadChannels"
+condSeq+=theLArBadChannelCondAlg
 
-svcMgr.PoolSvc.ReadCatalog += ["prfile:poolcond/PoolCat_oflcond.xml",
-                               "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml",
-                               "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml",
-                               "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml",
-                               "xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml",
-                               "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml"]
 
 ## The reference is the Oracle DB
 if  'LArCaliParamsFolder' in dir():
     if not 'InputTagSpecCali' in dir():
        InputTagSpecCali = LArCalibFolderTag(LArCaliParamsFolder,LArInputTag)
 
-#    print 'Input tag: ',InputTagSpecCali," in folder: ",LArCaliParamsFolder
-    conddb.addFolder("",LArCaliParamsFolder+"<tag>"+InputTagSpecCali+"</tag><key>"+LArCaliInputKey+"</key><dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection)
+    conddb.addFolder("",LArCaliParamsFolder+"<tag>"+InputTagSpecCali+"</tag><dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection,className="LArCaliPulseParamsComplete")
 
    
 if 'LArDetParamsFolder' in dir():
     if not 'InputTagSpecDet' in dir():
        InputTagSpecDet = LArCalibFolderTag(LArDetParamsFolder,LArInputTag)
 
-#    print 'Input tag: ',InputTagSpecDet," in folder: ",LArDetParamsFolder
-    conddb.addFolder("",LArDetParamsFolder+"<tag>"+InputTagSpecDet+"</tag><key>"+LArDetInputKey+"</key><dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection)
+    conddb.addFolder("",LArDetParamsFolder+"<tag>"+InputTagSpecDet+"</tag><dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection,className="LArDetCellParamsComplete")
+
+if 'LArOFCBinFolder' in dir():
+    if not 'InputTagSpecDet' in dir():
+       InputTagSpecDet = LArCalibFolderTag(LArOFCBinFolder,LArInputTag)
+
+    conddb.addFolder("",LArOFCBinFolder+"<tag>"+InputTagSpecDet+"</tag><dbConnection>"+DBConnection+"</dbConnection><key>LArOFCBinComplete</key>"+ChannelSelection,className="LArOFCBinComplete")
 
    
 ##########################################################################
@@ -125,21 +107,20 @@ if 'LArDetParamsFolder' in dir():
 #                                                                        #
 ##########################################################################
 
-if (WriteNtuple):
-   from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple
-   LArParams2Ntuple = LArParams2Ntuple( "LArParams2Ntuple" )
-   LArParams2Ntuple.NtupleName  = "PARAMS"
-   LArParams2Ntuple.KeyList     =  LArInputKey 
-   LArParams2Ntuple.AllChannels2Ntuple   =  AllChannels2Ntuple 
-   
-   topSequence+=LArParams2Ntuple
-   
-   theApp.HistogramPersistency = "ROOT"
-   from GaudiSvc.GaudiSvcConf import NTupleSvc
-   if os.path.exists(OutputRootFileDir+"/"+OutputRootFileName): 
-      os.remove(OutputRootFileDir+"/"+OutputRootFileName)  
-   svcMgr += NTupleSvc()
-   svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRootFileDir+"/"+OutputRootFileName+"' OPT='NEW'" ]
+from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple
+LArParams2Ntuple = LArParams2Ntuple( "LArParams2Ntuple" )
+LArParams2Ntuple.NtupleName  = "PARAMS"
+LArParams2Ntuple.KeyList     =  LArInputKey 
+LArParams2Ntuple.AllChannels2Ntuple   =  AllChannels2Ntuple 
+
+topSequence+=LArParams2Ntuple
+
+theApp.HistogramPersistency = "ROOT"
+from GaudiSvc.GaudiSvcConf import NTupleSvc
+if os.path.exists(OutputRootFileDir+"/"+OutputRootFileName): 
+   os.remove(OutputRootFileDir+"/"+OutputRootFileName)  
+svcMgr += NTupleSvc()
+svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRootFileDir+"/"+OutputRootFileName+"' OPT='NEW'" ]
 
 ###########################################################################
 
@@ -172,11 +153,9 @@ 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)
-theAuditorSvc += getConfigurable("ChronoAuditor")()
-theAuditorSvc += getConfigurable("NameAuditor")()
-
 ###########################################################################
 
+StoreGateSvc = Service( "StoreGateSvc" )
+StoreGateSvc.OutputLevel=DEBUG
+StoreGateSvc.Dump = True
+
diff --git a/LArCalorimeter/LArCalibTools/src/LArCompleteToFlat.cxx b/LArCalorimeter/LArCalibTools/src/LArCompleteToFlat.cxx
index 05f381f4edd5a5881043c8f2c29c22c0349616d4..4601af60ac91e9aa6d1e47119a52f5d8cbe665f6 100644
--- a/LArCalorimeter/LArCalibTools/src/LArCompleteToFlat.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArCompleteToFlat.cxx
@@ -475,9 +475,24 @@ CondAttrListCollection* LArCompleteToFlat::rampFlat(const ILArRamp* input, const
     for (unsigned hs=0;hs<m_hashMax;++hs) {
       const HWIdentifier chid=m_onlineID->channel_Id(hs);
       std::vector<float> rampVec(input->ADC2DAC(chid,gain).asVector());
+      if(rampVec.size()>=2 && rampVec[1]>500) {
+         ATH_MSG_WARNING("Protection against crazy ramp values, set 500");
+         rampVec[1]=500.;
+      }
       if (rampVec.size()==0 && gain==2 && m_fakeEMBPSLowGain && cabling->isOnlineConnected(chid) ) { 
 	rampVec=input->ADC2DAC(chid,1).asVector();
-	rampVec[1]*=10.0;
+        if(rampVec.size()==0) {
+           ATH_MSG_WARNING("Filling EMBPS ramp with default values 0,10");
+           rampVec.resize(2);
+           rampVec[0]=0.;
+           rampVec[1]=10.;
+        } else {
+	   rampVec[1]*=10.0;
+           if(rampVec[1]>500) {
+              ATH_MSG_WARNING("Protection against crazy ramp values, set 500");
+              rampVec[1]=500.;
+           }
+        }
 	++nCopiedEMPS;
       }
       
diff --git a/LArCalorimeter/LArCalibTools/src/LArParams2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArParams2Ntuple.cxx
index 5ff5e28392b09723869f35e64c4fdbfba71caddf..6cbd9b0d7fffae12fd19657af886dc12bc90d3db 100644
--- a/LArCalorimeter/LArCalibTools/src/LArParams2Ntuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArParams2Ntuple.cxx
@@ -45,12 +45,10 @@ StatusCode LArParams2Ntuple::initialize() {
   m_ntTitle=m_ntName;
   m_ntpath=std::string("/NTUPLES/FILE1/")+m_ntName;
 
-  
   if ( m_classNames.size() != m_nClasses ) { // should never happen! but just to be sure...
     ATH_MSG_FATAL( "List of class names does not match foreseen number of classes, cannot go on!" ) ;
     return StatusCode::FAILURE ;
   }
- 
   for ( unsigned i=0 ; i<m_keylist.size() ; i++ ) {
     ATH_MSG_DEBUG("examinimg key " << m_keylist[i] << "...");
     unsigned idx = LArParamsProperties::getClassIndex(m_keylist[i]) ;
@@ -64,6 +62,7 @@ StatusCode LArParams2Ntuple::initialize() {
     }
   }
 
+  ATH_MSG_INFO("LArParams2Ntuple 3"); 
   if ( m_useAbstractInterface ) {
     ATH_MSG_INFO( "All parameters will be accessed through abstract interface" ) ;
     if ( ! m_allChannels2Ntuple ) {
diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFCBin.h b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFCBin.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f0672bf85c283b5c1dabefe7de534a47d6e1e1d
--- /dev/null
+++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ILArOFCBin.h
@@ -0,0 +1,29 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARELECCALIB_ILAROFCBIN_H
+#define LARELECCALIB_ILAROFCBIN_H
+
+#include "AthenaKernel/CLASS_DEF.h" 
+#include "LArElecCalib/LArCalibErrorCode.h"
+class HWIdentifier;
+
+class ILArOFCBin {
+public: 
+
+  virtual ~ILArOFCBin() {};
+
+  virtual const int& bin( const HWIdentifier& id, const int& gain) const =0 ;
+
+  enum {ERRORCODE = LArElecCalib::ERRORCODE};
+
+} ;
+
+CLASS_DEF( ILArOFCBin, 82247889, 1) 
+
+//ConditionsContainer clid for athenaMT"
+#include "AthenaKernel/CondCont.h"
+CLASS_DEF( CondCont<ILArOFCBin> , 77000255 , 1 )
+
+#endif 
diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/LArElecCalibDict.h b/LArCalorimeter/LArElecCalib/LArElecCalib/LArElecCalibDict.h
index 66c532f31d98e9aa7b5f1c4af86ebb8c7272b13d..57cb17bfd8c8135c250c563712a2157854765861 100755
--- a/LArCalorimeter/LArElecCalib/LArElecCalib/LArElecCalibDict.h
+++ b/LArCalorimeter/LArElecCalib/LArElecCalib/LArElecCalibDict.h
@@ -45,5 +45,6 @@
 #include "LArElecCalib/ILAruA2MeV.h"
 #include "LArElecCalib/ILArHVScaleCorr.h"
 #include "LArElecCalib/ILArFEBTempTool.h"
+#include "LArElecCalib/ILArOFCBin.h"
 
 #endif // LARELECCALIB_LARELECCALIBDICT_H
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py
index 4deabf0d65ee8af1c949b2199635c61443461803..6408dd91bf3d436a0eb34a2dab70e64c125e1ac0 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py
@@ -85,7 +85,7 @@ theLArCompleteToFlat.FakeEMBPSLowGain=True
 theLArCompleteToFlat.isSC = SuperCells
 
 outTypes = []
-for (fldr,tag,key) in inputFolders:
+for (fldr,tag,key,classtype) in inputFolders:
   if "Pedestal" in fldr:
     outTypes.append("Pedestal")
     theLArCompleteToFlat.PedestalInput=key
@@ -99,11 +99,12 @@ for (fldr,tag,key) in inputFolders:
     outTypes.append("MphysOverMcal")
     theLArCompleteToFlat.MphysOverMcalInput=key
   elif "Shape" in fldr:
+    outTypes.append("Shape")
     theLArCompleteToFlat.ShapeInput=key
   if len(tag):
-     conddb.addFolder("","<db>"+inputDB+"</db>"+fldr+"<tag>"+tag+"</tag>")
+     conddb.addFolder("","<db>"+inputDB+"</db>"+fldr+"<tag>"+tag+"</tag>",className=classtype)
   else:
-    conddb.addFolder("","<db>"+inputDB+"</db>"+fldr)
+    conddb.addFolder("","<db>"+inputDB+"</db>"+fldr,className=classtype)
   pass
 
 topSequence+=theLArCompleteToFlat
diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py
index 160ede31994f23e5ad188faefecad0dadced3dd5..cac079bb3ff6f3c8588af7190c4982225e1985ba 100755
--- a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py
+++ b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py
@@ -29,3 +29,7 @@ if activateCondAlgs:
     condSeq += LArAlignCondAlg("LArAlignCondAlg")
     from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloAlignCondAlg
     condSeq += CaloAlignCondAlg("CaloAlignCondAlg")
+    if DetFlags.detdescr.Tile_on():
+      #Calo super cell building works only if both LAr and Tile are present
+      from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloSuperCellAlignCondAlg
+      condSeq += CaloSuperCellAlignCondAlg("CaloSuperCellAlignCondAlg")
diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py
index ecec70d3bd3c1e66d6b2b1a94423047fa5bf8c97..402641c9316413a0f369457de53d221fb0a50373 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py
@@ -35,10 +35,15 @@ def LArGMCfg(configFlags):
         if configFlags.Common.Project != 'AthSimulation':
             result.addCondAlgo(CompFactory.LArAlignCondAlg())
             result.addCondAlgo(CompFactory.CaloAlignCondAlg())
+            if configFlags.Detector.GeometryTile:
+                #Calo super cell building works only if both LAr and Tile are present
+                result.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg())
     else:
         # Build unalinged CaloDetDescrManager instance in the Condition Store
         if configFlags.Common.Project != 'AthSimulation':
             result.addCondAlgo(CompFactory.CaloAlignCondAlg(LArAlignmentStore="",CaloCellPositionShiftFolder=""))
+            if configFlags.Detector.GeometryTile:
+                result.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg())
             
     return result
 
diff --git a/LArCalorimeter/LArROD/python/LArFebErrorSummaryMakerConfig.py b/LArCalorimeter/LArROD/python/LArFebErrorSummaryMakerConfig.py
index 0cbe651e9a49f85a1a6f6f9533653fd8a0f553e2..9daf99458c9942c6fbd0ba8c677411f58a093471 100644
--- a/LArCalorimeter/LArROD/python/LArFebErrorSummaryMakerConfig.py
+++ b/LArCalorimeter/LArROD/python/LArFebErrorSummaryMakerConfig.py
@@ -6,8 +6,13 @@ from LArBadChannelTool.LArBadChannelConfig import LArBadFebCfg
 def LArFebErrorSummaryMakerCfg(configFlags):
 
     febSummaryMaker =LArFebErrorSummaryMaker()
-    febSummaryMaker.MaskFebScacStatus = [0x38080000]
-    febSummaryMaker.MaskFebEvtId      = [0x38080000]
+    from RecExConfig.RecFlags import rec
+    if int(rec.projectName()[4:6]) > 20:
+       febSummaryMaker.MaskFebScacStatus = [0x38680000,0x38720000]
+       febSummaryMaker.MaskFebEvtId      = [0x38680000]
+    else:
+       febSummaryMaker.MaskFebScacStatus = [0x38080000]
+       febSummaryMaker.MaskFebEvtId      = [0x38080000]   
     febSummaryMaker.WriteKey="StoreGateSvc+LArFebErrorSummary"
     # needed only if it is not in DB.
     #febSummaryMaker.MaskFebZeroSample = [0x39618000,0x39930000,0x3b1b0000,0x38db0000,0x38f60000,0x39ae8000,0x3bb90000]
diff --git a/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py b/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
index 34c676770a1270f13208bf7ede17e573f893c626..7cd27ddaa2d5dcb8e1530d1451d50d48279a9d80 100644
--- a/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
+++ b/LArCalorimeter/LArROD/python/LArRawChannelBuilderAlgConfig.py
@@ -98,6 +98,7 @@ if __name__=="__main__":
     # in case of testing iterative OFC:
     #ConfigFlags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/data15_1beam/data15_1beam.00260466.physics_L1Calo.merge.RAW._lb1380._SFO-ALL._0001.1']
     ConfigFlags.Input.isMC = False
+    ConfigFlags.Detector.GeometryTile = False
     ConfigFlags.lock()
 
 
diff --git a/LArCalorimeter/LArROD/share/LArFebErrorSummaryMaker_jobOptions.py b/LArCalorimeter/LArROD/share/LArFebErrorSummaryMaker_jobOptions.py
index e2a9c4bbfa61aa05ae98eb79f44d30c8585eae18..a824f2139c17c9de55c19525c600e89996454827 100644
--- a/LArCalorimeter/LArROD/share/LArFebErrorSummaryMaker_jobOptions.py
+++ b/LArCalorimeter/LArROD/share/LArFebErrorSummaryMaker_jobOptions.py
@@ -1,7 +1,12 @@
 from LArROD.LArRODConf import LArFebErrorSummaryMaker
 febSummaryMaker =LArFebErrorSummaryMaker()
-febSummaryMaker.MaskFebScacStatus = [0x38080000]
-febSummaryMaker.MaskFebEvtId      = [0x38080000]
+from RecExConfig.RecFlags import rec
+if int(rec.projectName()[4:6]) > 20:
+   febSummaryMaker.MaskFebScacStatus = [0x38680000, 0x38720000]
+   febSummaryMaker.MaskFebEvtId      = [0x38680000]
+else:
+   febSummaryMaker.MaskFebScacStatus = [0x38080000]
+   febSummaryMaker.MaskFebEvtId      = [0x38080000]
 febSummaryMaker.WriteKey="StoreGateSvc+LArFebErrorSummary"
 
 # needed only if it is not in DB.
diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArOFCBinComplete.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArOFCBinComplete.h
index 697d83b5374669713658adb959f343728aa4e530..726f153e94de088f66d4e40a58368b932c869647 100644
--- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArOFCBinComplete.h
+++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArOFCBinComplete.h
@@ -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
 */
 
 #ifndef LARRAWCONDITIONS_LAROFCBINCOMPLETE
 #define LARRAWCONDITIONS_LAROFCBINCOMPLETE
 
 #include "LArRawConditions/LArConditionsContainer.h"
+#include "LArElecCalib/ILArOFCBin.h"
 #include "LArRawConditions/LArOFCBinP.h"
 
-class LArOFCBinComplete : public LArConditionsContainer<LArOFCBinP> {
+class LArOFCBinComplete : public ILArOFCBin, 
+                         public LArConditionsContainer<LArOFCBinP> {
  public:
   LArOFCBinComplete();
   virtual ~LArOFCBinComplete();
 
   //Getter
-  const int& bin(const HWIdentifier& chid,const int& gain) const {
+  virtual const int& bin(const HWIdentifier& chid,const int& gain) const {
     return (this->get(chid,gain).m_bin); };
 
   //Setter
   void set(const HWIdentifier& chid, const int& gain, const int& bin);
 };
 
+#include "AthenaKernel/CondCont.h"
 CLASS_DEF(LArOFCBinComplete,113480660,1)
+CONDCONT_DEF(LArOFCBinComplete,18486430,ILArOFCBin);
 
 #endif
diff --git a/LArCalorimeter/LArRawConditions/src/LArOFCBinComplete.cxx b/LArCalorimeter/LArRawConditions/src/LArOFCBinComplete.cxx
index 7d284ab36868f47f3b85f5b164fe48a09f0e9f4d..92e39758867c273a3ade7b25ec8aebfa582fc62b 100644
--- a/LArCalorimeter/LArRawConditions/src/LArOFCBinComplete.cxx
+++ b/LArCalorimeter/LArRawConditions/src/LArOFCBinComplete.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 "LArRawConditions/LArOFCBinComplete.h"
diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
index 3ab4c8034a6dd917f20ffef42a334015dab5b99b..43e355d5ea183c8cb91dc9cc33c78f76275015eb 100644
--- a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
+++ b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
@@ -1,16 +1,21 @@
-Sat Aug 21 21:43:39 CEST 2021
+Mon Nov  1 22:34:52 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.42] [x86_64-centos7-gcc8-opt] [master-calo-ctests/ec2fa09c9e3] -- built on [2021-08-21T2138]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "LArRecUtils/LArFCalTowerBuilderTool_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5069 configurables from 8 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.42
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py"
 Py:Athena            INFO including file "CaloConditions/CaloConditions_jobOptions.py"
@@ -20,21 +25,21 @@ Py:Athena            INFO including file "TileIdCnv/TileIdCnv_jobOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on aibuild028.cern.ch on Sat Aug 21 21:43:53 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 3377 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3378 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -154,7 +159,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 6320 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6066 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -172,7 +177,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -184,17 +189,18 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 CondInputLoader      INFO Adding base classes:
   +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' )   -> no bases
@@ -202,7 +208,23 @@ CondInputLoader      INFO Adding base classes:
 CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
     +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
-ClassIDSvc           INFO getRegistryEntries: read 6040 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
+ClassIDSvc           INFO getRegistryEntries: read 6022 CLIDRegistry entries for module ALL
 ToolSvc.LArFCal...   INFO CaloTowerBuilder for the FCal initiated
 ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
@@ -223,7 +245,7 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 207 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -233,20 +255,6 @@ AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -257,6 +265,7 @@ 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager and range {[0,t:0,l:0] - [INVALID]}
 test1
 towers
 0 1 1 0 
@@ -6669,25 +6678,25 @@ Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All]
 ApplicationMgr       INFO Application Manager Stopped successfully
 CondInputLoader      INFO Finalizing CondInputLoader...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.07 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.05 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.05 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.04 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 ((     0.02 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      0.16 ))s
+IOVDbSvc             INFO  bytes in ((      0.10 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 3 ReadTime: ((     0.16 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 3 ReadTime: ((     0.10 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  170 [ms] Ave/Min/Max=    42.5(+-      68)/       0/     160 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  210 [ms] Ave/Min/Max=    52.5(+-    79.8)/       0/     190 [ms] #=  4
-ChronoStatSvc        INFO Time User   : Tot= 2.26  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      25(+-    43.3)/       0/     100 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    32.5(+-    50.7)/       0/     120 [ms] #=  4
+ChronoStatSvc        INFO Time User   : Tot= 1.67  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
index 2e4170b04ab8a5e1cfaac942e045badcf01317fe..210693f02fe88ceadec17e11d01d26cbc5c01d2c 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
@@ -1,7 +1,7 @@
-Sun Aug 22 06:42:48 CEST 2021
+Mon Nov  1 22:12:33 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.42] [x86_64-centos7-gcc8-opt] [master-calo-ctests/b78ddd66878] -- built on [2021-08-22T0641]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
@@ -9,9 +9,14 @@ Py:Athena            INFO including file "LArConditionsTest/LArConditionsTest_jo
 Py:Athena            INFO including file "AthenaCommon/Atlas_Gen.UnixStandardJob.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5069 configurables from 4 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.42
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "LArRawConditions/LArIdMap_ATLAS_jobOptions.py"
 Py:Athena            INFO including file "LArConditionsCommon/LArIdMap_MC_jobOptions.py"
@@ -30,20 +35,20 @@ Py:Athena            INFO including file "LArCondAthenaPool/LArCondAthenaPool_jo
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on aibuild028.cern.ch on Sun Aug 22 06:43:04 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:12:41 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 3377 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3378 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -172,7 +177,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 6430 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6176 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -190,7 +195,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -202,18 +207,19 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 6040 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6022 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -228,9 +234,25 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'AthenaAttributeList' , 'ConditionStore+/LAR/Identifier/OnOffIdMap' ) 
     +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 ClassIDSvc           INFO getRegistryEntries: read 452 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing xAODMaker::EventInfoCnvAlg
-ClassIDSvc           INFO getRegistryEntries: read 348 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 342 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Beam conditions service not available
 xAODMaker::Even...   INFO Will not fill beam spot information into xAOD::EventInfo
 LArConditionsTe...  DEBUG Property update for OutputLevel : new value = 2
@@ -275,7 +297,7 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/oflcond/oflcond.000002.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0058.pool.root File version:51304
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 206 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 187 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -285,20 +307,6 @@ AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -317,6 +325,7 @@ 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -6911,28 +6920,28 @@ Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All]
 ApplicationMgr       INFO Application Manager Stopped successfully
 CondInputLoader      INFO Finalizing CondInputLoader...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 7/2 objs/chan/bytes 7/1/1176 ((     0.40 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/10641036 ((     0.11 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/42700 ((     0.06 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/5462044 ((     0.35 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 7/2 objs/chan/bytes 7/1/1176 ((     0.09 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/10641036 ((     0.05 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/42700 ((     0.02 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/5462044 ((     0.08 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 4/2 objs/chan/bytes 4/1/780 ((     0.06 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 7/0 objs/chan/bytes 7/1/1211 ((     0.08 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 4/2 objs/chan/bytes 4/1/780 ((     0.02 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 7/0 objs/chan/bytes 7/1/1211 ((     0.03 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      1.05 ))s
+IOVDbSvc             INFO  bytes in ((      0.29 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 8 nFolders: 6 ReadTime: ((     1.05 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 8 nFolders: 6 ReadTime: ((     0.29 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  150 [ms] Ave/Min/Max=    37.5(+-    59.3)/       0/     140 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  180 [ms] Ave/Min/Max=    25.7(+-    55.3)/       0/     160 [ms] #=  7
-ChronoStatSvc        INFO Time User   : Tot= 3.26  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  110 [ms] Ave/Min/Max=    27.5(+-    42.1)/       0/     100 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    18.6(+-      38)/       0/     110 [ms] #=  7
+ChronoStatSvc        INFO Time User   : Tot= 2.13  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
index 0ce252e6f8e576c179fdb8521b8119d7e4764f6a..4f7a5a14a518e48b293f1505a0eba031d45d35f1 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
@@ -1,7 +1,7 @@
-Sat Aug 21 21:45:33 CEST 2021
+Mon Nov  1 22:12:33 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.42] [x86_64-centos7-gcc8-opt] [master-calo-ctests/ec2fa09c9e3] -- built on [2021-08-21T2138]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
@@ -9,9 +9,14 @@ Py:Athena            INFO including file "LArConditionsTest/LArConditionsTestRea
 Py:Athena            INFO including file "AthenaCommon/Atlas_Gen.UnixStandardJob.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5069 configurables from 8 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.42
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "LArRawConditions/LArIdMap_ATLAS_jobOptions.py"
 Py:Athena            INFO including file "LArConditionsCommon/LArIdMap_MC_jobOptions.py"
@@ -32,20 +37,20 @@ Py:Athena            INFO including file "AthenaPoolCnvSvc/AthenaPool_jobOptions
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on aibuild028.cern.ch on Sat Aug 21 21:45:46 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:12:41 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 3377 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3378 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -71,7 +76,7 @@ DbSession            INFO     Open     DbSession
 Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 99993A5D-2110-B45C-8015-27A23799B9A5
 Domain[ROOT_All]     INFO                           LarCondTestNoReg.root
-RootDatabase.open    INFO LarCondTestNoReg.root File version:62400
+RootDatabase.open    INFO LarCondTestNoReg.root File version:62406
 LarCondTestNoRe...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 99993A5D-2110-B45C-8015-27A23799B9A5
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
@@ -80,17 +85,17 @@ DbSession            INFO     Open     DbSession
 Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 99993A5D-2110-B45C-8015-27A23799B9A5
 Domain[ROOT_All]     INFO                           LarCondTestNoReg.root
-RootDatabase.open    INFO LarCondTestNoReg.root File version:62400
+RootDatabase.open    INFO LarCondTestNoReg.root File version:62406
 LarCondTestNoRe...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 99993A5D-2110-B45C-8015-27A23799B9A5
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] B909DF67-135F-B04D-9381-0447646F97EF
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 27C3CD83-94B9-B644-8855-1590EFA507A9
 Domain[ROOT_All]     INFO                           LarCondTestNoReg.root
-RootDatabase.open    INFO LarCondTestNoReg.root File version:62400
+RootDatabase.open    INFO LarCondTestNoReg.root File version:62406
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 3552 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3486 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
@@ -201,7 +206,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 5973 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 5785 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -219,7 +224,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -231,18 +236,19 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 4880 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4862 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 CondInputLoader      INFO Adding base classes:
   +  ( 'AthenaAttributeList' , 'ConditionStore+/LAR/Identifier/CalibIdMap' )   ->
@@ -256,9 +262,25 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'AthenaAttributeList' , 'ConditionStore+/LAR/Identifier/OnOffIdMap' ) 
     +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 ClassIDSvc           INFO getRegistryEntries: read 452 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing xAODMaker::EventInfoCnvAlg
-ClassIDSvc           INFO getRegistryEntries: read 348 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 342 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Beam conditions service not available
 xAODMaker::Even...   INFO Will not fill beam spot information into xAOD::EventInfo
 LArConditionsTe...  DEBUG Property update for OutputLevel : new value = 2
@@ -300,7 +322,7 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/oflcond/oflcond.000002.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0058.pool.root File version:51304
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 206 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 187 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -310,20 +332,6 @@ AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -342,6 +350,7 @@ 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -613,9 +622,9 @@ LArConditionsTe...  DEBUG New        : chan id, gain, ramps [4.4.1.1.24.5.86.0]
 LArConditionsTe...  DEBUG Corrections: chan id, gain, ramps [4.4.1.1.24.5.86.0] 2 -582 -583 -584  Compare = 1
 LArConditionsTe...  DEBUG Iteration check OK 
 LArConditionsTe...  DEBUG Find check OK 
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] B909DF67-135F-B04D-9381-0447646F97EF
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 27C3CD83-94B9-B644-8855-1590EFA507A9
 Domain[ROOT_All]     INFO                           LarCondTestNoReg.root
-RootDatabase.open    INFO LarCondTestNoReg.root File version:62400
+RootDatabase.open    INFO LarCondTestNoReg.root File version:62406
 LArConditionsTe...   INFO Retrieved ramps for LArRampsSingleGroup 
 LArConditionsTe...   INFO in testEachCondObject()
 LArConditionsTe...  DEBUG Number of channels, iovs 16 0
@@ -6273,40 +6282,40 @@ LArConditionsTe...  DEBUG Total number of correction objects 20
 LArConditionsTe...  DEBUG End of testCondObjects 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #0 1 events processed so far  <<<===
 LarCondTestNoRe...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] B909DF67-135F-B04D-9381-0447646F97EF
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 27C3CD83-94B9-B644-8855-1590EFA507A9
 /cvmfs/atlas-co...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] E01BD448-BF95-DB11-983E-0015C5098AA3
 /cvmfs/atlas-co...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 LarCondTestNoRe...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] B909DF67-135F-B04D-9381-0447646F97EF
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 27C3CD83-94B9-B644-8855-1590EFA507A9
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
 CondInputLoader      INFO Finalizing CondInputLoader...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 7/2 objs/chan/bytes 7/1/1176 ((     0.36 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/10641036 ((     0.29 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/42700 ((     0.04 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/5462044 ((     0.13 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 7/2 objs/chan/bytes 7/1/1176 ((     0.11 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/10641036 ((     0.06 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/42700 ((     0.03 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/5462044 ((     0.08 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 4/2 objs/chan/bytes 4/1/780 ((     0.04 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 7/0 objs/chan/bytes 7/1/1211 ((     0.25 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 7/0 objs/chan/bytes 7/1/1211 ((     0.04 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      1.12 ))s
+IOVDbSvc             INFO  bytes in ((      0.35 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 8 nFolders: 6 ReadTime: ((     1.12 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 8 nFolders: 6 ReadTime: ((     0.35 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   50 [ms] Ave/Min/Max=   0.193(+-    1.63)/       0/      20 [ms] #=259
-cObj_ALL             INFO Time User   : Tot=  160 [ms] Ave/Min/Max=    14.5(+-    22.7)/       0/      70 [ms] #= 11
-ChronoStatSvc        INFO Time User   : Tot= 3.47  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=   30 [ms] Ave/Min/Max=   0.116(+-    1.07)/       0/      10 [ms] #=259
+cObj_ALL             INFO Time User   : Tot=   70 [ms] Ave/Min/Max=    6.36(+-    9.79)/       0/      30 [ms] #= 11
+ChronoStatSvc        INFO Time User   : Tot= 2.33  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
index 3a796ff5a31ebd5b7fba230aac2f9ca90a5c169b..3e2624d0d8e71d96c095143d51b784b0f3d043e8 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
@@ -1,7 +1,7 @@
-Sat Aug 21 21:44:57 CEST 2021
+Mon Nov  1 22:11:59 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.42] [x86_64-centos7-gcc8-opt] [master-calo-ctests/ec2fa09c9e3] -- built on [2021-08-21T2138]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
@@ -9,9 +9,14 @@ Py:Athena            INFO including file "LArConditionsTest/LArConditionsTestWri
 Py:Athena            INFO including file "AthenaCommon/Atlas_Gen.UnixStandardJob.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5069 configurables from 8 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.42
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "LArRawConditions/LArIdMap_ATLAS_jobOptions.py"
 Py:Athena            INFO including file "LArConditionsCommon/LArIdMap_MC_jobOptions.py"
@@ -31,20 +36,20 @@ Py:Athena            INFO including file "LArCondAthenaPool/LArCondAthenaPool_jo
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on aibuild028.cern.ch on Sat Aug 21 21:45:10 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:12:12 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 3377 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3378 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host aibuild028.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -173,7 +178,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 6430 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6176 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -191,7 +196,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -203,18 +208,19 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 6040 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6022 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -229,9 +235,25 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'AthenaAttributeList' , 'ConditionStore+/LAR/Identifier/OnOffIdMap' ) 
     +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 ClassIDSvc           INFO getRegistryEntries: read 452 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing xAODMaker::EventInfoCnvAlg
-ClassIDSvc           INFO getRegistryEntries: read 512 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 506 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Beam conditions service not available
 xAODMaker::Even...   INFO Will not fill beam spot information into xAOD::EventInfo
 LArConditionsTe...  DEBUG Property update for OutputLevel : new value = 2
@@ -277,7 +299,7 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/oflcond/oflcond.000002.conditions.simul.pool.v0000/oflcond.000002.conditions.simul.pool.v0000._0058.pool.root File version:51304
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 206 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 187 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -287,20 +309,6 @@ AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-08-20T2101/Athena/22.0.42/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -319,6 +327,7 @@ 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -6905,9 +6914,9 @@ LArConditionsTe...  DEBUG Total number of correction objects 20
 LArConditionsTe...  DEBUG End of testCondObjects 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #0 1 events processed so far  <<<===
 /cvmfs/atlas-co...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
-/cvmfs/atlas-co...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] E01BD448-BF95-DB11-983E-0015C5098AA3
+/cvmfs/atlas-co...   INFO Database being retired...
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
@@ -6915,9 +6924,9 @@ CondInputLoader      INFO Finalizing CondInputLoader...
 OutputCondition...   INFO Finalize: preparing to write conditions objects 
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] B909DF67-135F-B04D-9381-0447646F97EF
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] 27C3CD83-94B9-B644-8855-1590EFA507A9
 Domain[ROOT_All]     INFO                           LarCondTestNoReg.root
-RootDatabase.open    INFO LarCondTestNoReg.root File version:62400
+RootDatabase.open    INFO LarCondTestNoReg.root File version:62406
 ClassIDSvc           INFO getRegistryEntries: read 35 CLIDRegistry entries for module ALL
 OutputCondition...   INFO Identified a total of 3 objects to write out:
 OutputCondition...   INFO 0: LArRampMC#/LArCalorimeter/LArTests/LArRampsSingleGroup#/LArCalorimeter/LArTests/LArRampsSingleGroup
@@ -6942,23 +6951,23 @@ OutputCondition...   INFO Register object LArRampMC#/LArCalorimeter/LArTests/LAr
 OutputCondition...   INFO Register object LArRampMC#/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping in IOV database folder /LArCalorimeter/LArTests/LArRampsFeedThroughGrouping without tagging
 OutputCondition...   INFO Registered 3 objects in IOV database
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 7/2 objs/chan/bytes 7/1/1176 ((     0.15 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/10641036 ((     0.07 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/42700 ((     0.24 ))s
-IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/5462044 ((     0.12 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 7/2 objs/chan/bytes 7/1/1176 ((     0.10 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/CalibIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/10641036 ((     0.05 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/FebRodMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/42700 ((     0.02 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/OnOffIdMap (AttrList) db-read 7/1 objs/chan/bytes 7/1/5462044 ((     0.07 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 ((     0.00 ))s
 IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 4/2 objs/chan/bytes 4/1/780 ((     0.03 ))s
 IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 7/0 objs/chan/bytes 7/1/1211 ((     0.04 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      0.64 ))s
+IOVDbSvc             INFO  bytes in ((      0.31 ))s
 IOVDbSvc             INFO Disconnecting from sqlite://;schema=mycool.db;dbname=OFLP200
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 1 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 8 nFolders: 6 ReadTime: ((     0.64 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 8 nFolders: 6 ReadTime: ((     0.31 ))s
 IOVDbSvc             INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: ((     0.00 ))s
 LarCondTestNoRe...   INFO Database being retired...
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] B909DF67-135F-B04D-9381-0447646F97EF
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] 27C3CD83-94B9-B644-8855-1590EFA507A9
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
@@ -6966,12 +6975,12 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us]  #=  1
-fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=       0(+-       0)/       0/       0 [us] #=  4
+fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=     2.5(+-    4.33)/       0/      10 [ms] #=  4
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=  0.0392(+-   0.625)/       0/      10 [ms] #=255
-cRep_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    32.5(+-    44.9)/       0/     110 [ms] #=  4
-cObjR_ALL            INFO Time User   : Tot=  170 [ms] Ave/Min/Max=    42.5(+-    62.6)/       0/     150 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  200 [ms] Ave/Min/Max=    28.6(+-    58.7)/       0/     170 [ms] #=  7
-ChronoStatSvc        INFO Time User   : Tot= 4.36  [s]  #=  1
+cRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=      10(+-    17.3)/       0/      40 [ms] #=  4
+cObjR_ALL            INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      30(+-    46.4)/       0/     110 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    18.6(+-    41.6)/       0/     120 [ms] #=  7
+ChronoStatSvc        INFO Time User   : Tot= 2.56  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py
index d97136146acbb3bbc27208def83979a13411a5c5..5932523991c97a3d8ba672e623f2494e32c51241 100644
--- a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py
+++ b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgConfig.py
@@ -15,7 +15,14 @@ def BunchCrossingCondAlgCfg(configFlags):
 
     if (configFlags.Input.isMC):
         folder = "/Digitization/Parameters"
-        result.merge(addFolders(configFlags,folder,None,className="AthenaAttributeList",tag='HEAD'))
+        from AthenaConfiguration.Enums import ProductionStep
+        if configFlags.Common.ProductionStep not in [ProductionStep.Digitization, ProductionStep.PileUpPresampling]:
+            result.merge(addFolders(configFlags,folder,None,className="AthenaAttributeList",tag='HEAD'))
+        else:
+            # Here we are in a digitization job, so the
+            # /Digitization/Parameters metadata is not present in the
+            # input file and will be created during the job
+            pass
     else: #data case
         folder = '/TDAQ/OLC/LHC/FILLPARAMS'
         result.merge(addFolders(configFlags,folder,'TDAQ',className = 'AthenaAttributeList',tag='HEAD'))
diff --git a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgDefault.py b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgDefault.py
index 27ddc0dfa968031f42741e6a51e6817321131df9..79076008ca151d97f5e9cb9753658a7d3dc45882 100644
--- a/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgDefault.py
+++ b/LumiBlock/LumiBlockComps/python/BunchCrossingCondAlgDefault.py
@@ -22,12 +22,19 @@ def BunchCrossingCondAlgDefault():
 
     if (isMC):
         folder = "/Digitization/Parameters"
-        if not conddb.folderRequested(folder):
-            mlog.info("Adding folder %s", folder)
-            conddb.addFolderWithTag('', folder, 'HEAD',
-                                    className = 'AthenaAttributeList')
+        from AthenaCommon.DetFlags import DetFlags
+        if not DetFlags.digitize.any_on():
+            if not conddb.folderRequested(folder):
+                mlog.info("Adding folder %s", folder)
+                conddb.addFolderWithTag('', folder, 'HEAD',
+                                        className = 'AthenaAttributeList')
+            else:
+                mlog.info("Folder %s already requested", folder)
         else:
-            mlog.info("Folder %s already requested", folder)
+            # Here we are in a digitization job, so the
+            # /Digitization/Parameters metadata is not present in the
+            # input file and will be created during the job
+            mlog.info("Folder %s will be created during the job.", folder)
     else:
         folder = '/TDAQ/OLC/LHC/FILLPARAMS'
         # Mistakenly created as multi-version folder, must specify HEAD 
diff --git a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcByteStreamData.h b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcByteStreamData.h
index fb063e87731f245a1013ffb76fbd6f2374add108..e187822c030d7304d638ecc0751ad257e60717c1 100644
--- a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcByteStreamData.h
+++ b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/src/TgcByteStreamData.h
@@ -191,7 +191,8 @@ struct TGC_BYTESTREAM_NSL_ROI
   unsigned pt:        4;
   unsigned charge:    1;
   unsigned coinflag:  3;
-  unsigned fill1:     6;
+  unsigned innerflag: 4;
+  unsigned fill1:     2;
   unsigned bcBitmap:  2;
   unsigned sector:    4;
   unsigned fwd:       1;
diff --git a/MuonSpectrometer/MuonRDO/MuonRDO/TgcL1RawData.h b/MuonSpectrometer/MuonRDO/MuonRDO/TgcL1RawData.h
index 6c0629bba8d8ad6d7327107d46025ef0d782d666..6508d3438520e60f2073af03413ad68c46912279 100755
--- a/MuonSpectrometer/MuonRDO/MuonRDO/TgcL1RawData.h
+++ b/MuonSpectrometer/MuonRDO/MuonRDO/TgcL1RawData.h
@@ -72,16 +72,17 @@ public:
     // New Sector logic
     // RoI
     TgcL1RawData(uint16_t bcTag,
-               uint16_t subDetectorId,
-               uint16_t srodId,
-               uint16_t l1Id,
-               uint16_t bcId,
-               bool forward,
-               uint16_t sector,
-               uint16_t coinflag,
-               bool muplus,
-               uint16_t threshold,
-               uint16_t roi);
+                 uint16_t subDetectorId,
+                 uint16_t srodId,
+                 uint16_t l1Id,
+                 uint16_t bcId,
+                 bool forward,
+                 uint16_t sector,
+                 uint16_t innerflag,
+                 uint16_t coinflag,
+                 bool muplus,
+                 uint16_t threshold,
+                 uint16_t roi);
 
     // NSW
     TgcL1RawData(uint16_t bcTag,
@@ -343,6 +344,7 @@ private:
     bool m_overlap;
     bool m_veto;
     uint16_t m_roi;
+    uint16_t m_innerflag;
     uint16_t m_coinflag;
 
     // NSW
diff --git a/MuonSpectrometer/MuonRDO/src/TgcL1RawData.cxx b/MuonSpectrometer/MuonRDO/src/TgcL1RawData.cxx
index f105f8e3a723c10f88b5df4155535758e42a323a..ffbbaf49b80ba17837e35ec3a1766e7506a2a11e 100755
--- a/MuonSpectrometer/MuonRDO/src/TgcL1RawData.cxx
+++ b/MuonSpectrometer/MuonRDO/src/TgcL1RawData.cxx
@@ -94,21 +94,23 @@ TgcL1RawData::TgcL1RawData(uint16_t bcTag,
 // New Sector logic
 // RoI
 TgcL1RawData::TgcL1RawData(uint16_t bcTag,
-                       uint16_t subDetectorId,
-                       uint16_t srodId,
-                       uint16_t l1Id,
-                       uint16_t bcId,
-                       bool forward,
-                       uint16_t sector,
-                       uint16_t coinflag,
-                       bool muplus,
-                       uint16_t threshold,
-                       uint16_t roi)
+                           uint16_t subDetectorId,
+                           uint16_t srodId,
+                           uint16_t l1Id,
+                           uint16_t bcId,
+                           bool forward,
+                           uint16_t sector,
+                           uint16_t innerflag,
+                           uint16_t coinflag,
+                           bool muplus,
+                           uint16_t threshold,
+                           uint16_t roi)
 {
     clear(bcTag, subDetectorId, srodId, l1Id, bcId);
     m_type = TYPE_NSL_ROI;
     m_forward = forward;
     m_sector = sector;
+    m_innerflag = innerflag;
     m_coinflag = coinflag;
     m_muplus = muplus;
     m_threshold = threshold;
@@ -159,7 +161,7 @@ TgcL1RawData::TgcL1RawData(uint16_t bcTag,
                            uint16_t rpcdphi)
 {
     clear(bcTag, subDetectorId, srodId, l1Id, bcId);
-    m_type = TYPE_NSL_NSW;
+    m_type = TYPE_NSL_RPC;
     m_forward = forward;
     m_sector = sector;
     m_rpceta   = rpceta;
@@ -182,7 +184,7 @@ TgcL1RawData::TgcL1RawData(uint16_t bcTag,
                            uint16_t cid)
 {
     clear(bcTag, subDetectorId, srodId, l1Id, bcId);
-    m_type = TYPE_NSL_NSW;
+    m_type = TYPE_NSL_EIFI;
     m_forward = forward;
     m_sector = sector;
     m_ei = ei;
@@ -202,7 +204,7 @@ TgcL1RawData::TgcL1RawData(uint16_t bcTag,
                            uint16_t bcid)
 {
     clear(bcTag, subDetectorId, srodId, l1Id, bcId);
-    m_type = TYPE_NSL_NSW;
+    m_type = TYPE_NSL_TMDB;
     m_forward = forward;
     m_sector = sector;
     m_tmdbmod = mod;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/MuonCombinePatternTools/MuonCombinePatternTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/MuonCombinePatternTools/MuonCombinePatternTool.h
index a0e78bfeb1fcda290a37281bf8d17b8e5536568d..fbdcf9582e805adb22e28b4f90eceffb7d5a49a1 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/MuonCombinePatternTools/MuonCombinePatternTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/MuonCombinePatternTools/MuonCombinePatternTool.h
@@ -5,228 +5,170 @@
 #ifndef MUONCOMBINEPATTERNTOOLS_MUONCOMBINEPATTERNTOOL_H
 #define MUONCOMBINEPATTERNTOOLS_MUONCOMBINEPATTERNTOOL_H
 
+#include <cmath>
+
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
-#include "MuonRecToolInterfaces/IMuonCombinePatternTool.h"
-
 #include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
+#include "MuonRecToolInterfaces/IMuonCombinePatternTool.h"
 
-#include <cmath>
-
-class MuonCombinePatternTool
-  : public AthAlgTool
-  , virtual public Muon::IMuonCombinePatternTool
-{
+class MuonCombinePatternTool : public AthAlgTool, virtual public Muon::IMuonCombinePatternTool {
 private:
-  struct ChamberInfo
-  {
-    ChamberInfo()
-      : neta(0)
-      , nphi(0)
-      , ninside(0)
-      , noutside(0)
-      , ninsidePat(0)
-      , noutsidePat(0)
-      , phiMin(1e9)
-      , phiMax(-1e9)
-    {}
-    int neta;
-    int nphi;
-    int ninside;
-    int noutside;
-    int ninsidePat;
-    int noutsidePat;
-    double phiMin;
-    double phiMax;
-  };
-  typedef std::map<Identifier, ChamberInfo> IdChMap;
-  typedef IdChMap::iterator IdChIt;
+    struct ChamberInfo {
+        ChamberInfo() : neta(0), nphi(0), ninside(0), noutside(0), ninsidePat(0), noutsidePat(0), phiMin(1e9), phiMax(-1e9) {}
+        int neta;
+        int nphi;
+        int ninside;
+        int noutside;
+        int ninsidePat;
+        int noutsidePat;
+        double phiMin;
+        double phiMax;
+    };
+    typedef std::map<Identifier, ChamberInfo> IdChMap;
+    typedef IdChMap::iterator IdChIt;
 
 public:
-  MuonCombinePatternTool(const std::string& type,
-                         const std::string& name,
-                         const IInterface* parent);
-  virtual ~MuonCombinePatternTool() = default;
-
-  virtual StatusCode initialize();
-
-  /** Combines phi and eta pattern collection into a new combined pattern
-   * collection */
-  virtual MuonPrdPatternCollection* combineEtaPhiPatterns(
-    const MuonPrdPatternCollection* phiPatternCollection,
-    const MuonPrdPatternCollection* etaPatternCollection,
-    const std::map<const Trk::PrepRawData*,
-                   std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phiEtaHitAssMap) const;
-
-  /** Combines phi and eta pattern into a new combined pattern */
-  virtual Muon::MuonPrdPattern* makeCombinedPattern(
-    const Muon::MuonPrdPattern* phipattern,
-    const Muon::MuonPrdPattern* etapattern) const;
-
-  /** converts MuonPrdPatterns into MuonPatternCombinationCollection
-   * MuonPatternCombinationCollection are default output for PatternFinder */
-  virtual MuonPatternCombinationCollection* makePatternCombinations(
-    const MuonPrdPatternCollection* muonpatterns) const;
+    MuonCombinePatternTool(const std::string& type, const std::string& name, const IInterface* parent);
+    virtual ~MuonCombinePatternTool() = default;
+
+    virtual StatusCode initialize();
+
+    /** Combines phi and eta pattern collection into a new combined pattern
+     * collection */
+    virtual MuonPrdPatternCollection* combineEtaPhiPatterns(
+        const MuonPrdPatternCollection* phiPatternCollection, const MuonPrdPatternCollection* etaPatternCollection,
+        const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const;
+
+    /** Combines phi and eta pattern into a new combined pattern */
+    virtual Muon::MuonPrdPattern* makeCombinedPattern(const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern) const;
+
+    /** converts MuonPrdPatterns into MuonPatternCombinationCollection
+     * MuonPatternCombinationCollection are default output for PatternFinder */
+    virtual MuonPatternCombinationCollection* makePatternCombinations(const MuonPrdPatternCollection* muonpatterns) const;
 
 private:
-  /** make combined pattern from all candidates, removes duplicates with phi
-   * when no overlap with eta pattern */
-  MuonPrdPatternCollection* makeCombinedPatterns(
-    std::vector<std::pair<const Muon::MuonPrdPattern*,
-                          const Muon::MuonPrdPattern*>>& candidates) const;
-
-  /** number of associated hits between patterns, returns by reference the phi
-   * hits to be added based on association with eta hits */
-  int overlap(
-    const Muon::MuonPrdPattern* phipattern,
-    const Muon::MuonPrdPattern* etapattern,
-    std::vector<const Trk::PrepRawData*>& associated_phihits_notonphipattern,
-    const std::map<const Trk::PrepRawData*,
-                   std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phiEtaHitAssMap) const;
-
-  /** is pattern1 a complete subset of other pattern2? */
-  static bool subset(const Muon::MuonPrdPattern* pattern1,
-                     const Muon::MuonPrdPattern* pattern2);
-
-  /** is candidate1 a complete subset of other candidate2? */
-  static bool subset(
-    std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-              std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
-      candidate1,
-    std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-              std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
-      candidate2);
-
-  /** add associated phi hits to phi pattern (factory: builds new
-   * Muon::MuonPrdPattern) */
-  const Muon::MuonPrdPattern* updatePhiPattern(
-    const Muon::MuonPrdPattern* phipattern,
-    std::vector<const Trk::PrepRawData*> missedphihits) const;
-
-  /** clean phi pattern, similar as in MuonHoughPatternTool, used for newly
-   * created phi patterns based on hit association */
-  Muon::MuonPrdPattern* cleanPhiPattern(
-    const Muon::MuonPrdPattern* phipattern) const;
-
-  /** clean combined pattern, remove outliers */
-  Muon::MuonPrdPattern* cleanupCombinedPattern(
-    Muon::MuonPrdPattern*& combinedpattern) const;
-
-  /** split patterns in two at point closest to IP in rphi */
-  std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-  splitPatterns2D(const Muon::MuonPrdPattern* phipattern,
-                  const Muon::MuonPrdPattern* etapattern) const;
-
-  /** split patterns in two at point closest to IP in 3D */
-  std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-  splitPatterns3D(const Muon::MuonPrdPattern* phipattern,
-                  const Muon::MuonPrdPattern* etapattern) const;
-
-  /** split patterns in two when crossing calorimeter at point closest to IP in
-     3D (should be same as splitting at calorimeter) if not split empty vector
-     is returned */
-  std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-  splitPatternsCylinder(const Muon::MuonPrdPattern* phipattern,
-                        const Muon::MuonPrdPattern* etapattern) const;
-
-  /** make combined phi pattern by associating phi hits to noncombined eta
-   * pattern, return 0 if no phi measurements added, 2nd argument is if checking
-   * that added phi hits are already on pattern (not necessary for uncombined
-   * etapattern) */
-  Muon::MuonPrdPattern* makeAssPhiPattern(
-    const Muon::MuonPrdPattern* pattern,
-    const std::map<const Trk::PrepRawData*,
-                   std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phiEtaHitAssMap,
-    bool check = false) const;
-
-  /** calculate new track parameters of match (only for cosmics!) returns [r0,
-   * phi, rz0, theta]*/
-  double* updateParametersForCosmics(
-    const Muon::MuonPrdPattern* phipattern,
-    const Muon::MuonPrdPattern* etapattern) const;
-
-  /** calculate phi and r0 for cosmic patterns, phi estimate needs to be given
-   */
-  std::pair<double, double> calculateR0Phi(
-    const Muon::MuonPrdPattern* phipattern,
-    const Muon::MuonPrdPattern* etapattern,
-    double phi_estimate = -M_PI_2) const;
-
-  /** calculate rz0 for cosmic pattern */
-  static double calculateRz0(const Muon::MuonPrdPattern* pattern,
-                             double phi,
-                             double theta);
-
-  /** update patterns based on new track parameters (used only for cosmics)
-   * builds 2 new prd patterns */
-  static std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>
-  updatePatternsForCosmics(const Muon::MuonPrdPattern* phipattern,
-                           const Muon::MuonPrdPattern* etapattern,
-                           const double* new_pars);
-
-  /** calculates global position of prd */
-  static const Amg::Vector3D& globalPrdPos(const Trk::PrepRawData* prd);
-
-  /** adds eta,phi pair to candidate vector, also performs splitting and
-   * associated pattern (only for cosmics!)*/
-  void addCandidate(
-    const Muon::MuonPrdPattern* etapattern,
-    const Muon::MuonPrdPattern* phipattern,
-    std::vector<std::pair<const Muon::MuonPrdPattern*,
-                          const Muon::MuonPrdPattern*>>& candidates,
-    bool add_asspattern,
-    std::vector<const Muon::MuonPrdPattern*>& patternsToDelete,
-    const std::map<const Trk::PrepRawData*,
-                   std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phiEtaHitAssMap) const;
-
-  /** clean candidates from subsets or duplicates */
-  static void cleanCandidates(
-    std::vector<std::pair<const Muon::MuonPrdPattern*,
-                          const Muon::MuonPrdPattern*>>& candidates);
-
-  /** print out pattern hits */
-  void printPattern(const Muon::MuonPrdPattern* muonpattern) const;
-
-  /** object for use of mathematical formulas for trackmodels */
-  MuonHoughMathUtils m_muonHoughMathUtils;
-
-  /** distance cut in xy for hits */
-  const double m_maximum_xydistance;
-  /** distance cut in rz for hits */
-  const double m_maximum_rzdistance;
-
-  /** use cosmic settings */
-  bool m_use_cosmics;
-
-  /** split patterns (only for cosmics) */
-  bool m_splitpatterns;
-
-  /** don't discard any candidates based on gasgap assocation (true by default)
-   */
-  bool m_nodiscarding;
-
-  /** take only best phi match as candidate or take all phi matches (false by
-   * default, but true for cosmics) */
-  bool m_bestphimatch;
-
-  /** flip direction for cosmics after splitting as if coming from IP (false by
-   * default) */
-  bool m_flipdirectionforcosmics;
-
-  bool m_useTightAssociation;
-  unsigned int m_maxSizePhiPatternLoose;
-  unsigned int m_maxSizeEtaPatternLoose;
-
-  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{
-    this,
-    "MuonIdHelperSvc",
-    "Muon::MuonIdHelperSvc/MuonIdHelperSvc"
-  };
+    /** make combined pattern from all candidates, removes duplicates with phi
+     * when no overlap with eta pattern */
+    MuonPrdPatternCollection* makeCombinedPatterns(
+        std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>& candidates) const;
+
+    /** number of associated hits between patterns, returns by reference the phi
+     * hits to be added based on association with eta hits */
+    int overlap(const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern,
+                std::vector<const Trk::PrepRawData*>& associated_phihits_notonphipattern,
+                const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const;
+
+    /** is pattern1 a complete subset of other pattern2? */
+    static bool subset(const Muon::MuonPrdPattern* pattern1, const Muon::MuonPrdPattern* pattern2);
+
+    /** is candidate1 a complete subset of other candidate2? */
+    static bool subset(std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
+                                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>& candidate1,
+                       std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
+                                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>& candidate2);
+
+    /** add associated phi hits to phi pattern (factory: builds new
+     * Muon::MuonPrdPattern) */
+    const Muon::MuonPrdPattern* updatePhiPattern(const Muon::MuonPrdPattern* phipattern,
+                                                 std::vector<const Trk::PrepRawData*> missedphihits) const;
+
+    /** clean phi pattern, similar as in MuonHoughPatternTool, used for newly
+     * created phi patterns based on hit association */
+    Muon::MuonPrdPattern* cleanPhiPattern(const Muon::MuonPrdPattern* phipattern) const;
+
+    /** clean combined pattern, remove outliers */
+    Muon::MuonPrdPattern* cleanupCombinedPattern(Muon::MuonPrdPattern*& combinedpattern) const;
+
+    /** split patterns in two at point closest to IP in rphi */
+    std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitPatterns2D(const Muon::MuonPrdPattern* phipattern,
+                                                                                         const Muon::MuonPrdPattern* etapattern) const;
+
+    /** split patterns in two at point closest to IP in 3D */
+    std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitPatterns3D(const Muon::MuonPrdPattern* phipattern,
+                                                                                         const Muon::MuonPrdPattern* etapattern) const;
+
+    /** split patterns in two when crossing calorimeter at point closest to IP in
+       3D (should be same as splitting at calorimeter) if not split empty vector
+       is returned */
+    std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitPatternsCylinder(
+        const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern) const;
+
+    /** make combined phi pattern by associating phi hits to noncombined eta
+     * pattern, return 0 if no phi measurements added, 2nd argument is if checking
+     * that added phi hits are already on pattern (not necessary for uncombined
+     * etapattern) */
+    Muon::MuonPrdPattern* makeAssPhiPattern(
+        const Muon::MuonPrdPattern* pattern,
+        const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap,
+        bool check = false) const;
+
+    /** calculate new track parameters of match (only for cosmics!) returns [r0,
+     * phi, rz0, theta]*/
+    double* updateParametersForCosmics(const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern) const;
+
+    /** calculate phi and r0 for cosmic patterns, phi estimate needs to be given
+     */
+    std::pair<double, double> calculateR0Phi(const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern,
+                                             double phi_estimate = -M_PI_2) const;
+
+    /** calculate rz0 for cosmic pattern */
+    static double calculateRz0(const Muon::MuonPrdPattern* pattern, double phi, double theta);
+
+    /** update patterns based on new track parameters (used only for cosmics)
+     * builds 2 new prd patterns */
+    static std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*> updatePatternsForCosmics(
+        const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern, const double* new_pars);
+
+    /** calculates global position of prd */
+    static const Amg::Vector3D& globalPrdPos(const Trk::PrepRawData* prd);
+
+    /** adds eta,phi pair to candidate vector, also performs splitting and
+     * associated pattern (only for cosmics!)*/
+    void addCandidate(
+        const Muon::MuonPrdPattern* etapattern, const Muon::MuonPrdPattern* phipattern,
+        std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>& candidates, bool add_asspattern,
+        std::vector<const Muon::MuonPrdPattern*>& patternsToDelete,
+        const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const;
+
+    /** clean candidates from subsets or duplicates */
+    static void cleanCandidates(std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>& candidates);
+
+    /** print out pattern hits */
+    void printPattern(const Muon::MuonPrdPattern* muonpattern) const;
+
+    /** object for use of mathematical formulas for trackmodels */
+    MuonHoughMathUtils m_muonHoughMathUtils;
+
+    /** distance cut in xy for hits */
+    const double m_maximum_xydistance;
+    /** distance cut in rz for hits */
+    const double m_maximum_rzdistance;
+
+    /** use cosmic settings */
+    bool m_use_cosmics;
+
+    /** split patterns (only for cosmics) */
+    bool m_splitpatterns;
+
+    /** don't discard any candidates based on gasgap assocation (true by default)
+     */
+    bool m_nodiscarding;
+
+    /** take only best phi match as candidate or take all phi matches (false by
+     * default, but true for cosmics) */
+    bool m_bestphimatch;
+
+    /** flip direction for cosmics after splitting as if coming from IP (false by
+     * default) */
+    bool m_flipdirectionforcosmics;
+
+    bool m_useTightAssociation;
+    unsigned int m_maxSizePhiPatternLoose;
+    unsigned int m_maxSizeEtaPatternLoose;
+
+    ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 };
 
-#endif // MUONCOMBINEPATTERNTOOLS_MUONCOMBINEPATTERNTOOL_H
+#endif  // MUONCOMBINEPATTERNTOOLS_MUONCOMBINEPATTERNTOOL_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/doc/packagedoc.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/doc/packagedoc.h
index c9d12469b63f9434e6fef189431a112fd2e8e5f2..e101f3ea8916f561f6747340ae2a528cffdbcf48 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/doc/packagedoc.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/doc/packagedoc.h
@@ -8,7 +8,8 @@
 
 @section MuonCombinePatternTools_MuonCombinePatternToolsIntro Introduction
 
-This AlgTool will combine global eta and phi patterns from the HoughPatternTool into combined Patterns, using the track model used in the houghtransforms and a distance cut
+This AlgTool will combine global eta and phi patterns from the HoughPatternTool into combined Patterns, using the track model used in the
+houghtransforms and a distance cut
 
 @section MuonCombinePatternTools_MuonCombinePatternToolsOverview Class Overview
   The MuonCombinePatternTools package contains the following classes:
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/MuonCombinePatternTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/MuonCombinePatternTool.cxx
index 52c11c6b999a7aa4ad3cb48786451d6351743f15..d7f1bba5e943c2ec9a8aef483f8409a3369f5c67 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/MuonCombinePatternTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/MuonCombinePatternTool.cxx
@@ -4,2514 +4,2020 @@
 
 #include "MuonCombinePatternTools/MuonCombinePatternTool.h"
 
+#include <iterator>
+
 #include "CxxUtils/sincos.h"
 #include "MuonHoughPatternEvent/MuonHoughPattern.h"
 #include "MuonPattern/MuonPatternChamberIntersect.h"
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "TrkParameters/TrackParameters.h"
-#include "TrkSurfaces/Surface.h" // should not be included
-
-#include <iterator>
+#include "TrkSurfaces/Surface.h"  // should not be included
 
-double
-rotatePhi(double phi, double rotationFraction)
-{
-  // check whether we rotate to a large value than pi, if so add additional
-  // rotation by -2pi
-  if (phi + rotationFraction * M_PI > M_PI)
-    return phi + (rotationFraction - 2.) * M_PI;
-  return phi + rotationFraction * M_PI;
+double rotatePhi(double phi, double rotationFraction) {
+    // check whether we rotate to a large value than pi, if so add additional
+    // rotation by -2pi
+    if (phi + rotationFraction * M_PI > M_PI) return phi + (rotationFraction - 2.) * M_PI;
+    return phi + rotationFraction * M_PI;
 }
 
-MuonCombinePatternTool::MuonCombinePatternTool(const std::string& type,
-                                               const std::string& name,
-                                               const IInterface* parent)
-  : AthAlgTool(type, name, parent)
-  , m_maximum_xydistance(3500)
-  , m_maximum_rzdistance(1500)
-  , m_use_cosmics(false)
-  , m_splitpatterns(true)
-  , m_nodiscarding(true)
-  , m_bestphimatch(false)
-  , m_flipdirectionforcosmics(false)
-{
-  declareInterface<IMuonCombinePatternTool>(this);
-  declareProperty("UseCosmics", m_use_cosmics);
-  declareProperty("SplitPatterns", m_splitpatterns);
-  declareProperty("NoDiscarding", m_nodiscarding);
-  declareProperty("BestPhiMatch", m_bestphimatch);
-  declareProperty("FlipDirectionForCosmics", m_flipdirectionforcosmics);
-  declareProperty("UseTightAssociation", m_useTightAssociation = false);
-  declareProperty("MaxSizePhiPatternLooseCuts", m_maxSizePhiPatternLoose = 40);
-  declareProperty("MaxSizeEtaPatternLooseCuts", m_maxSizeEtaPatternLoose = 200);
+MuonCombinePatternTool::MuonCombinePatternTool(const std::string& type, const std::string& name, const IInterface* parent) :
+    AthAlgTool(type, name, parent),
+    m_maximum_xydistance(3500),
+    m_maximum_rzdistance(1500),
+    m_use_cosmics(false),
+    m_splitpatterns(true),
+    m_nodiscarding(true),
+    m_bestphimatch(false),
+    m_flipdirectionforcosmics(false) {
+    declareInterface<IMuonCombinePatternTool>(this);
+    declareProperty("UseCosmics", m_use_cosmics);
+    declareProperty("SplitPatterns", m_splitpatterns);
+    declareProperty("NoDiscarding", m_nodiscarding);
+    declareProperty("BestPhiMatch", m_bestphimatch);
+    declareProperty("FlipDirectionForCosmics", m_flipdirectionforcosmics);
+    declareProperty("UseTightAssociation", m_useTightAssociation = false);
+    declareProperty("MaxSizePhiPatternLooseCuts", m_maxSizePhiPatternLoose = 40);
+    declareProperty("MaxSizeEtaPatternLooseCuts", m_maxSizeEtaPatternLoose = 200);
 }
 
-StatusCode
-MuonCombinePatternTool::initialize()
-{
-  ATH_MSG_DEBUG("MuonCombinePatternTool::initialize");
-  ATH_CHECK(m_idHelperSvc.retrieve());
-  if (!m_use_cosmics) {
-    m_splitpatterns = false;
-  }
-  if (m_use_cosmics) {
-    m_bestphimatch = true;
-  }
-  ATH_MSG_DEBUG(" UseCosmics: " << m_use_cosmics
-                                << " Split Patterns: " << m_splitpatterns
-                                << " NoDiscarding: " << m_nodiscarding
-                                << " BestPhiMatch: " << m_bestphimatch);
-  return StatusCode::SUCCESS;
+StatusCode MuonCombinePatternTool::initialize() {
+    ATH_MSG_DEBUG("MuonCombinePatternTool::initialize");
+    ATH_CHECK(m_idHelperSvc.retrieve());
+    if (!m_use_cosmics) { m_splitpatterns = false; }
+    if (m_use_cosmics) { m_bestphimatch = true; }
+    ATH_MSG_DEBUG(" UseCosmics: " << m_use_cosmics << " Split Patterns: " << m_splitpatterns << " NoDiscarding: " << m_nodiscarding
+                                  << " BestPhiMatch: " << m_bestphimatch);
+    return StatusCode::SUCCESS;
 }
 
-MuonPrdPatternCollection*
-MuonCombinePatternTool::combineEtaPhiPatterns(
-  const MuonPrdPatternCollection* phiPatternCollection,
-  const MuonPrdPatternCollection* etaPatternCollection,
-  /** phi eta association map, eta prds are key*/
-  const std::map<const Trk::PrepRawData*,
-                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phiEtaHitAssMap) const
-{
-  bool myDebug = false;
-  std::vector<const Muon::MuonPrdPattern*> patternsToDelete;
-  std::vector<
-    std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>
-    candidates; // vector of etapatterns (key) and phipatterns (value), that are
-                // candidates for combining. Both etapatterns and phipatterns
-                // can occur multiple times
-
-  if (m_use_cosmics && m_splitpatterns) {
-    patternsToDelete.reserve(
-      6 * etaPatternCollection
-            ->size()); // split eta (2) and phi patterns (2) + associated (2) ,
-                       // might be more when more than one match is found
-  } else {
-    patternsToDelete.reserve(
-      etaPatternCollection->size()); // only associated patterns
-  }
-  // strategy
-  // associate eta pattern to phi patterns
-  // are phi hits on a eta and eta hits on phi pattern?
-
-  // some printout
-  ATH_MSG_DEBUG(" combineEtaPhiPatterns:  eta patterns: "
-                << etaPatternCollection->size()
-                << "  phi patterns: " << phiPatternCollection->size());
-
-  for (unsigned int etalevel = 0; etalevel < etaPatternCollection->size();
-       etalevel++) {
-
-    const Muon::MuonPrdPattern* etapattern = etaPatternCollection->at(etalevel);
-    if (etapattern->numberOfContainedPrds() == 0)
-      continue;
+MuonPrdPatternCollection* MuonCombinePatternTool::combineEtaPhiPatterns(
+    const MuonPrdPatternCollection* phiPatternCollection, const MuonPrdPatternCollection* etaPatternCollection,
+    /** phi eta association map, eta prds are key*/
+    const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const {
+    bool myDebug = false;
+    std::vector<const Muon::MuonPrdPattern*> patternsToDelete;
+    std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>
+        candidates;  // vector of etapatterns (key) and phipatterns (value), that are
+                     // candidates for combining. Both etapatterns and phipatterns
+                     // can occur multiple times
+
+    if (m_use_cosmics && m_splitpatterns) {
+        patternsToDelete.reserve(6 * etaPatternCollection->size());  // split eta (2) and phi patterns (2) + associated (2) ,
+                                                                     // might be more when more than one match is found
+    } else {
+        patternsToDelete.reserve(etaPatternCollection->size());  // only associated patterns
+    }
+    // strategy
+    // associate eta pattern to phi patterns
+    // are phi hits on a eta and eta hits on phi pattern?
+
+    // some printout
+    ATH_MSG_DEBUG(" combineEtaPhiPatterns:  eta patterns: " << etaPatternCollection->size()
+                                                            << "  phi patterns: " << phiPatternCollection->size());
+
+    for (unsigned int etalevel = 0; etalevel < etaPatternCollection->size(); etalevel++) {
+        const Muon::MuonPrdPattern* etapattern = etaPatternCollection->at(etalevel);
+        if (etapattern->numberOfContainedPrds() == 0) continue;
+
+        double theta = etapattern->globalDirection().theta();
+        const double phieta = etapattern->globalDirection().phi();
+        CxxUtils::sincos scphieta(phieta);
+        CxxUtils::sincos sctheta(theta);
+        double dx_eta = scphieta.cs * sctheta.sn;
+        double dy_eta = scphieta.sn * sctheta.sn;
+        double dz_eta = sctheta.cs;
+        double z0 = etapattern->globalPosition().z();  // 0 for non -cosmics
+        double rz0 = z0 * sctheta.sn;                  // closest distance in rz
+
+        double eta_x = etapattern->globalPosition().x();
+        double eta_y = etapattern->globalPosition().y();
+        double pattern_z0 =
+            z0 + std::sqrt(eta_x * eta_x + eta_y * eta_y) * sctheta.cs / sctheta.sn;  // z belonging to (x0,y0) -> noncosmics just close to
+                                                                                      // 0 (0.001 * sin/cos)
+        double eta_r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(eta_x, eta_y, phieta);
+        double charge = 1.;
+        if (eta_r0 < 0) charge = -1.;
+        //           Get inverse curvature from eta pattern
+        double curvature = etapattern->globalDirection().mag();
+        double invcurvature = 0.;
+        if (curvature > 2) invcurvature = charge / curvature;
+
+        ATH_MSG_DEBUG(" eta pattern info level: " << etalevel << " phi " << phieta << " theta " << theta << " x0 " << eta_x << " y0 "
+                                                  << eta_y << " z0 " << z0 << " hits " << etapattern->numberOfContainedPrds());
+        // flags for cosmics:
+        double min_average_distance = m_maximum_xydistance + m_maximum_rzdistance;
+        const Muon::MuonPrdPattern* max_phipattern = nullptr;
+        int max_philevel = -1;
+        // flags
+        double dotprodbest = -1.;
+        int phibest = -1;
+        bool ismatched = false;
+        for (unsigned int philevel = 0; philevel < phiPatternCollection->size(); philevel++) {
+            const Muon::MuonPrdPattern* phipattern = phiPatternCollection->at(philevel);
+            if (phipattern->numberOfContainedPrds() == 0) continue;
+            bool useTightAssociation = false;
+
+            if (m_useTightAssociation && (phipattern->numberOfContainedPrds() > m_maxSizePhiPatternLoose ||
+                                          etapattern->numberOfContainedPrds() > m_maxSizeEtaPatternLoose)) {
+                if (phipattern->numberOfContainedPrds() > m_maxSizePhiPatternLoose)
+                    ATH_MSG_DEBUG(" using tight cuts due to phi hits " << phipattern->numberOfContainedPrds() << " cut "
+                                                                       << m_maxSizePhiPatternLoose);
+                if (etapattern->numberOfContainedPrds() > m_maxSizeEtaPatternLoose)
+                    ATH_MSG_DEBUG(" using tight cuts due to eta hits " << etapattern->numberOfContainedPrds() << " cut "
+                                                                       << m_maxSizeEtaPatternLoose);
+                useTightAssociation = true;
+            }
 
-    double theta = etapattern->globalDirection().theta();
-    const double phieta = etapattern->globalDirection().phi();
-    CxxUtils::sincos scphieta(phieta);
-    CxxUtils::sincos sctheta(theta);
-    double dx_eta = scphieta.cs * sctheta.sn;
-    double dy_eta = scphieta.sn * sctheta.sn;
-    double dz_eta = sctheta.cs;
-    double z0 = etapattern->globalPosition().z(); // 0 for non -cosmics
-    double rz0 = z0 * sctheta.sn;                 // closest distance in rz
+            double phi = phipattern->globalDirection().phi();  // should be in rad
+            const double thetaphi = phipattern->globalDirection().theta();
+            CxxUtils::sincos scphi(phi);
+            CxxUtils::sincos scthetaphi(thetaphi);
+            double dx_phi = scphi.cs * scthetaphi.sn;
+            double dy_phi = scphi.sn * scthetaphi.sn;
+            double dz_phi = scthetaphi.cs;
+            double dotprod = dx_phi * dx_eta + dy_phi * dy_eta + dz_phi * dz_eta;
+
+            if (dotprod > dotprodbest) {
+                dotprodbest = dotprod;
+                phibest = philevel;
+            }
 
-    double eta_x = etapattern->globalPosition().x();
-    double eta_y = etapattern->globalPosition().y();
-    double pattern_z0 =
-      z0 + std::sqrt(eta_x * eta_x + eta_y * eta_y) * sctheta.cs /
-             sctheta.sn; // z belonging to (x0,y0) -> noncosmics just close to 0
-                         // (0.001 * sin/cos)
-    double eta_r0 =
-      MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(eta_x, eta_y, phieta);
-    double charge = 1.;
-    if (eta_r0 < 0)
-      charge = -1.;
-    //           Get inverse curvature from eta pattern
-    double curvature = etapattern->globalDirection().mag();
-    double invcurvature = 0.;
-    if (curvature > 2)
-      invcurvature = charge / curvature;
-
-    ATH_MSG_DEBUG(" eta pattern info level: "
-                  << etalevel << " phi " << phieta << " theta " << theta
-                  << " x0 " << eta_x << " y0 " << eta_y << " z0 " << z0
-                  << " hits " << etapattern->numberOfContainedPrds());
-    // flags for cosmics:
-    double min_average_distance = m_maximum_xydistance + m_maximum_rzdistance;
-    const Muon::MuonPrdPattern* max_phipattern = nullptr;
-    int max_philevel = -1;
-    // flags
-    double dotprodbest = -1.;
-    int phibest = -1;
-    bool ismatched = false;
-    for (unsigned int philevel = 0; philevel < phiPatternCollection->size();
-         philevel++) {
-      const Muon::MuonPrdPattern* phipattern =
-        phiPatternCollection->at(philevel);
-      if (phipattern->numberOfContainedPrds() == 0)
-        continue;
-      bool useTightAssociation = false;
-
-      if (m_useTightAssociation &&
-          (phipattern->numberOfContainedPrds() > m_maxSizePhiPatternLoose ||
-           etapattern->numberOfContainedPrds() > m_maxSizeEtaPatternLoose)) {
-        if (phipattern->numberOfContainedPrds() > m_maxSizePhiPatternLoose)
-          ATH_MSG_DEBUG(" using tight cuts due to phi hits "
-                        << phipattern->numberOfContainedPrds() << " cut "
-                        << m_maxSizePhiPatternLoose);
-        if (etapattern->numberOfContainedPrds() > m_maxSizeEtaPatternLoose)
-          ATH_MSG_DEBUG(" using tight cuts due to eta hits "
-                        << etapattern->numberOfContainedPrds() << " cut "
-                        << m_maxSizeEtaPatternLoose);
-        useTightAssociation = true;
-      }
-
-      double phi = phipattern->globalDirection().phi(); // should be in rad
-      const double thetaphi = phipattern->globalDirection().theta();
-      CxxUtils::sincos scphi(phi);
-      CxxUtils::sincos scthetaphi(thetaphi);
-      double dx_phi = scphi.cs * scthetaphi.sn;
-      double dy_phi = scphi.sn * scthetaphi.sn;
-      double dz_phi = scthetaphi.cs;
-      double dotprod = dx_phi * dx_eta + dy_phi * dy_eta + dz_phi * dz_eta;
-
-      if (dotprod > dotprodbest) {
-        dotprodbest = dotprod;
-        phibest = philevel;
-      }
-
-      if (!m_use_cosmics) {
-        ATH_MSG_DEBUG(" eta nr " << etalevel << " phi nr " << philevel
-                                 << " inproduct " << dotprod << " sin angle "
-                                 << std::sin(std::acos(dotprod)));
-      }
-
-      double r0 = 0;
-      double phipattern_x = 0;
-      double phipattern_y = 0;
-
-      if (m_use_cosmics) {
-        // new information: update parameters
-        double* new_pars = updateParametersForCosmics(phipattern, etapattern);
-        r0 = new_pars[0];
-        phi = new_pars[1];
-        scphi = CxxUtils::sincos(phi);
-        theta = new_pars[3];
-        sctheta = CxxUtils::sincos(theta);
-        rz0 = new_pars[2];
-        phipattern_x = r0 * scphi.sn;
-        phipattern_y = r0 * scphi.cs;
-        delete[] new_pars;
-      }
-
-      else {
-        const Amg::Vector3D& posphipattern = phipattern->globalPosition();
-        phipattern_x = posphipattern.x();
-        phipattern_y = posphipattern.y();
-        r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(
-          phipattern_x, phipattern_y, phi);
-      }
-
-      // is etapattern on phi pattern?
-      // Loop over hits etapattern
-
-      // int nhits_in_average_eta=0;
-      // int nhits_inside_distance_cut_eta=0;
-
-      if (dotprod <= 0.5 && !m_use_cosmics)
-        continue;
-
-      ATH_MSG_DEBUG(" Matched Eta/phi pattern ");
-
-      // keep track of the number of eta/phi trigger and CSC hits per chamber
-      std::map<Identifier, ChamberInfo> infoPerChamber;
-      std::map<Muon::MuonStationIndex::StIndex, ChamberInfo> infoPerStation;
-      // Loop over hits phi pattern
-      double average_distance = 0;
-      int nhits_in_average = 0;
-      int nhits_inside_distance_cut = 0;
-
-      double phiPatMin = 1e9;
-      double phiPatMax = -1e9;
-
-      for (unsigned int phihitid = 0;
-           phihitid < phipattern->numberOfContainedPrds();
-           phihitid++) {
-        const Trk::PrepRawData* prd = phipattern->prd(phihitid);
-        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-        const double hitx = globalposhit.x();
-        const double hity = globalposhit.y();
-        const double hitz = globalposhit.z();
-        double radius_hit = std::sqrt(hitx * hitx + hity * hity);
-        double dotprodradius = sctheta.apply(
-          radius_hit, hitz); // (radius_hit) * sctheta.sn + hitz * sctheta.cs;
-        ATH_MSG_VERBOSE("combine hit: "
-                        << m_idHelperSvc->toString(prd->identify())
-                        << " dotprod: " << dotprodradius);
-        if (dotprodradius >= 0 || m_use_cosmics) // should be on
-        {
-          double residu_distance_mm = 1000000.;
-
-          if (m_use_cosmics) {
-            const double perp =
-              scphi.apply(hity, hitx); // hitx*scphi.cs + hity*scphi.sn;
-
-            residu_distance_mm =
-              MuonHoughMathUtils::signedDistanceToLine(hitz, perp, rz0, theta);
-          } else {
-            residu_distance_mm = MuonHoughMathUtils::signedDistanceCurvedToHit(
-              pattern_z0, theta, invcurvature, hitx, hity, hitz);
-          }
-
-          double distancetoline = std::abs(residu_distance_mm);
-
-          ATH_MSG_VERBOSE(" distance RZ: " << residu_distance_mm);
-
-          if (distancetoline < m_maximum_rzdistance) {
-            ATH_MSG_VERBOSE(" accepted ");
-            nhits_inside_distance_cut++;
-            nhits_in_average++;
-            average_distance += distancetoline;
+            if (!m_use_cosmics) {
+                ATH_MSG_DEBUG(" eta nr " << etalevel << " phi nr " << philevel << " inproduct " << dotprod << " sin angle "
+                                         << std::sin(std::acos(dotprod)));
+            }
 
-            if (useTightAssociation) {
-              Identifier chId = m_idHelperSvc->chamberId(prd->identify());
-              std::map<Identifier, ChamberInfo>::iterator chPos =
-                infoPerChamber.find(chId);
-              ChamberInfo* chInfo = nullptr;
-              if (chPos != infoPerChamber.end()) {
-                chInfo = &chPos->second;
-              } else {
-                chInfo = &infoPerChamber[chId];
-              }
-              ++chInfo->nphi;
-              double hitphi = globalposhit.phi();
-              if (hitphi < chInfo->phiMin)
-                chInfo->phiMin = hitphi;
-              if (hitphi > chInfo->phiMax)
-                chInfo->phiMax = hitphi;
-
-              Muon::MuonStationIndex::StIndex stIndex =
-                m_idHelperSvc->stationIndex(prd->identify());
-              std::map<Muon::MuonStationIndex::StIndex, ChamberInfo>::iterator
-                stPos = infoPerStation.find(stIndex);
-              if (stPos != infoPerStation.end()) {
-                chInfo = &stPos->second;
-              } else {
-                chInfo = &infoPerStation[stIndex];
-              }
-              ++chInfo->nphi;
-              if (hitphi < chInfo->phiMin)
-                chInfo->phiMin = hitphi;
-              if (hitphi > chInfo->phiMax)
-                chInfo->phiMax = hitphi;
-              if (hitphi < phiPatMin)
-                phiPatMin = hitphi;
-              if (hitphi > phiPatMax)
-                phiPatMax = hitphi;
+            double r0 = 0;
+            double phipattern_x = 0;
+            double phipattern_y = 0;
+
+            if (m_use_cosmics) {
+                // new information: update parameters
+                double* new_pars = updateParametersForCosmics(phipattern, etapattern);
+                r0 = new_pars[0];
+                phi = new_pars[1];
+                scphi = CxxUtils::sincos(phi);
+                theta = new_pars[3];
+                sctheta = CxxUtils::sincos(theta);
+                rz0 = new_pars[2];
+                phipattern_x = r0 * scphi.sn;
+                phipattern_y = r0 * scphi.cs;
+                delete[] new_pars;
+            }
+
+            else {
+                const Amg::Vector3D& posphipattern = phipattern->globalPosition();
+                phipattern_x = posphipattern.x();
+                phipattern_y = posphipattern.y();
+                r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(phipattern_x, phipattern_y, phi);
             }
-          }
-        } // dotprodradius
-      }   // size muonpattern
-
-      if (nhits_in_average > 0)
-        average_distance /= nhits_in_average;
-
-      ATH_MSG_DEBUG(" Result for phi pattern: accepted hits "
-                    << nhits_inside_distance_cut << " average distance "
-                    << average_distance);
-
-      bool etapattern_passed = false;
-      for (unsigned int etahitid = 0;
-           etahitid < etapattern->numberOfContainedPrds();
-           etahitid++) {
-        const Trk::PrepRawData* prd = etapattern->prd(etahitid);
-        const Amg::Vector3D& etaglobalposhit = globalPrdPos(prd);
-        const double etahitx = etaglobalposhit.x();
-        const double etahity = etaglobalposhit.y();
-
-        if (!m_use_cosmics) {
-          double etadotprod = scphi.apply(
-            etahity, etahitx); // etahitx * scphi.cs + etahity * scphi.sn; //
-                               // same as in maketruetracksegment
-          if (etadotprod < 0)
-            continue; // hit in wrong hemisphere
-        }
 
-        const double xdiff = phipattern_x - etahitx;
-        const double ydiff = phipattern_y - etahity;
-        const double etahitr = std::sqrt(xdiff * xdiff + ydiff * ydiff);
+            // is etapattern on phi pattern?
+            // Loop over hits etapattern
+
+            // int nhits_in_average_eta=0;
+            // int nhits_inside_distance_cut_eta=0;
+
+            if (dotprod <= 0.5 && !m_use_cosmics) continue;
+
+            ATH_MSG_DEBUG(" Matched Eta/phi pattern ");
+
+            // keep track of the number of eta/phi trigger and CSC hits per chamber
+            std::map<Identifier, ChamberInfo> infoPerChamber;
+            std::map<Muon::MuonStationIndex::StIndex, ChamberInfo> infoPerStation;
+            // Loop over hits phi pattern
+            double average_distance = 0;
+            int nhits_in_average = 0;
+            int nhits_inside_distance_cut = 0;
+
+            double phiPatMin = 1e9;
+            double phiPatMax = -1e9;
+
+            for (unsigned int phihitid = 0; phihitid < phipattern->numberOfContainedPrds(); phihitid++) {
+                const Trk::PrepRawData* prd = phipattern->prd(phihitid);
+                const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+                const double hitx = globalposhit.x();
+                const double hity = globalposhit.y();
+                const double hitz = globalposhit.z();
+                double radius_hit = std::sqrt(hitx * hitx + hity * hity);
+                double dotprodradius = sctheta.apply(radius_hit, hitz);  // (radius_hit) * sctheta.sn + hitz * sctheta.cs;
+                ATH_MSG_VERBOSE("combine hit: " << m_idHelperSvc->toString(prd->identify()) << " dotprod: " << dotprodradius);
+                if (dotprodradius >= 0 || m_use_cosmics)  // should be on
+                {
+                    double residu_distance_mm = 1000000.;
+
+                    if (m_use_cosmics) {
+                        const double perp = scphi.apply(hity, hitx);  // hitx*scphi.cs + hity*scphi.sn;
+
+                        residu_distance_mm = MuonHoughMathUtils::signedDistanceToLine(hitz, perp, rz0, theta);
+                    } else {
+                        residu_distance_mm =
+                            MuonHoughMathUtils::signedDistanceCurvedToHit(pattern_z0, theta, invcurvature, hitx, hity, hitz);
+                    }
+
+                    double distancetoline = std::abs(residu_distance_mm);
+
+                    ATH_MSG_VERBOSE(" distance RZ: " << residu_distance_mm);
+
+                    if (distancetoline < m_maximum_rzdistance) {
+                        ATH_MSG_VERBOSE(" accepted ");
+                        nhits_inside_distance_cut++;
+                        nhits_in_average++;
+                        average_distance += distancetoline;
+
+                        if (useTightAssociation) {
+                            Identifier chId = m_idHelperSvc->chamberId(prd->identify());
+                            std::map<Identifier, ChamberInfo>::iterator chPos = infoPerChamber.find(chId);
+                            ChamberInfo* chInfo = nullptr;
+                            if (chPos != infoPerChamber.end()) {
+                                chInfo = &chPos->second;
+                            } else {
+                                chInfo = &infoPerChamber[chId];
+                            }
+                            ++chInfo->nphi;
+                            double hitphi = globalposhit.phi();
+                            if (hitphi < chInfo->phiMin) chInfo->phiMin = hitphi;
+                            if (hitphi > chInfo->phiMax) chInfo->phiMax = hitphi;
+
+                            Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(prd->identify());
+                            std::map<Muon::MuonStationIndex::StIndex, ChamberInfo>::iterator stPos = infoPerStation.find(stIndex);
+                            if (stPos != infoPerStation.end()) {
+                                chInfo = &stPos->second;
+                            } else {
+                                chInfo = &infoPerStation[stIndex];
+                            }
+                            ++chInfo->nphi;
+                            if (hitphi < chInfo->phiMin) chInfo->phiMin = hitphi;
+                            if (hitphi > chInfo->phiMax) chInfo->phiMax = hitphi;
+                            if (hitphi < phiPatMin) phiPatMin = hitphi;
+                            if (hitphi > phiPatMax) phiPatMax = hitphi;
+                        }
+                    }
+                }  // dotprodradius
+            }      // size muonpattern
+
+            if (nhits_in_average > 0) average_distance /= nhits_in_average;
+
+            ATH_MSG_DEBUG(" Result for phi pattern: accepted hits " << nhits_inside_distance_cut << " average distance "
+                                                                    << average_distance);
+
+            bool etapattern_passed = false;
+            for (unsigned int etahitid = 0; etahitid < etapattern->numberOfContainedPrds(); etahitid++) {
+                const Trk::PrepRawData* prd = etapattern->prd(etahitid);
+                const Amg::Vector3D& etaglobalposhit = globalPrdPos(prd);
+                const double etahitx = etaglobalposhit.x();
+                const double etahity = etaglobalposhit.y();
+
+                if (!m_use_cosmics) {
+                    double etadotprod = scphi.apply(etahity, etahitx);  // etahitx * scphi.cs + etahity * scphi.sn; //
+                                                                        // same as in maketruetracksegment
+                    if (etadotprod < 0) continue;                       // hit in wrong hemisphere
+                }
 
-        //		const double etahitz=etaglobalposhit.z();
+                const double xdiff = phipattern_x - etahitx;
+                const double ydiff = phipattern_y - etahity;
+                const double etahitr = std::sqrt(xdiff * xdiff + ydiff * ydiff);
 
-        // 		double scale = std::sqrt(etahitx*etahitx +
-        // etahity*etahity
-        // + etahitz*etahitz)/7000.; 		if (scale < 1 ) scale = 1.;
+                //		const double etahitz=etaglobalposhit.z();
 
-        bool hit_passed = false;
-        double etadistancetoline = std::abs(
-          MuonHoughMathUtils::distanceToLine(etahitx, etahity, r0, phi));
+                // 		double scale = std::sqrt(etahitx*etahitx +
+                // etahity*etahity
+                // + etahitz*etahitz)/7000.; 		if (scale < 1 ) scale = 1.;
 
-        ATH_MSG_VERBOSE("combine: " << m_idHelperSvc->toString(prd->identify())
-                                    << " distance xy " << etadistancetoline);
+                bool hit_passed = false;
+                double etadistancetoline = std::abs(MuonHoughMathUtils::distanceToLine(etahitx, etahity, r0, phi));
 
-        if (m_use_cosmics) { // phi cone does not work for cosmics since hits
-                             // might be close to position of pattern
+                ATH_MSG_VERBOSE("combine: " << m_idHelperSvc->toString(prd->identify()) << " distance xy " << etadistancetoline);
 
-          const double scale = etahitr / 7000.;
-          if (etadistancetoline < scale * m_maximum_xydistance) {
-            hit_passed = true;
-          }
-        } else { // phi within 30 degrees
-          if (2 * etadistancetoline <
-              etahitr) { // this corresponds with 30 degrees , normal formula:
-                         // (etadistancetoline/etahitr) < sin( Pi/180 * degrees)
-            hit_passed = true;
-          }
-        }
+                if (m_use_cosmics) {  // phi cone does not work for cosmics since hits
+                                      // might be close to position of pattern
 
-        if (hit_passed) {
-
-          // if (m_verbose) m_log << MSG::VERBOSE << "hit in xy distance cut: "
-          // << nhits_inside_distance_cut_eta << endmsg;
-          // nhits_inside_distance_cut_eta++;
-          // nhits_in_average_eta++;
-          etapattern_passed = true; // only one hit required
-          // break;
-          ATH_MSG_VERBOSE(" accepted");
-
-          if (useTightAssociation) {
-            Identifier chId = m_idHelperSvc->chamberId(prd->identify());
-            std::map<Identifier, ChamberInfo>::iterator chPos =
-              infoPerChamber.find(chId);
-            ChamberInfo* chInfo = nullptr;
-            if (chPos != infoPerChamber.end()) {
-              chInfo = &chPos->second;
-            } else {
-              chInfo = &infoPerChamber[chId];
-            }
-            ++chInfo->neta;
-            if (m_idHelperSvc->isMdt(prd->identify())) {
-
-              Muon::MuonStationIndex::StIndex stIndex =
-                m_idHelperSvc->stationIndex(prd->identify());
-              ChamberInfo& stInfo = infoPerStation[stIndex];
-
-              const MuonGM::MdtReadoutElement* mdtDetEl =
-                dynamic_cast<const MuonGM::MdtReadoutElement*>(
-                  prd->detectorElement());
-              if (!mdtDetEl)
-                continue;
-
-              const Identifier& id = prd->identify();
-              const Trk::Surface& surf = mdtDetEl->surface(id);
-              int layer = m_idHelperSvc->mdtIdHelper().tubeLayer(id);
-              int tube = m_idHelperSvc->mdtIdHelper().tube(id);
-              double halfLength = 0.5 * mdtDetEl->getWireLength(layer, tube);
-              Amg::Vector2D lpLeft(0, -halfLength);
-              Amg::Vector3D gposLeft = surf.localToGlobal(lpLeft);
-              double phiLeft = gposLeft.phi();
-
-              Amg::Vector2D lpRight(0, halfLength);
-              const Amg::Vector3D gposRight = surf.localToGlobal(lpRight);
-              double phiRight = gposRight.phi();
-              double phiMin = phiRight < phiLeft ? phiRight : phiLeft;
-              double phiMax = phiRight < phiLeft ? phiLeft : phiRight;
-
-              Amg::Vector3D tubePos = mdtDetEl->tubePos(id);
-              Amg::Vector3D ROPos = mdtDetEl->ROPos(id);
-              Amg::Vector3D HVPos = 2 * tubePos - ROPos;
-              double tubeL = (HVPos - ROPos).mag();
-              double phiRO = ROPos.phi();
-              double phiHV = HVPos.phi();
-              double phiMinPos = phiHV < phiRO ? phiHV : phiRO;
-              double phiMaxPos = phiHV < phiRO ? phiRO : phiHV;
-
-              if (myDebug && (fabs(phiMin - phiMinPos) > 0.01 ||
-                              fabs(phiMax - phiMaxPos) > 0.01)) {
-                ATH_MSG_DEBUG(" inconsistent Phi!!: from locToGlob ("
-                              << phiMin << "," << phiMax
-                              << "), from positions (" << phiMinPos << ","
-                              << phiMaxPos << ")");
-              }
-              double rotationFraction = 0.;
-              if (phiMin < 0 && phiMax > 0) {
-                if (phiMin < -0.75 * M_PI || phiMax > 0.75 * M_PI)
-                  rotationFraction = 1.5;
-                else
-                  rotationFraction = 0.5;
-              } else if (phiMax < 0) {
-                rotationFraction = 1.;
-              }
-              double phiMinR = rotatePhi(phiMin, rotationFraction);
-              double phiMaxR = rotatePhi(phiMax, rotationFraction);
-              phiMin = phiMinR < phiMaxR ? phiMinR : phiMaxR;
-              phiMax = phiMinR > phiMaxR ? phiMinR : phiMaxR;
-
-              phiMinR = rotatePhi(phiMinPos, rotationFraction);
-              phiMaxR = rotatePhi(phiMaxPos, rotationFraction);
-              phiMinPos = phiMinR < phiMaxR ? phiMinR : phiMaxR;
-              phiMaxPos = phiMinR > phiMaxR ? phiMinR : phiMaxR;
-
-              // enlarge range by 0.1 rad
-              phiMin = phiMin > 0 ? phiMin - 0.1 : phiMin + 0.1;
-              phiMax = phiMax > 0 ? phiMax + 0.1 : phiMax - 0.1;
-
-              double phiMinSec = 1e9;
-              double phiMaxSec = -1e9;
-              if (stInfo.nphi > 0 && stInfo.phiMin < 1000) {
-                phiMinR = rotatePhi(stInfo.phiMin, rotationFraction);
-                phiMaxR = rotatePhi(stInfo.phiMax, rotationFraction);
-                phiMinSec = phiMinR < phiMaxR ? phiMinR : phiMaxR;
-                phiMaxSec = phiMinR > phiMaxR ? phiMinR : phiMaxR;
-
-                bool inside = true;
-
-                // easy case
-                if (phiMinSec > 0 && phiMaxSec > 0) {
-                  if (phiMin > phiMaxSec || phiMax < phiMinSec)
-                    inside = false;
-                } else if (phiMinSec < 0 && phiMaxSec < 0) {
-                  // easy case (2), always outside
-                  inside = false;
-                } else {
-                  // finaly check if phiMaxSec large than maxPhi
-                  if (phiMax < phiMaxSec)
-                    inside = false;
+                    const double scale = etahitr / 7000.;
+                    if (etadistancetoline < scale * m_maximum_xydistance) { hit_passed = true; }
+                } else {                                    // phi within 30 degrees
+                    if (2 * etadistancetoline < etahitr) {  // this corresponds with 30 degrees , normal formula:
+                                                            // (etadistancetoline/etahitr) < sin( Pi/180 * degrees)
+                        hit_passed = true;
+                    }
                 }
-                // case with a
-                if (inside) {
-                  ++stInfo.ninside;
-                  ++chInfo->ninside;
-                  if (myDebug) {
-                    ATH_MSG_DEBUG(" Inside  ");
-                  }
-                } else {
-                  ++stInfo.noutside;
-                  ++chInfo->noutside;
-                  if (myDebug) {
-                    ATH_MSG_DEBUG(" Outside ");
-                  }
+
+                if (hit_passed) {
+                    // if (m_verbose) m_log << MSG::VERBOSE << "hit in xy distance cut: "
+                    // << nhits_inside_distance_cut_eta << endmsg;
+                    // nhits_inside_distance_cut_eta++;
+                    // nhits_in_average_eta++;
+                    etapattern_passed = true;  // only one hit required
+                    // break;
+                    ATH_MSG_VERBOSE(" accepted");
+
+                    if (useTightAssociation) {
+                        Identifier chId = m_idHelperSvc->chamberId(prd->identify());
+                        std::map<Identifier, ChamberInfo>::iterator chPos = infoPerChamber.find(chId);
+                        ChamberInfo* chInfo = nullptr;
+                        if (chPos != infoPerChamber.end()) {
+                            chInfo = &chPos->second;
+                        } else {
+                            chInfo = &infoPerChamber[chId];
+                        }
+                        ++chInfo->neta;
+                        if (m_idHelperSvc->isMdt(prd->identify())) {
+                            Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(prd->identify());
+                            ChamberInfo& stInfo = infoPerStation[stIndex];
+
+                            const MuonGM::MdtReadoutElement* mdtDetEl =
+                                dynamic_cast<const MuonGM::MdtReadoutElement*>(prd->detectorElement());
+                            if (!mdtDetEl) continue;
+
+                            const Identifier& id = prd->identify();
+                            const Trk::Surface& surf = mdtDetEl->surface(id);
+                            int layer = m_idHelperSvc->mdtIdHelper().tubeLayer(id);
+                            int tube = m_idHelperSvc->mdtIdHelper().tube(id);
+                            double halfLength = 0.5 * mdtDetEl->getWireLength(layer, tube);
+                            Amg::Vector2D lpLeft(0, -halfLength);
+                            Amg::Vector3D gposLeft = surf.localToGlobal(lpLeft);
+                            double phiLeft = gposLeft.phi();
+
+                            Amg::Vector2D lpRight(0, halfLength);
+                            const Amg::Vector3D gposRight = surf.localToGlobal(lpRight);
+                            double phiRight = gposRight.phi();
+                            double phiMin = phiRight < phiLeft ? phiRight : phiLeft;
+                            double phiMax = phiRight < phiLeft ? phiLeft : phiRight;
+
+                            Amg::Vector3D tubePos = mdtDetEl->tubePos(id);
+                            Amg::Vector3D ROPos = mdtDetEl->ROPos(id);
+                            Amg::Vector3D HVPos = 2 * tubePos - ROPos;
+                            double tubeL = (HVPos - ROPos).mag();
+                            double phiRO = ROPos.phi();
+                            double phiHV = HVPos.phi();
+                            double phiMinPos = phiHV < phiRO ? phiHV : phiRO;
+                            double phiMaxPos = phiHV < phiRO ? phiRO : phiHV;
+
+                            if (myDebug && (fabs(phiMin - phiMinPos) > 0.01 || fabs(phiMax - phiMaxPos) > 0.01)) {
+                                ATH_MSG_DEBUG(" inconsistent Phi!!: from locToGlob (" << phiMin << "," << phiMax << "), from positions ("
+                                                                                      << phiMinPos << "," << phiMaxPos << ")");
+                            }
+                            double rotationFraction = 0.;
+                            if (phiMin < 0 && phiMax > 0) {
+                                if (phiMin < -0.75 * M_PI || phiMax > 0.75 * M_PI)
+                                    rotationFraction = 1.5;
+                                else
+                                    rotationFraction = 0.5;
+                            } else if (phiMax < 0) {
+                                rotationFraction = 1.;
+                            }
+                            double phiMinR = rotatePhi(phiMin, rotationFraction);
+                            double phiMaxR = rotatePhi(phiMax, rotationFraction);
+                            phiMin = phiMinR < phiMaxR ? phiMinR : phiMaxR;
+                            phiMax = phiMinR > phiMaxR ? phiMinR : phiMaxR;
+
+                            phiMinR = rotatePhi(phiMinPos, rotationFraction);
+                            phiMaxR = rotatePhi(phiMaxPos, rotationFraction);
+                            phiMinPos = phiMinR < phiMaxR ? phiMinR : phiMaxR;
+                            phiMaxPos = phiMinR > phiMaxR ? phiMinR : phiMaxR;
+
+                            // enlarge range by 0.1 rad
+                            phiMin = phiMin > 0 ? phiMin - 0.1 : phiMin + 0.1;
+                            phiMax = phiMax > 0 ? phiMax + 0.1 : phiMax - 0.1;
+
+                            double phiMinSec = 1e9;
+                            double phiMaxSec = -1e9;
+                            if (stInfo.nphi > 0 && stInfo.phiMin < 1000) {
+                                phiMinR = rotatePhi(stInfo.phiMin, rotationFraction);
+                                phiMaxR = rotatePhi(stInfo.phiMax, rotationFraction);
+                                phiMinSec = phiMinR < phiMaxR ? phiMinR : phiMaxR;
+                                phiMaxSec = phiMinR > phiMaxR ? phiMinR : phiMaxR;
+
+                                bool inside = true;
+
+                                // easy case
+                                if (phiMinSec > 0 && phiMaxSec > 0) {
+                                    if (phiMin > phiMaxSec || phiMax < phiMinSec) inside = false;
+                                } else if (phiMinSec < 0 && phiMaxSec < 0) {
+                                    // easy case (2), always outside
+                                    inside = false;
+                                } else {
+                                    // finaly check if phiMaxSec large than maxPhi
+                                    if (phiMax < phiMaxSec) inside = false;
+                                }
+                                // case with a
+                                if (inside) {
+                                    ++stInfo.ninside;
+                                    ++chInfo->ninside;
+                                    if (myDebug) { ATH_MSG_DEBUG(" Inside  "); }
+                                } else {
+                                    ++stInfo.noutside;
+                                    ++chInfo->noutside;
+                                    if (myDebug) { ATH_MSG_DEBUG(" Outside "); }
+                                }
+                            }
+
+                            phiMinR = rotatePhi(phiPatMin, rotationFraction);
+                            phiMaxR = rotatePhi(phiPatMax, rotationFraction);
+                            double phiMinPat = phiMinR < phiMaxR ? phiMinR : phiMaxR;
+                            double phiMaxPat = phiMinR > phiMaxR ? phiMinR : phiMaxR;
+
+                            bool insidePat = true;
+                            // easy case
+                            if (phiMinPat > 0 && phiMaxPat > 0) {
+                                if (phiMin > phiMaxPat || phiMax < phiMinPat) insidePat = false;
+                            } else if (phiMinPat < 0 && phiMaxPat < 0) {
+                                // easy case (2), always outside
+                                insidePat = false;
+                            } else {
+                                // finaly check if phiMaxPat large than maxPhi
+                                if (phiMax < phiMaxPat) insidePat = false;
+                            }
+
+                            // case with a
+                            if (insidePat) {
+                                ++stInfo.ninsidePat;
+                                ++chInfo->ninsidePat;
+                                if (myDebug) { ATH_MSG_DEBUG(" InPat  "); }
+                            } else {
+                                ++stInfo.noutsidePat;
+                                ++chInfo->noutsidePat;
+                                if (myDebug) { ATH_MSG_DEBUG(" OutPat "); }
+                            }
+                            if (myDebug) {
+                                ATH_MSG_DEBUG(" : Phi MDT ("
+                                              << std::setprecision(3) << std::setw(4) << phiMin << "," << std::setw(4) << phiMax << ") "
+                                              << " from pos (" << std::setprecision(3) << std::setw(4) << phiMinPos << "," << std::setw(4)
+                                              << phiMaxPos << ") ");
+                                if (stInfo.nphi > 0 && stInfo.phiMin < 1000) {
+                                    ATH_MSG_DEBUG(" phi range (" << std::setprecision(3) << std::setw(4) << stInfo.phiMin << ","
+                                                                 << std::setw(4) << stInfo.phiMax << ")  ");
+                                }
+                                ATH_MSG_DEBUG(" pat range (" << std::setprecision(3) << std::setw(4) << phiMinPat << "," << std::setw(4)
+                                                             << phiMaxPat << ")  " << m_idHelperSvc->toString(prd->identify()));
+                                if (mdtDetEl->hasCutouts()) { ATH_MSG_DEBUG(" hasCutOuts "); }
+                                ATH_MSG_DEBUG(" ATL " << mdtDetEl->getActiveTubeLength(layer, tube) << " WL "
+                                                      << mdtDetEl->getWireLength(layer, tube) << " GL "
+                                                      << mdtDetEl->getGasLength(layer, tube) << " POSL " << tubeL);
+                            }
+                        }
+                    }
                 }
-              }
-
-              phiMinR = rotatePhi(phiPatMin, rotationFraction);
-              phiMaxR = rotatePhi(phiPatMax, rotationFraction);
-              double phiMinPat = phiMinR < phiMaxR ? phiMinR : phiMaxR;
-              double phiMaxPat = phiMinR > phiMaxR ? phiMinR : phiMaxR;
-
-              bool insidePat = true;
-              // easy case
-              if (phiMinPat > 0 && phiMaxPat > 0) {
-                if (phiMin > phiMaxPat || phiMax < phiMinPat)
-                  insidePat = false;
-              } else if (phiMinPat < 0 && phiMaxPat < 0) {
-                // easy case (2), always outside
-                insidePat = false;
-              } else {
-                // finaly check if phiMaxPat large than maxPhi
-                if (phiMax < phiMaxPat)
-                  insidePat = false;
-              }
-
-              // case with a
-              if (insidePat) {
-                ++stInfo.ninsidePat;
-                ++chInfo->ninsidePat;
-                if (myDebug) {
-                  ATH_MSG_DEBUG(" InPat  ");
+
+            }  // eta pattern
+
+            if (!etapattern_passed) continue;  // no etahit close to phipattern, try next phi pattern
+
+            unsigned int netaPhiPairs = 0;
+            if (useTightAssociation) {
+                // now we have calculated the eta/phi hit content of the 'merged'
+                // pattern
+                std::map<Identifier, ChamberInfo>::iterator chit = infoPerChamber.begin();
+                std::map<Identifier, ChamberInfo>::iterator chit_end = infoPerChamber.end();
+                std::map<int, ChamberInfo> hitsPerSector;
+                for (; chit != chit_end; ++chit) {
+                    if (myDebug) {
+                        ATH_MSG_DEBUG("  " << std::setw(32) << m_idHelperSvc->toStringChamber(chit->first) << "  eta hits "
+                                           << chit->second.neta << "  phi hits " << chit->second.nphi << "  ninside  "
+                                           << chit->second.ninside << "  noutside  " << chit->second.noutside << "  ninside  "
+                                           << chit->second.ninsidePat << "  noutside  " << chit->second.noutsidePat);
+                    }
+                    if (chit->second.neta > 0 && chit->second.nphi) ++netaPhiPairs;
                 }
-              } else {
-                ++stInfo.noutsidePat;
-                ++chInfo->noutsidePat;
                 if (myDebug) {
-                  ATH_MSG_DEBUG(" OutPat ");
+                    ATH_MSG_DEBUG(" eta/phi pattern hit overlap " << netaPhiPairs);
+                    if (!etapattern_passed) { ATH_MSG_DEBUG("  failed eta hit match "); }
+                    if (nhits_inside_distance_cut < (phipattern->numberOfContainedPrds() * 0.25)) {
+                        ATH_MSG_DEBUG("  failed phi hit match ");
+                    }
+                    if (netaPhiPairs == 0) { ATH_MSG_DEBUG("  Bad match, no overlap "); }
                 }
-              }
-              if (myDebug) {
-                ATH_MSG_DEBUG(" : Phi MDT ("
-                              << std::setprecision(3) << std::setw(4) << phiMin
-                              << "," << std::setw(4) << phiMax << ") "
-                              << " from pos (" << std::setprecision(3)
-                              << std::setw(4) << phiMinPos << ","
-                              << std::setw(4) << phiMaxPos << ") ");
-                if (stInfo.nphi > 0 && stInfo.phiMin < 1000) {
-                  ATH_MSG_DEBUG(" phi range (" << std::setprecision(3)
-                                               << std::setw(4) << stInfo.phiMin
-                                               << "," << std::setw(4)
-                                               << stInfo.phiMax << ")  ");
+                std::map<int, ChamberInfo>::iterator secIt = hitsPerSector.begin();
+                std::map<int, ChamberInfo>::iterator secIt_end = hitsPerSector.end();
+                for (; secIt != secIt_end; ++secIt) {
+                    if (myDebug) {
+                        ATH_MSG_DEBUG(" sector " << std::setw(4) << secIt->first << "  eta hits " << chit->second.neta << "  phi hits "
+                                                 << chit->second.nphi << "  ninside  " << chit->second.ninside << "  noutside  "
+                                                 << chit->second.noutside << "  ninside  " << chit->second.ninsidePat << "  noutside  "
+                                                 << chit->second.noutsidePat);
+                    }
                 }
-                ATH_MSG_DEBUG(" pat range ("
-                              << std::setprecision(3) << std::setw(4)
-                              << phiMinPat << "," << std::setw(4) << phiMaxPat
-                              << ")  "
-                              << m_idHelperSvc->toString(prd->identify()));
-                if (mdtDetEl->hasCutouts()) {
-                  ATH_MSG_DEBUG(" hasCutOuts ");
+            }
+            if (msgLvl(MSG::DEBUG)) {
+                ATH_MSG_DEBUG(" Eta pattern compatible with phi pattern, eta/phi overlap " << netaPhiPairs << " ass phi hits "
+                                                                                           << nhits_inside_distance_cut << " tot phi hits "
+                                                                                           << phipattern->numberOfContainedPrds());
+                if (useTightAssociation) { ATH_MSG_DEBUG(" using tight association"); }
+            }
+
+            // at least 25% matched, to be more robust than 1!
+            if ((!useTightAssociation || netaPhiPairs > 0) && nhits_inside_distance_cut >= (phipattern->numberOfContainedPrds() * 0.25)) {
+                ismatched = true;
+
+                // for non-cosmics try every candidate
+                // for cosmics keep track of best candidate, possible eff loss when phi
+                // patterns are split
+                if (m_use_cosmics) {
+                    double new_pars[4] = {r0, phi, pattern_z0, theta};
+                    std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*> updatedpatterns =
+                        updatePatternsForCosmics(phipattern, etapattern, new_pars);
+                    phipattern = updatedpatterns.first;
+                    etapattern = updatedpatterns.second;
+
+                    patternsToDelete.push_back(updatedpatterns.first);
+                    patternsToDelete.push_back(updatedpatterns.second);
+                    ATH_MSG_DEBUG(" Combination accepted with cosmic selection ");
+                } else if (useTightAssociation) {
+                    ATH_MSG_DEBUG(" Tight association, cleaning patterns");
+
+                    // clean up hits using local phi info
+                    Muon::MuonPrdPattern* etaPat = new Muon::MuonPrdPattern(etapattern->globalPosition(), etapattern->globalDirection());
+                    Muon::MuonPrdPattern* phiPat = new Muon::MuonPrdPattern(phipattern->globalPosition(), phipattern->globalDirection());
+                    for (unsigned int etahitid = 0; etahitid < etapattern->numberOfContainedPrds(); etahitid++) {
+                        const Trk::PrepRawData* prd = etapattern->prd(etahitid);
+                        const Identifier& id = prd->identify();
+                        Identifier chId = m_idHelperSvc->chamberId(id);
+                        std::map<Identifier, ChamberInfo>::iterator chPos = infoPerChamber.find(chId);
+                        if (chPos == infoPerChamber.end()) continue;
+
+                        if (m_idHelperSvc->isMdt(id)) {
+                            if (chPos->second.ninside == 0 && chPos->second.noutside > 0) continue;
+                            if (chPos->second.ninsidePat == 0 && chPos->second.noutsidePat > 0) continue;
+                        } else {
+                            if (chPos->second.nphi == 0) continue;
+                        }
+                        etaPat->addPrd(prd);
+                    }
+                    for (unsigned int phihitid = 0; phihitid < phipattern->numberOfContainedPrds(); phihitid++) {
+                        const Trk::PrepRawData* prd = phipattern->prd(phihitid);
+                        const Identifier& id = prd->identify();
+                        Identifier chId = m_idHelperSvc->chamberId(id);
+                        std::map<Identifier, ChamberInfo>::iterator chPos = infoPerChamber.find(chId);
+                        if (chPos == infoPerChamber.end()) continue;
+
+                        if (chPos->second.neta == 0) continue;
+                        phiPat->addPrd(prd);
+                    }
+                    patternsToDelete.push_back(etaPat);
+                    patternsToDelete.push_back(phiPat);
+                    phipattern = phiPat;
+                    etapattern = etaPat;
                 }
-                ATH_MSG_DEBUG(" ATL "
-                              << mdtDetEl->getActiveTubeLength(layer, tube)
-                              << " WL " << mdtDetEl->getWireLength(layer, tube)
-                              << " GL " << mdtDetEl->getGasLength(layer, tube)
-                              << " POSL " << tubeL);
-              }
+
+                if (!m_bestphimatch) {
+                    addCandidate(etapattern, phipattern, candidates, false, patternsToDelete, phiEtaHitAssMap);
+                    ATH_MSG_DEBUG("Candidate FOUND eta " << etalevel << " phi " << philevel << " dotprod: " << dotprod);
+                } else {
+                    if (average_distance < min_average_distance) {
+                        ATH_MSG_DEBUG(" Selected as best candidate ");
+                        min_average_distance = average_distance;
+                        max_phipattern = phipattern;
+                        max_philevel = philevel;
+                    }
+                    ATH_MSG_DEBUG(" theta pattern " << etapattern->globalDirection().theta() << " phi "
+                                                    << phipattern->globalDirection().phi() << "average distance " << average_distance
+                                                    << " number of hits " << nhits_inside_distance_cut << " etalevel: " << etalevel);
+                }
+
+                // add recovery for the case we have an inefficiency in the eta hits
+            } else if (useTightAssociation && netaPhiPairs == 0 &&
+                       nhits_inside_distance_cut >= (phipattern->numberOfContainedPrds() * 0.25)) {
+                ATH_MSG_DEBUG(" Combination rejected by phi/eta overlap: average distance " << average_distance);
+
+                if (average_distance < min_average_distance) {
+                    ATH_MSG_DEBUG("  but selected as best candidate ");
+                    min_average_distance = average_distance;
+                    max_phipattern = phipattern;
+                    max_philevel = philevel;
+                }
+            }  // nhits>=25%
+        }      // size phi level
+
+        // for cosmics only match best phi pattern
+        if (m_bestphimatch) {
+            if (ismatched) {
+                //      const Muon::MuonPrdPattern* phipattern =
+                //      phiPatternCollection->at(max_philevel);
+                addCandidate(etapattern, max_phipattern, candidates, true, patternsToDelete, phiEtaHitAssMap);
+                ATH_MSG_DEBUG("Candidate FOUND eta " << etalevel << " phi " << max_philevel);
             }
-          }
         }
+        // make associated phi pattern for every etapattern and as candidate for
+        // robustness not needed for cosmics when matched, since already done for
+        // first match:
+
+        if (!(m_use_cosmics && m_splitpatterns && ismatched)) {
+            const Muon::MuonPrdPattern* assphipattern = makeAssPhiPattern(etapattern, phiEtaHitAssMap, true);
+            ATH_MSG_DEBUG("No match found, trying to create associated phi pattern ");
+            if (assphipattern) {
+                // make sure ass phi pattern is not a complete subset of one of the
+                // other phi patterns:
+
+                bool subsetcheck = false;
+
+                std::reverse_iterator<std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>::iterator> rit =
+                    candidates.rbegin();
+                for (; rit != candidates.rend(); ++rit) {
+                    if ((*rit).first != etapattern) { break; }
+                    // 	    for (;phi_it!=range.second;++phi_it) {
+                    if (subset(assphipattern, (*rit).second)) {
+                        subsetcheck = true;
+                        break;
+                    }
+                }
+                if (subsetcheck) {
+                    delete assphipattern;
+                    assphipattern = nullptr;
+                } else {
+                    // these associated phi patterns should be deleted at end of routine:
+                    patternsToDelete.push_back(assphipattern);
 
-      } // eta pattern
+                    ATH_MSG_DEBUG("Candidate FOUND eta " << etalevel << " and associated phipattern ");
 
-      if (!etapattern_passed)
-        continue; // no etahit close to phipattern, try next phi pattern
+                    ismatched = true;
 
-      unsigned int netaPhiPairs = 0;
-      if (useTightAssociation) {
-        // now we have calculated the eta/phi hit content of the 'merged'
-        // pattern
-        std::map<Identifier, ChamberInfo>::iterator chit =
-          infoPerChamber.begin();
-        std::map<Identifier, ChamberInfo>::iterator chit_end =
-          infoPerChamber.end();
-        std::map<int, ChamberInfo> hitsPerSector;
-        for (; chit != chit_end; ++chit) {
-          if (myDebug) {
-            ATH_MSG_DEBUG("  " << std::setw(32)
-                               << m_idHelperSvc->toStringChamber(chit->first)
-                               << "  eta hits " << chit->second.neta
-                               << "  phi hits " << chit->second.nphi
-                               << "  ninside  " << chit->second.ninside
-                               << "  noutside  " << chit->second.noutside
-                               << "  ninside  " << chit->second.ninsidePat
-                               << "  noutside  " << chit->second.noutsidePat);
-          }
-          if (chit->second.neta > 0 && chit->second.nphi)
-            ++netaPhiPairs;
-        }
-        if (myDebug) {
-          ATH_MSG_DEBUG(" eta/phi pattern hit overlap " << netaPhiPairs);
-          if (!etapattern_passed) {
-            ATH_MSG_DEBUG("  failed eta hit match ");
-          }
-          if (nhits_inside_distance_cut <
-              (phipattern->numberOfContainedPrds() * 0.25)) {
-            ATH_MSG_DEBUG("  failed phi hit match ");
-          }
-          if (netaPhiPairs == 0) {
-            ATH_MSG_DEBUG("  Bad match, no overlap ");
-          }
+                    // print associated pattern:
+                    if (msgLvl(MSG::VERBOSE)) printPattern(assphipattern);
+
+                    if (m_use_cosmics) {
+                        double* new_pars = updateParametersForCosmics(assphipattern, etapattern);
+                        std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*> updatedpatterns =
+                            updatePatternsForCosmics(assphipattern, etapattern, new_pars);
+                        assphipattern = updatedpatterns.first;
+                        etapattern = updatedpatterns.second;
+
+                        patternsToDelete.push_back(updatedpatterns.first);
+                        patternsToDelete.push_back(updatedpatterns.second);
+                        delete[] new_pars;
+                    }
+                    ATH_MSG_DEBUG(" adding eta pattern with recalculated associated phi pattern ");
+
+                    addCandidate(etapattern, assphipattern, candidates, false, patternsToDelete, phiEtaHitAssMap);
+                }
+            }
         }
-        std::map<int, ChamberInfo>::iterator secIt = hitsPerSector.begin();
-        std::map<int, ChamberInfo>::iterator secIt_end = hitsPerSector.end();
-        for (; secIt != secIt_end; ++secIt) {
-          if (myDebug) {
-            ATH_MSG_DEBUG(" sector " << std::setw(4) << secIt->first
-                                     << "  eta hits " << chit->second.neta
-                                     << "  phi hits " << chit->second.nphi
-                                     << "  ninside  " << chit->second.ninside
-                                     << "  noutside  " << chit->second.noutside
-                                     << "  ninside  " << chit->second.ninsidePat
-                                     << "  noutside  "
-                                     << chit->second.noutsidePat);
-          }
+        if (!ismatched && max_philevel > -1) {
+            addCandidate(etapattern, max_phipattern, candidates, true, patternsToDelete, phiEtaHitAssMap);
+            ismatched = true;
+            ATH_MSG_DEBUG("No good candidate found, adding best phi pattern " << etalevel << " phi " << max_philevel);
         }
-      }
-      if (msgLvl(MSG::DEBUG)) {
-        ATH_MSG_DEBUG(
-          " Eta pattern compatible with phi pattern, eta/phi overlap "
-          << netaPhiPairs << " ass phi hits " << nhits_inside_distance_cut
-          << " tot phi hits " << phipattern->numberOfContainedPrds());
-        if (useTightAssociation) {
-          ATH_MSG_DEBUG(" using tight association");
+        if (!ismatched) {
+            if (msgLvl(MSG::DEBUG)) {
+                ATH_MSG_DEBUG("NO COMBINED Candidate FOUND eta " << etalevel << " phi " << phibest);
+                if (!m_use_cosmics) ATH_MSG_DEBUG("dotprodbest: " << dotprodbest);
+                ATH_MSG_DEBUG("writing out eta pattern (no cleanup)");
+            }
+            Muon::MuonPrdPattern* phi_dummy = nullptr;
+            candidates.emplace_back(etapattern, phi_dummy);
+        } else {
+            if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Candidate was associated to a phi pattern ");
         }
-      }
-
-      // at least 25% matched, to be more robust than 1!
-      if ((!useTightAssociation || netaPhiPairs > 0) &&
-          nhits_inside_distance_cut >=
-            (phipattern->numberOfContainedPrds() * 0.25)) {
-        ismatched = true;
-
-        // for non-cosmics try every candidate
-        // for cosmics keep track of best candidate, possible eff loss when phi
-        // patterns are split
-        if (m_use_cosmics) {
-          double new_pars[4] = { r0, phi, pattern_z0, theta };
-          std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>
-            updatedpatterns =
-              updatePatternsForCosmics(phipattern, etapattern, new_pars);
-          phipattern = updatedpatterns.first;
-          etapattern = updatedpatterns.second;
-
-          patternsToDelete.push_back(updatedpatterns.first);
-          patternsToDelete.push_back(updatedpatterns.second);
-          ATH_MSG_DEBUG(" Combination accepted with cosmic selection ");
-        } else if (useTightAssociation) {
-
-          ATH_MSG_DEBUG(" Tight association, cleaning patterns");
-
-          // clean up hits using local phi info
-          Muon::MuonPrdPattern* etaPat = new Muon::MuonPrdPattern(
-            etapattern->globalPosition(), etapattern->globalDirection());
-          Muon::MuonPrdPattern* phiPat = new Muon::MuonPrdPattern(
-            phipattern->globalPosition(), phipattern->globalDirection());
-          for (unsigned int etahitid = 0;
-               etahitid < etapattern->numberOfContainedPrds();
-               etahitid++) {
-            const Trk::PrepRawData* prd = etapattern->prd(etahitid);
-            const Identifier& id = prd->identify();
-            Identifier chId = m_idHelperSvc->chamberId(id);
-            std::map<Identifier, ChamberInfo>::iterator chPos =
-              infoPerChamber.find(chId);
-            if (chPos == infoPerChamber.end())
-              continue;
-
-            if (m_idHelperSvc->isMdt(id)) {
-              if (chPos->second.ninside == 0 && chPos->second.noutside > 0)
-                continue;
-              if (chPos->second.ninsidePat == 0 &&
-                  chPos->second.noutsidePat > 0)
-                continue;
-            } else {
-              if (chPos->second.nphi == 0)
-                continue;
+    }  // size rtheta level
+
+    MuonPrdPatternCollection* combinedpatterns = makeCombinedPatterns(candidates);
+
+    // delete associated and split patterns:
+    std::vector<const Muon::MuonPrdPattern*>::iterator it = patternsToDelete.begin();
+    for (; it != patternsToDelete.end(); ++it) { delete (*it); }
+
+    // release memory:
+    std::vector<const Muon::MuonPrdPattern*>().swap(patternsToDelete);
+
+    return combinedpatterns;
+
+}  // combineEtaPhiPatterns
+
+MuonPrdPatternCollection* MuonCombinePatternTool::makeCombinedPatterns(
+    std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>& candidates) const {
+    ATH_MSG_DEBUG("Number of Candidates: " << candidates.size());
+
+    //  if (m_use_cosmics == true) {
+    cleanCandidates(candidates);
+    ATH_MSG_DEBUG("Number of Candidates after cleaning: " << candidates.size());
+    //}
+
+    MuonPrdPatternCollection* combinedPatternCollection = new MuonPrdPatternCollection();
+    int number_comb_patterns = 0;
+    std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>::iterator it = candidates.begin();
+
+    for (; it != candidates.end(); ++it) {
+        ATH_MSG_DEBUG("Next Candidate");
+
+        const Muon::MuonPrdPattern* etapattern = (*it).first;
+        const Muon::MuonPrdPattern* phipattern = (*it).second;
+
+        if (phipattern) {
+            Muon::MuonPrdPattern* combinedpattern = makeCombinedPattern(phipattern, etapattern);
+            if (combinedpattern) {
+                combinedPatternCollection->push_back(combinedpattern);
+                if (msgLvl(MSG::VERBOSE)) { printPattern(combinedpattern); }
+                number_comb_patterns++;
+            } else
+                ATH_MSG_WARNING("combined pattern lost");
+        } else {  // no combined match found &&  no associated phi hits found
+            if (m_splitpatterns && m_use_cosmics) {
+                ATH_MSG_DEBUG(
+                    "No combined pattern, eta pattern split based on phi "
+                    "direction of eta pattern ");
+
+                std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitetapatterns =
+                    splitPatternsCylinder(nullptr, etapattern);
+                if (splitetapatterns.empty()) {
+                    combinedPatternCollection->push_back(etapattern->clone());
+                } else {
+                    for (unsigned int i = 0; i < splitetapatterns.size(); i++) {
+                        if (splitetapatterns[i].second->numberOfContainedPrds() != 0) {
+                            combinedPatternCollection->push_back(splitetapatterns[i].second);
+                        } else {
+                            delete splitetapatterns[i].second;
+                        }
+                    }
+                }
+            } else {  // don't split pattern
+                ATH_MSG_DEBUG("No combined pattern, eta pattern copied ");
+                Muon::MuonPrdPattern* etapattern_copy =
+                    new Muon::MuonPrdPattern(etapattern->globalPosition(), etapattern->globalDirection());
+                for (unsigned int etahitnr = 0; etahitnr < etapattern->numberOfContainedPrds(); etahitnr++) {
+                    etapattern_copy->addPrd(etapattern->prd(etahitnr));
+                }  // size eta pattern
+                combinedPatternCollection->push_back(etapattern_copy);
+                if (msgLvl(MSG::VERBOSE)) { printPattern(etapattern_copy); }
             }
-            etaPat->addPrd(prd);
-          }
-          for (unsigned int phihitid = 0;
-               phihitid < phipattern->numberOfContainedPrds();
-               phihitid++) {
-            const Trk::PrepRawData* prd = phipattern->prd(phihitid);
-            const Identifier& id = prd->identify();
-            Identifier chId = m_idHelperSvc->chamberId(id);
-            std::map<Identifier, ChamberInfo>::iterator chPos =
-              infoPerChamber.find(chId);
-            if (chPos == infoPerChamber.end())
-              continue;
-
-            if (chPos->second.neta == 0)
-              continue;
-            phiPat->addPrd(prd);
-          }
-          patternsToDelete.push_back(etaPat);
-          patternsToDelete.push_back(phiPat);
-          phipattern = phiPat;
-          etapattern = etaPat;
         }
+    }
+
+    ATH_MSG_DEBUG("Number of combined patterns: " << number_comb_patterns << " Number of unmatched etapatterns: "
+                                                  << combinedPatternCollection->size() - number_comb_patterns);
+
+    return combinedPatternCollection;
+}
+
+Muon::MuonPrdPattern* MuonCombinePatternTool::makeCombinedPattern(const Muon::MuonPrdPattern* phipattern,
+                                                                  const Muon::MuonPrdPattern* etapattern) const {
+    ATH_MSG_DEBUG("make combined pattern");
+
+    double phi = phipattern->globalDirection().phi();
+    double theta = etapattern->globalDirection().theta();
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
+
+    double phieta = etapattern->globalDirection().phi();
+    double eta_x = etapattern->globalPosition().x();
+    double eta_y = etapattern->globalPosition().y();
+    double eta_r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(eta_x, eta_y, phieta);
+    double charge = 1.;
+    if (!m_use_cosmics && eta_r0 < 0) charge = -1.;
+    double curvature = etapattern->globalDirection().mag();
+
+    // Store charge in sign of r0 (like in Muon eta pattern)
+
+    double x0 = charge * (phipattern->globalPosition().x());
+    double y0 = charge * (phipattern->globalPosition().y());
+
+    double z0_phi = 0.;  // for non-cosmics
+
+    if (m_use_cosmics) {  // calculate average z_0 for eta hits
+        z0_phi = calculateRz0(etapattern, phi, theta) / sctheta.sn;
+    }
+
+    const Amg::Vector3D& dir = Amg::Vector3D(curvature * scphi.cs * sctheta.sn, curvature * scphi.sn * sctheta.sn, curvature * sctheta.cs);
+    const Amg::Vector3D& pos = Amg::Vector3D(x0, y0, z0_phi);
+
+    Muon::MuonPrdPattern* combinedpattern = new Muon::MuonPrdPattern(pos, dir);
+
+    for (unsigned int etahitnr = 0; etahitnr < etapattern->numberOfContainedPrds(); etahitnr++) {
+        combinedpattern->addPrd(etapattern->prd(etahitnr));
+    }
+
+    for (unsigned int phihitnr = 0; phihitnr < phipattern->numberOfContainedPrds(); phihitnr++) {
+        //      if
+        //      (!(combinedhoughpattern.hitInHoughPattern(phipattern->getHit(phihitnr))))
+        //      // should not be possible, maybe still good to check this
+        //{
+        combinedpattern->addPrd(phipattern->prd(phihitnr));
+    }  // size phi pattern
+
+    ATH_MSG_DEBUG("Combined pattern with charge " << charge << " curvature " << curvature);
+    ATH_MSG_DEBUG("direction combined pattern: " << scphi.cs * sctheta.sn << " " << scphi.sn * sctheta.sn << " " << sctheta.cs);
+    ATH_MSG_DEBUG("position combined pattern: " << x0 << " " << y0 << " " << z0_phi);
+    ATH_MSG_DEBUG("etapatternsize: " << etapattern->numberOfContainedPrds());
+    ATH_MSG_DEBUG("phipatternsize: " << phipattern->numberOfContainedPrds());
+    ATH_MSG_DEBUG("Combined Track size: " << combinedpattern->numberOfContainedPrds());
+
+    if (m_use_cosmics) {
+        if (msgLvl(MSG::VERBOSE)) ATH_MSG_VERBOSE("No Cleaning for Cosmics!");
+
+        if (msgLvl(MSG::VERBOSE)) { printPattern(combinedpattern); }
+        return combinedpattern;
+    }
+
+    ATH_MSG_DEBUG("Start Cleaning and Recalculating of Combined Pattern");
+
+    bool change = true;
+
+    while (change) {
+        int size_before_cleanup = combinedpattern->numberOfContainedPrds();
+        ATH_MSG_DEBUG("size before cleanup: " << size_before_cleanup);
+
+        Muon::MuonPrdPattern* cleaneduppattern = cleanupCombinedPattern(combinedpattern);
+
+        // swap(cleaneduppattern,combinedpattern);
+        delete combinedpattern;
+        combinedpattern = nullptr;
 
-        if (!m_bestphimatch) {
-          addCandidate(etapattern,
-                       phipattern,
-                       candidates,
-                       false,
-                       patternsToDelete,
-                       phiEtaHitAssMap);
-          ATH_MSG_DEBUG("Candidate FOUND eta " << etalevel << " phi "
-                                               << philevel
-                                               << " dotprod: " << dotprod);
+        int size_after_cleanup = cleaneduppattern->numberOfContainedPrds();
+        ATH_MSG_DEBUG("size after cleanup: " << size_after_cleanup);
+
+        if (size_before_cleanup == size_after_cleanup || size_after_cleanup == 0) {
+            if (msgLvl(MSG::VERBOSE)) { printPattern(cleaneduppattern); }
+            return cleaneduppattern;
+        } else if (size_after_cleanup < size_before_cleanup) {
+            combinedpattern = cleaneduppattern;
         } else {
-          if (average_distance < min_average_distance) {
-            ATH_MSG_DEBUG(" Selected as best candidate ");
-            min_average_distance = average_distance;
-            max_phipattern = phipattern;
-            max_philevel = philevel;
-          }
-          ATH_MSG_DEBUG(" theta pattern "
-                        << etapattern->globalDirection().theta() << " phi "
-                        << phipattern->globalDirection().phi()
-                        << "average distance " << average_distance
-                        << " number of hits " << nhits_inside_distance_cut
-                        << " etalevel: " << etalevel);
+            change = false;
+            ATH_MSG_FATAL("Cosmic Muon through computer bit? ");
         }
+    }  // while
+    return nullptr;
+}  // makeCombinedPattern
 
-        // add recovery for the case we have an inefficiency in the eta hits
-      } else if (useTightAssociation && netaPhiPairs == 0 &&
-                 nhits_inside_distance_cut >=
-                   (phipattern->numberOfContainedPrds() * 0.25)) {
-        ATH_MSG_DEBUG(
-          " Combination rejected by phi/eta overlap: average distance "
-          << average_distance);
-
-        if (average_distance < min_average_distance) {
-          ATH_MSG_DEBUG("  but selected as best candidate ");
-          min_average_distance = average_distance;
-          max_phipattern = phipattern;
-          max_philevel = philevel;
-        }
-      } // nhits>=25%
-    }   // size phi level
-
-    // for cosmics only match best phi pattern
-    if (m_bestphimatch) {
-      if (ismatched) {
-        //      const Muon::MuonPrdPattern* phipattern =
-        //      phiPatternCollection->at(max_philevel);
-        addCandidate(etapattern,
-                     max_phipattern,
-                     candidates,
-                     true,
-                     patternsToDelete,
-                     phiEtaHitAssMap);
-        ATH_MSG_DEBUG("Candidate FOUND eta " << etalevel << " phi "
-                                             << max_philevel);
-      }
+std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> MuonCombinePatternTool::splitPatterns2D(
+    const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern) const {
+    std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitPatterns;
+    splitPatterns.reserve(2);
+
+    double phi = phipattern->globalDirection().phi();
+    double theta = etapattern->globalDirection().theta();
+
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
+
+    Amg::Vector3D dir1 = Amg::Vector3D(scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs);
+    Amg::Vector3D dir2 = dir1;
+
+    Muon::MuonPrdPattern* phipattern1 = new Muon::MuonPrdPattern(phipattern->globalPosition(), dir1);  // "lower" pattern (y<0)
+    Muon::MuonPrdPattern* etapattern1 = new Muon::MuonPrdPattern(etapattern->globalPosition(), dir1);  // "lower" pattern (y<0)
+
+    if (m_flipdirectionforcosmics) {
+        const double newphi = phi + M_PI;
+        const double newtheta = M_PI - etapattern->globalDirection().theta();
+        CxxUtils::sincos scnewphi(newphi);
+        CxxUtils::sincos scnewtheta(newtheta);
+
+        // flip phi and theta for second pattern:
+        dir2 = Amg::Vector3D(scnewphi.cs * scnewtheta.sn, scnewphi.sn * scnewtheta.sn, scnewtheta.cs);
     }
-    // make associated phi pattern for every etapattern and as candidate for
-    // robustness not needed for cosmics when matched, since already done for
-    // first match:
-
-    if (!(m_use_cosmics && m_splitpatterns && ismatched)) {
-      const Muon::MuonPrdPattern* assphipattern =
-        makeAssPhiPattern(etapattern, phiEtaHitAssMap, true);
-      ATH_MSG_DEBUG("No match found, trying to create associated phi pattern ");
-      if (assphipattern) {
-        // make sure ass phi pattern is not a complete subset of one of the
-        // other phi patterns:
-
-        bool subsetcheck = false;
-
-        std::reverse_iterator<
-          std::vector<std::pair<const Muon::MuonPrdPattern*,
-                                const Muon::MuonPrdPattern*>>::iterator>
-          rit = candidates.rbegin();
-        for (; rit != candidates.rend(); ++rit) {
-          if ((*rit).first != etapattern) {
-            break;
-          }
-          // 	    for (;phi_it!=range.second;++phi_it) {
-          if (subset(assphipattern, (*rit).second)) {
-            subsetcheck = true;
-            break;
-          }
+
+    Muon::MuonPrdPattern* phipattern2 = new Muon::MuonPrdPattern(phipattern->globalPosition(), dir2);  // "upper" pattern (y>0)
+    Muon::MuonPrdPattern* etapattern2 = new Muon::MuonPrdPattern(etapattern->globalPosition(), dir2);  // "upper" pattern (y>0)
+
+    ATH_MSG_DEBUG(" split pattern1 theta: " << phipattern1->globalDirection().theta() << " phi: " << phipattern1->globalDirection().phi());
+    ATH_MSG_DEBUG(" split pattern2 theta: " << phipattern2->globalDirection().theta() << " phi: " << phipattern2->globalDirection().phi());
+
+    splitPatterns.emplace_back(phipattern1, etapattern1);
+    splitPatterns.emplace_back(etapattern1, etapattern2);
+
+    for (unsigned int hitid = 0; hitid < phipattern->numberOfContainedPrds(); hitid++) {
+        const Trk::PrepRawData* prd = phipattern->prd(hitid);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        const double hitx = globalposhit.x();
+        const double hity = globalposhit.y();
+        const double dotprod = scphi.apply(hity, hitx);  // hity * scphi.sn + hitx * scphi.cs;
+        if (dotprod >= 0) {
+            phipattern1->addPrd(prd);
+        } else {
+            phipattern2->addPrd(prd);
         }
-        if (subsetcheck) {
-          delete assphipattern;
-          assphipattern = nullptr;
+    }
+    for (unsigned int hitid = 0; hitid < etapattern->numberOfContainedPrds(); hitid++) {
+        const Trk::PrepRawData* prd = etapattern->prd(hitid);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        const double hitx = globalposhit.x();
+        const double hity = globalposhit.y();
+        const double dotprod = scphi.apply(hity, hitx);  // hity * scphi.sn + hitx * scphi.cs;
+        if (dotprod >= 0) {
+            etapattern1->addPrd(prd);
         } else {
-          // these associated phi patterns should be deleted at end of routine:
-          patternsToDelete.push_back(assphipattern);
+            etapattern2->addPrd(prd);
+        }
+    }
 
-          ATH_MSG_DEBUG("Candidate FOUND eta "
-                        << etalevel << " and associated phipattern ");
+    return splitPatterns;
+}
 
-          ismatched = true;
+std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> MuonCombinePatternTool::splitPatterns3D(
+    const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern) const {
+    // phi pattern may be 0
 
-          // print associated pattern:
-          if (msgLvl(MSG::VERBOSE))
-            printPattern(assphipattern);
+    std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitPatterns;
+    splitPatterns.reserve(2);
 
-          if (m_use_cosmics) {
-            double* new_pars =
-              updateParametersForCosmics(assphipattern, etapattern);
-            std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>
-              updatedpatterns =
-                updatePatternsForCosmics(assphipattern, etapattern, new_pars);
-            assphipattern = updatedpatterns.first;
-            etapattern = updatedpatterns.second;
+    // phi and etapattern should have identical directions and positions (except
+    // for z_0), but new built anyway to be robust
 
-            patternsToDelete.push_back(updatedpatterns.first);
-            patternsToDelete.push_back(updatedpatterns.second);
-            delete[] new_pars;
-          }
-          ATH_MSG_DEBUG(
-            " adding eta pattern with recalculated associated phi pattern ");
-
-          addCandidate(etapattern,
-                       assphipattern,
-                       candidates,
-                       false,
-                       patternsToDelete,
-                       phiEtaHitAssMap);
-        }
-      }
-    }
-    if (!ismatched && max_philevel > -1) {
-      addCandidate(etapattern,
-                   max_phipattern,
-                   candidates,
-                   true,
-                   patternsToDelete,
-                   phiEtaHitAssMap);
-      ismatched = true;
-      ATH_MSG_DEBUG("No good candidate found, adding best phi pattern "
-                    << etalevel << " phi " << max_philevel);
+    Amg::Vector3D globalpos;
+    if (phipattern) {
+        globalpos = phipattern->globalPosition();
+    } else {
+        globalpos = etapattern->globalPosition();
     }
-    if (!ismatched) {
-      if (msgLvl(MSG::DEBUG)) {
-        ATH_MSG_DEBUG("NO COMBINED Candidate FOUND eta " << etalevel << " phi "
-                                                         << phibest);
-        if (!m_use_cosmics)
-          ATH_MSG_DEBUG("dotprodbest: " << dotprodbest);
-        ATH_MSG_DEBUG("writing out eta pattern (no cleanup)");
-      }
-      Muon::MuonPrdPattern* phi_dummy = nullptr;
-      candidates.emplace_back(etapattern, phi_dummy);
+
+    double phi;
+    if (phipattern) {
+        phi = phipattern->globalDirection().phi();
     } else {
-      if (msgLvl(MSG::DEBUG))
-        ATH_MSG_DEBUG("Candidate was associated to a phi pattern ");
+        phi = etapattern->globalDirection().phi();
     }
-  } // size rtheta level
 
-  MuonPrdPatternCollection* combinedpatterns = makeCombinedPatterns(candidates);
+    const double theta = etapattern->globalDirection().theta();
 
-  // delete associated and split patterns:
-  std::vector<const Muon::MuonPrdPattern*>::iterator it =
-    patternsToDelete.begin();
-  for (; it != patternsToDelete.end(); ++it) {
-    delete (*it);
-  }
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
 
-  // release memory:
-  std::vector<const Muon::MuonPrdPattern*>().swap(patternsToDelete);
+    Amg::Vector3D dir1 = Amg::Vector3D(scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs);
+    Amg::Vector3D dir2 = dir1;
 
-  return combinedpatterns;
+    if (m_flipdirectionforcosmics) {
+        const double newphi = phi + M_PI;
+        const double newtheta = M_PI - theta;
 
-} // combineEtaPhiPatterns
+        CxxUtils::sincos scnewphi(newphi);
+        CxxUtils::sincos scnewtheta(newtheta);
 
-MuonPrdPatternCollection*
-MuonCombinePatternTool::makeCombinedPatterns(
-  std::vector<std::pair<const Muon::MuonPrdPattern*,
-                        const Muon::MuonPrdPattern*>>& candidates) const
-{
-  ATH_MSG_DEBUG("Number of Candidates: " << candidates.size());
+        // flip phi and theta for second pattern:
+        dir2 = Amg::Vector3D(scnewphi.cs * scnewtheta.sn, scnewphi.sn * scnewtheta.sn, scnewtheta.cs);
+    }
 
-  //  if (m_use_cosmics == true) {
-  cleanCandidates(candidates);
-  ATH_MSG_DEBUG("Number of Candidates after cleaning: " << candidates.size());
-  //}
+    Muon::MuonPrdPattern* etapattern1 = new Muon::MuonPrdPattern(globalpos, dir1);  //
+    Muon::MuonPrdPattern* etapattern2 = new Muon::MuonPrdPattern(globalpos, dir2);  // "upper" pattern (y>0)
+    Muon::MuonPrdPattern* phipattern1 = nullptr;
+    Muon::MuonPrdPattern* phipattern2 = nullptr;
 
-  MuonPrdPatternCollection* combinedPatternCollection =
-    new MuonPrdPatternCollection();
-  int number_comb_patterns = 0;
-  std::vector<std::pair<const Muon::MuonPrdPattern*,
-                        const Muon::MuonPrdPattern*>>::iterator it =
-    candidates.begin();
+    if (phipattern) {
+        phipattern1 = new Muon::MuonPrdPattern(globalpos, dir1);  // "lower" pattern (y<0)
+        phipattern2 = new Muon::MuonPrdPattern(globalpos, dir2);  // "upper" pattern (y>0)
+    }
 
-  for (; it != candidates.end(); ++it) {
-    ATH_MSG_DEBUG("Next Candidate");
+    splitPatterns.emplace_back(phipattern1, etapattern1);
+    splitPatterns.emplace_back(phipattern2, etapattern2);
+
+    if (msgLvl(MSG::DEBUG)) {
+        ATH_MSG_DEBUG(" split pattern theta: " << theta << " phi: " << phi);
+        ATH_MSG_DEBUG(" split pattern1 theta: " << etapattern1->globalDirection().theta()
+                                                << " phi: " << etapattern1->globalDirection().phi());
+        ATH_MSG_DEBUG(" split pattern2 theta: " << etapattern2->globalDirection().theta()
+                                                << " phi: " << etapattern2->globalDirection().phi());
+        std::vector<double> splitpoint =
+            MuonHoughMathUtils::shortestPointOfLineToOrigin(globalpos.x(), globalpos.y(), globalpos.z(), phi, theta);
+        ATH_MSG_DEBUG(" splitpoint, x: " << splitpoint[0] << " y: " << splitpoint[1] << " z: " << splitpoint[2]);
+    }
 
-    const Muon::MuonPrdPattern* etapattern = (*it).first;
-    const Muon::MuonPrdPattern* phipattern = (*it).second;
+    double d_x = scphi.cs * sctheta.sn;
+    double d_y = scphi.sn * sctheta.sn;
 
     if (phipattern) {
-      Muon::MuonPrdPattern* combinedpattern =
-        makeCombinedPattern(phipattern, etapattern);
-      if (combinedpattern) {
-        combinedPatternCollection->push_back(combinedpattern);
-        if (msgLvl(MSG::VERBOSE)) {
-          printPattern(combinedpattern);
-        }
-        number_comb_patterns++;
-      } else
-        ATH_MSG_WARNING("combined pattern lost");
-    } else { // no combined match found &&  no associated phi hits found
-      if (m_splitpatterns && m_use_cosmics) {
-        ATH_MSG_DEBUG("No combined pattern, eta pattern split based on phi "
-                      "direction of eta pattern ");
-
-        std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-          splitetapatterns = splitPatternsCylinder(nullptr, etapattern);
-        if (splitetapatterns.empty()) {
-          combinedPatternCollection->push_back(etapattern->clone());
-        } else {
-          for (unsigned int i = 0; i < splitetapatterns.size(); i++) {
-            if (splitetapatterns[i].second->numberOfContainedPrds() != 0) {
-              combinedPatternCollection->push_back(splitetapatterns[i].second);
+        for (unsigned int hitid = 0; hitid < phipattern->numberOfContainedPrds(); hitid++) {
+            const Trk::PrepRawData* prd = phipattern->prd(hitid);
+            const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+            const double hitx = globalposhit.x();
+            const double hity = globalposhit.y();
+            const double hitz = globalposhit.z();
+            const double dotprod = hitx * d_x + hity * d_y + hitz * sctheta.cs;
+            if (dotprod >= 0) {
+                phipattern1->addPrd(prd);
             } else {
-              delete splitetapatterns[i].second;
+                phipattern2->addPrd(prd);
             }
-          }
+            ATH_MSG_VERBOSE(" dotprod: " << dotprod);
         }
-      } else { // don't split pattern
-        ATH_MSG_DEBUG("No combined pattern, eta pattern copied ");
-        Muon::MuonPrdPattern* etapattern_copy = new Muon::MuonPrdPattern(
-          etapattern->globalPosition(), etapattern->globalDirection());
-        for (unsigned int etahitnr = 0;
-             etahitnr < etapattern->numberOfContainedPrds();
-             etahitnr++) {
-          etapattern_copy->addPrd(etapattern->prd(etahitnr));
-        } // size eta pattern
-        combinedPatternCollection->push_back(etapattern_copy);
-        if (msgLvl(MSG::VERBOSE)) {
-          printPattern(etapattern_copy);
+    }
+
+    for (unsigned int hitid = 0; hitid < etapattern->numberOfContainedPrds(); hitid++) {
+        const Trk::PrepRawData* prd = etapattern->prd(hitid);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        const double hitx = globalposhit.x();
+        const double hity = globalposhit.y();
+        const double hitz = globalposhit.z();
+        const double dotprod = hitx * d_x + hity * d_y + hitz * sctheta.cs;
+        if (dotprod >= 0) {
+            etapattern1->addPrd(prd);
+        } else {
+            etapattern2->addPrd(prd);
         }
-      }
+        ATH_MSG_VERBOSE(" dotprod: " << dotprod);
     }
-  }
 
-  ATH_MSG_DEBUG("Number of combined patterns: "
-                << number_comb_patterns << " Number of unmatched etapatterns: "
-                << combinedPatternCollection->size() - number_comb_patterns);
+    if (msgLvl(MSG::DEBUG)) {
+        if (phipattern) {
+            ATH_MSG_DEBUG("Final size, phi: " << phipattern1->numberOfContainedPrds() << " " << phipattern2->numberOfContainedPrds());
+        }
+        ATH_MSG_DEBUG("Final size, eta: " << etapattern1->numberOfContainedPrds() << " " << etapattern2->numberOfContainedPrds());
+    }
 
-  return combinedPatternCollection;
+    return splitPatterns;
 }
 
-Muon::MuonPrdPattern*
-MuonCombinePatternTool::makeCombinedPattern(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern) const
-{
-  ATH_MSG_DEBUG("make combined pattern");
-
-  double phi = phipattern->globalDirection().phi();
-  double theta = etapattern->globalDirection().theta();
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-
-  double phieta = etapattern->globalDirection().phi();
-  double eta_x = etapattern->globalPosition().x();
-  double eta_y = etapattern->globalPosition().y();
-  double eta_r0 =
-    MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(eta_x, eta_y, phieta);
-  double charge = 1.;
-  if (!m_use_cosmics && eta_r0 < 0)
-    charge = -1.;
-  double curvature = etapattern->globalDirection().mag();
-
-  // Store charge in sign of r0 (like in Muon eta pattern)
-
-  double x0 = charge * (phipattern->globalPosition().x());
-  double y0 = charge * (phipattern->globalPosition().y());
-
-  double z0_phi = 0.; // for non-cosmics
-
-  if (m_use_cosmics) { // calculate average z_0 for eta hits
-    z0_phi = calculateRz0(etapattern, phi, theta) / sctheta.sn;
-  }
-
-  const Amg::Vector3D& dir = Amg::Vector3D(curvature * scphi.cs * sctheta.sn,
-                                           curvature * scphi.sn * sctheta.sn,
-                                           curvature * sctheta.cs);
-  const Amg::Vector3D& pos = Amg::Vector3D(x0, y0, z0_phi);
-
-  Muon::MuonPrdPattern* combinedpattern = new Muon::MuonPrdPattern(pos, dir);
-
-  for (unsigned int etahitnr = 0;
-       etahitnr < etapattern->numberOfContainedPrds();
-       etahitnr++) {
-    combinedpattern->addPrd(etapattern->prd(etahitnr));
-  }
-
-  for (unsigned int phihitnr = 0;
-       phihitnr < phipattern->numberOfContainedPrds();
-       phihitnr++) {
-    //      if
-    //      (!(combinedhoughpattern.hitInHoughPattern(phipattern->getHit(phihitnr))))
-    //      // should not be possible, maybe still good to check this
-    //{
-    combinedpattern->addPrd(phipattern->prd(phihitnr));
-  } // size phi pattern
-
-  ATH_MSG_DEBUG("Combined pattern with charge " << charge << " curvature "
-                                                << curvature);
-  ATH_MSG_DEBUG("direction combined pattern: " << scphi.cs * sctheta.sn << " "
-                                               << scphi.sn * sctheta.sn << " "
-                                               << sctheta.cs);
-  ATH_MSG_DEBUG("position combined pattern: " << x0 << " " << y0 << " "
-                                              << z0_phi);
-  ATH_MSG_DEBUG("etapatternsize: " << etapattern->numberOfContainedPrds());
-  ATH_MSG_DEBUG("phipatternsize: " << phipattern->numberOfContainedPrds());
-  ATH_MSG_DEBUG(
-    "Combined Track size: " << combinedpattern->numberOfContainedPrds());
-
-  if (m_use_cosmics) {
-    if (msgLvl(MSG::VERBOSE))
-      ATH_MSG_VERBOSE("No Cleaning for Cosmics!");
+std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> MuonCombinePatternTool::splitPatternsCylinder(
+    const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern) const {
+    // phi pattern may be 0
+    Amg::Vector3D patternpos;
+    double phi;
 
-    if (msgLvl(MSG::VERBOSE)) {
-      printPattern(combinedpattern);
+    if (phipattern) {
+        patternpos = phipattern->globalPosition();
+        phi = phipattern->globalDirection().phi();
+    } else {
+        patternpos = etapattern->globalPosition();
+        phi = etapattern->globalDirection().phi();
     }
-    return combinedpattern;
-  }
 
-  ATH_MSG_DEBUG("Start Cleaning and Recalculating of Combined Pattern");
+    const double theta = etapattern->globalDirection().theta();
 
-  bool change = true;
+    // decide if track is split:
 
-  while (change) {
-    int size_before_cleanup = combinedpattern->numberOfContainedPrds();
-    ATH_MSG_DEBUG("size before cleanup: " << size_before_cleanup);
+    // calculate intersection with pattern and calorimeter cylinder (r0=4000,
+    // c0=6000) if there is one, then track will be split
 
-    Muon::MuonPrdPattern* cleaneduppattern =
-      cleanupCombinedPattern(combinedpattern);
+    const double x_0 = patternpos.x();
+    const double y_0 = patternpos.y();
+    const double z_0 = patternpos.z();
 
-    // swap(cleaneduppattern,combinedpattern);
-    delete combinedpattern;
-    combinedpattern = nullptr;
+    bool intersect = MuonHoughMathUtils::lineThroughCylinder(x_0, y_0, z_0, phi, theta, MuonHough::radius_cylinder, MuonHough::z_cylinder);
 
-    int size_after_cleanup = cleaneduppattern->numberOfContainedPrds();
-    ATH_MSG_DEBUG("size after cleanup: " << size_after_cleanup);
-
-    if (size_before_cleanup == size_after_cleanup || size_after_cleanup == 0) {
-      if (msgLvl(MSG::VERBOSE)) {
-        printPattern(cleaneduppattern);
-      }
-      return cleaneduppattern;
-    } else if (size_after_cleanup < size_before_cleanup) {
-      combinedpattern = cleaneduppattern;
-    } else {
-      change = false;
-      ATH_MSG_FATAL("Cosmic Muon through computer bit? ");
+    if (!intersect) {  // no split
+        ATH_MSG_DEBUG("Pattern not through calorimeter -> do not split ");
+        return std::vector<std::pair<Muon::MuonPrdPattern*,
+                                     Muon::MuonPrdPattern*>>();  // return empty vector , probably
+                                                                 // better way to save this creation
     }
-  } // while
-  return nullptr;
-} // makeCombinedPattern
-
-std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-MuonCombinePatternTool::splitPatterns2D(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern) const
-{
-  std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-    splitPatterns;
-  splitPatterns.reserve(2);
-
-  double phi = phipattern->globalDirection().phi();
-  double theta = etapattern->globalDirection().theta();
-
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-
-  Amg::Vector3D dir1 =
-    Amg::Vector3D(scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs);
-  Amg::Vector3D dir2 = dir1;
-
-  Muon::MuonPrdPattern* phipattern1 = new Muon::MuonPrdPattern(
-    phipattern->globalPosition(), dir1); // "lower" pattern (y<0)
-  Muon::MuonPrdPattern* etapattern1 = new Muon::MuonPrdPattern(
-    etapattern->globalPosition(), dir1); // "lower" pattern (y<0)
-
-  if (m_flipdirectionforcosmics) {
-    const double newphi = phi + M_PI;
-    const double newtheta = M_PI - etapattern->globalDirection().theta();
-    CxxUtils::sincos scnewphi(newphi);
-    CxxUtils::sincos scnewtheta(newtheta);
-
-    // flip phi and theta for second pattern:
-    dir2 = Amg::Vector3D(
-      scnewphi.cs * scnewtheta.sn, scnewphi.sn * scnewtheta.sn, scnewtheta.cs);
-  }
-
-  Muon::MuonPrdPattern* phipattern2 = new Muon::MuonPrdPattern(
-    phipattern->globalPosition(), dir2); // "upper" pattern (y>0)
-  Muon::MuonPrdPattern* etapattern2 = new Muon::MuonPrdPattern(
-    etapattern->globalPosition(), dir2); // "upper" pattern (y>0)
-
-  ATH_MSG_DEBUG(" split pattern1 theta: "
-                << phipattern1->globalDirection().theta()
-                << " phi: " << phipattern1->globalDirection().phi());
-  ATH_MSG_DEBUG(" split pattern2 theta: "
-                << phipattern2->globalDirection().theta()
-                << " phi: " << phipattern2->globalDirection().phi());
-
-  splitPatterns.emplace_back(phipattern1, etapattern1);
-  splitPatterns.emplace_back(etapattern1, etapattern2);
-
-  for (unsigned int hitid = 0; hitid < phipattern->numberOfContainedPrds();
-       hitid++) {
-    const Trk::PrepRawData* prd = phipattern->prd(hitid);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    const double hitx = globalposhit.x();
-    const double hity = globalposhit.y();
-    const double dotprod =
-      scphi.apply(hity, hitx); // hity * scphi.sn + hitx * scphi.cs;
-    if (dotprod >= 0) {
-      phipattern1->addPrd(prd);
-    } else {
-      phipattern2->addPrd(prd);
+
+    return splitPatterns3D(phipattern, etapattern);
+}
+
+Muon::MuonPrdPattern* MuonCombinePatternTool::cleanupCombinedPattern(Muon::MuonPrdPattern*& combinedpattern) const {
+    const double phipattern = combinedpattern->globalDirection().phi();
+    const double thetapattern = combinedpattern->globalDirection().theta();
+
+    CxxUtils::sincos scthetapattern(thetapattern);
+
+    const Amg::Vector3D& patternpos = combinedpattern->globalPosition();
+    const double posx = patternpos.x();
+    const double posy = patternpos.y();
+    const double posz = patternpos.z();
+
+    double invcurvature = 0.;
+    double r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(posx, posy, phipattern);
+    double charge = 1.;
+    if (r0 < 0) charge = -1.;
+    double curvature = combinedpattern->globalDirection().mag();
+    if (curvature > 2) invcurvature = charge / curvature;
+
+    ATH_MSG_DEBUG("cleaned up pattern: phi " << phipattern << " theta: " << thetapattern << " position: " << posx << " " << posy << " "
+                                             << posz);
+    ATH_MSG_DEBUG("Cleanup pattern charge " << charge << " curvature " << curvature);
+
+    Muon::MuonPrdPattern* combinedpattern_cleaned =
+        new Muon::MuonPrdPattern(combinedpattern->globalPosition(), combinedpattern->globalDirection());
+
+    for (unsigned int hitid = 0; hitid < combinedpattern->numberOfContainedPrds(); hitid++) {
+        const Trk::PrepRawData* prd = combinedpattern->prd(hitid);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        const double hitx = globalposhit.x();
+        const double hity = globalposhit.y();
+        const double hitz = globalposhit.z();
+
+        double r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(posx, posy, phipattern);
+        double distance_xy = MuonHoughMathUtils::distanceToLine(hitx, hity, r0, phipattern);
+        // double distance_rz =1000000.;
+        //       if (m_use_cosmics == true)
+        // 	{
+        //      double radius_hit = std::sqrt(hitx*hitx+hity*hity);
+        double radius_pattern = std::sqrt(posx * posx + posy * posy);
+        double z0 = posz - radius_pattern * scthetapattern.cs / scthetapattern.sn;
+        // 	  double rz0 = z0*std::sin(thetapattern);
+        // 	  distance_rz = -rz0 + std::sin(thetapattern) * hitz -
+        // std::cos(thetapattern) * radius_hit;
+
+        // 	}
+        //       else
+        // 	{
+        double distance_rz = MuonHoughMathUtils::signedDistanceCurvedToHit(z0, thetapattern, invcurvature, hitx, hity, hitz);
+        // 	}
+
+        double scale = std::sqrt(hitx * hitx + hity * hity + hitz * hitz) / 7000.;
+        if (scale < 1) scale = 1.;
+
+        ATH_MSG_VERBOSE("hit: " << hitx << " " << hity << " " << hitz);
+        ATH_MSG_VERBOSE("CLEAN distancetopattern: "
+                        << " dist xy " << distance_xy << " dist rz " << distance_rz << " scale: " << scale);
+        if (std::abs(distance_xy) < scale * m_maximum_xydistance && std::abs(distance_rz) < m_maximum_rzdistance) {
+            combinedpattern_cleaned->addPrd(prd);
+        } else {
+            if (msgLvl(MSG::DEBUG)) {
+                ATH_MSG_DEBUG("Hit discarded: " << hitid << " dis xy " << distance_xy << " dis rz " << distance_rz);
+                ATH_MSG_DEBUG("Hit info: ");
+                m_idHelperSvc->mdtIdHelper().print(prd->identify());
+            }
+        }
     }
-  }
-  for (unsigned int hitid = 0; hitid < etapattern->numberOfContainedPrds();
-       hitid++) {
-    const Trk::PrepRawData* prd = etapattern->prd(hitid);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    const double hitx = globalposhit.x();
-    const double hity = globalposhit.y();
-    const double dotprod =
-      scphi.apply(hity, hitx); // hity * scphi.sn + hitx * scphi.cs;
-    if (dotprod >= 0) {
-      etapattern1->addPrd(prd);
-    } else {
-      etapattern2->addPrd(prd);
+
+    ATH_MSG_DEBUG("size of cleaned pattern: " << combinedpattern_cleaned->numberOfContainedPrds());
+
+    if (combinedpattern_cleaned->numberOfContainedPrds() == 0 && combinedpattern->numberOfContainedPrds() != 0) {
+        ATH_MSG_DEBUG(
+            "cleaned up pattern is empty (should happen only when initially no phi "
+            "pattern found and phi hits are added by ascociation map)");
     }
-  }
 
-  return splitPatterns;
+    return combinedpattern_cleaned;
 }
 
-std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-MuonCombinePatternTool::splitPatterns3D(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern) const
-{
-  // phi pattern may be 0
-
-  std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-    splitPatterns;
-  splitPatterns.reserve(2);
-
-  // phi and etapattern should have identical directions and positions (except
-  // for z_0), but new built anyway to be robust
-
-  Amg::Vector3D globalpos;
-  if (phipattern) {
-    globalpos = phipattern->globalPosition();
-  } else {
-    globalpos = etapattern->globalPosition();
-  }
-
-  double phi;
-  if (phipattern) {
-    phi = phipattern->globalDirection().phi();
-  } else {
-    phi = etapattern->globalDirection().phi();
-  }
-
-  const double theta = etapattern->globalDirection().theta();
-
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-
-  Amg::Vector3D dir1 =
-    Amg::Vector3D(scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs);
-  Amg::Vector3D dir2 = dir1;
-
-  if (m_flipdirectionforcosmics) {
-
-    const double newphi = phi + M_PI;
-    const double newtheta = M_PI - theta;
-
-    CxxUtils::sincos scnewphi(newphi);
-    CxxUtils::sincos scnewtheta(newtheta);
-
-    // flip phi and theta for second pattern:
-    dir2 = Amg::Vector3D(
-      scnewphi.cs * scnewtheta.sn, scnewphi.sn * scnewtheta.sn, scnewtheta.cs);
-  }
-
-  Muon::MuonPrdPattern* etapattern1 =
-    new Muon::MuonPrdPattern(globalpos, dir1); //
-  Muon::MuonPrdPattern* etapattern2 =
-    new Muon::MuonPrdPattern(globalpos, dir2); // "upper" pattern (y>0)
-  Muon::MuonPrdPattern* phipattern1 = nullptr;
-  Muon::MuonPrdPattern* phipattern2 = nullptr;
-
-  if (phipattern) {
-    phipattern1 =
-      new Muon::MuonPrdPattern(globalpos, dir1); // "lower" pattern (y<0)
-    phipattern2 =
-      new Muon::MuonPrdPattern(globalpos, dir2); // "upper" pattern (y>0)
-  }
-
-  splitPatterns.emplace_back(phipattern1, etapattern1);
-  splitPatterns.emplace_back(phipattern2, etapattern2);
-
-  if (msgLvl(MSG::DEBUG)) {
-    ATH_MSG_DEBUG(" split pattern theta: " << theta << " phi: " << phi);
-    ATH_MSG_DEBUG(" split pattern1 theta: "
-                  << etapattern1->globalDirection().theta()
-                  << " phi: " << etapattern1->globalDirection().phi());
-    ATH_MSG_DEBUG(" split pattern2 theta: "
-                  << etapattern2->globalDirection().theta()
-                  << " phi: " << etapattern2->globalDirection().phi());
-    std::vector<double> splitpoint =
-      MuonHoughMathUtils::shortestPointOfLineToOrigin(
-        globalpos.x(), globalpos.y(), globalpos.z(), phi, theta);
-    ATH_MSG_DEBUG(" splitpoint, x: " << splitpoint[0] << " y: " << splitpoint[1]
-                                     << " z: " << splitpoint[2]);
-  }
-
-  double d_x = scphi.cs * sctheta.sn;
-  double d_y = scphi.sn * sctheta.sn;
-
-  if (phipattern) {
-    for (unsigned int hitid = 0; hitid < phipattern->numberOfContainedPrds();
-         hitid++) {
-      const Trk::PrepRawData* prd = phipattern->prd(hitid);
-      const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-      const double hitx = globalposhit.x();
-      const double hity = globalposhit.y();
-      const double hitz = globalposhit.z();
-      const double dotprod = hitx * d_x + hity * d_y + hitz * sctheta.cs;
-      if (dotprod >= 0) {
-        phipattern1->addPrd(prd);
-      } else {
-        phipattern2->addPrd(prd);
-      }
-      ATH_MSG_VERBOSE(" dotprod: " << dotprod);
-    }
-  }
-
-  for (unsigned int hitid = 0; hitid < etapattern->numberOfContainedPrds();
-       hitid++) {
-    const Trk::PrepRawData* prd = etapattern->prd(hitid);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    const double hitx = globalposhit.x();
-    const double hity = globalposhit.y();
-    const double hitz = globalposhit.z();
-    const double dotprod = hitx * d_x + hity * d_y + hitz * sctheta.cs;
-    if (dotprod >= 0) {
-      etapattern1->addPrd(prd);
-    } else {
-      etapattern2->addPrd(prd);
+Muon::MuonPrdPattern* MuonCombinePatternTool::makeAssPhiPattern(
+    const Muon::MuonPrdPattern* muonpattern,
+    /** phi eta association map, eta prds are key*/
+    const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap,
+    bool check_already_on_pattern) const {
+    // bool hits_added = false;
+    const unsigned int size = muonpattern->numberOfContainedPrds();
+
+    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hits;
+    if (check_already_on_pattern) {
+        for (unsigned int i = 0; i < size; i++) { hits.insert(muonpattern->prd(i)); }
     }
-    ATH_MSG_VERBOSE(" dotprod: " << dotprod);
-  }
+    std::vector<const Trk::PrepRawData*> phihits;
+    phihits.reserve(20);  // just a sophisticated guess
 
-  if (msgLvl(MSG::DEBUG)) {
-    if (phipattern) {
-      ATH_MSG_DEBUG("Final size, phi: "
-                    << phipattern1->numberOfContainedPrds() << " "
-                    << phipattern2->numberOfContainedPrds());
+    std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::const_iterator it;
+    for (unsigned int i = 0; i < size; i++) {
+        const Trk::PrepRawData* prd = muonpattern->prd(i);
+        // check on type of prd?
+        const Muon::MuonCluster* muoncluster = dynamic_cast<const Muon::MuonCluster*>(prd);
+        if (muoncluster) {
+            // test on measuresphi?
+            it = phiEtaHitAssMap->find(prd);
+            if (it != phiEtaHitAssMap->end()) {  // check if hit has associated hit
+                std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator set_it = (*it).second.begin();
+                for (; set_it != (*it).second.end(); ++set_it) {
+                    if (!check_already_on_pattern || hits.find(*set_it) == hits.end()) {  // check if associated hit already in pattern
+                        phihits.push_back(*set_it);
+                        if (check_already_on_pattern) { hits.insert(*set_it); }
+                        ATH_MSG_VERBOSE("Associated Phi Hit Added to Pattern");
+                        // hits_added = true;
+                    }
+                }
+            }
+        }
     }
-    ATH_MSG_DEBUG("Final size, eta: " << etapattern1->numberOfContainedPrds()
-                                      << " "
-                                      << etapattern2->numberOfContainedPrds());
-  }
+    Muon::MuonPrdPattern* phipattern = nullptr;
 
-  return splitPatterns;
-}
+    if (phihits.empty()) { return phipattern; }
 
-std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-MuonCombinePatternTool::splitPatternsCylinder(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern) const
-{
-  // phi pattern may be 0
-  Amg::Vector3D patternpos;
-  double phi;
-
-  if (phipattern) {
-    patternpos = phipattern->globalPosition();
-    phi = phipattern->globalDirection().phi();
-  } else {
-    patternpos = etapattern->globalPosition();
-    phi = etapattern->globalDirection().phi();
-  }
-
-  const double theta = etapattern->globalDirection().theta();
-
-  // decide if track is split:
-
-  // calculate intersection with pattern and calorimeter cylinder (r0=4000,
-  // c0=6000) if there is one, then track will be split
-
-  const double x_0 = patternpos.x();
-  const double y_0 = patternpos.y();
-  const double z_0 = patternpos.z();
-
-  bool intersect =
-    MuonHoughMathUtils::lineThroughCylinder(x_0,
-                                             y_0,
-                                             z_0,
-                                             phi,
-                                             theta,
-                                             MuonHough::radius_cylinder,
-                                             MuonHough::z_cylinder);
-
-  if (!intersect) { // no split
-    ATH_MSG_DEBUG("Pattern not through calorimeter -> do not split ");
-    return std::vector<
-      std::pair<Muon::MuonPrdPattern*,
-                Muon::MuonPrdPattern*>>(); // return empty vector , probably
-                                           // better way to save this creation
-  }
-
-  return splitPatterns3D(phipattern, etapattern);
-}
+    std::vector<const Trk::PrepRawData*>::iterator vec_it = phihits.begin();
+    double phi = 0., sin_phi = 0., cos_phi = 0.;
+    if (m_use_cosmics) {
+        phi = muonpattern->globalDirection().phi();
+    } else {
+        for (; vec_it != phihits.end(); ++vec_it) {
+            const Amg::Vector3D& globalposhit = globalPrdPos(*vec_it);
+            const double hitx = globalposhit.x();
+            const double hity = globalposhit.y();
+            const double phihit = std::atan2(hity, hitx);
+            CxxUtils::sincos scphihit(phihit);
+            sin_phi += scphihit.sn;
+            cos_phi += scphihit.cs;
+        }
+        phi = std::atan2(sin_phi, cos_phi);
+    }
 
-Muon::MuonPrdPattern*
-MuonCombinePatternTool::cleanupCombinedPattern(
-  Muon::MuonPrdPattern*& combinedpattern) const
-{
-  const double phipattern = combinedpattern->globalDirection().phi();
-  const double thetapattern = combinedpattern->globalDirection().theta();
-
-  CxxUtils::sincos scthetapattern(thetapattern);
-
-  const Amg::Vector3D& patternpos = combinedpattern->globalPosition();
-  const double posx = patternpos.x();
-  const double posy = patternpos.y();
-  const double posz = patternpos.z();
-
-  double invcurvature = 0.;
-  double r0 =
-    MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(posx, posy, phipattern);
-  double charge = 1.;
-  if (r0 < 0)
-    charge = -1.;
-  double curvature = combinedpattern->globalDirection().mag();
-  if (curvature > 2)
-    invcurvature = charge / curvature;
-
-  ATH_MSG_DEBUG("cleaned up pattern: phi "
-                << phipattern << " theta: " << thetapattern
-                << " position: " << posx << " " << posy << " " << posz);
-  ATH_MSG_DEBUG("Cleanup pattern charge " << charge << " curvature "
-                                          << curvature);
-
-  Muon::MuonPrdPattern* combinedpattern_cleaned = new Muon::MuonPrdPattern(
-    combinedpattern->globalPosition(), combinedpattern->globalDirection());
-
-  for (unsigned int hitid = 0; hitid < combinedpattern->numberOfContainedPrds();
-       hitid++) {
-    const Trk::PrepRawData* prd = combinedpattern->prd(hitid);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    const double hitx = globalposhit.x();
-    const double hity = globalposhit.y();
-    const double hitz = globalposhit.z();
-
-    double r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(
-      posx, posy, phipattern);
-    double distance_xy =
-      MuonHoughMathUtils::distanceToLine(hitx, hity, r0, phipattern);
-    // double distance_rz =1000000.;
-    //       if (m_use_cosmics == true)
-    // 	{
-    //      double radius_hit = std::sqrt(hitx*hitx+hity*hity);
-    double radius_pattern = std::sqrt(posx * posx + posy * posy);
-    double z0 = posz - radius_pattern * scthetapattern.cs / scthetapattern.sn;
-    // 	  double rz0 = z0*std::sin(thetapattern);
-    // 	  distance_rz = -rz0 + std::sin(thetapattern) * hitz -
-    // std::cos(thetapattern) * radius_hit;
-
-    // 	}
-    //       else
-    // 	{
-    double distance_rz = MuonHoughMathUtils::signedDistanceCurvedToHit(
-      z0, thetapattern, invcurvature, hitx, hity, hitz);
-    // 	}
-
-    double scale = std::sqrt(hitx * hitx + hity * hity + hitz * hitz) / 7000.;
-    if (scale < 1)
-      scale = 1.;
-
-    ATH_MSG_VERBOSE("hit: " << hitx << " " << hity << " " << hitz);
-    ATH_MSG_VERBOSE("CLEAN distancetopattern: "
-                    << " dist xy " << distance_xy << " dist rz " << distance_rz
-                    << " scale: " << scale);
-    if (std::abs(distance_xy) < scale * m_maximum_xydistance &&
-        std::abs(distance_rz) < m_maximum_rzdistance) {
-      combinedpattern_cleaned->addPrd(prd);
+    const double curvature = muonpattern->globalDirection().mag();
+    const double theta = muonpattern->globalDirection().theta();
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
+
+    if (m_use_cosmics) {
+        phipattern = new Muon::MuonPrdPattern(muonpattern->globalPosition(), muonpattern->globalDirection());
     } else {
-      if (msgLvl(MSG::DEBUG)) {
-        ATH_MSG_DEBUG("Hit discarded: " << hitid << " dis xy " << distance_xy
-                                        << " dis rz " << distance_rz);
-        ATH_MSG_DEBUG("Hit info: ");
-        m_idHelperSvc->mdtIdHelper().print(prd->identify());
-      }
+        const Amg::Vector3D& globalpos = Amg::Vector3D(0.001, 0.001, 0.);
+        const Amg::Vector3D& globaldir =
+            Amg::Vector3D(curvature * scphi.cs * sctheta.sn, curvature * scphi.sn * sctheta.sn, curvature * sctheta.cs);
+        phipattern = new Muon::MuonPrdPattern(globalpos, globaldir);
     }
-  }
 
-  ATH_MSG_DEBUG("size of cleaned pattern: "
-                << combinedpattern_cleaned->numberOfContainedPrds());
+    vec_it = phihits.begin();
+    for (; vec_it != phihits.end(); ++vec_it) { phipattern->addPrd(*vec_it); }
 
-  if (combinedpattern_cleaned->numberOfContainedPrds() == 0 &&
-      combinedpattern->numberOfContainedPrds() != 0) {
-    ATH_MSG_DEBUG(
-      "cleaned up pattern is empty (should happen only when initially no phi "
-      "pattern found and phi hits are added by ascociation map)");
-  }
+    // perform cleaning on newly created phipattern:
+    Muon::MuonPrdPattern* phipatternclean = cleanPhiPattern(phipattern);
+    delete phipattern;
 
-  return combinedpattern_cleaned;
+    if (phipatternclean->numberOfContainedPrds() <= 0) {
+        delete phipatternclean;
+        return nullptr;
+    }
+    return phipatternclean;
 }
 
-Muon::MuonPrdPattern*
-MuonCombinePatternTool::makeAssPhiPattern(
-  const Muon::MuonPrdPattern* muonpattern,
-  /** phi eta association map, eta prds are key*/
-  const std::map<const Trk::PrepRawData*,
-                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phiEtaHitAssMap,
-  bool check_already_on_pattern) const
-{
-  // bool hits_added = false;
-  const unsigned int size = muonpattern->numberOfContainedPrds();
-
-  std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hits;
-  if (check_already_on_pattern) {
-    for (unsigned int i = 0; i < size; i++) {
-      hits.insert(muonpattern->prd(i));
+double* MuonCombinePatternTool::updateParametersForCosmics(const Muon::MuonPrdPattern* phipattern,
+                                                           const Muon::MuonPrdPattern* etapattern) const {
+    // method returns r0, phi, rz0, theta
+
+    const unsigned int etasize = etapattern->numberOfContainedPrds();
+    const unsigned int phisize = phipattern->numberOfContainedPrds();
+
+    const Amg::Vector3D& etaglobalpos = etapattern->globalPosition();
+    const Amg::Vector3D& etaglobaldir = etapattern->globalDirection();
+
+    const Amg::Vector3D& phiglobalpos = phipattern->globalPosition();
+    const Amg::Vector3D& phiglobaldir = phipattern->globalDirection();
+
+    double* old_pars = new double[4];
+
+    old_pars[0] = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(phiglobalpos.x(), phiglobalpos.y(), phiglobaldir.phi());
+    old_pars[1] = phiglobaldir.phi();
+
+    const double theta_orig = etaglobaldir.theta();
+    old_pars[2] = etaglobalpos.z() * std::sin(theta_orig);
+    old_pars[3] = theta_orig;
+
+    if (phisize + etasize <= 1) return old_pars;
+
+    // first calculate new phi, r0 (initial value , -Pi/2):
+    std::pair<double, double> rphi_start = calculateR0Phi(phipattern, etapattern);
+    // for stabilising (can be cpu-optimised greatly):
+    std::pair<double, double> rphi = calculateR0Phi(phipattern, etapattern, rphi_start.first);
+
+    if (msgLvl(MSG::DEBUG) && std::abs(std::sin(rphi.first - rphi_start.first)) > 0.15 &&
+        std::abs(std::sin(etaglobaldir.phi() - phiglobaldir.phi())) < 0.15) {
+        ATH_MSG_DEBUG("unexpected phi change!");
+        ATH_MSG_DEBUG("phi first: " << rphi_start.first << " phi second: " << rphi.first);
+        ATH_MSG_DEBUG("phi etapattern: " << etaglobaldir.phi() << " phi phipattern: " << phiglobaldir.phi());
     }
-  }
-  std::vector<const Trk::PrepRawData*> phihits;
-  phihits.reserve(20); // just a sophisticated guess
-
-  std::map<const Trk::PrepRawData*,
-           std::set<const Trk::PrepRawData*,
-                    Muon::IdentifierPrdLess>>::const_iterator it;
-  for (unsigned int i = 0; i < size; i++) {
-    const Trk::PrepRawData* prd = muonpattern->prd(i);
-    // check on type of prd?
-    const Muon::MuonCluster* muoncluster =
-      dynamic_cast<const Muon::MuonCluster*>(prd);
-    if (muoncluster) {
-      // test on measuresphi?
-      it = phiEtaHitAssMap->find(prd);
-      if (it != phiEtaHitAssMap->end()) { // check if hit has associated hit
-        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator
-          set_it = (*it).second.begin();
-        for (; set_it != (*it).second.end(); ++set_it) {
-          if (!check_already_on_pattern ||
-              hits.find(*set_it) ==
-                hits.end()) { // check if associated hit already in pattern
-            phihits.push_back(*set_it);
-            if (check_already_on_pattern) {
-              hits.insert(*set_it);
-            }
-            ATH_MSG_VERBOSE("Associated Phi Hit Added to Pattern");
-            // hits_added = true;
-          }
-        }
-      }
+
+    const double phi = rphi.first;
+    const double r0 = rphi.second;
+
+    CxxUtils::sincos scphi(phi);
+
+    // calculate new theta and rz0: (not using phi hits this time, as eta pattern
+    // is larger in general
+
+    double av_radii = 0.;
+    double av_z = 0.;
+
+    for (unsigned int i = 0; i < etasize; i++) {
+        const Trk::PrepRawData* prd = etapattern->prd(i);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        av_radii += scphi.apply(globalposhit.y(),
+                                globalposhit.x());  // globalposhit.x()*scphi.cs + globalposhit.y()*scphi.sn;
+        av_z += globalposhit.z();
     }
-  }
-  Muon::MuonPrdPattern* phipattern = nullptr;
-
-  if (phihits.empty()) {
-    return phipattern;
-  }
-
-  std::vector<const Trk::PrepRawData*>::iterator vec_it = phihits.begin();
-  double phi = 0., sin_phi = 0., cos_phi = 0.;
-  if (m_use_cosmics) {
-    phi = muonpattern->globalDirection().phi();
-  } else {
-    for (; vec_it != phihits.end(); ++vec_it) {
-      const Amg::Vector3D& globalposhit = globalPrdPos(*vec_it);
-      const double hitx = globalposhit.x();
-      const double hity = globalposhit.y();
-      const double phihit = std::atan2(hity, hitx);
-      CxxUtils::sincos scphihit(phihit);
-      sin_phi += scphihit.sn;
-      cos_phi += scphihit.cs;
+
+    if (etasize > 0) {
+        av_radii /= etasize;
+        av_z /= etasize;
     }
-    phi = std::atan2(sin_phi, cos_phi);
-  }
-
-  const double curvature = muonpattern->globalDirection().mag();
-  const double theta = muonpattern->globalDirection().theta();
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-
-  if (m_use_cosmics) {
-    phipattern = new Muon::MuonPrdPattern(muonpattern->globalPosition(),
-                                          muonpattern->globalDirection());
-  } else {
-    const Amg::Vector3D& globalpos = Amg::Vector3D(0.001, 0.001, 0.);
-    const Amg::Vector3D& globaldir =
-      Amg::Vector3D(curvature * scphi.cs * sctheta.sn,
-                    curvature * scphi.sn * sctheta.sn,
-                    curvature * sctheta.cs);
-    phipattern = new Muon::MuonPrdPattern(globalpos, globaldir);
-  }
-
-  vec_it = phihits.begin();
-  for (; vec_it != phihits.end(); ++vec_it) {
-    phipattern->addPrd(*vec_it);
-  }
-
-  // perform cleaning on newly created phipattern:
-  Muon::MuonPrdPattern* phipatternclean = cleanPhiPattern(phipattern);
-  delete phipattern;
-
-  if (phipatternclean->numberOfContainedPrds() <= 0) {
-    delete phipatternclean;
-    return nullptr;
-  }
-  return phipatternclean;
-}
+    double sumr = 0.;
+    double sumz = 0.;
+    for (unsigned int i = 0; i < etasize; i++) {
+        const Trk::PrepRawData* prd = etapattern->prd(i);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
 
-double*
-MuonCombinePatternTool::updateParametersForCosmics(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern) const
-{
-  // method returns r0, phi, rz0, theta
-
-  const unsigned int etasize = etapattern->numberOfContainedPrds();
-  const unsigned int phisize = phipattern->numberOfContainedPrds();
-
-  const Amg::Vector3D& etaglobalpos = etapattern->globalPosition();
-  const Amg::Vector3D& etaglobaldir = etapattern->globalDirection();
-
-  const Amg::Vector3D& phiglobalpos = phipattern->globalPosition();
-  const Amg::Vector3D& phiglobaldir = phipattern->globalDirection();
-
-  double* old_pars = new double[4];
-
-  old_pars[0] = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(
-    phiglobalpos.x(), phiglobalpos.y(), phiglobaldir.phi());
-  old_pars[1] = phiglobaldir.phi();
-
-  const double theta_orig = etaglobaldir.theta();
-  old_pars[2] = etaglobalpos.z() * std::sin(theta_orig);
-  old_pars[3] = theta_orig;
-
-  if (phisize + etasize <= 1)
-    return old_pars;
-
-  // first calculate new phi, r0 (initial value , -Pi/2):
-  std::pair<double, double> rphi_start = calculateR0Phi(phipattern, etapattern);
-  // for stabilising (can be cpu-optimised greatly):
-  std::pair<double, double> rphi =
-    calculateR0Phi(phipattern, etapattern, rphi_start.first);
-
-  if (msgLvl(MSG::DEBUG) &&
-      std::abs(std::sin(rphi.first - rphi_start.first)) > 0.15 &&
-      std::abs(std::sin(etaglobaldir.phi() - phiglobaldir.phi())) < 0.15) {
-    ATH_MSG_DEBUG("unexpected phi change!");
-    ATH_MSG_DEBUG("phi first: " << rphi_start.first
-                                << " phi second: " << rphi.first);
-    ATH_MSG_DEBUG("phi etapattern: " << etaglobaldir.phi()
-                                     << " phi phipattern: "
-                                     << phiglobaldir.phi());
-  }
-
-  const double phi = rphi.first;
-  const double r0 = rphi.second;
-
-  CxxUtils::sincos scphi(phi);
-
-  // calculate new theta and rz0: (not using phi hits this time, as eta pattern
-  // is larger in general
-
-  double av_radii = 0.;
-  double av_z = 0.;
-
-  for (unsigned int i = 0; i < etasize; i++) {
-    const Trk::PrepRawData* prd = etapattern->prd(i);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    av_radii += scphi.apply(
-      globalposhit.y(),
-      globalposhit
-        .x()); // globalposhit.x()*scphi.cs + globalposhit.y()*scphi.sn;
-    av_z += globalposhit.z();
-  }
-
-  if (etasize > 0) {
-    av_radii /= etasize;
-    av_z /= etasize;
-  }
-  double sumr = 0.;
-  double sumz = 0.;
-  for (unsigned int i = 0; i < etasize; i++) {
-    const Trk::PrepRawData* prd = etapattern->prd(i);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-
-    double hitx = globalposhit.x();
-    double hity = globalposhit.y();
-    double hitz = globalposhit.z();
-    double radius = scphi.apply(hity, hitx); // hitx*scphi.cs + hity*scphi.sn;
-    double r_offset = radius - av_radii;
-    double z_offset = hitz - av_z;
-    double weight = r_offset * r_offset + z_offset * z_offset;
-    int sign = 1;
-    if (r_offset * std::cos(theta_orig) + z_offset * std::sin(theta_orig) < 0) {
-      sign = -1;
+        double hitx = globalposhit.x();
+        double hity = globalposhit.y();
+        double hitz = globalposhit.z();
+        double radius = scphi.apply(hity, hitx);  // hitx*scphi.cs + hity*scphi.sn;
+        double r_offset = radius - av_radii;
+        double z_offset = hitz - av_z;
+        double weight = r_offset * r_offset + z_offset * z_offset;
+        int sign = 1;
+        if (r_offset * std::cos(theta_orig) + z_offset * std::sin(theta_orig) < 0) { sign = -1; }
+        sumr += weight * sign * r_offset;
+        sumz += weight * sign * z_offset;
     }
-    sumr += weight * sign * r_offset;
-    sumz += weight * sign * z_offset;
-  }
 
-  //  const double sum_tan = sum_tanweight/sum_weight;
+    //  const double sum_tan = sum_tanweight/sum_weight;
 
-  ATH_MSG_VERBOSE("av_z : " << av_z << " av_radii: " << av_radii
-                            << " sumr: " << sumr << " sumz: " << sumz);
-  if (std::abs(sumr) < 0.000001 || std::abs(sumz) < 0.000001)
-    return old_pars;
+    ATH_MSG_VERBOSE("av_z : " << av_z << " av_radii: " << av_radii << " sumr: " << sumr << " sumz: " << sumz);
+    if (std::abs(sumr) < 0.000001 || std::abs(sumz) < 0.000001) return old_pars;
 
-  double theta = std::atan2(sumr, sumz);
+    double theta = std::atan2(sumr, sumz);
 
-  if (theta < 0)
-    theta += M_PI;
+    if (theta < 0) theta += M_PI;
 
-  double rz0 = calculateRz0(etapattern, phi, theta);
+    double rz0 = calculateRz0(etapattern, phi, theta);
 
-  // ATH_MSG_DEBUG("old method rz0: " << sctheta.apply(av_z,-av_radii) );
-  // const double rz0 = sctheta.apply(av_z,-av_radii); // (av_z * sctheta.sn) -
-  // av_radii * sctheta.cs;
+    // ATH_MSG_DEBUG("old method rz0: " << sctheta.apply(av_z,-av_radii) );
+    // const double rz0 = sctheta.apply(av_z,-av_radii); // (av_z * sctheta.sn) -
+    // av_radii * sctheta.cs;
 
-  double* new_pars = new double[4];
+    double* new_pars = new double[4];
 
-  new_pars[0] = r0;
-  new_pars[1] = phi;
-  new_pars[2] = rz0;
-  new_pars[3] = theta;
+    new_pars[0] = r0;
+    new_pars[1] = phi;
+    new_pars[2] = rz0;
+    new_pars[3] = theta;
 
-  ATH_MSG_DEBUG("updated parameters: r0: "
-                << new_pars[0] << " phi: " << new_pars[1]
-                << " rz0: " << new_pars[2] << " theta: " << new_pars[3]);
-  ATH_MSG_DEBUG("old parameters: r0: " << old_pars[0] << " phi: " << old_pars[1]
-                                       << " rz0: " << old_pars[2]
-                                       << " theta: " << old_pars[3]);
+    ATH_MSG_DEBUG("updated parameters: r0: " << new_pars[0] << " phi: " << new_pars[1] << " rz0: " << new_pars[2]
+                                             << " theta: " << new_pars[3]);
+    ATH_MSG_DEBUG("old parameters: r0: " << old_pars[0] << " phi: " << old_pars[1] << " rz0: " << old_pars[2] << " theta: " << old_pars[3]);
 
-  if (msgLvl(MSG::VERBOSE)) {
-    ATH_MSG_VERBOSE("phisize: " << phisize << " etasize: " << etasize);
-    for (unsigned int i = 0; i < phisize; i++) {
-      const Trk::PrepRawData* prd = phipattern->prd(i);
-      const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-      double hitx = globalposhit.x();
-      double hity = globalposhit.y();
-      double distance =
-        MuonHoughMathUtils::signedDistanceToLine(hitx, hity, r0, phi);
-      ATH_MSG_VERBOSE("distance to updated parameters in xy: " << distance);
-      distance = MuonHoughMathUtils::signedDistanceToLine(
-        hitx, hity, old_pars[0], old_pars[1]);
-      ATH_MSG_VERBOSE("old distance phi hit: " << distance);
+    if (msgLvl(MSG::VERBOSE)) {
+        ATH_MSG_VERBOSE("phisize: " << phisize << " etasize: " << etasize);
+        for (unsigned int i = 0; i < phisize; i++) {
+            const Trk::PrepRawData* prd = phipattern->prd(i);
+            const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+            double hitx = globalposhit.x();
+            double hity = globalposhit.y();
+            double distance = MuonHoughMathUtils::signedDistanceToLine(hitx, hity, r0, phi);
+            ATH_MSG_VERBOSE("distance to updated parameters in xy: " << distance);
+            distance = MuonHoughMathUtils::signedDistanceToLine(hitx, hity, old_pars[0], old_pars[1]);
+            ATH_MSG_VERBOSE("old distance phi hit: " << distance);
+        }
+        for (unsigned int i = 0; i < etasize; i++) {
+            const Trk::PrepRawData* prd = etapattern->prd(i);
+            const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+            double hitx = globalposhit.x();
+            double hity = globalposhit.y();
+            double distance = MuonHoughMathUtils::signedDistanceToLine(hitx, hity, r0, phi);
+            ATH_MSG_VERBOSE("distance to updated parameters in xy: " << distance);
+            distance = MuonHoughMathUtils::signedDistanceToLine(hitx, hity, old_pars[0], old_pars[1]);
+            ATH_MSG_VERBOSE("old distance eta hit: " << distance);
+        }
+        for (unsigned int i = 0; i < etasize; i++) {
+            const Trk::PrepRawData* prd = etapattern->prd(i);
+            const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+            double hitz = globalposhit.z();
+            double perp = scphi.apply(globalposhit.y(),
+                                      globalposhit.x());  // globalposhit.x()*scphi.cs + globalposhit.y()*scphi.sn;
+            double distance = MuonHoughMathUtils::signedDistanceToLine(hitz, perp, rz0, theta);
+            ATH_MSG_VERBOSE("distance to updated parameters in Rz: " << distance);
+            distance = MuonHoughMathUtils::signedDistanceToLine(hitz, perp, old_pars[2], old_pars[3]);
+            ATH_MSG_VERBOSE("old distance: " << distance);
+        }
     }
+
+    delete[] old_pars;
+    return new_pars;
+}
+
+std::pair<double, double> MuonCombinePatternTool::calculateR0Phi(const Muon::MuonPrdPattern* phipattern,
+                                                                 const Muon::MuonPrdPattern* etapattern, double phi_est) const {
+    // use eta pattern as well, since phi patterns consist sometimes of only 1
+    // station etahit error 200mrad (2Pi/16*2), phi hit 20mrad (should be hough
+    // binsize (18 mrad), but prefer ~ factor 10 for stabilility)
+
+    // test if lever_arm > 2 m before updating , if not old values are used
+
+    ATH_MSG_VERBOSE("calculateR0Phi");
+
+    CxxUtils::sincos scphi_est(phi_est);
+
+    const unsigned int etasize = etapattern->numberOfContainedPrds();
+    const unsigned int phisize = phipattern->numberOfContainedPrds();
+
+    const Amg::Vector3D& etaglobaldir = etapattern->globalDirection();
+    const double phi_etapattern = etaglobaldir.phi();
+    CxxUtils::sincos scphi_eta(phi_etapattern);
+
+    const Amg::Vector3D& phiglobaldir = phipattern->globalDirection();
+    const Amg::Vector3D& phiglobalpos = phipattern->globalPosition();
+    const double phi_phipattern = phiglobaldir.phi();
+    CxxUtils::sincos scphi_phi(phi_phipattern);
+
+    const double phi_error_inv = 1. / 20.;
+    const double phi_error_inv2 = phi_error_inv * phi_error_inv;
+    const double eta_error_inv = 1. / 400.;
+    const double eta_error_inv2 = eta_error_inv * eta_error_inv;
+
+    // from MuonHoughPattern::updateParametersRPhi (partial code duplication.. :(
+    // )
+
+    double sum_etax = 0., sum_etay = 0., sum_phix = 0., sum_phiy = 0.;
+
+    // calculate average point
+
     for (unsigned int i = 0; i < etasize; i++) {
-      const Trk::PrepRawData* prd = etapattern->prd(i);
-      const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-      double hitx = globalposhit.x();
-      double hity = globalposhit.y();
-      double distance =
-        MuonHoughMathUtils::signedDistanceToLine(hitx, hity, r0, phi);
-      ATH_MSG_VERBOSE("distance to updated parameters in xy: " << distance);
-      distance = MuonHoughMathUtils::signedDistanceToLine(
-        hitx, hity, old_pars[0], old_pars[1]);
-      ATH_MSG_VERBOSE("old distance eta hit: " << distance);
+        const Trk::PrepRawData* prd = etapattern->prd(i);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        sum_etax += globalposhit.x();
+        sum_etay += globalposhit.y();
     }
-    for (unsigned int i = 0; i < etasize; i++) {
-      const Trk::PrepRawData* prd = etapattern->prd(i);
-      const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-      double hitz = globalposhit.z();
-      double perp = scphi.apply(
-        globalposhit.y(),
-        globalposhit
-          .x()); // globalposhit.x()*scphi.cs + globalposhit.y()*scphi.sn;
-      double distance =
-        MuonHoughMathUtils::signedDistanceToLine(hitz, perp, rz0, theta);
-      ATH_MSG_VERBOSE("distance to updated parameters in Rz: " << distance);
-      distance = MuonHoughMathUtils::signedDistanceToLine(
-        hitz, perp, old_pars[2], old_pars[3]);
-      ATH_MSG_VERBOSE("old distance: " << distance);
+
+    for (unsigned int i = 0; i < phisize; i++) {
+        const Trk::PrepRawData* prd = phipattern->prd(i);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        sum_phix += globalposhit.x();
+        sum_phiy += globalposhit.y();
     }
-  }
 
-  delete[] old_pars;
-  return new_pars;
-}
+    const double av_x = (eta_error_inv2 * sum_etax + phi_error_inv2 * sum_phix) / (eta_error_inv2 * etasize + phi_error_inv2 * phisize);
+    const double av_y = (eta_error_inv2 * sum_etay + phi_error_inv2 * sum_phiy) / (eta_error_inv2 * etasize + phi_error_inv2 * phisize);
+
+    if (msgLvl(MSG::VERBOSE)) { ATH_MSG_VERBOSE(" av_x: " << av_x << " av_y: " << av_y); }
+
+    // calculate weighted sum:
+
+    double sumx = 0.;
+    double sumy = 0.;
 
-std::pair<double, double>
-MuonCombinePatternTool::calculateR0Phi(const Muon::MuonPrdPattern* phipattern,
-                                       const Muon::MuonPrdPattern* etapattern,
-                                       double phi_est) const
-{
-  // use eta pattern as well, since phi patterns consist sometimes of only 1
-  // station etahit error 200mrad (2Pi/16*2), phi hit 20mrad (should be hough
-  // binsize (18 mrad), but prefer ~ factor 10 for stabilility)
-
-  // test if lever_arm > 2 m before updating , if not old values are used
-
-  ATH_MSG_VERBOSE("calculateR0Phi");
-
-  CxxUtils::sincos scphi_est(phi_est);
-
-  const unsigned int etasize = etapattern->numberOfContainedPrds();
-  const unsigned int phisize = phipattern->numberOfContainedPrds();
-
-  const Amg::Vector3D& etaglobaldir = etapattern->globalDirection();
-  const double phi_etapattern = etaglobaldir.phi();
-  CxxUtils::sincos scphi_eta(phi_etapattern);
-
-  const Amg::Vector3D& phiglobaldir = phipattern->globalDirection();
-  const Amg::Vector3D& phiglobalpos = phipattern->globalPosition();
-  const double phi_phipattern = phiglobaldir.phi();
-  CxxUtils::sincos scphi_phi(phi_phipattern);
-
-  const double phi_error_inv = 1. / 20.;
-  const double phi_error_inv2 = phi_error_inv * phi_error_inv;
-  const double eta_error_inv = 1. / 400.;
-  const double eta_error_inv2 = eta_error_inv * eta_error_inv;
-
-  // from MuonHoughPattern::updateParametersRPhi (partial code duplication.. :(
-  // )
-
-  double sum_etax = 0., sum_etay = 0., sum_phix = 0., sum_phiy = 0.;
-
-  // calculate average point
-
-  for (unsigned int i = 0; i < etasize; i++) {
-    const Trk::PrepRawData* prd = etapattern->prd(i);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    sum_etax += globalposhit.x();
-    sum_etay += globalposhit.y();
-  }
-
-  for (unsigned int i = 0; i < phisize; i++) {
-    const Trk::PrepRawData* prd = phipattern->prd(i);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    sum_phix += globalposhit.x();
-    sum_phiy += globalposhit.y();
-  }
-
-  const double av_x = (eta_error_inv2 * sum_etax + phi_error_inv2 * sum_phix) /
-                      (eta_error_inv2 * etasize + phi_error_inv2 * phisize);
-  const double av_y = (eta_error_inv2 * sum_etay + phi_error_inv2 * sum_phiy) /
-                      (eta_error_inv2 * etasize + phi_error_inv2 * phisize);
-
-  if (msgLvl(MSG::VERBOSE)) {
-    ATH_MSG_VERBOSE(" av_x: " << av_x << " av_y: " << av_y);
-  }
-
-  // calculate weighted sum:
-
-  double sumx = 0.;
-  double sumy = 0.;
-
-  // keep track of extreme points
-
-  double x_min = 0., x_max = 0.;
-  double y_min = 0., y_max = 0.;
-  double lever_min = 0., lever_max = 0.;
-
-  for (unsigned int i = 0; i < etasize; i++) {
-    const Trk::PrepRawData* prd = etapattern->prd(i);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    double hitx = globalposhit.x();
-    double hity = globalposhit.y();
-    double x_offset = hitx - av_x;
-    double y_offset = hity - av_y;
-    double height_squared = x_offset * x_offset + y_offset * y_offset;
-    double weight = height_squared * eta_error_inv2;
-    int sign = 1;
-    if (x_offset * scphi_est.cs + y_offset * scphi_est.sn < 0) {
-      sign = -1;
+    // keep track of extreme points
+
+    double x_min = 0., x_max = 0.;
+    double y_min = 0., y_max = 0.;
+    double lever_min = 0., lever_max = 0.;
+
+    for (unsigned int i = 0; i < etasize; i++) {
+        const Trk::PrepRawData* prd = etapattern->prd(i);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        double hitx = globalposhit.x();
+        double hity = globalposhit.y();
+        double x_offset = hitx - av_x;
+        double y_offset = hity - av_y;
+        double height_squared = x_offset * x_offset + y_offset * y_offset;
+        double weight = height_squared * eta_error_inv2;
+        int sign = 1;
+        if (x_offset * scphi_est.cs + y_offset * scphi_est.sn < 0) { sign = -1; }
+        sumx += weight * sign * x_offset;
+        sumy += weight * sign * y_offset;
+
+        if (sign == 1 && height_squared > lever_max) {
+            lever_max = height_squared;
+            x_max = hitx;
+            y_max = hity;
+        } else if (sign == -1 && height_squared > lever_min) {
+            lever_min = height_squared;
+            x_min = hitx;
+            y_min = hity;
+        }
     }
-    sumx += weight * sign * x_offset;
-    sumy += weight * sign * y_offset;
-
-    if (sign == 1 && height_squared > lever_max) {
-      lever_max = height_squared;
-      x_max = hitx;
-      y_max = hity;
-    } else if (sign == -1 && height_squared > lever_min) {
-      lever_min = height_squared;
-      x_min = hitx;
-      y_min = hity;
+
+    for (unsigned int i = 0; i < phisize; i++) {
+        const Trk::PrepRawData* prd = phipattern->prd(i);
+        const Amg::Vector3D& globalposhit = globalPrdPos(prd);
+        double hitx = globalposhit.x();
+        double hity = globalposhit.y();
+        double x_offset = hitx - av_x;
+        double y_offset = hity - av_y;
+        double height_squared = x_offset * x_offset + y_offset * y_offset;
+        double weight = height_squared * phi_error_inv2;
+        int sign = 1;
+        if (x_offset * scphi_est.cs + y_offset * scphi_est.sn < 0) { sign = -1; }
+        sumx += weight * sign * x_offset;
+        sumy += weight * sign * y_offset;
+
+        if (sign == 1 && height_squared > lever_max) {
+            lever_max = height_squared;
+            x_max = hitx;
+            y_max = hity;
+        } else if (sign == -1 && height_squared > lever_min) {
+            lever_min = height_squared;
+            x_min = hitx;
+            y_min = hity;
+        }
     }
-  }
-
-  for (unsigned int i = 0; i < phisize; i++) {
-    const Trk::PrepRawData* prd = phipattern->prd(i);
-    const Amg::Vector3D& globalposhit = globalPrdPos(prd);
-    double hitx = globalposhit.x();
-    double hity = globalposhit.y();
-    double x_offset = hitx - av_x;
-    double y_offset = hity - av_y;
-    double height_squared = x_offset * x_offset + y_offset * y_offset;
-    double weight = height_squared * phi_error_inv2;
-    int sign = 1;
-    if (x_offset * scphi_est.cs + y_offset * scphi_est.sn < 0) {
-      sign = -1;
+
+    ATH_MSG_VERBOSE("av_x : " << av_x << " av_y: " << av_y << " sumx: " << sumx << " sumy: " << sumy);
+
+    if (std::abs(sumx) < 0.000001 || std::abs(sumy) < 0.000001) {
+        ATH_MSG_DEBUG(" sum too small to update");
+
+        return std::make_pair(MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(phiglobalpos.x(), phiglobalpos.y(), phi_phipattern),
+                              phi_phipattern);
     }
-    sumx += weight * sign * x_offset;
-    sumy += weight * sign * y_offset;
-
-    if (sign == 1 && height_squared > lever_max) {
-      lever_max = height_squared;
-      x_max = hitx;
-      y_max = hity;
-    } else if (sign == -1 && height_squared > lever_min) {
-      lever_min = height_squared;
-      x_min = hitx;
-      y_min = hity;
+
+    // lever arm has to be larger than 2 m, else no update:
+
+    if (std::sqrt((x_max - x_min) * (x_max - x_min) + (y_max - y_min) * (y_max - y_min)) < 2000) {
+        ATH_MSG_VERBOSE("lever arm too small: av_x : " << std::sqrt((x_max - x_min) * (x_max - x_min) + (y_max - y_min) * (y_max - y_min))
+                                                       << " x_max: " << x_max << " x_min: " << x_min << " y_max: " << y_max
+                                                       << " y_min: " << y_min);
+        return std::make_pair(MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(phiglobalpos.x(), phiglobalpos.y(), phi_phipattern),
+                              phi_phipattern);
     }
-  }
-
-  ATH_MSG_VERBOSE("av_x : " << av_x << " av_y: " << av_y << " sumx: " << sumx
-                            << " sumy: " << sumy);
-
-  if (std::abs(sumx) < 0.000001 || std::abs(sumy) < 0.000001) {
-    ATH_MSG_DEBUG(" sum too small to update");
-
-    return std::make_pair(MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(
-                            phiglobalpos.x(), phiglobalpos.y(), phi_phipattern),
-                          phi_phipattern);
-  }
-
-  // lever arm has to be larger than 2 m, else no update:
-
-  if (std::sqrt((x_max - x_min) * (x_max - x_min) +
-                (y_max - y_min) * (y_max - y_min)) < 2000) {
-    ATH_MSG_VERBOSE("lever arm too small: av_x : "
-                    << std::sqrt((x_max - x_min) * (x_max - x_min) +
-                                 (y_max - y_min) * (y_max - y_min))
-                    << " x_max: " << x_max << " x_min: " << x_min
-                    << " y_max: " << y_max << " y_min: " << y_min);
-    return std::make_pair(MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(
-                            phiglobalpos.x(), phiglobalpos.y(), phi_phipattern),
-                          phi_phipattern);
-  }
-
-  double phi_fit = std::atan2(sumy, sumx);
-  if (phi_fit > 0)
-    phi_fit -= M_PI; // phi between 0,-Pi for cosmics!
-  CxxUtils::sincos scphi(phi_fit);
-  const double r0_fit =
-    scphi.apply(av_x, -av_y); // av_x * scphi.sn - av_y * scphi.cs;
-
-  return std::make_pair(phi_fit, r0_fit);
-}
 
-double
-MuonCombinePatternTool::calculateRz0(const Muon::MuonPrdPattern* pattern,
-                                     double phi,
-                                     double theta)
-{
+    double phi_fit = std::atan2(sumy, sumx);
+    if (phi_fit > 0) phi_fit -= M_PI;  // phi between 0,-Pi for cosmics!
+    CxxUtils::sincos scphi(phi_fit);
+    const double r0_fit = scphi.apply(av_x, -av_y);  // av_x * scphi.sn - av_y * scphi.cs;
+
+    return std::make_pair(phi_fit, r0_fit);
+}
 
-  double nhits = pattern->numberOfContainedPrds();
-  CxxUtils::sincos sctheta(theta);
-  CxxUtils::sincos scphi(phi);
+double MuonCombinePatternTool::calculateRz0(const Muon::MuonPrdPattern* pattern, double phi, double theta) {
+    double nhits = pattern->numberOfContainedPrds();
+    CxxUtils::sincos sctheta(theta);
+    CxxUtils::sincos scphi(phi);
 
-  /*
-    x = r_0 sin(phi) + t*cos(phi)sin(theta)
-    y = - r_0 cos(phi) + t*sin(phi)sin(theta)
-    z = z_0 + t*cos(theta)
+    /*
+      x = r_0 sin(phi) + t*cos(phi)sin(theta)
+      y = - r_0 cos(phi) + t*sin(phi)sin(theta)
+      z = z_0 + t*cos(theta)
 
-    2 methods (average point of average_z0):
+      2 methods (average point of average_z0):
 
-    r^2 = x^2+y^2 = r_0^2 + t^2*sin^2(theta)
-    (this projects the hit radially onto the line)
+      r^2 = x^2+y^2 = r_0^2 + t^2*sin^2(theta)
+      (this projects the hit radially onto the line)
 
-    Not so good as the radius of the hits can be smaller than r_0
+      Not so good as the radius of the hits can be smaller than r_0
 
-    method based on:
+      method based on:
 
-    x*cos(phi) + y*sin(phi) = t*sin(theta)
-    (projects the hit on the line in x-y and calculates the distance to r_0)
+      x*cos(phi) + y*sin(phi) = t*sin(theta)
+      (projects the hit on the line in x-y and calculates the distance to r_0)
 
-    works best
-  */
+      works best
+    */
 
-  // method 3:
+    // method 3:
 
-  double rz0 = 0.;
-  for (unsigned int i = 0; i < nhits; i++) {
-    const Trk::PrepRawData* prd = pattern->prd(i);
-    const Amg::Vector3D& poshit = globalPrdPos(prd);
-    const double hitx = poshit.x();
-    const double hity = poshit.y();
-    const double hitz = poshit.z();
-    const double hitr = sqrt(hitx * hitx + hity * hity);
-    // hitx*scphi.cs + hity*scphi.sn == sin theta * t
-    int sign = (hitx * scphi.cs + hity * scphi.sn > 0) ? 1 : -1;
-    rz0 += hitz * sctheta.sn - sign * sctheta.cs * hitr;
-  }
+    double rz0 = 0.;
+    for (unsigned int i = 0; i < nhits; i++) {
+        const Trk::PrepRawData* prd = pattern->prd(i);
+        const Amg::Vector3D& poshit = globalPrdPos(prd);
+        const double hitx = poshit.x();
+        const double hity = poshit.y();
+        const double hitz = poshit.z();
+        const double hitr = sqrt(hitx * hitx + hity * hity);
+        // hitx*scphi.cs + hity*scphi.sn == sin theta * t
+        int sign = (hitx * scphi.cs + hity * scphi.sn > 0) ? 1 : -1;
+        rz0 += hitz * sctheta.sn - sign * sctheta.cs * hitr;
+    }
 
-  if (nhits > 0)
-    rz0 /= nhits;
-  return rz0;
+    if (nhits > 0) rz0 /= nhits;
+    return rz0;
 }
 
-std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>
-MuonCombinePatternTool::updatePatternsForCosmics(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern,
-  const double* new_pars)
-{
-  double phi = new_pars[1];
-  double theta = new_pars[3];
-
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-
-  double x0 = new_pars[0] * scphi.sn;
-  double y0 = -new_pars[0] * scphi.cs;
-  double z0_phi = new_pars[2];
-  double z0_eta = new_pars[2];
-  if (std::abs(sctheta.sn) > 1e-7) {
-    z0_phi = (new_pars[2] + new_pars[0] * sctheta.cs) /
-             sctheta.sn;               // z0 belonging to (x0,y0)
-    z0_eta = new_pars[2] / sctheta.sn; // z0 of rz0
-  }
-
-  const Amg::Vector3D& globalDir =
-    Amg::Vector3D(scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs);
-  const Amg::Vector3D& globalPosPhi = Amg::Vector3D(x0, y0, z0_phi);
-  const Amg::Vector3D& globalPosEta = Amg::Vector3D(x0, y0, z0_eta);
-
-  Muon::MuonPrdPattern* updatedphipattern =
-    new Muon::MuonPrdPattern(globalPosPhi, globalDir);
-  Muon::MuonPrdPattern* updatedetapattern =
-    new Muon::MuonPrdPattern(globalPosEta, globalDir);
-
-  for (unsigned int phihitnr = 0;
-       phihitnr < phipattern->numberOfContainedPrds();
-       phihitnr++) {
-    updatedphipattern->addPrd(phipattern->prd(phihitnr));
-  } // size phi pattern
-
-  for (unsigned int etahitnr = 0;
-       etahitnr < etapattern->numberOfContainedPrds();
-       etahitnr++) {
-    updatedetapattern->addPrd(etapattern->prd(etahitnr));
-  } // size eta pattern
-
-  return (std::make_pair(updatedphipattern, updatedetapattern));
+std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*> MuonCombinePatternTool::updatePatternsForCosmics(
+    const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern, const double* new_pars) {
+    double phi = new_pars[1];
+    double theta = new_pars[3];
+
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
+
+    double x0 = new_pars[0] * scphi.sn;
+    double y0 = -new_pars[0] * scphi.cs;
+    double z0_phi = new_pars[2];
+    double z0_eta = new_pars[2];
+    if (std::abs(sctheta.sn) > 1e-7) {
+        z0_phi = (new_pars[2] + new_pars[0] * sctheta.cs) / sctheta.sn;  // z0 belonging to (x0,y0)
+        z0_eta = new_pars[2] / sctheta.sn;                               // z0 of rz0
+    }
+
+    const Amg::Vector3D& globalDir = Amg::Vector3D(scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs);
+    const Amg::Vector3D& globalPosPhi = Amg::Vector3D(x0, y0, z0_phi);
+    const Amg::Vector3D& globalPosEta = Amg::Vector3D(x0, y0, z0_eta);
+
+    Muon::MuonPrdPattern* updatedphipattern = new Muon::MuonPrdPattern(globalPosPhi, globalDir);
+    Muon::MuonPrdPattern* updatedetapattern = new Muon::MuonPrdPattern(globalPosEta, globalDir);
+
+    for (unsigned int phihitnr = 0; phihitnr < phipattern->numberOfContainedPrds(); phihitnr++) {
+        updatedphipattern->addPrd(phipattern->prd(phihitnr));
+    }  // size phi pattern
+
+    for (unsigned int etahitnr = 0; etahitnr < etapattern->numberOfContainedPrds(); etahitnr++) {
+        updatedetapattern->addPrd(etapattern->prd(etahitnr));
+    }  // size eta pattern
+
+    return (std::make_pair(updatedphipattern, updatedetapattern));
 }
 
-const Amg::Vector3D&
-MuonCombinePatternTool::globalPrdPos(const Trk::PrepRawData* prd)
-{
-  const Muon::MuonCluster* cprd = dynamic_cast<const Muon::MuonCluster*>(prd);
-  if (cprd)
-    return cprd->globalPosition();
+const Amg::Vector3D& MuonCombinePatternTool::globalPrdPos(const Trk::PrepRawData* prd) {
+    const Muon::MuonCluster* cprd = dynamic_cast<const Muon::MuonCluster*>(prd);
+    if (cprd) return cprd->globalPosition();
 
-  const Muon::MdtPrepData* mdtprd = dynamic_cast<const Muon::MdtPrepData*>(prd);
-  if (mdtprd)
-    return mdtprd->globalPosition();
+    const Muon::MdtPrepData* mdtprd = dynamic_cast<const Muon::MdtPrepData*>(prd);
+    if (mdtprd) return mdtprd->globalPosition();
 
-  return prd->detectorElement()->surface(prd->identify()).center();
+    return prd->detectorElement()->surface(prd->identify()).center();
 }
 
-MuonPatternCombinationCollection*
-MuonCombinePatternTool::makePatternCombinations(
-  const MuonPrdPatternCollection* muonpatterns) const
-{
-  ATH_MSG_DEBUG("makePatternCombinations");
-
-  MuonPatternCombinationCollection* patterncombinations =
-    new MuonPatternCombinationCollection();
-
-  MuonPrdPatternCollection::const_iterator pit = muonpatterns->begin();
-  MuonPrdPatternCollection::const_iterator pit_end = muonpatterns->end();
-
-  for (; pit != pit_end; ++pit) {
-    const Amg::Vector3D& roadmom = (*pit)->globalDirection();
-    const Amg::Vector3D& roadpos = (*pit)->globalPosition();
-    ATH_MSG_DEBUG("phi: " << roadmom.phi() << " eta: " << roadmom.eta());
-    ATH_MSG_DEBUG("x: " << roadpos.x() << " y: " << roadpos.y()
-                        << " z: " << roadpos.z());
-
-    // sort pattern per chamber
-    std::map<Identifier, std::vector<const Trk::PrepRawData*>> chamberMap;
-    std::map<Identifier, std::vector<const Trk::PrepRawData*>>::iterator chit;
-    std::map<Identifier, std::vector<const Trk::PrepRawData*>>::iterator
-      chit_end = chamberMap.end();
-    for (unsigned int i = 0; i < (*pit)->numberOfContainedPrds(); i++) {
-      const Trk::PrepRawData* prd = (*pit)->prd(i);
-      Identifier channelId = prd->identify();
-      Identifier moduleId;
-      if (m_idHelperSvc->isMdt(channelId)) {
-        moduleId = m_idHelperSvc->mdtIdHelper().elementID(channelId);
-      } else if (m_idHelperSvc->isCsc(channelId)) {
-        moduleId = m_idHelperSvc->cscIdHelper().elementID(channelId);
-      } else if (m_idHelperSvc->isTgc(channelId)) {
-        moduleId = m_idHelperSvc->tgcIdHelper().elementID(channelId);
-      } else if (m_idHelperSvc->isRpc(channelId)) {
-        moduleId = m_idHelperSvc->rpcIdHelper().elementID(channelId);
-      } else {
-        ATH_MSG_ERROR("prd is not a muonhit?!");
-      }
-
-      chit = chamberMap.find(moduleId);
-      if (chit != chit_end) {
-        (*chit).second.push_back(prd);
-      } else {
-        std::vector<const Trk::PrepRawData*> prdVec;
-        prdVec.reserve(10);
-        prdVec.push_back(prd);
-        chamberMap[moduleId] = prdVec;
-      }
-    }
+MuonPatternCombinationCollection* MuonCombinePatternTool::makePatternCombinations(const MuonPrdPatternCollection* muonpatterns) const {
+    ATH_MSG_DEBUG("makePatternCombinations");
+
+    MuonPatternCombinationCollection* patterncombinations = new MuonPatternCombinationCollection();
+
+    MuonPrdPatternCollection::const_iterator pit = muonpatterns->begin();
+    MuonPrdPatternCollection::const_iterator pit_end = muonpatterns->end();
+
+    for (; pit != pit_end; ++pit) {
+        const Amg::Vector3D& roadmom = (*pit)->globalDirection();
+        const Amg::Vector3D& roadpos = (*pit)->globalPosition();
+        ATH_MSG_DEBUG("phi: " << roadmom.phi() << " eta: " << roadmom.eta());
+        ATH_MSG_DEBUG("x: " << roadpos.x() << " y: " << roadpos.y() << " z: " << roadpos.z());
+
+        // sort pattern per chamber
+        std::map<Identifier, std::vector<const Trk::PrepRawData*>> chamberMap;
+        std::map<Identifier, std::vector<const Trk::PrepRawData*>>::iterator chit;
+        std::map<Identifier, std::vector<const Trk::PrepRawData*>>::iterator chit_end = chamberMap.end();
+        for (unsigned int i = 0; i < (*pit)->numberOfContainedPrds(); i++) {
+            const Trk::PrepRawData* prd = (*pit)->prd(i);
+            Identifier channelId = prd->identify();
+            Identifier moduleId;
+            if (m_idHelperSvc->isMdt(channelId)) {
+                moduleId = m_idHelperSvc->mdtIdHelper().elementID(channelId);
+            } else if (m_idHelperSvc->isCsc(channelId)) {
+                moduleId = m_idHelperSvc->cscIdHelper().elementID(channelId);
+            } else if (m_idHelperSvc->isTgc(channelId)) {
+                moduleId = m_idHelperSvc->tgcIdHelper().elementID(channelId);
+            } else if (m_idHelperSvc->isRpc(channelId)) {
+                moduleId = m_idHelperSvc->rpcIdHelper().elementID(channelId);
+            } else {
+                ATH_MSG_ERROR("prd is not a muonhit?!");
+            }
 
-    // build chamberintersect vector
-    std::vector<Muon::MuonPatternChamberIntersect> mpciVec;
-    mpciVec.reserve(chamberMap.size());
-    Amg::Vector3D patpose;
-    Amg::Vector3D patdire;
-    chit = chamberMap.begin();
-    for (; chit != chit_end; ++chit) {
-      const Trk::PrepRawData* prd = *((*chit).second.begin());
-      // Identifier id = prd->identify();
-      const Amg::Vector3D& globalpos = globalPrdPos(prd);
-
-      if (m_use_cosmics) {
-        // not flip
-
-        patdire = roadmom.unit();
-        patpose = roadpos;
-      } else {
-        MuonHoughMathUtils::extrapolateCurvedRoad(
-          roadpos, roadmom, globalpos, patpose, patdire);
-      }
-
-      Muon::MuonPatternChamberIntersect mpci =
-        Muon::MuonPatternChamberIntersect(patpose, patdire, (*chit).second);
-      mpciVec.push_back(mpci);
-    }
+            chit = chamberMap.find(moduleId);
+            if (chit != chit_end) {
+                (*chit).second.push_back(prd);
+            } else {
+                std::vector<const Trk::PrepRawData*> prdVec;
+                prdVec.reserve(10);
+                prdVec.push_back(prd);
+                chamberMap[moduleId] = prdVec;
+            }
+        }
+
+        // build chamberintersect vector
+        std::vector<Muon::MuonPatternChamberIntersect> mpciVec;
+        mpciVec.reserve(chamberMap.size());
+        Amg::Vector3D patpose;
+        Amg::Vector3D patdire;
+        chit = chamberMap.begin();
+        for (; chit != chit_end; ++chit) {
+            const Trk::PrepRawData* prd = *((*chit).second.begin());
+            // Identifier id = prd->identify();
+            const Amg::Vector3D& globalpos = globalPrdPos(prd);
+
+            if (m_use_cosmics) {
+                // not flip
 
-    Amg::Vector3D tvertex = Amg::Vector3D(0., 0., 0.);
-    Trk::TrackParameters* parameters = new Trk::Perigee(
-      roadpos, roadmom, 1., tvertex); // if -1 then charge flipped anyway
-    Muon::MuonPatternCombination* combination =
-      new Muon::MuonPatternCombination(parameters, mpciVec);
-    patterncombinations->push_back(combination);
-  }
-  return patterncombinations;
+                patdire = roadmom.unit();
+                patpose = roadpos;
+            } else {
+                MuonHoughMathUtils::extrapolateCurvedRoad(roadpos, roadmom, globalpos, patpose, patdire);
+            }
+
+            Muon::MuonPatternChamberIntersect mpci = Muon::MuonPatternChamberIntersect(patpose, patdire, (*chit).second);
+            mpciVec.push_back(mpci);
+        }
+
+        Amg::Vector3D tvertex = Amg::Vector3D(0., 0., 0.);
+        Trk::TrackParameters* parameters = new Trk::Perigee(roadpos, roadmom, 1., tvertex);  // if -1 then charge flipped anyway
+        Muon::MuonPatternCombination* combination = new Muon::MuonPatternCombination(parameters, mpciVec);
+        patterncombinations->push_back(combination);
+    }
+    return patterncombinations;
 }
 
-int
-MuonCombinePatternTool::overlap(
-  const Muon::MuonPrdPattern* phipattern,
-  const Muon::MuonPrdPattern* etapattern,
-  std::vector<const Trk::PrepRawData*>& hits_to_be_added,
-  /** phi eta association map, eta prds are key*/
-  const std::map<const Trk::PrepRawData*,
-                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phiEtaHitAssMap) const
-{
-  /** method no longer used */
-
-  if (!phiEtaHitAssMap)
-    return 0;
-
-  int overlap = 0;
-  std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> phihits;
-  for (unsigned int i = 0; i < phipattern->numberOfContainedPrds(); i++) {
-    phihits.insert(phipattern->prd(i));
-  }
-
-  std::map<const Trk::PrepRawData*,
-           std::set<const Trk::PrepRawData*,
-                    Muon::IdentifierPrdLess>>::const_iterator it;
-  ATH_MSG_DEBUG(
-    "number of prds in eta pattern: " << etapattern->numberOfContainedPrds());
-  for (unsigned int i = 0; i < etapattern->numberOfContainedPrds(); i++) {
-    const Trk::PrepRawData* prd = etapattern->prd(i);
-    // check on type of prd?
-    const Muon::MuonCluster* muoncluster =
-      dynamic_cast<const Muon::MuonCluster*>(prd);
-    if (muoncluster) {
-      it = phiEtaHitAssMap->find(prd);
-      if (it != phiEtaHitAssMap->end()) { // check if hit has associated hit
-        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator
-          set_it = (*it).second.begin();
-        for (; set_it != (*it).second.end(); ++set_it) {
-          if (phihits.find(*set_it) !=
-              phihits.end()) { // check if associated hit is on phi pattern
-            ATH_MSG_VERBOSE("overlapping hit found!");
-            overlap++;
-          } else { // associated hit not on phi pattern
-            hits_to_be_added.push_back(*set_it);
-            ATH_MSG_VERBOSE("Associated Phi Hit Added to Pattern");
-          }
+int MuonCombinePatternTool::overlap(
+    const Muon::MuonPrdPattern* phipattern, const Muon::MuonPrdPattern* etapattern, std::vector<const Trk::PrepRawData*>& hits_to_be_added,
+    /** phi eta association map, eta prds are key*/
+    const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const {
+    /** method no longer used */
+
+    if (!phiEtaHitAssMap) return 0;
+
+    int overlap = 0;
+    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> phihits;
+    for (unsigned int i = 0; i < phipattern->numberOfContainedPrds(); i++) { phihits.insert(phipattern->prd(i)); }
+
+    std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::const_iterator it;
+    ATH_MSG_DEBUG("number of prds in eta pattern: " << etapattern->numberOfContainedPrds());
+    for (unsigned int i = 0; i < etapattern->numberOfContainedPrds(); i++) {
+        const Trk::PrepRawData* prd = etapattern->prd(i);
+        // check on type of prd?
+        const Muon::MuonCluster* muoncluster = dynamic_cast<const Muon::MuonCluster*>(prd);
+        if (muoncluster) {
+            it = phiEtaHitAssMap->find(prd);
+            if (it != phiEtaHitAssMap->end()) {  // check if hit has associated hit
+                std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator set_it = (*it).second.begin();
+                for (; set_it != (*it).second.end(); ++set_it) {
+                    if (phihits.find(*set_it) != phihits.end()) {  // check if associated hit is on phi pattern
+                        ATH_MSG_VERBOSE("overlapping hit found!");
+                        overlap++;
+                    } else {  // associated hit not on phi pattern
+                        hits_to_be_added.push_back(*set_it);
+                        ATH_MSG_VERBOSE("Associated Phi Hit Added to Pattern");
+                    }
+                }
+            } else {
+                ATH_MSG_VERBOSE("prd not associated to any phi hit: " << prd);
+            }
         }
-      } else {
-        ATH_MSG_VERBOSE("prd not associated to any phi hit: " << prd);
-      }
     }
-  }
-  return overlap;
+    return overlap;
 }
 
-bool
-MuonCombinePatternTool::subset(const Muon::MuonPrdPattern* pattern1,
-                               const Muon::MuonPrdPattern* pattern2)
-{
-  /** is pattern1 a complete subset of other pattern2? */
-
-  // first check if pattern 1 is not larger than 2:
-  if (pattern1->numberOfContainedPrds() > pattern2->numberOfContainedPrds()) {
-    return false;
-  }
-
-  bool subset = true;
-
-  std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hits;
-  for (unsigned int hitnr = 0; hitnr < pattern2->numberOfContainedPrds();
-       hitnr++) {
-    hits.insert(pattern2->prd(hitnr));
-  }
-
-  for (unsigned int hitnr = 0; hitnr < pattern1->numberOfContainedPrds();
-       hitnr++) {
-    if (hits.find(pattern1->prd(hitnr)) == hits.end()) {
-      subset = false;
-      break;
+bool MuonCombinePatternTool::subset(const Muon::MuonPrdPattern* pattern1, const Muon::MuonPrdPattern* pattern2) {
+    /** is pattern1 a complete subset of other pattern2? */
+
+    // first check if pattern 1 is not larger than 2:
+    if (pattern1->numberOfContainedPrds() > pattern2->numberOfContainedPrds()) { return false; }
+
+    bool subset = true;
+
+    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hits;
+    for (unsigned int hitnr = 0; hitnr < pattern2->numberOfContainedPrds(); hitnr++) { hits.insert(pattern2->prd(hitnr)); }
+
+    for (unsigned int hitnr = 0; hitnr < pattern1->numberOfContainedPrds(); hitnr++) {
+        if (hits.find(pattern1->prd(hitnr)) == hits.end()) {
+            subset = false;
+            break;
+        }
     }
-  }
-  return subset;
+    return subset;
 }
 
-bool
-MuonCombinePatternTool::subset(
-  std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-            std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
-    candidate1,
-  std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-            std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
-    candidate2)
-{
-  /** is candidate1 a complete subset of other candidate2? */
-
-  // first check if pattern 1 is not larger than 2:
-  if (candidate1.first.size() > candidate2.first.size() ||
-      candidate1.second.size() > candidate2.second.size()) {
-    return false;
-  }
-
-  std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator set_it;
-
-  for (set_it = candidate1.first.begin(); set_it != candidate1.first.end();
-       ++set_it) {
-    if (candidate2.first.find(*set_it) == candidate2.first.end()) {
-      return false;
+bool MuonCombinePatternTool::subset(std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
+                                              std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>& candidate1,
+                                    std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
+                                              std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>& candidate2) {
+    /** is candidate1 a complete subset of other candidate2? */
+
+    // first check if pattern 1 is not larger than 2:
+    if (candidate1.first.size() > candidate2.first.size() || candidate1.second.size() > candidate2.second.size()) { return false; }
+
+    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator set_it;
+
+    for (set_it = candidate1.first.begin(); set_it != candidate1.first.end(); ++set_it) {
+        if (candidate2.first.find(*set_it) == candidate2.first.end()) { return false; }
     }
-  }
-  for (set_it = candidate1.second.begin(); set_it != candidate1.second.end();
-       ++set_it) {
-    if (candidate2.second.find(*set_it) == candidate2.second.end()) {
-      return false;
+    for (set_it = candidate1.second.begin(); set_it != candidate1.second.end(); ++set_it) {
+        if (candidate2.second.find(*set_it) == candidate2.second.end()) { return false; }
     }
-  }
 
-  return true;
+    return true;
 }
 
-void
-MuonCombinePatternTool::printPattern(
-  const Muon::MuonPrdPattern* muonpattern) const
-{
-  if (msgLvl(MSG::VERBOSE)) {
-    ATH_MSG_VERBOSE("Printout of Pattern: ");
-
-    const Amg::Vector3D& pos = muonpattern->globalPosition();
-    const Amg::Vector3D& dir = muonpattern->globalDirection();
-
-    ATH_MSG_VERBOSE("pos: x: " << pos.x() << " y: " << pos.y()
-                               << " z: " << pos.z());
-    ATH_MSG_VERBOSE("dir: x: " << dir.x() << " y: " << dir.y()
-                               << " z: " << dir.z());
-    ATH_MSG_VERBOSE("phi: " << dir.phi() << " theta: " << dir.theta()
-                            << " rz0: " << pos.z() * std::sin(dir.theta()));
-
-    for (unsigned int k = 0; k < muonpattern->numberOfContainedPrds(); k++) {
-      const Trk::PrepRawData* prd = muonpattern->prd(k);
-      const Muon::MdtPrepData* mdtprd =
-        dynamic_cast<const Muon::MdtPrepData*>(prd);
-      if (mdtprd) {
-        const Trk::Surface& surface =
-          mdtprd->detectorElement()->surface(mdtprd->identify());
-        const Amg::Vector3D& gpos = surface.center();
-        ATH_MSG_VERBOSE("mdt " << k << " x: " << gpos.x() << " y: " << gpos.y()
-                               << " z: " << gpos.z());
-      } else if (!mdtprd) {
-        const Muon::MuonCluster* muoncluster =
-          dynamic_cast<const Muon::MuonCluster*>(prd);
-        if (muoncluster) {
-          const Amg::Vector3D& gpos = muoncluster->globalPosition();
-          ATH_MSG_VERBOSE("cluster " << k << " x: " << gpos.x() << " y: "
-                                     << gpos.y() << " z: " << gpos.z());
-        }
-        if (!muoncluster) {
-          ATH_MSG_VERBOSE("no muon prd? ");
+void MuonCombinePatternTool::printPattern(const Muon::MuonPrdPattern* muonpattern) const {
+    if (msgLvl(MSG::VERBOSE)) {
+        ATH_MSG_VERBOSE("Printout of Pattern: ");
+
+        const Amg::Vector3D& pos = muonpattern->globalPosition();
+        const Amg::Vector3D& dir = muonpattern->globalDirection();
+
+        ATH_MSG_VERBOSE("pos: x: " << pos.x() << " y: " << pos.y() << " z: " << pos.z());
+        ATH_MSG_VERBOSE("dir: x: " << dir.x() << " y: " << dir.y() << " z: " << dir.z());
+        ATH_MSG_VERBOSE("phi: " << dir.phi() << " theta: " << dir.theta() << " rz0: " << pos.z() * std::sin(dir.theta()));
+
+        for (unsigned int k = 0; k < muonpattern->numberOfContainedPrds(); k++) {
+            const Trk::PrepRawData* prd = muonpattern->prd(k);
+            const Muon::MdtPrepData* mdtprd = dynamic_cast<const Muon::MdtPrepData*>(prd);
+            if (mdtprd) {
+                const Trk::Surface& surface = mdtprd->detectorElement()->surface(mdtprd->identify());
+                const Amg::Vector3D& gpos = surface.center();
+                ATH_MSG_VERBOSE("mdt " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
+            } else if (!mdtprd) {
+                const Muon::MuonCluster* muoncluster = dynamic_cast<const Muon::MuonCluster*>(prd);
+                if (muoncluster) {
+                    const Amg::Vector3D& gpos = muoncluster->globalPosition();
+                    ATH_MSG_VERBOSE("cluster " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
+                }
+                if (!muoncluster) { ATH_MSG_VERBOSE("no muon prd? "); }
+            }
         }
-      }
     }
-  }
 }
 
-const Muon::MuonPrdPattern*
-MuonCombinePatternTool::updatePhiPattern(
-  const Muon::MuonPrdPattern* phipattern,
-  std::vector<const Trk::PrepRawData*> missedphihits) const
-{
-  Muon::MuonPrdPattern* updatedphipattern = new Muon::MuonPrdPattern(
-    phipattern->globalPosition(), phipattern->globalDirection());
-  for (unsigned int phihitnr = 0;
-       phihitnr < phipattern->numberOfContainedPrds();
-       phihitnr++) {
-    updatedphipattern->addPrd(phipattern->prd(phihitnr));
-    // ATH_MSG_DEBUG(" prd: " << phipattern->prd(phihitnr) );
-  } // size phi pattern
-
-  std::vector<const Trk::PrepRawData*>::iterator it = missedphihits.begin();
-  for (; it != missedphihits.end(); ++it) {
-    // check on compatibility?
-    updatedphipattern->addPrd(*it);
-  }
-
-  // clean updated phi pattern:
-
-  const Muon::MuonPrdPattern* cleanUpdatedPhipattern =
-    cleanPhiPattern(updatedphipattern);
-  delete updatedphipattern;
-
-  return cleanUpdatedPhipattern;
+const Muon::MuonPrdPattern* MuonCombinePatternTool::updatePhiPattern(const Muon::MuonPrdPattern* phipattern,
+                                                                     std::vector<const Trk::PrepRawData*> missedphihits) const {
+    Muon::MuonPrdPattern* updatedphipattern = new Muon::MuonPrdPattern(phipattern->globalPosition(), phipattern->globalDirection());
+    for (unsigned int phihitnr = 0; phihitnr < phipattern->numberOfContainedPrds(); phihitnr++) {
+        updatedphipattern->addPrd(phipattern->prd(phihitnr));
+        // ATH_MSG_DEBUG(" prd: " << phipattern->prd(phihitnr) );
+    }  // size phi pattern
+
+    std::vector<const Trk::PrepRawData*>::iterator it = missedphihits.begin();
+    for (; it != missedphihits.end(); ++it) {
+        // check on compatibility?
+        updatedphipattern->addPrd(*it);
+    }
+
+    // clean updated phi pattern:
+
+    const Muon::MuonPrdPattern* cleanUpdatedPhipattern = cleanPhiPattern(updatedphipattern);
+    delete updatedphipattern;
+
+    return cleanUpdatedPhipattern;
 }
 
-Muon::MuonPrdPattern*
-MuonCombinePatternTool::cleanPhiPattern(
-  const Muon::MuonPrdPattern* phipattern) const
-{
-  const Amg::Vector3D& olddir = phipattern->globalDirection();
-  const double theta = olddir.theta();
-  const unsigned int size = phipattern->numberOfContainedPrds();
-
-  if (msgLvl(MSG::DEBUG)) {
-    ATH_MSG_DEBUG("Start Phi hits cleaning with " << size << " hits "
-                                                  << " theta " << theta);
-    const Amg::Vector3D& oldpos = phipattern->globalPosition();
-    double r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(
-      oldpos.x(), oldpos.y(), olddir.phi());
-    ATH_MSG_DEBUG("Start Phi: " << olddir.phi() << " r0: " << r0);
-  }
-
-  // need internal class to be able to remove hits fast
-  MuonHoughPattern* newpattern =
-    new MuonHoughPattern(MuonHough::hough_xy, true); // patterns owns hits
-  for (unsigned int phihitnr = 0; phihitnr < size; phihitnr++) {
-    newpattern->addHit(new MuonHoughHit(phipattern->prd(phihitnr)));
-  }
-  newpattern->updateParametersRPhi(m_use_cosmics);
-  double phi = newpattern->getEPhi();
-  double r0 = newpattern->getERPhi();
-
-  CxxUtils::sincos scphi(phi);
-
-  const int number_of_iterations = 4;
-  double cutvalues[number_of_iterations] = { 1000., 500., 250., 125. };
-
-  if (m_use_cosmics) {
-    cutvalues[0] = 5000.;
-    cutvalues[1] = 2500.;
-    cutvalues[2] = 1250.;
-    cutvalues[3] = 1250.;
-  }
-
-  for (int it = 0; it < number_of_iterations; it++) {
-    ATH_MSG_VERBOSE("iteration " << it << " cutvalue: " << cutvalues[it]);
-    bool change = true;
-    while (change) {
-      ATH_MSG_VERBOSE("size: " << newpattern->size() << " r0: " << r0
-                               << " phi: " << phi);
-
-      double max_dist = 0.;
-      unsigned int max_i = 99999;
-      for (unsigned int i = 0; i < newpattern->size(); i++) {
-        double dist =
-          scphi.apply(newpattern->getHitx(i), -newpattern->getHity(i)) -
-          r0; //  newpattern->getHitx(i) * scphi.sn - newpattern->getHity(i) *
-              //  scphi.cs - r0;
-        ATH_MSG_VERBOSE("Dist: " << dist);
-        if (fabs(dist) > fabs(max_dist)) {
-          max_dist = dist;
-          max_i = i;
+Muon::MuonPrdPattern* MuonCombinePatternTool::cleanPhiPattern(const Muon::MuonPrdPattern* phipattern) const {
+    const Amg::Vector3D& olddir = phipattern->globalDirection();
+    const double theta = olddir.theta();
+    const unsigned int size = phipattern->numberOfContainedPrds();
+
+    if (msgLvl(MSG::DEBUG)) {
+        ATH_MSG_DEBUG("Start Phi hits cleaning with " << size << " hits "
+                                                      << " theta " << theta);
+        const Amg::Vector3D& oldpos = phipattern->globalPosition();
+        double r0 = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(oldpos.x(), oldpos.y(), olddir.phi());
+        ATH_MSG_DEBUG("Start Phi: " << olddir.phi() << " r0: " << r0);
+    }
+
+    // need internal class to be able to remove hits fast
+    MuonHoughPattern* newpattern = new MuonHoughPattern(MuonHough::hough_xy, true);  // patterns owns hits
+    for (unsigned int phihitnr = 0; phihitnr < size; phihitnr++) { newpattern->addHit(new MuonHoughHit(phipattern->prd(phihitnr))); }
+    newpattern->updateParametersRPhi(m_use_cosmics);
+    double phi = newpattern->getEPhi();
+    double r0 = newpattern->getERPhi();
+
+    CxxUtils::sincos scphi(phi);
+
+    const int number_of_iterations = 4;
+    double cutvalues[number_of_iterations] = {1000., 500., 250., 125.};
+
+    if (m_use_cosmics) {
+        cutvalues[0] = 5000.;
+        cutvalues[1] = 2500.;
+        cutvalues[2] = 1250.;
+        cutvalues[3] = 1250.;
+    }
+
+    for (int it = 0; it < number_of_iterations; it++) {
+        ATH_MSG_VERBOSE("iteration " << it << " cutvalue: " << cutvalues[it]);
+        bool change = true;
+        while (change) {
+            ATH_MSG_VERBOSE("size: " << newpattern->size() << " r0: " << r0 << " phi: " << phi);
+
+            double max_dist = 0.;
+            unsigned int max_i = 99999;
+            for (unsigned int i = 0; i < newpattern->size(); i++) {
+                double dist =
+                    scphi.apply(newpattern->getHitx(i), -newpattern->getHity(i)) - r0;  //  newpattern->getHitx(i) * scphi.sn -
+                                                                                        //  newpattern->getHity(i) * scphi.cs - r0;
+                ATH_MSG_VERBOSE("Dist: " << dist);
+                if (fabs(dist) > fabs(max_dist)) {
+                    max_dist = dist;
+                    max_i = i;
+                }
+            }
+            if (fabs(max_dist) < cutvalues[it]) {
+                change = false;
+            } else {
+                newpattern->removeHit(max_i);
+                newpattern->updateParametersRPhi(m_use_cosmics);
+                phi = newpattern->getEPhi();
+                r0 = newpattern->getERPhi();
+                scphi = CxxUtils::sincos(phi);
+            }
         }
-      }
-      if (fabs(max_dist) < cutvalues[it]) {
-        change = false;
-      } else {
-        newpattern->removeHit(max_i);
-        newpattern->updateParametersRPhi(m_use_cosmics);
-        phi = newpattern->getEPhi();
-        r0 = newpattern->getERPhi();
-        scphi = CxxUtils::sincos(phi);
-      }
     }
-  }
 
-  ATH_MSG_DEBUG("Final size: " << newpattern->size() << " r0: " << r0
-                               << " phi: " << phi);
+    ATH_MSG_DEBUG("Final size: " << newpattern->size() << " r0: " << r0 << " phi: " << phi);
 
-  // update parameters rz (not very important as later overwritten)
-  // put r0 to IP for collisions
+    // update parameters rz (not very important as later overwritten)
+    // put r0 to IP for collisions
 
-  double thetanew = 0.;
-  double r0_new = 1.; // put 1 mm r0 value
+    double thetanew = 0.;
+    double r0_new = 1.;  // put 1 mm r0 value
 
-  if (m_use_cosmics) {
-    r0_new = r0;
-  }
+    if (m_use_cosmics) { r0_new = r0; }
 
-  unsigned int nPatterns = newpattern->size();
-  for (unsigned int i = 0; i < nPatterns; i++) {
-    thetanew += newpattern->getTheta(i);
-  }
+    unsigned int nPatterns = newpattern->size();
+    for (unsigned int i = 0; i < nPatterns; i++) { thetanew += newpattern->getTheta(i); }
 
-  if (nPatterns > 0)
-    thetanew /= nPatterns;
+    if (nPatterns > 0) thetanew /= nPatterns;
 
-  double z0_new = 0.;
+    double z0_new = 0.;
 
-  double x0_new = r0_new * scphi.sn;
-  double y0_new = -r0_new * scphi.cs;
-  CxxUtils::sincos sctheta(thetanew);
+    double x0_new = r0_new * scphi.sn;
+    double y0_new = -r0_new * scphi.cs;
+    CxxUtils::sincos sctheta(thetanew);
 
-  const Amg::Vector3D pos = Amg::Vector3D(x0_new, y0_new, z0_new);
-  const Amg::Vector3D dir =
-    Amg::Vector3D(sctheta.sn * scphi.cs, sctheta.sn * scphi.sn, sctheta.cs);
+    const Amg::Vector3D pos = Amg::Vector3D(x0_new, y0_new, z0_new);
+    const Amg::Vector3D dir = Amg::Vector3D(sctheta.sn * scphi.cs, sctheta.sn * scphi.sn, sctheta.cs);
 
-  Muon::MuonPrdPattern* cleanpattern = new Muon::MuonPrdPattern(pos, dir);
+    Muon::MuonPrdPattern* cleanpattern = new Muon::MuonPrdPattern(pos, dir);
 
-  for (unsigned int i = 0; i < newpattern->size(); i++) {
-    cleanpattern->addPrd(newpattern->getPrd(i));
-  }
+    for (unsigned int i = 0; i < newpattern->size(); i++) { cleanpattern->addPrd(newpattern->getPrd(i)); }
 
-  delete newpattern; // remaining MuonHoughHits are deleted as well
+    delete newpattern;  // remaining MuonHoughHits are deleted as well
 
-  return cleanpattern;
+    return cleanpattern;
 }
 
-void
-MuonCombinePatternTool::addCandidate(
-  const Muon::MuonPrdPattern* etapattern,
-  const Muon::MuonPrdPattern* phipattern,
-  std::vector<std::pair<const Muon::MuonPrdPattern*,
-                        const Muon::MuonPrdPattern*>>& candidates,
-  bool add_asspattern,
-  std::vector<const Muon::MuonPrdPattern*>& patternsToDelete,
-  const std::map<const Trk::PrepRawData*,
-                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phiEtaHitAssMap) const
-{
-  if (!m_use_cosmics || !m_splitpatterns) {
-    candidates.emplace_back(etapattern, phipattern);
-    return;
-  }
-
-  std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-    splitpatterns = splitPatternsCylinder(phipattern, etapattern);
-
-  if (splitpatterns.empty()) {
-    candidates.emplace_back(etapattern, phipattern);
-  }
-
-  else {
-    for (unsigned int i = 0; i < splitpatterns.size(); i++) {
-      // skip when empty eta pattern , possible duplication when associated phi
-      // pattern is found, but then will be cleaned later
-      if (splitpatterns[i].second->numberOfContainedPrds() == 0) {
-        delete splitpatterns[i].first;
-        delete splitpatterns[i].second;
-      } else {
-        candidates.emplace_back(splitpatterns[i].second,
-                                splitpatterns[i].first);
-
-        // these associated phi patterns should be deleted at end of routine:
-        patternsToDelete.push_back(splitpatterns[i].first);
-        patternsToDelete.push_back(splitpatterns[i].second);
-      }
+void MuonCombinePatternTool::addCandidate(
+    const Muon::MuonPrdPattern* etapattern, const Muon::MuonPrdPattern* phipattern,
+    std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>& candidates, bool add_asspattern,
+    std::vector<const Muon::MuonPrdPattern*>& patternsToDelete,
+    const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const {
+    if (!m_use_cosmics || !m_splitpatterns) {
+        candidates.emplace_back(etapattern, phipattern);
+        return;
     }
-  }
-
-  // make associated pattern don't split eta pattern yet, but split based on phi
-  // of ass. pattern bool asspattern_added = false;
-  if (add_asspattern) {
-    const Muon::MuonPrdPattern* assphipattern =
-      makeAssPhiPattern(etapattern, phiEtaHitAssMap, true);
-    if (assphipattern) {
-
-      // print associated pattern:
-      if (msgLvl(MSG::VERBOSE)) {
-        ATH_MSG_VERBOSE("Associated Pattern: ");
-        printPattern(assphipattern);
-      }
-
-      // update parameters:
-
-      double* new_pars = updateParametersForCosmics(assphipattern, etapattern);
-      std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>
-        updatedpatterns =
-          updatePatternsForCosmics(assphipattern, etapattern, new_pars);
-      delete assphipattern;
-
-      assphipattern = updatedpatterns.first;
-      etapattern = updatedpatterns.second;
-
-      patternsToDelete.push_back(updatedpatterns.first);
-      patternsToDelete.push_back(updatedpatterns.second);
-      delete[] new_pars;
-
-      std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>>
-        splitpatterns_ass = splitPatternsCylinder(assphipattern, etapattern);
-
-      if (splitpatterns_ass.empty()) {
-        candidates.emplace_back(etapattern, assphipattern);
-      }
-
-      else {
-        for (unsigned int i = 0; i < splitpatterns_ass.size(); i++) {
-          if (splitpatterns_ass[i].first->numberOfContainedPrds() == 0 ||
-              splitpatterns_ass[i].second->numberOfContainedPrds() == 0) {
-            delete splitpatterns_ass[i].first;
-            delete splitpatterns_ass[i].second;
-          } else {
-            candidates.emplace_back(splitpatterns_ass[i].second,
-                                    splitpatterns_ass[i].first);
-
-            // these associated phi patterns should be deleted at end of
-            // routine:
-            patternsToDelete.push_back(splitpatterns_ass[i].first);
-            patternsToDelete.push_back(splitpatterns_ass[i].second);
-          }
+
+    std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitpatterns = splitPatternsCylinder(phipattern, etapattern);
+
+    if (splitpatterns.empty()) {
+        candidates.emplace_back(etapattern, phipattern);
+    }
+
+    else {
+        for (unsigned int i = 0; i < splitpatterns.size(); i++) {
+            // skip when empty eta pattern , possible duplication when associated phi
+            // pattern is found, but then will be cleaned later
+            if (splitpatterns[i].second->numberOfContainedPrds() == 0) {
+                delete splitpatterns[i].first;
+                delete splitpatterns[i].second;
+            } else {
+                candidates.emplace_back(splitpatterns[i].second, splitpatterns[i].first);
+
+                // these associated phi patterns should be deleted at end of routine:
+                patternsToDelete.push_back(splitpatterns[i].first);
+                patternsToDelete.push_back(splitpatterns[i].second);
+            }
         }
-      }
     }
-  }
-}
 
-void
-MuonCombinePatternTool::cleanCandidates(
-  std::vector<std::pair<const Muon::MuonPrdPattern*,
-                        const Muon::MuonPrdPattern*>>& candidates)
-{
-  std::vector<std::pair<const Muon::MuonPrdPattern*,
-                        const Muon::MuonPrdPattern*>>::iterator it1;
-  std::vector<std::pair<const Muon::MuonPrdPattern*,
-                        const Muon::MuonPrdPattern*>>::iterator it2;
-
-  // map between set of prd's (eta and phi) and candidates , stored for speed
-  std::map<
-    std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>,
-    std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-              std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>>
-    hitsMap;
-
-  // fill map
-
-  for (it1 = candidates.begin(); it1 != candidates.end(); ++it1) {
-    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> etahits;
-    for (unsigned int hitnr = 0; hitnr < (*it1).first->numberOfContainedPrds();
-         hitnr++) {
-      etahits.insert((*it1).first->prd(hitnr));
+    // make associated pattern don't split eta pattern yet, but split based on phi
+    // of ass. pattern bool asspattern_added = false;
+    if (add_asspattern) {
+        const Muon::MuonPrdPattern* assphipattern = makeAssPhiPattern(etapattern, phiEtaHitAssMap, true);
+        if (assphipattern) {
+            // print associated pattern:
+            if (msgLvl(MSG::VERBOSE)) {
+                ATH_MSG_VERBOSE("Associated Pattern: ");
+                printPattern(assphipattern);
+            }
+
+            // update parameters:
+
+            double* new_pars = updateParametersForCosmics(assphipattern, etapattern);
+            std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*> updatedpatterns =
+                updatePatternsForCosmics(assphipattern, etapattern, new_pars);
+            delete assphipattern;
+
+            assphipattern = updatedpatterns.first;
+            etapattern = updatedpatterns.second;
+
+            patternsToDelete.push_back(updatedpatterns.first);
+            patternsToDelete.push_back(updatedpatterns.second);
+            delete[] new_pars;
+
+            std::vector<std::pair<Muon::MuonPrdPattern*, Muon::MuonPrdPattern*>> splitpatterns_ass =
+                splitPatternsCylinder(assphipattern, etapattern);
+
+            if (splitpatterns_ass.empty()) {
+                candidates.emplace_back(etapattern, assphipattern);
+            }
+
+            else {
+                for (unsigned int i = 0; i < splitpatterns_ass.size(); i++) {
+                    if (splitpatterns_ass[i].first->numberOfContainedPrds() == 0 ||
+                        splitpatterns_ass[i].second->numberOfContainedPrds() == 0) {
+                        delete splitpatterns_ass[i].first;
+                        delete splitpatterns_ass[i].second;
+                    } else {
+                        candidates.emplace_back(splitpatterns_ass[i].second, splitpatterns_ass[i].first);
+
+                        // these associated phi patterns should be deleted at end of
+                        // routine:
+                        patternsToDelete.push_back(splitpatterns_ass[i].first);
+                        patternsToDelete.push_back(splitpatterns_ass[i].second);
+                    }
+                }
+            }
+        }
     }
-    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> phihits;
-    if ((*it1).second) { // phi pattern might be 0!
-      for (unsigned int hitnr = 0;
-           hitnr < (*it1).second->numberOfContainedPrds();
-           hitnr++) {
-        phihits.insert((*it1).second->prd(hitnr));
-      }
+}
+
+void MuonCombinePatternTool::cleanCandidates(std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>& candidates) {
+    std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>::iterator it1;
+    std::vector<std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>>::iterator it2;
+
+    // map between set of prd's (eta and phi) and candidates , stored for speed
+    std::map<
+        std::pair<const Muon::MuonPrdPattern*, const Muon::MuonPrdPattern*>,
+        std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>>
+        hitsMap;
+
+    // fill map
+
+    for (it1 = candidates.begin(); it1 != candidates.end(); ++it1) {
+        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> etahits;
+        for (unsigned int hitnr = 0; hitnr < (*it1).first->numberOfContainedPrds(); hitnr++) { etahits.insert((*it1).first->prd(hitnr)); }
+        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> phihits;
+        if ((*it1).second) {  // phi pattern might be 0!
+            for (unsigned int hitnr = 0; hitnr < (*it1).second->numberOfContainedPrds(); hitnr++) {
+                phihits.insert((*it1).second->prd(hitnr));
+            }
+        }
+        hitsMap.insert(std::make_pair((*it1), std::make_pair(etahits, phihits)));
     }
-    hitsMap.insert(std::make_pair((*it1), std::make_pair(etahits, phihits)));
-  }
-
-  for (it1 = candidates.begin(); it1 != candidates.end(); ++it1) {
-    std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-              std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
-      hits1 = hitsMap[(*it1)];
-    it2 = it1 + 1;
-    while (it2 != candidates.end()) {
-      std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
-                std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
-        hits2 = hitsMap[(*it2)];
-
-      if (subset((hits2), (hits1))) { // 2 subset of 1, remove 2 // in case of
-                                      // equality best (earliest) is kept
-        it2 = candidates.erase(
-          it2); // it2 points to next item, it1 not invalidated!
-      } else if (subset((hits1), (hits2))) { // 1 subset of 2, remove 1
-        it1 =
-          candidates.erase(it1); // it1 points to next item, it2 invalidated!
+
+    for (it1 = candidates.begin(); it1 != candidates.end(); ++it1) {
+        std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>&
+            hits1 = hitsMap[(*it1)];
         it2 = it1 + 1;
-        hits1 = hitsMap[(*it1)]; // redefine hits1
-      } else {
-        ++it2;
-      }
+        while (it2 != candidates.end()) {
+            std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>,
+                      std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>& hits2 = hitsMap[(*it2)];
+
+            if (subset((hits2), (hits1))) {         // 2 subset of 1, remove 2 // in case of
+                                                    // equality best (earliest) is kept
+                it2 = candidates.erase(it2);        // it2 points to next item, it1 not invalidated!
+            } else if (subset((hits1), (hits2))) {  // 1 subset of 2, remove 1
+                it1 = candidates.erase(it1);        // it1 points to next item, it2 invalidated!
+                it2 = it1 + 1;
+                hits1 = hitsMap[(*it1)];  // redefine hits1
+            } else {
+                ++it2;
+            }
+        }
     }
-  }
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/components/MuonCombinePatternTool_entries.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/components/MuonCombinePatternTool_entries.cxx
index f54b26d1c5e4ffd3222a5d95ab41c93b327c782a..de12865d08c57a497b0d73545c85d3ecc90faa4a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/components/MuonCombinePatternTool_entries.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonCombinePatternTools/src/components/MuonCombinePatternTool_entries.cxx
@@ -1,4 +1,3 @@
 #include "MuonCombinePatternTools/MuonCombinePatternTool.h"
 
-DECLARE_COMPONENT( MuonCombinePatternTool )
-
+DECLARE_COMPONENT(MuonCombinePatternTool)
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/IMuonHoughPatternTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/IMuonHoughPatternTool.h
index 33e03d81ab97a1324543a6e92abac584b6664063..240cfbf5b4b7586c6eaa59df049a5482bcb369d1 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/IMuonHoughPatternTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/IMuonHoughPatternTool.h
@@ -6,29 +6,28 @@
 #define MUONHOUGHPATTERNTOOLS_IMUONHOUGHPATTERNTOOL_H
 
 #include "GaudiKernel/IAlgTool.h"
-#include "MuonPattern/MuonPatternCollection.h"
 #include "MuonHoughPatternEvent/MuonHoughPatternCollection.h"
+#include "MuonPattern/MuonPatternCollection.h"
 
 class MuonHoughHitContainer;
 
-class IMuonHoughPatternTool : virtual public IAlgTool 
-{
- public:
-  /** @todo should be rethought and possibly using the Moore Interface */
-
-  DeclareInterfaceID(IMuonHoughPatternTool, 1, 0);
-  
-  /** Builds Patterns */
-  virtual void makePatterns(const MuonHoughHitContainer* hitcontainer, MuonHoughPatternContainerShip& houghpatterns) const = 0;
-
-  /** returns phi patterns */
-  virtual MuonPrdPatternCollection* getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const = 0;  
-  /** returns eta patterns */
-  virtual MuonPrdPatternCollection* getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const =0;
-  /** returns houghpatterns arrays*/
-  virtual MuonHoughPatternContainerShip emptyHoughPattern() const =0;
-  /** resets houghpattern arrays*/
-  virtual void reset(MuonHoughPatternContainerShip& houghpattern) const =0;
+class IMuonHoughPatternTool : virtual public IAlgTool {
+public:
+    /** @todo should be rethought and possibly using the Moore Interface */
+
+    DeclareInterfaceID(IMuonHoughPatternTool, 1, 0);
+
+    /** Builds Patterns */
+    virtual void makePatterns(const MuonHoughHitContainer* hitcontainer, MuonHoughPatternContainerShip& houghpatterns) const = 0;
+
+    /** returns phi patterns */
+    virtual MuonPrdPatternCollection* getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const = 0;
+    /** returns eta patterns */
+    virtual MuonPrdPatternCollection* getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const = 0;
+    /** returns houghpatterns arrays*/
+    virtual MuonHoughPatternContainerShip emptyHoughPattern() const = 0;
+    /** resets houghpattern arrays*/
+    virtual void reset(MuonHoughPatternContainerShip& houghpattern) const = 0;
 };
 
-#endif //MUONHOUGHPATTERNTOOLS_IMUONHOUGHPATTERNTOOL_H
+#endif  // MUONHOUGHPATTERNTOOLS_IMUONHOUGHPATTERNTOOL_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternFinderTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternFinderTool.h
index c07d5e1ebeb5a7f03facdee269f6108c3c8392db..9c61547289fdc49bf9fc110f9c6f026a5fdf6f1c 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternFinderTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternFinderTool.h
@@ -5,25 +5,23 @@
 #ifndef MUONHOUGHPATTERNALGS_MUONHOUGHPATTERNFINDERTOOL_H
 #define MUONHOUGHPATTERNALGS_MUONHOUGHPATTERNFINDERTOOL_H
 
+#include <iostream>
+#include <string>
+#include <vector>
+
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "MuonRecToolInterfaces/IMuonHoughPatternFinderTool.h"
-
 #include "MuonHoughPatternTools/IMuonHoughPatternTool.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
-#include "MuonRecHelperTools/MuonEDMPrinterTool.h"
-#include "MuonRecToolInterfaces/IMuonCombinePatternTool.h"
-
 #include "MuonPattern/MuonPatternCollection.h"
 #include "MuonPattern/MuonPatternCombinationCollection.h"
+#include "MuonRecHelperTools/MuonEDMPrinterTool.h"
+#include "MuonRecToolInterfaces/IMuonCombinePatternTool.h"
+#include "MuonRecToolInterfaces/IMuonHoughPatternFinderTool.h"
 #include "MuonSegment/MuonSegmentCombinationCollection.h"
 #include "TrkDriftCircleMath/DriftCircle.h"
 
-#include <iostream>
-#include <string>
-#include <vector>
-
 class TH1F;
 class TFile;
 
@@ -31,241 +29,167 @@ class MuonHoughHitContainer;
 
 namespace Muon {
 
-class MuonHoughPatternFinderTool
-  : virtual public IMuonHoughPatternFinderTool
-  , public AthAlgTool
-{
-public:
-  /** constructor */
-  MuonHoughPatternFinderTool(const std::string&,
-                             const std::string&,
-                             const IInterface*);
-
-  /** destructor */
-  virtual ~MuonHoughPatternFinderTool() = default;
-
-  /** initialize */
-  virtual StatusCode initialize();
-  /** finalize */
-  virtual StatusCode finalize();
-
-  /** find patterns for a give set of MuonPrepData collections + optionally CSC
-   * segment combinations */
-  std::pair<std::unique_ptr<MuonPatternCombinationCollection>,
-            std::unique_ptr<Muon::HoughDataPerSectorVec>>
-  find(const std::vector<const MdtPrepDataCollection*>& mdtCols,
-       const std::vector<const CscPrepDataCollection*>& cscCols,
-       const std::vector<const TgcPrepDataCollection*>& tgcCols,
-       const std::vector<const RpcPrepDataCollection*>& rpcCols,
-       const MuonSegmentCombinationCollection* cscSegmentCombis,
-       const EventContext& ctx) const;
-
-private:
-  /** retrieves all hits and converts them into internal EDM */
-  const MuonHoughHitContainer* getAllHits(
-    const std::vector<const MdtPrepDataCollection*>& mdtCols,
-    const std::vector<const CscPrepDataCollection*>& cscCols,
-    const std::vector<const TgcPrepDataCollection*>& tgcCols,
-    const std::vector<const RpcPrepDataCollection*>& rpcCols,
-    const MuonSegmentCombinationCollection* cscSegmentCombis,
-    std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
-    std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
-    std::map<const Trk::PrepRawData*,
-             std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phietahitassociation) const;
-
-  /** possibility to skip events, nothing implemented */
-  static bool cut() ;
-
-  /** analyse hits */
-  MuonPatternCombinationCollection* analyse(
-    const MuonHoughHitContainer& hitcontainer,
-    const std::map<const Trk::PrepRawData*,
-                   std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phietahitassociation,
-    const EventContext& ctx) const;
-
-private:
-  /** record patterncollection to storegate or deletes collection when
-   * m_recordAllOutput is false */
-  void record(MuonPrdPatternCollection* patCol,
-              const SG::WriteHandleKey<MuonPrdPatternCollection>& key,
-              const EventContext& ctx) const;
-
-  /** convert and add rpc preprawdata collection (1 chamber) */
-  void addRpcCollection(
-    Muon::RpcPrepDataCollection::const_iterator cit_begin,
-    Muon::RpcPrepDataCollection::const_iterator cit_end,
-    MuonHoughHitContainer* hitcontainer,
-    std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
-    std::map<const Trk::PrepRawData*,
-             std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phietahitassociation) const;
-  /** convert and add mdt preprawdata collection (1 chamber) */
-  void addMdtCollection(
-    Muon::MdtPrepDataCollection::const_iterator cit_begin,
-    Muon::MdtPrepDataCollection::const_iterator cit_end,
-    MuonHoughHitContainer* hitcontainer,
-    std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
-    std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const;
-  /** convert and add csc preprawdata collection (1 chamber) */
-  void addCscCollection(
-    Muon::CscPrepDataCollection::const_iterator cit_begin,
-    Muon::CscPrepDataCollection::const_iterator cit_end,
-    MuonHoughHitContainer* hitcontainer,
-    std::map<const Trk::PrepRawData*,
-             std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phietahitassociation) const;
-  /** convert and add tgc preprawdata collection (1 chamber) */
-  void addTgcCollection(
-    Muon::TgcPrepDataCollection::const_iterator cit_begin,
-    Muon::TgcPrepDataCollection::const_iterator cit_end,
-    MuonHoughHitContainer* hitcontainer,
-    std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
-    std::map<const Trk::PrepRawData*,
-             std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phietahitassociation) const;
-
-  /** finds best segment for given driftcircle vector (nl1/2 = number of dc's in
-   * ml 1 and 2, angledif is difference between angle of segment and
-   * chamberangle, sel is vector of selected hits (0 not selected, 1 selected)
-   */
-  void fastSegmentFinder(TrkDriftCircleMath::DCVec& dcs,
-                         int& nl1,
-                         int& nl2,
-                         double& angleDif,
-                         std::vector<int>& sel) const;
-
-  /** calculateStationCode(const Identifier)*/
-  int calculateStationCode(const Identifier) const;
-
-  /** update station map for rpc chamber, with id of chamber, and size of hits
-   * in rpc chamber */
-  void updateRpcMdtStationMap(
-    const Identifier rpcid,
-    int hit_begin,
-    int hit_end,
-    std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap) const;
-
-  /** update station map for tgc chamber, with id of chamber, and size of hits
-   * in tgc chamber */
-  void updateTgcMdtStationMap(
-    const Identifier tgcid,
-    int hit_begin,
-    int hit_end,
-    std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const;
-
-  /** calculates an unique stationcode integer (own convention)*/
-  int stationCode(Identifier id) const;
-
-  /** calculates an unique stationcode integer (own convention)*/
-  static int stationCode(int stationname, int phi, int eta) ;
-
-  static void addToStationMap(
-    std::map<int, std::vector<std::pair<int, int>>>& stationmap,
-    std::map<int, std::vector<std::pair<int, int>>>::iterator& it,
-    int& stationcode,
-    const int& hit_begin,
-    const int& hit_end) ;
-
-  ToolHandle<IMuonHoughPatternTool> m_muonHoughPatternTool{
-    this,
-    "muonHoughPatternTool",
-    "MuonHoughPatternTool"
-  }; //!< Pointer to concrete tool
-  ToolHandle<Muon::IMuonCombinePatternTool> m_muonCombinePatternTool{
-    this,
-    "muonCombinePatternTool",
-    "MuonCombinePatternTool"
-  }; //!< Pointer to concrete tool
-  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{
-    this,
-    "MuonIdHelperSvc",
-    "Muon::MuonIdHelperSvc/MuonIdHelperSvc"
-  };
-  ToolHandle<Muon::MuonEDMPrinterTool> m_printer{
-    this,
-    "printerTool",
-    "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
-    "ToolHandle for EDM printing of segments"
-  };
-
-  /** reweight hits (true) */
-  Gaudi::Property<bool> m_hit_reweights{ this, "HitReweights", true };
-  /** use adc cut (true) */
-  Gaudi::Property<bool> m_mdt_adc_cut{ this, "MDT_ADC_cut", true };
-  /** value of adc cut (50) */
-  Gaudi::Property<int> m_mdt_adc_min{ this, "MDT_ADC_value", 50 };
-  /** use tdc cut (false) */
-  Gaudi::Property<bool> m_mdt_tdc_cut{ this, "MDT_TDC_cut", true };
-
-  /** use rpc preprawdata (true) */
-  Gaudi::Property<bool> m_use_rpc{ this, "RPC", true };
-  /** use tgc preprawdata (true) */
-  Gaudi::Property<bool> m_use_tgc{ this, "TGC", true };
-  /** use csc preprawdata (true) */
-  Gaudi::Property<bool> m_use_csc{ this, "CSC", true };
-  /** use mdt preprawdata (true) */
-  Gaudi::Property<bool> m_use_mdt{ this, "MDT", true };
-  /** use weight for csc segments */
-  double m_weight_csc_on_segment;
-
-  /** reduce cpu for showers (true) */
-  Gaudi::Property<bool> m_showerskip{ this, "ShowerSkipping", true };
-  /** percentage of occupancy to skip MDT chamber (0.3) */
-  Gaudi::Property<double> m_showerskipperc{ this, "ShowerSkipPercentage", 0.3 };
-
-  /** flag to output a root file to study the weights of hits */
-  Gaudi::Property<bool> m_use_histos{ this, "UseHistos", false };
-
-  /** flag to print out a summary of what comes in and what comes out */
-  Gaudi::Property<bool> m_summary{ this, "DoSummary", false };
-
-  /** flag to write out intermediate patterns */
-  Gaudi::Property<bool> m_recordAllOutput{ this, "RecordAll", false };
-
-  /** storegate location for csc association map */
-  Gaudi::Property<std::string> m_cscAssoOutputLocation{
-    this,
-    "PatCscSegAssMapOutputLocation",
-    "MuonPatCscSegAssMap"
-  }; // Not used
-
-  /** pointer to the CSC segment combination collection */
-  // const MuonSegmentCombinationCollection* m_csc_segments;
-
-  /** histogram file for studies on weighting (only in use, when m_use_histos is
-   * true) */
-  TFile* m_file{};
-  /** all hits histograms for studies on weighting (only in use, when
-   * m_use_histos is true) */
-  TH1F* m_weighthistogram{};
-  /** mdt histogram */
-  TH1F* m_weighthistogrammdt{};
-  /** rpc histogram */
-  TH1F* m_weighthistogramrpc{};
-  /** tgc histogram */
-  TH1F* m_weighthistogramtgc{};
-  /** csc histogram */
-  TH1F* m_weighthistogramcsc{};
-
-  SG::WriteHandleKey<MuonPrdPatternCollection> m_CosmicPhiPatternsKey{
-    this,
-    "CosmicPhiKey",
-    "CosmicPhiPatterns"
-  };
-  SG::WriteHandleKey<MuonPrdPatternCollection> m_CosmicEtaPatternsKey{
-    this,
-    "CosmicEtaPatterns",
-    "CosmicEtaPatterns"
-  };
-  SG::WriteHandleKey<MuonPrdPatternCollection> m_COMBINED_PATTERNSKey{
-    this,
-    "PATTERNS",
-    "COMBINED_PATTERNS"
-  };
-};
-
-}
-
-#endif // MUONHOUGHPATTERNALGS_MUONHOUGHPATTERNALG_H
+    class MuonHoughPatternFinderTool : virtual public IMuonHoughPatternFinderTool, public AthAlgTool {
+    public:
+        /** constructor */
+        MuonHoughPatternFinderTool(const std::string&, const std::string&, const IInterface*);
+
+        /** destructor */
+        virtual ~MuonHoughPatternFinderTool() = default;
+
+        /** initialize */
+        virtual StatusCode initialize();
+        /** finalize */
+        virtual StatusCode finalize();
+
+        /** find patterns for a give set of MuonPrepData collections + optionally CSC
+         * segment combinations */
+        std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<Muon::HoughDataPerSectorVec>> find(
+            const std::vector<const MdtPrepDataCollection*>& mdtCols, const std::vector<const CscPrepDataCollection*>& cscCols,
+            const std::vector<const TgcPrepDataCollection*>& tgcCols, const std::vector<const RpcPrepDataCollection*>& rpcCols,
+            const MuonSegmentCombinationCollection* cscSegmentCombis, const EventContext& ctx) const;
+
+    private:
+        /** retrieves all hits and converts them into internal EDM */
+        const MuonHoughHitContainer* getAllHits(
+            const std::vector<const MdtPrepDataCollection*>& mdtCols, const std::vector<const CscPrepDataCollection*>& cscCols,
+            const std::vector<const TgcPrepDataCollection*>& tgcCols, const std::vector<const RpcPrepDataCollection*>& rpcCols,
+            const MuonSegmentCombinationCollection* cscSegmentCombis, std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
+            std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
+            std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const;
+
+        /** possibility to skip events, nothing implemented */
+        static bool cut();
+
+        /** analyse hits */
+        MuonPatternCombinationCollection* analyse(
+            const MuonHoughHitContainer& hitcontainer,
+            const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation,
+            const EventContext& ctx) const;
+
+    private:
+        /** record patterncollection to storegate or deletes collection when
+         * m_recordAllOutput is false */
+        void record(MuonPrdPatternCollection* patCol, const SG::WriteHandleKey<MuonPrdPatternCollection>& key,
+                    const EventContext& ctx) const;
+
+        /** convert and add rpc preprawdata collection (1 chamber) */
+        void addRpcCollection(
+            Muon::RpcPrepDataCollection::const_iterator cit_begin, Muon::RpcPrepDataCollection::const_iterator cit_end,
+            MuonHoughHitContainer* hitcontainer, std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
+            std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const;
+        /** convert and add mdt preprawdata collection (1 chamber) */
+        void addMdtCollection(Muon::MdtPrepDataCollection::const_iterator cit_begin, Muon::MdtPrepDataCollection::const_iterator cit_end,
+                              MuonHoughHitContainer* hitcontainer, std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
+                              std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const;
+        /** convert and add csc preprawdata collection (1 chamber) */
+        void addCscCollection(
+            Muon::CscPrepDataCollection::const_iterator cit_begin, Muon::CscPrepDataCollection::const_iterator cit_end,
+            MuonHoughHitContainer* hitcontainer,
+            std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const;
+        /** convert and add tgc preprawdata collection (1 chamber) */
+        void addTgcCollection(
+            Muon::TgcPrepDataCollection::const_iterator cit_begin, Muon::TgcPrepDataCollection::const_iterator cit_end,
+            MuonHoughHitContainer* hitcontainer, std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
+            std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const;
+
+        /** finds best segment for given driftcircle vector (nl1/2 = number of dc's in
+         * ml 1 and 2, angledif is difference between angle of segment and
+         * chamberangle, sel is vector of selected hits (0 not selected, 1 selected)
+         */
+        void fastSegmentFinder(TrkDriftCircleMath::DCVec& dcs, int& nl1, int& nl2, double& angleDif, std::vector<int>& sel) const;
+
+        /** calculateStationCode(const Identifier)*/
+        int calculateStationCode(const Identifier) const;
+
+        /** update station map for rpc chamber, with id of chamber, and size of hits
+         * in rpc chamber */
+        void updateRpcMdtStationMap(const Identifier rpcid, int hit_begin, int hit_end,
+                                    std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap) const;
+
+        /** update station map for tgc chamber, with id of chamber, and size of hits
+         * in tgc chamber */
+        void updateTgcMdtStationMap(const Identifier tgcid, int hit_begin, int hit_end,
+                                    std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const;
+
+        /** calculates an unique stationcode integer (own convention)*/
+        int stationCode(Identifier id) const;
+
+        /** calculates an unique stationcode integer (own convention)*/
+        static int stationCode(int stationname, int phi, int eta);
+
+        static void addToStationMap(std::map<int, std::vector<std::pair<int, int>>>& stationmap,
+                                    std::map<int, std::vector<std::pair<int, int>>>::iterator& it, int& stationcode, const int& hit_begin,
+                                    const int& hit_end);
+
+        ToolHandle<IMuonHoughPatternTool> m_muonHoughPatternTool{this, "muonHoughPatternTool",
+                                                                 "MuonHoughPatternTool"};  //!< Pointer to concrete tool
+        ToolHandle<Muon::IMuonCombinePatternTool> m_muonCombinePatternTool{this, "muonCombinePatternTool",
+                                                                           "MuonCombinePatternTool"};  //!< Pointer to concrete tool
+        ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+        ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
+                                                       "ToolHandle for EDM printing of segments"};
+
+        /** reweight hits (true) */
+        Gaudi::Property<bool> m_hit_reweights{this, "HitReweights", true};
+        /** use adc cut (true) */
+        Gaudi::Property<bool> m_mdt_adc_cut{this, "MDT_ADC_cut", true};
+        /** value of adc cut (50) */
+        Gaudi::Property<int> m_mdt_adc_min{this, "MDT_ADC_value", 50};
+        /** use tdc cut (false) */
+        Gaudi::Property<bool> m_mdt_tdc_cut{this, "MDT_TDC_cut", true};
+
+        /** use rpc preprawdata (true) */
+        Gaudi::Property<bool> m_use_rpc{this, "RPC", true};
+        /** use tgc preprawdata (true) */
+        Gaudi::Property<bool> m_use_tgc{this, "TGC", true};
+        /** use csc preprawdata (true) */
+        Gaudi::Property<bool> m_use_csc{this, "CSC", true};
+        /** use mdt preprawdata (true) */
+        Gaudi::Property<bool> m_use_mdt{this, "MDT", true};
+        /** use weight for csc segments */
+        double m_weight_csc_on_segment;
+
+        /** reduce cpu for showers (true) */
+        Gaudi::Property<bool> m_showerskip{this, "ShowerSkipping", true};
+        /** percentage of occupancy to skip MDT chamber (0.3) */
+        Gaudi::Property<double> m_showerskipperc{this, "ShowerSkipPercentage", 0.3};
+
+        /** flag to output a root file to study the weights of hits */
+        Gaudi::Property<bool> m_use_histos{this, "UseHistos", false};
+
+        /** flag to print out a summary of what comes in and what comes out */
+        Gaudi::Property<bool> m_summary{this, "DoSummary", false};
+
+        /** flag to write out intermediate patterns */
+        Gaudi::Property<bool> m_recordAllOutput{this, "RecordAll", false};
+
+        /** storegate location for csc association map */
+        Gaudi::Property<std::string> m_cscAssoOutputLocation{this, "PatCscSegAssMapOutputLocation", "MuonPatCscSegAssMap"};  // Not used
+
+        /** pointer to the CSC segment combination collection */
+        // const MuonSegmentCombinationCollection* m_csc_segments;
+
+        /** histogram file for studies on weighting (only in use, when m_use_histos is
+         * true) */
+        TFile* m_file{};
+        /** all hits histograms for studies on weighting (only in use, when
+         * m_use_histos is true) */
+        TH1F* m_weighthistogram{};
+        /** mdt histogram */
+        TH1F* m_weighthistogrammdt{};
+        /** rpc histogram */
+        TH1F* m_weighthistogramrpc{};
+        /** tgc histogram */
+        TH1F* m_weighthistogramtgc{};
+        /** csc histogram */
+        TH1F* m_weighthistogramcsc{};
+
+        SG::WriteHandleKey<MuonPrdPatternCollection> m_CosmicPhiPatternsKey{this, "CosmicPhiKey", "CosmicPhiPatterns"};
+        SG::WriteHandleKey<MuonPrdPatternCollection> m_CosmicEtaPatternsKey{this, "CosmicEtaPatterns", "CosmicEtaPatterns"};
+        SG::WriteHandleKey<MuonPrdPatternCollection> m_COMBINED_PATTERNSKey{this, "PATTERNS", "COMBINED_PATTERNS"};
+    };
+
+}  // namespace Muon
+
+#endif  // MUONHOUGHPATTERNALGS_MUONHOUGHPATTERNALG_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternTool.h
index a0101756856f61aea1c65e24d49860005a689569..8d2fe48117ac453c4e9926df503640924323118e 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonHoughPatternTool.h
@@ -5,289 +5,290 @@
 #ifndef MUONHOUGHPATTERNTOOLS_MUONHOUGHPATTERNTOOL_H
 #define MUONHOUGHPATTERNTOOLS_MUONHOUGHPATTERNTOOL_H
 
-#include "MuonHoughPatternTools/IMuonHoughPatternTool.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
+#include "MuonHoughPatternTools/IMuonHoughPatternTool.h"
 
 class MuonHoughTransformSteering;
 class MuonHoughTransformer;
 class TFile;
 class TH2F;
 
-class MuonHoughPatternTool : virtual public IMuonHoughPatternTool, public AthAlgTool
-{
- public:
-
-  /** Default constructor */
-  MuonHoughPatternTool(const std::string& type, const std::string& name, const IInterface* parent);
-  /** Destructor */
-  virtual ~MuonHoughPatternTool() = default;
-
-  /** method that builds the patterns */
-  virtual void makePatterns(const MuonHoughHitContainer* hitcontainer, MuonHoughPatternContainerShip& houghpatterns) const ;
-
-  /** initiates private members */
-  virtual StatusCode initialize(); 
-
-  /** deletes private members */
-  virtual StatusCode finalize(); 
-
-  /** returns phipattern container in EDM */
-  virtual MuonPrdPatternCollection* getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const ;
-  /** returns etapattern container in EDM */
-  virtual MuonPrdPatternCollection* getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const ;
-
-  /** resets houpattern vector, called once per event from FinderTool*/
-  void reset(MuonHoughPatternContainerShip& houghpattern) const;
-  /** creates houghpatterns, called from FinderTool */
-  MuonHoughPatternContainerShip emptyHoughPattern() const;
-
- private:
-
-  /** method that builds the patterns */
-  virtual void makePatterns(int id_number, double weightmdt, const MuonHoughHitContainer* event, MuonHoughPatternContainerShip& houghpatterns) const ;
-
-  /** returns curvedpattern container in EDM */
-  MuonPrdPatternCollection* getCurvedMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const ;
-
-  /** reset association flag of hits in m_event */
-  static void resetAssociation(const MuonHoughHitContainer* event) ;
-
-  /** reduces Detector sizes for Hough Histograms to find patterns from muons from the Interaction Point (default on) */
-  void useIPMuons();
-  
-  /**
-   * @brief fills the hough histograms 
-   * @param[in] id_number The enum number corresponding to the HoughTransform
-   * @param[in] level The iteration number
-   * @param[in] event_to_analyse The hitcontainer which fills the histogram
-   * @param[in] houghtransform The HoughTransform
-   */
-  void fillHistos(int id_number, int level,const MuonHoughHitContainer* event_to_analyse,MuonHoughTransformSteering* houghtransform) const ;
-  /**
-   * @brief analyses the hough histograms 
-   * @param[in] id_number The enum number corresponding to the HoughTransform
-   * @param[in] level The iteration number
-   * @param[in] event_to_analyse The hitcontainer which will be associated to the pattern
-   * @param[in] houghtransform The HoughTransform
-   */
-  bool analyseHisto(int id_number, int level,const MuonHoughHitContainer* event_to_analyse,MuonHoughTransformSteering* houghtransform, MuonHoughPatternContainerShip& houghpatterns) const;
-
-  /** method to analyse the pattern build, currently nothing implemented */
-  void analyseTrack(int id_number,const MuonHoughHitContainer* event_to_analyse,MuonHoughTransformSteering* houghtransform) const; 
-
-  /** returns if there are hits left */
-  static bool hitsLeft(const MuonHoughHitContainer* event);
-
-  /** returns number of hits left (unused) */
-  int numberOfHits(const MuonHoughHitContainer* event)const;
-
-  /** checks if hit is already in one of the found houghpatterns (unused) */
-  bool hitInHoughPattern(MuonHoughHit* hit,const MuonHoughPatternContainer &houghpattern)const; 
-
-  /** returns a hitcontainer with hits not yet used in pattern */
-  static MuonHoughHitContainer* hitsNotInPattern(const MuonHoughHitContainer* event, int id_number);
-
-  /** rescales hits per iteration to reduce number of patterns when already some have been found */
-  void weightRescaling(const MuonHoughHitContainer* event, int id_number, int level)const;
-
-  /** calculates new weights based on rejection factor (1-origweight) and number of hits in event, only done for MDTs */
-  void calculateWeights(const MuonHoughHitContainer* event, double weightmdt)const;
-
-  /** returns number of hits that are in both hough patterns */
-  int overlapHoughPatterns(const MuonHoughPattern *houghpattern1, const MuonHoughPattern *houghpattern2)const;
-
-  /** selects the hitcontainer to be used for filling the histograms */
-  MuonHoughHitContainer* whichEventHough(int id, const MuonHoughHitContainer* event, double weightmdt)const;
-
-  /** selects the hitcontainer to be used to associate to the maxima */
-  MuonHoughHitContainer* whichEventAssociation(int id, const MuonHoughHitContainer* event)const;
-
-  /** returns the Houghtransform for the id */
-  MuonHoughTransformSteering* whichHoughTransform (int id) const;
-
-  /** returns the maximum iteration, not in use */
-  std::vector <int> maxLevelHoughPattern(const MuonHoughPatternContainerShip &houghpattern)const;
-
-  /** returns the maximum iteration, not in use */
-  /** @todo should be in houghpattern? */
-  int maxLevelHoughPattern(const MuonHoughPatternContainerShip &houghpattern,int id_number)const; 
-
-  /** corrects the maximum of the histogram with a factor (not in use anymore, used for old rz transform) */
-  void transformCoordsMaximum(std::pair <double,double> &coordsmaximum,double r0_true)const;
-
-  /** converts hough pattern to EDM eta patterns */
-  Muon::MuonPrdPattern* houghPatternToEtaPattern(MuonHoughPattern* houghpattern)const;
-  /** converts hough pattern to EDM phi patterns */
-  Muon::MuonPrdPattern* houghPatternToPhiPattern(MuonHoughPattern* houghpattern)const;
-  /** converts and combines two hough patterns to one EDM phi pattern */
-  Muon::MuonPrdPattern* houghPatternsToOneEtaPattern(MuonHoughPattern* houghpattern1, MuonHoughPattern* houghpattern2)const;
-  /** converts and combines two hough patterns to one EDM phi pattern */
-  Muon::MuonPrdPattern* houghPatternsToOnePhiPattern(MuonHoughPattern* houghpattern1, MuonHoughPattern* houghpattern2)const;
-  /** converts hough pattern to EDM phi patterns and cleans it from outliers */
-  Muon::MuonPrdPattern* houghPatternToCleanPhiPattern(MuonHoughPattern* houghpattern)const;
-
-  /** returns minimum number of hits a hough pattern can contain */
-  unsigned int getThresholdHoughPattern(int id_number)const;
-  /** returns minimum number for the maximum of a hough transform */
-  double getThresholdHisto(int id_number)const;
-
-  /** calculates the mdt weight cut value */
-  void setWeightMdtCutValue(const MuonHoughHitContainer* event, double& weightmdt) const;
-
-  /** hit through weight cut? */
-  bool hitThroughCut(MuonHoughHit* hit, double weightmdt)const;
-
-  /** pointer to the file name for the hough histograms */
-  TFile *m_file{};
-  /** object for use of mathematical formulas for trackmodels */
-  MuonHoughMathUtils m_muonhoughmathutils;
-
-  /** output histograms (false) */
-  Gaudi::Property<bool> m_use_histos{this,"UseHistos",false};
-  /** use cosmic settings (false) */
-  Gaudi::Property<bool> m_use_cosmics{this,"UseCosmics",false};
-  /** use csc hits in association / pattern (true) */
-  Gaudi::Property<bool> m_use_csc_in_pattern{this,"UseCscInPattern",true};
-  /** use csc hits in histogram (false) */
-  Gaudi::Property<bool> m_use_csc_in_hough{this,"UseCscInHough",true};
-  /** use negative weights (false) */
-  Gaudi::Property<bool> m_use_negative_weights{this,"UseNegativeWeights",false};
-  /** use curved hough transformation for eta patterns (true) */
-  Gaudi::Property<bool> m_use_curvedhough{this,"UseCurvedHough",true};
-  
-  /** number of hough transforms currently supported (7) */
-  int m_number_of_ids;
-
-  /** number of iterations (5) */
-  Gaudi::Property<int> m_number_of_maxima{this,"NumberOfMaximaPerIterations",5};
-
-  /** use rpc phi strips in phi-patterns (true) */
-  //const bool m_use_rpc_measures_phi; 
-  /** use rpc eta strips in eta-patterns (true) */
-  const bool m_use_rpc_measures_eta; 
-  /** use interaction point constraint (true) */
-  bool m_use_ip; 
-
-  /** minimal size for a phi pattern (1) */
-  Gaudi::Property<unsigned int> m_thresholdpattern_xyz{this,"SetThresholdPatternRPhi",1}; 
-  /** minimal size for a eta pattern (3) */
-  Gaudi::Property<unsigned int> m_thresholdpattern_rz{this,"SetThresholdPatternREta",3};
-
-  // hittosegment association: 
-
-  /** distance hits are associated with pattern in mm */
-  const double m_maximum_residu_mm;
-  /** distance hits are associated with pattern in mm for cosmics */
-  const double m_maximum_residu_mm_cosmics;
-  /** distance hits are associated with pattern in degrees */
-  const double m_maximum_residu_angle;
-
-  /** // number of maximum iterations over houghtransform */
-  const int m_maximum_level; 
-
-  // for hough_correction:
-
-  /** use hough correction 
-   * to correct the maximum found in rz-plane slightly as there is a bias in the houghtransform 
-   */
-  //const bool m_use_hough_correction; 
-  /** constant 1 for z for hough correction */
-  const double m_z_cor_constant;
-  /** constant 2 for z for hough correction */
-  const double m_z_cor_constant2;
-  /** constant 1 for theta for hough correction */
-  const double m_theta_cor_constant;
-  /** constant 2 for theta for hough correction */
-  const double m_theta_cor_constant2;
-
-  // detectorsizes:
-
-  /** acceptancy of patterns in xy (phi) in mm */
-  double m_detectorsize_xy; 
-  /** acceptancy of patterns in yz (not used) in mm */
-  double m_detectorsize_yz; 
-  /** acceptancy of patterns in rz (eta) in mm */
-  double m_detectorsize_rz;
-  
-  /** size of full detector in xy (phi) in mm, used as acceptancy for cosmics */
-  const double m_detectorsize_xy_full;
-  /** size of full detector in yz (not used) in mm, used as acceptancy for cosmics */
-  const double m_detectorsize_yz_full; 
-  /** size of full detector in rz (eta) in mm, used as acceptancy for cosmics */
-  const double m_detectorsize_rz_full; 
-
-  /** acceptancy of patterns for ip in xy (phi) in mm */
-  const double m_detectorsize_xy_ip; 
-  /** acceptancy of patterns for ip in yz (not used) in mm */
-  const double m_detectorsize_yz_ip;  
-  /** acceptancy of patterns for ip in rz (eta) in mm */
-  const double m_detectorsize_rz_ip; 
-
-  /** max range of angle in xyz in degrees (360) */
-  const double m_detectorsize_angle_xyz;
-  /** max range of angle in rz in degrees (180) */
-  const double m_detectorsize_angle_rz; 
-  /** max range of 1/sqrt(curvature) for curved transform, corresponds to 0.02 ~ 2,5m ~ 1.6GeV */
-  //const double m_detectorsize_inv_sqrt_curvature; 
-
-  // properties of histograms:
-
-  /** bin width for xy */
-  const double m_stepsize_xy;
-  /** bin width for yz */
-  const double m_stepsize_yz;
-  /** bin width for rz */
-  const double m_stepsize_rz;
-  /** bin width for xy cosmics */
-  const double m_stepsize_xy_cosmics;
-  /** bin width for rzcosmics */
-  const double m_stepsize_rz_cosmics;
-  /** bin width for angle in xyz */
-  const double m_stepsize_per_angle_xyz;
-  /** bin width for angle in rz */
-  const double m_stepsize_per_angle_rz;
-  /** bin width for angle in xy cosmics */
-  const double m_stepsize_per_angle_xy_cosmics;
-  /** bin width for angle in rzcosmics */
-  const double m_stepsize_per_angle_rz_cosmics;
-  /** bin width for 1/sqrt(curvature) */
-  //const double m_stepsize_per_inv_sqrt_curvature;
-
-  /** new curved properties */
-  const int m_nbins_curved; 
-
-  /** weight_cut for hits in hough */
-  Gaudi::Property<bool> m_weightcut{this,"ApplyWeightCut",true};
-
-  /** value of weight cut */
-  Gaudi::Property<double> m_weight{this,"WeightCut",0.25}; // cut all hits under 0.25
-
-  /** weight_cut for mdt hits in hough */
-  Gaudi::Property<bool> m_weightcutmdt{this,"ApplyWeightCutMdt",true};  // cut all mdt hits under a certain weight (dependent on number of mdt hits in event
-
-  /** threshold histogram in xyz */
-  Gaudi::Property<double> m_thresholdhisto_xyz{this,"SetThresholdHistoRPhi",0.9};
-  /** threshold histogram in rz */
-  Gaudi::Property<double> m_thresholdhisto_rz{this,"SetThresholdHistoREta",2.1};
-
-  /** number of sectors (different regions in which patterns can be found in the same iteration) in xyz */
-  Gaudi::Property<int> m_number_of_sectors_xyz{this,"SetNumberOfSectorsRPhi",12};
-  /** number of sectors (different regions in which patterns can be found in the same iteration) in rz */
-  Gaudi::Property<int> m_number_of_sectors_rz{this,"SetNumberOfSectorsREta",16};
-  /** number of sectors (different regions in which patterns can be found in the same iteration) in rzcosmics */
-  int m_number_of_sectors_rz_cosmics;
-
-  /** output level (range 0-10) (default 0) */
-  Gaudi::Property<int> m_printlevel{this,"Printlevel",0};
-
-  mutable std::atomic_uint m_ncalls{0};
-
-  /** maximum number of phi hits to do pattern recognition, if small zero no cut is applied */
-  Gaudi::Property<int> m_maxNumberOfPhiHits{this,"MaximumNumberOfPhiHits",-1};
-
-  /** print out pattern hits */
-  void printPattern(Muon::MuonPrdPattern* muonpattern)const;
+class MuonHoughPatternTool : virtual public IMuonHoughPatternTool, public AthAlgTool {
+public:
+    /** Default constructor */
+    MuonHoughPatternTool(const std::string& type, const std::string& name, const IInterface* parent);
+    /** Destructor */
+    virtual ~MuonHoughPatternTool() = default;
+
+    /** method that builds the patterns */
+    virtual void makePatterns(const MuonHoughHitContainer* hitcontainer, MuonHoughPatternContainerShip& houghpatterns) const;
+
+    /** initiates private members */
+    virtual StatusCode initialize();
+
+    /** deletes private members */
+    virtual StatusCode finalize();
+
+    /** returns phipattern container in EDM */
+    virtual MuonPrdPatternCollection* getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const;
+    /** returns etapattern container in EDM */
+    virtual MuonPrdPatternCollection* getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const;
+
+    /** resets houpattern vector, called once per event from FinderTool*/
+    void reset(MuonHoughPatternContainerShip& houghpattern) const;
+    /** creates houghpatterns, called from FinderTool */
+    MuonHoughPatternContainerShip emptyHoughPattern() const;
+
+private:
+    /** method that builds the patterns */
+    virtual void makePatterns(int id_number, double weightmdt, const MuonHoughHitContainer* event,
+                              MuonHoughPatternContainerShip& houghpatterns) const;
+
+    /** returns curvedpattern container in EDM */
+    MuonPrdPatternCollection* getCurvedMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const;
+
+    /** reset association flag of hits in m_event */
+    static void resetAssociation(const MuonHoughHitContainer* event);
+
+    /** reduces Detector sizes for Hough Histograms to find patterns from muons from the Interaction Point (default on) */
+    void useIPMuons();
+
+    /**
+     * @brief fills the hough histograms
+     * @param[in] id_number The enum number corresponding to the HoughTransform
+     * @param[in] level The iteration number
+     * @param[in] event_to_analyse The hitcontainer which fills the histogram
+     * @param[in] houghtransform The HoughTransform
+     */
+    void fillHistos(int id_number, int level, const MuonHoughHitContainer* event_to_analyse,
+                    MuonHoughTransformSteering* houghtransform) const;
+    /**
+     * @brief analyses the hough histograms
+     * @param[in] id_number The enum number corresponding to the HoughTransform
+     * @param[in] level The iteration number
+     * @param[in] event_to_analyse The hitcontainer which will be associated to the pattern
+     * @param[in] houghtransform The HoughTransform
+     */
+    bool analyseHisto(int id_number, int level, const MuonHoughHitContainer* event_to_analyse, MuonHoughTransformSteering* houghtransform,
+                      MuonHoughPatternContainerShip& houghpatterns) const;
+
+    /** method to analyse the pattern build, currently nothing implemented */
+    void analyseTrack(int id_number, const MuonHoughHitContainer* event_to_analyse, MuonHoughTransformSteering* houghtransform) const;
+
+    /** returns if there are hits left */
+    static bool hitsLeft(const MuonHoughHitContainer* event);
+
+    /** returns number of hits left (unused) */
+    int numberOfHits(const MuonHoughHitContainer* event) const;
+
+    /** checks if hit is already in one of the found houghpatterns (unused) */
+    bool hitInHoughPattern(MuonHoughHit* hit, const MuonHoughPatternContainer& houghpattern) const;
+
+    /** returns a hitcontainer with hits not yet used in pattern */
+    static MuonHoughHitContainer* hitsNotInPattern(const MuonHoughHitContainer* event, int id_number);
+
+    /** rescales hits per iteration to reduce number of patterns when already some have been found */
+    void weightRescaling(const MuonHoughHitContainer* event, int id_number, int level) const;
+
+    /** calculates new weights based on rejection factor (1-origweight) and number of hits in event, only done for MDTs */
+    void calculateWeights(const MuonHoughHitContainer* event, double weightmdt) const;
+
+    /** returns number of hits that are in both hough patterns */
+    int overlapHoughPatterns(const MuonHoughPattern* houghpattern1, const MuonHoughPattern* houghpattern2) const;
+
+    /** selects the hitcontainer to be used for filling the histograms */
+    MuonHoughHitContainer* whichEventHough(int id, const MuonHoughHitContainer* event, double weightmdt) const;
+
+    /** selects the hitcontainer to be used to associate to the maxima */
+    MuonHoughHitContainer* whichEventAssociation(int id, const MuonHoughHitContainer* event) const;
+
+    /** returns the Houghtransform for the id */
+    MuonHoughTransformSteering* whichHoughTransform(int id) const;
+
+    /** returns the maximum iteration, not in use */
+    std::vector<int> maxLevelHoughPattern(const MuonHoughPatternContainerShip& houghpattern) const;
+
+    /** returns the maximum iteration, not in use */
+    /** @todo should be in houghpattern? */
+    int maxLevelHoughPattern(const MuonHoughPatternContainerShip& houghpattern, int id_number) const;
+
+    /** corrects the maximum of the histogram with a factor (not in use anymore, used for old rz transform) */
+    void transformCoordsMaximum(std::pair<double, double>& coordsmaximum, double r0_true) const;
+
+    /** converts hough pattern to EDM eta patterns */
+    Muon::MuonPrdPattern* houghPatternToEtaPattern(MuonHoughPattern* houghpattern) const;
+    /** converts hough pattern to EDM phi patterns */
+    Muon::MuonPrdPattern* houghPatternToPhiPattern(MuonHoughPattern* houghpattern) const;
+    /** converts and combines two hough patterns to one EDM phi pattern */
+    Muon::MuonPrdPattern* houghPatternsToOneEtaPattern(MuonHoughPattern* houghpattern1, MuonHoughPattern* houghpattern2) const;
+    /** converts and combines two hough patterns to one EDM phi pattern */
+    Muon::MuonPrdPattern* houghPatternsToOnePhiPattern(MuonHoughPattern* houghpattern1, MuonHoughPattern* houghpattern2) const;
+    /** converts hough pattern to EDM phi patterns and cleans it from outliers */
+    Muon::MuonPrdPattern* houghPatternToCleanPhiPattern(MuonHoughPattern* houghpattern) const;
+
+    /** returns minimum number of hits a hough pattern can contain */
+    unsigned int getThresholdHoughPattern(int id_number) const;
+    /** returns minimum number for the maximum of a hough transform */
+    double getThresholdHisto(int id_number) const;
+
+    /** calculates the mdt weight cut value */
+    void setWeightMdtCutValue(const MuonHoughHitContainer* event, double& weightmdt) const;
+
+    /** hit through weight cut? */
+    bool hitThroughCut(MuonHoughHit* hit, double weightmdt) const;
+
+    /** pointer to the file name for the hough histograms */
+    TFile* m_file{};
+    /** object for use of mathematical formulas for trackmodels */
+    MuonHoughMathUtils m_muonhoughmathutils;
+
+    /** output histograms (false) */
+    Gaudi::Property<bool> m_use_histos{this, "UseHistos", false};
+    /** use cosmic settings (false) */
+    Gaudi::Property<bool> m_use_cosmics{this, "UseCosmics", false};
+    /** use csc hits in association / pattern (true) */
+    Gaudi::Property<bool> m_use_csc_in_pattern{this, "UseCscInPattern", true};
+    /** use csc hits in histogram (false) */
+    Gaudi::Property<bool> m_use_csc_in_hough{this, "UseCscInHough", true};
+    /** use negative weights (false) */
+    Gaudi::Property<bool> m_use_negative_weights{this, "UseNegativeWeights", false};
+    /** use curved hough transformation for eta patterns (true) */
+    Gaudi::Property<bool> m_use_curvedhough{this, "UseCurvedHough", true};
+
+    /** number of hough transforms currently supported (7) */
+    int m_number_of_ids;
+
+    /** number of iterations (5) */
+    Gaudi::Property<int> m_number_of_maxima{this, "NumberOfMaximaPerIterations", 5};
+
+    /** use rpc phi strips in phi-patterns (true) */
+    // const bool m_use_rpc_measures_phi;
+    /** use rpc eta strips in eta-patterns (true) */
+    const bool m_use_rpc_measures_eta;
+    /** use interaction point constraint (true) */
+    bool m_use_ip;
+
+    /** minimal size for a phi pattern (1) */
+    Gaudi::Property<unsigned int> m_thresholdpattern_xyz{this, "SetThresholdPatternRPhi", 1};
+    /** minimal size for a eta pattern (3) */
+    Gaudi::Property<unsigned int> m_thresholdpattern_rz{this, "SetThresholdPatternREta", 3};
+
+    // hittosegment association:
+
+    /** distance hits are associated with pattern in mm */
+    const double m_maximum_residu_mm;
+    /** distance hits are associated with pattern in mm for cosmics */
+    const double m_maximum_residu_mm_cosmics;
+    /** distance hits are associated with pattern in degrees */
+    const double m_maximum_residu_angle;
+
+    /** // number of maximum iterations over houghtransform */
+    const int m_maximum_level;
+
+    // for hough_correction:
+
+    /** use hough correction
+     * to correct the maximum found in rz-plane slightly as there is a bias in the houghtransform
+     */
+    // const bool m_use_hough_correction;
+    /** constant 1 for z for hough correction */
+    const double m_z_cor_constant;
+    /** constant 2 for z for hough correction */
+    const double m_z_cor_constant2;
+    /** constant 1 for theta for hough correction */
+    const double m_theta_cor_constant;
+    /** constant 2 for theta for hough correction */
+    const double m_theta_cor_constant2;
+
+    // detectorsizes:
+
+    /** acceptancy of patterns in xy (phi) in mm */
+    double m_detectorsize_xy;
+    /** acceptancy of patterns in yz (not used) in mm */
+    double m_detectorsize_yz;
+    /** acceptancy of patterns in rz (eta) in mm */
+    double m_detectorsize_rz;
+
+    /** size of full detector in xy (phi) in mm, used as acceptancy for cosmics */
+    const double m_detectorsize_xy_full;
+    /** size of full detector in yz (not used) in mm, used as acceptancy for cosmics */
+    const double m_detectorsize_yz_full;
+    /** size of full detector in rz (eta) in mm, used as acceptancy for cosmics */
+    const double m_detectorsize_rz_full;
+
+    /** acceptancy of patterns for ip in xy (phi) in mm */
+    const double m_detectorsize_xy_ip;
+    /** acceptancy of patterns for ip in yz (not used) in mm */
+    const double m_detectorsize_yz_ip;
+    /** acceptancy of patterns for ip in rz (eta) in mm */
+    const double m_detectorsize_rz_ip;
+
+    /** max range of angle in xyz in degrees (360) */
+    const double m_detectorsize_angle_xyz;
+    /** max range of angle in rz in degrees (180) */
+    const double m_detectorsize_angle_rz;
+    /** max range of 1/sqrt(curvature) for curved transform, corresponds to 0.02 ~ 2,5m ~ 1.6GeV */
+    // const double m_detectorsize_inv_sqrt_curvature;
+
+    // properties of histograms:
+
+    /** bin width for xy */
+    const double m_stepsize_xy;
+    /** bin width for yz */
+    const double m_stepsize_yz;
+    /** bin width for rz */
+    const double m_stepsize_rz;
+    /** bin width for xy cosmics */
+    const double m_stepsize_xy_cosmics;
+    /** bin width for rzcosmics */
+    const double m_stepsize_rz_cosmics;
+    /** bin width for angle in xyz */
+    const double m_stepsize_per_angle_xyz;
+    /** bin width for angle in rz */
+    const double m_stepsize_per_angle_rz;
+    /** bin width for angle in xy cosmics */
+    const double m_stepsize_per_angle_xy_cosmics;
+    /** bin width for angle in rzcosmics */
+    const double m_stepsize_per_angle_rz_cosmics;
+    /** bin width for 1/sqrt(curvature) */
+    // const double m_stepsize_per_inv_sqrt_curvature;
+
+    /** new curved properties */
+    const int m_nbins_curved;
+
+    /** weight_cut for hits in hough */
+    Gaudi::Property<bool> m_weightcut{this, "ApplyWeightCut", true};
+
+    /** value of weight cut */
+    Gaudi::Property<double> m_weight{this, "WeightCut", 0.25};  // cut all hits under 0.25
+
+    /** weight_cut for mdt hits in hough */
+    Gaudi::Property<bool> m_weightcutmdt{this, "ApplyWeightCutMdt",
+                                         true};  // cut all mdt hits under a certain weight (dependent on number of mdt hits in event
+
+    /** threshold histogram in xyz */
+    Gaudi::Property<double> m_thresholdhisto_xyz{this, "SetThresholdHistoRPhi", 0.9};
+    /** threshold histogram in rz */
+    Gaudi::Property<double> m_thresholdhisto_rz{this, "SetThresholdHistoREta", 2.1};
+
+    /** number of sectors (different regions in which patterns can be found in the same iteration) in xyz */
+    Gaudi::Property<int> m_number_of_sectors_xyz{this, "SetNumberOfSectorsRPhi", 12};
+    /** number of sectors (different regions in which patterns can be found in the same iteration) in rz */
+    Gaudi::Property<int> m_number_of_sectors_rz{this, "SetNumberOfSectorsREta", 16};
+    /** number of sectors (different regions in which patterns can be found in the same iteration) in rzcosmics */
+    int m_number_of_sectors_rz_cosmics;
+
+    /** output level (range 0-10) (default 0) */
+    Gaudi::Property<int> m_printlevel{this, "Printlevel", 0};
+
+    mutable std::atomic_uint m_ncalls{0};
+
+    /** maximum number of phi hits to do pattern recognition, if small zero no cut is applied */
+    Gaudi::Property<int> m_maxNumberOfPhiHits{this, "MaximumNumberOfPhiHits", -1};
+
+    /** print out pattern hits */
+    void printPattern(Muon::MuonPrdPattern* muonpattern) const;
 };
 
-#endif //MUONHOUGHPATTERNTOOLS_MUONHOUGHPATTERNTOOL_H
+#endif  // MUONHOUGHPATTERNTOOLS_MUONHOUGHPATTERNTOOL_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
index ed4d421f84297aa0e19e2417c6a9cdbbdbb2575b..9f3ecfa2386e9f3c306a90647cdff23ee2e6c099 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/MuonHoughPatternTools/MuonLayerHoughTool.h
@@ -5,363 +5,338 @@
 #ifndef MUONHOUGHPATTERNTOOLS_MUONLAYERHOUGHTOOL_H
 #define MUONHOUGHPATTERNTOOLS_MUONLAYERHOUGHTOOL_H
 
+#include <set>
+
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
-
-#include "MuonRecToolInterfaces/IMuonHoughPatternFinderTool.h"
-
-#include "MuonPrepRawData/MuonPrepDataContainer.h"
-#include "MuonPrepRawData/MMPrepDataContainer.h"
-#include "MuonPrepRawData/sTgcPrepDataContainer.h"
-#include "MuonPattern/MuonPatternCombinationCollection.h"
-
+#include "GeoPrimitives/GeoPrimitives.h"
+#include "MuonClusterization/RpcHitClustering.h"
+#include "MuonClusterization/TgcHitClustering.h"
+#include "MuonDetDescrUtils/MuonSectorMapping.h"
+#include "MuonHoughPatternTools/HoughDataPerSec.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
-#include "MuonRecHelperTools/MuonEDMPrinterTool.h"
 #include "MuonLayerHough/HitNtuple.h"
-
-#include "MuonClusterization/TgcHitClustering.h"
-#include "MuonClusterization/RpcHitClustering.h"
-#include "MuonLayerHough/MuonRegionHough.h"
 #include "MuonLayerHough/MuonLayerHough.h"
-#include "MuonLayerHough/MuonPhiLayerHough.h"
 #include "MuonLayerHough/MuonLayerHoughSelector.h"
-#include "MuonHoughPatternTools/HoughDataPerSec.h"
-
-#include <set>
-#include "GeoPrimitives/GeoPrimitives.h"
-#include "MuonDetDescrUtils/MuonSectorMapping.h"
-#include "xAODTruth/TruthParticleContainer.h"
-#include "xAODMuon/MuonSegmentContainer.h"
+#include "MuonLayerHough/MuonPhiLayerHough.h"
+#include "MuonLayerHough/MuonRegionHough.h"
+#include "MuonPattern/MuonPatternCombinationCollection.h"
+#include "MuonPrepRawData/MMPrepDataContainer.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
+#include "MuonPrepRawData/sTgcPrepDataContainer.h"
+#include "MuonRecHelperTools/MuonEDMPrinterTool.h"
+#include "MuonRecToolInterfaces/IMuonHoughPatternFinderTool.h"
 #include "TrkTruthData/PRD_MultiTruthCollection.h"
+#include "xAODMuon/MuonSegmentContainer.h"
+#include "xAODTruth/TruthParticleContainer.h"
 
-namespace Trk{
-  class PrepRawData;
+namespace Trk {
+    class PrepRawData;
 }
 
 class TFile;
 class TTree;
 
 namespace MuonGM {
-  class MuonDetectorManager;
+    class MuonDetectorManager;
 }
 namespace MuonHough {
-  class HitDebugInfo;
+    class HitDebugInfo;
 }
 
-static const InterfaceID IID_MuonLayerHoughTool("Muon::MuonLayerHoughTool",1,0);
+static const InterfaceID IID_MuonLayerHoughTool("Muon::MuonLayerHoughTool", 1, 0);
 
 namespace Muon {
 
-  class MuonLayerHoughTool:  virtual public IMuonHoughPatternFinderTool, public AthAlgTool  {
-  public:
-    
-    typedef std::vector<IdentifierHash>   HashVec;
-    typedef std::vector< HashVec >        RegionHashVec;
-    typedef std::vector< RegionHashVec >  TechnologyRegionHashVec;
-    typedef RegionHashVec::const_iterator RegionHashVecCit;
-
-    struct CollectionsPerSector {
-      int sector;
-      TechnologyRegionHashVec technologyRegionHashVecs;
-    };
-    typedef std::vector<CollectionsPerSector>       CollectionsPerSectorVec;
-    typedef CollectionsPerSectorVec::const_iterator CollectionsPerSectorCit;
-
-    typedef HoughDataPerSec::HitVec HitVec;
-    typedef HoughDataPerSec::RegionHitVec RegionHitVec;
-    typedef HoughDataPerSec::PhiHitVec PhiHitVec;
-    typedef HoughDataPerSec::RegionPhiHitVec RegionPhiHitVec;
-    typedef HoughDataPerSec::MaximumVec MaximumVec;
-    typedef HoughDataPerSec::PhiMaximumVec PhiMaximumVec; 
-    typedef HoughDataPerSec::MaximumAssociationMap MaximumAssociationMap;
-    typedef HoughDataPerSec::RegionMaximumVec RegionMaximumVec;
-    typedef HoughDataPerSec::RegionPhiMaximumVec RegionPhiMaximumVec;
-
-    typedef HoughDataPerSec                       HoughDataPerSector;
-
-    typedef Muon::HoughDataPerSectorVec HoughDataPerSectorVec;
-    
-    
-    
-    class Road {
+    class MuonLayerHoughTool : virtual public IMuonHoughPatternFinderTool, public AthAlgTool {
     public:
-      Road(MuonHough::MuonLayerHough::Maximum& seed_) : neighbouringRegion(MuonStationIndex::DetectorRegionUnknown), neighbouringSector(-1), seed(&seed_) { add(seed); }
-      Road() : neighbouringRegion(MuonStationIndex::DetectorRegionUnknown), neighbouringSector(-1), seed(0) {} 
-      MuonStationIndex::DetectorRegionIndex neighbouringRegion;
-      int  neighbouringSector;
-      MuonHough::MuonLayerHough::Maximum* seed;
-      void add( MuonHough::MuonLayerHough::Maximum* max ){
-        maxima.push_back(max);
-        maximumSet.insert(max);
-      }
-      void add( MuonHough::MuonPhiLayerHough::Maximum* max ){
-        phiMaxima.push_back(max);
-      }
-      MaximumVec    maxima;
-      PhiMaximumVec phiMaxima;
-      std::set<MuonHough::MuonLayerHough::Maximum*>    maximumSet;
-
-      std::vector<MuonHough::MuonPhiLayerHough::Maximum> mergedPhiMaxima;
+        typedef std::vector<IdentifierHash> HashVec;
+        typedef std::vector<HashVec> RegionHashVec;
+        typedef std::vector<RegionHashVec> TechnologyRegionHashVec;
+        typedef RegionHashVec::const_iterator RegionHashVecCit;
+
+        struct CollectionsPerSector {
+            int sector;
+            TechnologyRegionHashVec technologyRegionHashVecs;
+        };
+        typedef std::vector<CollectionsPerSector> CollectionsPerSectorVec;
+        typedef CollectionsPerSectorVec::const_iterator CollectionsPerSectorCit;
+
+        typedef HoughDataPerSec::HitVec HitVec;
+        typedef HoughDataPerSec::RegionHitVec RegionHitVec;
+        typedef HoughDataPerSec::PhiHitVec PhiHitVec;
+        typedef HoughDataPerSec::RegionPhiHitVec RegionPhiHitVec;
+        typedef HoughDataPerSec::MaximumVec MaximumVec;
+        typedef HoughDataPerSec::PhiMaximumVec PhiMaximumVec;
+        typedef HoughDataPerSec::MaximumAssociationMap MaximumAssociationMap;
+        typedef HoughDataPerSec::RegionMaximumVec RegionMaximumVec;
+        typedef HoughDataPerSec::RegionPhiMaximumVec RegionPhiMaximumVec;
+
+        typedef HoughDataPerSec HoughDataPerSector;
+
+        typedef Muon::HoughDataPerSectorVec HoughDataPerSectorVec;
+
+        class Road {
+        public:
+            Road(MuonHough::MuonLayerHough::Maximum& seed_) :
+                neighbouringRegion(MuonStationIndex::DetectorRegionUnknown), neighbouringSector(-1), seed(&seed_) {
+                add(seed);
+            }
+            Road() : neighbouringRegion(MuonStationIndex::DetectorRegionUnknown), neighbouringSector(-1), seed(0) {}
+            MuonStationIndex::DetectorRegionIndex neighbouringRegion;
+            int neighbouringSector;
+            MuonHough::MuonLayerHough::Maximum* seed;
+            void add(MuonHough::MuonLayerHough::Maximum* max) {
+                maxima.push_back(max);
+                maximumSet.insert(max);
+            }
+            void add(MuonHough::MuonPhiLayerHough::Maximum* max) { phiMaxima.push_back(max); }
+            MaximumVec maxima;
+            PhiMaximumVec phiMaxima;
+            std::set<MuonHough::MuonLayerHough::Maximum*> maximumSet;
+
+            std::vector<MuonHough::MuonPhiLayerHough::Maximum> mergedPhiMaxima;
+        };
+
+        /** Default constructor */
+        MuonLayerHoughTool(const std::string& type, const std::string& name, const IInterface* parent);
+
+        /** Destructor */
+        virtual ~MuonLayerHoughTool() = default;
+
+        /** @brief access to tool interface */
+        static const InterfaceID& interfaceID() { return IID_MuonLayerHoughTool; }
+
+        virtual StatusCode initialize() override;
+
+        virtual StatusCode finalize() override;
+
+        std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> analyse(
+            const MdtPrepDataContainer* mdtCont, const CscPrepDataContainer* cscCols, const TgcPrepDataContainer* tgcCont,
+            const RpcPrepDataContainer* rpcCont, const sTgcPrepDataContainer* stgcCont, const MMPrepDataContainer* mmCont,
+            const EventContext& ctx) const;
+
+        /** find patterns for a give set of MuonPrepData collections + optionally CSC segment combinations */
+        virtual std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> find(
+            const std::vector<const MdtPrepDataCollection*>& mdtCols, const std::vector<const CscPrepDataCollection*>& cscCols,
+            const std::vector<const TgcPrepDataCollection*>& tgcCols, const std::vector<const RpcPrepDataCollection*>& rpcCols,
+            const MuonSegmentCombinationCollection*, const EventContext& ctx) const override;
+
+        void reset() const;
+
+    private:
+        void getSectors(const Amg::Vector3D& pos, std::vector<int>& sectors) const;
+        void getSectors(const TgcClusterObj3D& tgc, std::vector<int>& sectors) const;
+
+        double rCor(const Amg::Vector3D& pos, const Identifier& id) const;
+        double rCor(const MuonCluster& rpc) const;
+        double rCor(const MdtPrepData& mdt) const;
+        double rCor(const TgcClusterObj3D& tgc, int val, int sector) const;
+
+        int sublay(const Identifier& id, float z = 0) const;  // the z value is only used for the tgcs
+
+        struct State {
+            MaximumVec
+                seedMaxima;  // Does not own the contained objects, they're just references to objects stored in houghDataPerSectorVec.
+            std::unique_ptr<HoughDataPerSectorVec> houghDataPerSectorVec{std::make_unique<HoughDataPerSectorVec>()};
+            std::set<Identifier> truthHits;
+            std::set<Identifier> foundTruthHits;
+            std::set<Identifier> outputTruthHits;
+        };
+
+        std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> analyse(State& state) const;
+
+        void fillHitsPerSector(std::set<Identifier>& truthHits, std::vector<std::unique_ptr<TgcHitClusteringObj>>& tgcClusteringObjs,
+                               const CollectionsPerSector& hashes, const MdtPrepDataContainer* mdtCont,
+                               const CscPrepDataContainer* /*cscCont*/, const TgcPrepDataContainer* tgcCont,
+                               const RpcPrepDataContainer* rpcCont, const sTgcPrepDataContainer* stgcCont,
+                               const MMPrepDataContainer* mmCont, HoughDataPerSector& houghData) const;
+
+        void fill(std::set<Identifier>& truthHits, const MdtPrepDataCollection& mdts, HitVec& hits) const;
+        void fill(std::set<Identifier>& truthHits, std::vector<std::unique_ptr<TgcHitClusteringObj>>& tgcClusteringObjs,
+                  const TgcPrepDataCollection& tgcs, HitVec& hits, PhiHitVec& phiHits, int sector) const;
+        void fill(std::set<Identifier>& truthHits, const RpcPrepDataCollection& rpcs, HitVec& hits, PhiHitVec& phiHits) const;
+        void fill(std::set<Identifier>& truthHits, const MMPrepDataCollection& mdts, HitVec& hits) const;
+        void fill(std::set<Identifier>& truthHits, const sTgcPrepDataCollection& stgcs, HitVec& hits, PhiHitVec& phiHits, int sector) const;
+
+        bool findMaxima(std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits, MaximumVec& seedMaxima,
+                        MuonHough::MuonLayerHough& hough, HitVec& hits, MaximumVec& maxima) const;
+        bool findMaxima(std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits, MuonHough::MuonPhiLayerHough& hough,
+                        PhiHitVec& hits, PhiMaximumVec& maxima, int sector) const;
+
+        void associateMaximaToPhiMaxima(MuonStationIndex::DetectorRegionIndex region, HoughDataPerSector& houghData,
+                                        std::map<MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec>& phiEtaAssociations,
+                                        std::vector<MaximumVec>& unassEtaMaxima) const;
+
+        void associateMaximaInNeighbouringSectors(HoughDataPerSector& houghData,
+                                                  std::vector<HoughDataPerSector>& houghDataPerSectorVec) const;
+
+        void extendSeed(MuonHough::MuonDetectorHough& detectorHoughTransforms, std::set<Identifier>& truthHits,
+                        std::set<Identifier>& foundTruthHits, Road& road, HoughDataPerSector& sectorData) const;  // const;
+        void associatePhiMaxima(Road& road, PhiMaximumVec& phiMaxima) const;
+
+        double combinedPeakheight(double ph, double ph1, double ph2, double phn, double rot, int layer, int /*region*/) const;
+        void updateHits(HitVec& hits, MuonHough::MuonLayerHough& hough) const;
+        void updateHits(PhiHitVec& hits, MuonHough::MuonPhiLayerHough& hough) const;
+        void createPatternCombinations(std::vector<MaximumVec>& maxima, MuonPatternCombinationCollection& patternCombis) const;
+
+        void createPatternCombinations(std::set<Identifier>& truthHits, std::set<Identifier>& outputTruthHits,
+                                       std::map<MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec>& phiEtaAssociations,
+                                       MuonPatternCombinationCollection& patternCombis) const;
+
+        void fillNtuple(HoughDataPerSectorVec& houghDataPerSectorVec) const;
+
+        void insertHash(const IdentifierHash& hash, const Identifier& id);
+        void insertHash(int sector, const IdentifierHash& hash, const Identifier& id);
+
+        void matchTruth(std::set<Identifier>& truthHits, const PRD_MultiTruthCollection& truthCol, const Identifier& id,
+                        MuonHough::HitDebugInfo& debug) const;
+        void initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr);
+        void getTruth(const EventContext& ctx) const;
+        void printTruthSummary(std::set<Identifier>& truth, std::set<Identifier>& found) const;
+
+        void buildRoads(MaximumVec& seedMaxima, MuonHough::MuonDetectorHough& detectorHoughTransforms, std::set<Identifier>& truthHits,
+                        std::set<Identifier>& foundTruthHits, std::unique_ptr<HoughDataPerSectorVec>& houghDataPerSectorVec,
+                        std::vector<Road>& roads) const;
+        void mergePhiMaxima(Road& road) const;
+
+        Gaudi::Property<bool> m_useSeeds{this, "UseSeeds", true};
+
+        ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
+        ToolHandle<MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
+
+        std::vector<MuonHough::MuonLayerHoughSelector> m_selectors;
+        std::vector<MuonHough::MuonLayerHoughSelector> m_selectorsLoose;
+        Gaudi::Property<bool> m_doNtuple{this, "DoNtuple", false};
+        TFile* m_file{};
+        TTree* m_tree{};
+        mutable MuonHough::HitNtuple* m_ntuple
+            ATLAS_THREAD_SAFE = {};  // Marked as thread-safe because it's disabled when running multi-threaded
+
+        SG::ReadHandleKeyArray<PRD_MultiTruthCollection> m_truthNames{this, "TruthNames", {}};
+        SG::ReadHandleKey<xAOD::TruthParticleContainer> m_MuonTruthParticlesKey{this, "MuonTruthParticlesKey", "MuonTruthParticles"};
+        SG::ReadHandleKey<xAOD::MuonSegmentContainer> m_MuonTruthSegmentsKey{this, "MuonTruthSegmentsKey", "MuonTruthSegments"};
+
+        Gaudi::Property<bool> m_useRpcTimeVeto{this, "RpcTimeVeto", false};
+        Gaudi::Property<bool> m_requireTriggerConfirmationNSW{this, "TriggerConfirmationNSW", false};
+        Gaudi::Property<bool> m_onlyUseCurrentBunch{this, "OnlyUseCurrentBunch", false};
+        Gaudi::Property<bool> m_doTruth{this, "DoTruth", false};
+        Gaudi::Property<bool> m_debugHough{this, "DebugHough", false};
+        Gaudi::Property<bool> m_doParabolicExtrapolation{this, "DoParabolicExtrapolation",
+                                                         true};  // if true, do parabolic; if false, do linear extrapolation
+        Gaudi::Property<float> m_extrapolationDistance{this, "ExtrapolationDistance", 1500.};  // default value is 1500
+        Gaudi::Property<bool> m_addSectors{this, "AddSectors", false};                         // default false
+
+        unsigned int m_ntechnologies;
+        std::map<unsigned int, unsigned int> m_techToTruthNameIdx;  // mapping the muon technology to the index of the m_truthNames vector
+        CollectionsPerSectorVec m_collectionsPerSector;
+
+        MuonSectorMapping m_sectorMapping;
     };
-    
-
-    /** Default constructor */
-    MuonLayerHoughTool(const std::string& type, const std::string& name, const IInterface* parent);
-
-    /** Destructor */
-    virtual ~MuonLayerHoughTool() = default;
-    
-    /** @brief access to tool interface */
-    static const InterfaceID& interfaceID() { return IID_MuonLayerHoughTool; }
-
-    virtual StatusCode initialize() override;
-
-    virtual StatusCode finalize() override;
-    
-    std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> analyse(
-                 const MdtPrepDataContainer*  mdtCont,  
-					       const CscPrepDataContainer*  cscCols,  
-					       const TgcPrepDataContainer*  tgcCont,  
-					       const RpcPrepDataContainer*  rpcCont,
-					       const sTgcPrepDataContainer* stgcCont,  
-		 const MMPrepDataContainer*  mmCont, const EventContext& ctx ) const;
-
-    /** find patterns for a give set of MuonPrepData collections + optionally CSC segment combinations */
-    virtual std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>>
-    find( const std::vector<const MdtPrepDataCollection*>& mdtCols,  
-          const std::vector<const CscPrepDataCollection*>& cscCols,  
-          const std::vector<const TgcPrepDataCollection*>& tgcCols,  
-          const std::vector<const RpcPrepDataCollection*>& rpcCols,  
-          const MuonSegmentCombinationCollection*, const EventContext& ctx ) const override;
-
-    void reset() const;
-
-  private:
-
-    void getSectors( const Amg::Vector3D& pos, std::vector<int>& sectors ) const;
-    void getSectors( const TgcClusterObj3D& tgc, std::vector<int>& sectors ) const;
-
-    double rCor( const Amg::Vector3D& pos, const Identifier& id ) const; 
-    double rCor( const MuonCluster& rpc ) const; 
-    double rCor( const MdtPrepData& mdt ) const;
-    double rCor( const TgcClusterObj3D& tgc, int val, int sector ) const;
-
-    int sublay( const Identifier& id, float z = 0 ) const; // the z value is only used for the tgcs
-
-    struct State {
-      MaximumVec seedMaxima; // Does not own the contained objects, they're just references to objects stored in houghDataPerSectorVec.
-      std::unique_ptr<HoughDataPerSectorVec> houghDataPerSectorVec { std::make_unique<HoughDataPerSectorVec>() };
-      std::set<Identifier> truthHits;
-      std::set<Identifier> foundTruthHits;
-      std::set<Identifier> outputTruthHits;
+
+    struct SortHoughDataPerSector {
+        bool operator()(const MuonLayerHoughTool::HoughDataPerSector* s1, const MuonLayerHoughTool::HoughDataPerSector* s2) const {
+            return s2->maxEtaHits() < s1->maxEtaHits();
+        }
     };
-  
-    std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> analyse(State& state) const;
-
-    void fillHitsPerSector( std::set<Identifier>& truthHits, 
-           std::vector<std::unique_ptr<TgcHitClusteringObj>>& tgcClusteringObjs,
-           const CollectionsPerSector& hashes,
-			     const MdtPrepDataContainer*  mdtCont,  
-			     const CscPrepDataContainer*  /*cscCont*/,  
-			     const TgcPrepDataContainer*  tgcCont,  
-			     const RpcPrepDataContainer*  rpcCont,
-			     const sTgcPrepDataContainer* stgcCont,  
-			     const MMPrepDataContainer*   mmCont,
-			     HoughDataPerSector& houghData ) const;
-
-    void fill( std::set<Identifier>& truthHits, const MdtPrepDataCollection& mdts, HitVec& hits ) const;
-    void fill( std::set<Identifier>& truthHits, std::vector<std::unique_ptr<TgcHitClusteringObj>>& tgcClusteringObjs,
-      const TgcPrepDataCollection& tgcs, HitVec& hits, PhiHitVec& phiHits, int sector ) const;
-    void fill( std::set<Identifier>& truthHits, const RpcPrepDataCollection& rpcs, HitVec& hits, PhiHitVec& phiHits ) const;
-    void fill( std::set<Identifier>& truthHits, const MMPrepDataCollection& mdts, HitVec& hits ) const;
-    void fill( std::set<Identifier>& truthHits, const sTgcPrepDataCollection& stgcs, HitVec& hits, PhiHitVec& phiHits, int sector ) const;
-
-    bool findMaxima( std::set<Identifier>& truthHits,
-         std::set<Identifier>& foundTruthHits,
-         MaximumVec& seedMaxima,
-         MuonHough::MuonLayerHough& hough,
-		     HitVec& hits, 
-		     MaximumVec& maxima ) const ;
-    bool findMaxima( std::set<Identifier>& truthHits,
-         std::set<Identifier>& foundTruthHits,
-         MuonHough::MuonPhiLayerHough& hough,
-		     PhiHitVec& hits, 
-		     PhiMaximumVec& maxima,
-		     int sector ) const;
-
-    void associateMaximaToPhiMaxima( MuonStationIndex::DetectorRegionIndex region, HoughDataPerSector& houghData,
-				     std::map< MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec >& phiEtaAssociations,
-				     std::vector< MaximumVec >& unassEtaMaxima
-				     ) const;
-
-    void associateMaximaInNeighbouringSectors( HoughDataPerSector& houghData, std::vector<HoughDataPerSector>& houghDataPerSectorVec ) const;
-
-    void extendSeed(MuonHough::MuonDetectorHough& detectorHoughTransforms, std::set<Identifier>& truthHits, 
-      std::set<Identifier>& foundTruthHits, Road& road, HoughDataPerSector& sectorData ) const; // const;
-    void associatePhiMaxima( Road& road, PhiMaximumVec& phiMaxima ) const;
-
-    double combinedPeakheight( double ph,  double ph1,  double ph2, double phn, double rot, int layer, int /*region*/ ) const;
-    void updateHits( HitVec& hits, MuonHough::MuonLayerHough& hough ) const;
-    void updateHits( PhiHitVec& hits, MuonHough::MuonPhiLayerHough& hough ) const;
-    void createPatternCombinations( std::vector< MaximumVec >& maxima,
-				    MuonPatternCombinationCollection& patternCombis ) const;
-
-    void createPatternCombinations(std::set<Identifier>& truthHits, std::set<Identifier>& outputTruthHits, 
-            std::map< MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec >& phiEtaAssociations,
-				    MuonPatternCombinationCollection& patternCombis ) const;
-
-    void fillNtuple( HoughDataPerSectorVec& houghDataPerSectorVec ) const;
-
-    void insertHash( const IdentifierHash& hash, const Identifier& id );
-    void insertHash( int sector, const IdentifierHash& hash, const Identifier& id );
-
-    void matchTruth( std::set<Identifier>& truthHits, const PRD_MultiTruthCollection& truthCol, const Identifier& id, MuonHough::HitDebugInfo& debug ) const;
-    void initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr);
-    void getTruth(const EventContext& ctx) const;
-    void printTruthSummary( std::set<Identifier>& truth, std::set<Identifier>& found ) const;
-
-    void buildRoads(MaximumVec& seedMaxima, MuonHough::MuonDetectorHough& detectorHoughTransforms, 
-      std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits,
-      std::unique_ptr<HoughDataPerSectorVec>& houghDataPerSectorVec, std::vector<Road>& roads ) const;
-    void mergePhiMaxima( Road& road ) const;
-
-    Gaudi::Property<bool> m_useSeeds{this,"UseSeeds",true};
-
-    ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-    ToolHandle<MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
-
-    std::vector<MuonHough::MuonLayerHoughSelector> m_selectors;
-    std::vector<MuonHough::MuonLayerHoughSelector> m_selectorsLoose;
-    Gaudi::Property<bool>       m_doNtuple{this,"DoNtuple",false};
-    TFile*     m_file{};
-    TTree*     m_tree{};
-    mutable MuonHough::HitNtuple* m_ntuple ATLAS_THREAD_SAFE = {}; // Marked as thread-safe because it's disabled when running multi-threaded
-
-    SG::ReadHandleKeyArray< PRD_MultiTruthCollection >       m_truthNames{this, "TruthNames", {}}; 
-    SG::ReadHandleKey<xAOD::TruthParticleContainer>       m_MuonTruthParticlesKey{this,"MuonTruthParticlesKey","MuonTruthParticles"};
-    SG::ReadHandleKey<xAOD::MuonSegmentContainer>       m_MuonTruthSegmentsKey{this,"MuonTruthSegmentsKey","MuonTruthSegments"};
-    
-    Gaudi::Property<bool> m_useRpcTimeVeto{this,"RpcTimeVeto",false};
-    Gaudi::Property<bool> m_requireTriggerConfirmationNSW{this,"TriggerConfirmationNSW",false};
-    Gaudi::Property<bool> m_onlyUseCurrentBunch{this,"OnlyUseCurrentBunch",false};
-    Gaudi::Property<bool> m_doTruth{this,"DoTruth",false};
-    Gaudi::Property<bool> m_debugHough{this,"DebugHough",false};
-    Gaudi::Property<bool> m_doParabolicExtrapolation{this,"DoParabolicExtrapolation",true}; // if true, do parabolic; if false, do linear extrapolation
-    Gaudi::Property<float> m_extrapolationDistance{this,"ExtrapolationDistance",1500.}; // default value is 1500
-    Gaudi::Property<bool> m_addSectors{this,"AddSectors",false}; // default false
-
-    unsigned int m_ntechnologies;
-    std::map<unsigned int,unsigned int> m_techToTruthNameIdx; // mapping the muon technology to the index of the m_truthNames vector
-    CollectionsPerSectorVec m_collectionsPerSector;
-
-    MuonSectorMapping              m_sectorMapping;
-  };
-
-  struct SortHoughDataPerSector {
-    bool operator()( const MuonLayerHoughTool::HoughDataPerSector* s1, const MuonLayerHoughTool::HoughDataPerSector* s2 ) const {
-      return s2->maxEtaHits() < s1->maxEtaHits();
+
+    inline void MuonLayerHoughTool::getSectors(const TgcClusterObj3D& tgc, std::vector<int>& sectors) const {
+        return getSectors(tgc.p11, sectors);
     }
-  };
-
-  inline void MuonLayerHoughTool::getSectors( const TgcClusterObj3D& tgc, std::vector<int>& sectors ) const {
-    return getSectors(tgc.p11,sectors);
-  }
-
-  inline void MuonLayerHoughTool::getSectors( const Amg::Vector3D& pos, std::vector<int>& sectors ) const {
-    return m_sectorMapping.getSectors(pos.phi(),sectors);
-  }
-
-  inline double MuonLayerHoughTool::rCor( const Amg::Vector3D& pos, const Identifier& id ) const {
-    return m_sectorMapping.transformRToSector(pos.perp(),pos.phi(),m_idHelperSvc->sector(id));
-  }
-  
-  inline double MuonLayerHoughTool::rCor( const MuonCluster& mm ) const {
-    return rCor(mm.globalPosition(),mm.identify());
-  }
-
-  inline double MuonLayerHoughTool::rCor( const MdtPrepData& mm ) const { 
-    return rCor(mm.globalPosition(),mm.identify());
-  } 
-  
-  inline double MuonLayerHoughTool::rCor( const TgcClusterObj3D& tgc, int val, int sector ) const {
-    const Amg::Vector3D& pos = val == 1 ? tgc.p11 : (val == 2 ? tgc.p12 : (val == 3 ? tgc.p21 : tgc.p22 ) );
-    return m_sectorMapping.transformRToSector(pos.perp(),pos.phi(),sector);
-  }
-
-  inline int MuonLayerHoughTool::sublay( const Identifier& id, float /*z*/ ) const {
-    int sublayer = 0;
-    if( m_idHelperSvc->isMdt(id) ) {
-      sublayer = m_idHelperSvc->mdtIdHelper().tubeLayer(id)-1;
-      if( m_idHelperSvc->mdtIdHelper().multilayer(id) == 2 ) sublayer += 4;
-    }else if( m_idHelperSvc->isMM(id) ) {
-      sublayer = m_idHelperSvc->mmIdHelper().gasGap(id)-1;
-      if( m_idHelperSvc->mmIdHelper().multilayer(id) == 2 ) sublayer += 4;
-      sublayer += 600; // type info
-    }else if( m_idHelperSvc->issTgc(id) ) {
-      sublayer = m_idHelperSvc->stgcIdHelper().gasGap(id)-1;
-      if( m_idHelperSvc->stgcIdHelper().multilayer(id) == 2 ) sublayer += 4;
-      sublayer += 500; // type info
-    }else if( m_idHelperSvc->isRpc(id) ){
-      sublayer = m_idHelperSvc->rpcIdHelper().gasGap(id)-1;
-      if( m_idHelperSvc->rpcIdHelper().doubletR(id) == 2 ) sublayer += 2;
-      sublayer += 100; // type info
-    }else if( m_idHelperSvc->isTgc(id) ){
-      sublayer = m_idHelperSvc->tgcIdHelper().gasGap(id)-1;
-      Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(id);
-      if( stIndex == Muon::MuonStationIndex::EM ) {
-       //T1 gets +3; T2 gets +3+3; T3 gets +3+6; T4 gets0 (because it is also EI)
-	Muon::MuonStationIndex::PhiIndex phiIndex = m_idHelperSvc->phiIndex(id);
-       sublayer += 3;
-	if( phiIndex == Muon::MuonStationIndex::T2 )       sublayer += 3;
-	else if( phiIndex == Muon::MuonStationIndex::T3 )  sublayer += 6;
-	// float fz = fabs(z);
-	// if( fz < 13350 )      sublayer += 0;
-	// else if( fz < 13440 ) sublayer += 3;
-	// else if( fz < 13520 ) sublayer += 6;
-	// else if( fz < 13600 ) sublayer += 9;
-	// else if( fz < 14650 ) sublayer += 12;
-	// else if( fz < 14740 ) sublayer += 15;
-	// else if( fz < 14800 ) sublayer += 18;
-	// else if( fz < 14850 ) sublayer += 21;
-	// else if( fz < 15070 ) sublayer += 24;
-	// else if( fz < 15150 ) sublayer += 27;
-	// else if( fz < 15220 ) sublayer += 30;
-	// else if( fz < 15250 ) sublayer += 33;
-	// else                  sublayer += 36;
-      }
-      sublayer += 300; // type info
+
+    inline void MuonLayerHoughTool::getSectors(const Amg::Vector3D& pos, std::vector<int>& sectors) const {
+        return m_sectorMapping.getSectors(pos.phi(), sectors);
     }
-    return sublayer;
-  }
 
+    inline double MuonLayerHoughTool::rCor(const Amg::Vector3D& pos, const Identifier& id) const {
+        return m_sectorMapping.transformRToSector(pos.perp(), pos.phi(), m_idHelperSvc->sector(id));
+    }
 
-  inline double MuonLayerHoughTool::combinedPeakheight( double ph,  double ph1,  double ph2, double phn, double /*rot*/, int layer, int /*region*/ ) const {
-    if( layer == 0 && ph < 3. ) return ph;
-    if( layer == 1 && ph < 4. ) return ph;
-    if( layer == 2 && ph < 3. ) return ph;
+    inline double MuonLayerHoughTool::rCor(const MuonCluster& mm) const { return rCor(mm.globalPosition(), mm.identify()); }
 
-    if( phn > 7 )     ph += phn;
+    inline double MuonLayerHoughTool::rCor(const MdtPrepData& mm) const { return rCor(mm.globalPosition(), mm.identify()); }
 
-    if( layer == 0 ){
-      if( ph1 > 6.9 ) ph += 2;
-      if( ph1 > 8.9 ) ph += 2;
-      if( ph2 > 5.9 ) ph += 2;
-      if( ph2 > 7.9 ) ph += 2;
+    inline double MuonLayerHoughTool::rCor(const TgcClusterObj3D& tgc, int val, int sector) const {
+        const Amg::Vector3D& pos = val == 1 ? tgc.p11 : (val == 2 ? tgc.p12 : (val == 3 ? tgc.p21 : tgc.p22));
+        return m_sectorMapping.transformRToSector(pos.perp(), pos.phi(), sector);
     }
-    if( layer == 1 ){
-      if( ph1 > 6.9 )   ph += 2;
-      if( ph2 > 5.9 )   ph += 2;
-      if( ph2 > 7.9 )   ph += 2;
-      if( ph2 > 11.9 )  ph += 2;
+
+    inline int MuonLayerHoughTool::sublay(const Identifier& id, float /*z*/) const {
+        int sublayer = 0;
+        if (m_idHelperSvc->isMdt(id)) {
+            sublayer = m_idHelperSvc->mdtIdHelper().tubeLayer(id) - 1;
+            if (m_idHelperSvc->mdtIdHelper().multilayer(id) == 2) sublayer += 4;
+        } else if (m_idHelperSvc->isMM(id)) {
+            sublayer = m_idHelperSvc->mmIdHelper().gasGap(id) - 1;
+            if (m_idHelperSvc->mmIdHelper().multilayer(id) == 2) sublayer += 4;
+            sublayer += 600;  // type info
+        } else if (m_idHelperSvc->issTgc(id)) {
+            sublayer = m_idHelperSvc->stgcIdHelper().gasGap(id) - 1;
+            if (m_idHelperSvc->stgcIdHelper().multilayer(id) == 2) sublayer += 4;
+            sublayer += 500;  // type info
+        } else if (m_idHelperSvc->isRpc(id)) {
+            sublayer = m_idHelperSvc->rpcIdHelper().gasGap(id) - 1;
+            if (m_idHelperSvc->rpcIdHelper().doubletR(id) == 2) sublayer += 2;
+            sublayer += 100;  // type info
+        } else if (m_idHelperSvc->isTgc(id)) {
+            sublayer = m_idHelperSvc->tgcIdHelper().gasGap(id) - 1;
+            Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(id);
+            if (stIndex == Muon::MuonStationIndex::EM) {
+                // T1 gets +3; T2 gets +3+3; T3 gets +3+6; T4 gets0 (because it is also EI)
+                Muon::MuonStationIndex::PhiIndex phiIndex = m_idHelperSvc->phiIndex(id);
+                sublayer += 3;
+                if (phiIndex == Muon::MuonStationIndex::T2)
+                    sublayer += 3;
+                else if (phiIndex == Muon::MuonStationIndex::T3)
+                    sublayer += 6;
+                // float fz = fabs(z);
+                // if( fz < 13350 )      sublayer += 0;
+                // else if( fz < 13440 ) sublayer += 3;
+                // else if( fz < 13520 ) sublayer += 6;
+                // else if( fz < 13600 ) sublayer += 9;
+                // else if( fz < 14650 ) sublayer += 12;
+                // else if( fz < 14740 ) sublayer += 15;
+                // else if( fz < 14800 ) sublayer += 18;
+                // else if( fz < 14850 ) sublayer += 21;
+                // else if( fz < 15070 ) sublayer += 24;
+                // else if( fz < 15150 ) sublayer += 27;
+                // else if( fz < 15220 ) sublayer += 30;
+                // else if( fz < 15250 ) sublayer += 33;
+                // else                  sublayer += 36;
+            }
+            sublayer += 300;  // type info
+        }
+        return sublayer;
     }
-    if( layer == 2 ){
-      if( ph1 > 6.9 )   ph += 2;
-      if( ph2 > 6.9 )   ph += 2;
-      if( ph2 > 8.9 )   ph += 2;
+
+    inline double MuonLayerHoughTool::combinedPeakheight(double ph, double ph1, double ph2, double phn, double /*rot*/, int layer,
+                                                         int /*region*/) const {
+        if (layer == 0 && ph < 3.) return ph;
+        if (layer == 1 && ph < 4.) return ph;
+        if (layer == 2 && ph < 3.) return ph;
+
+        if (phn > 7) ph += phn;
+
+        if (layer == 0) {
+            if (ph1 > 6.9) ph += 2;
+            if (ph1 > 8.9) ph += 2;
+            if (ph2 > 5.9) ph += 2;
+            if (ph2 > 7.9) ph += 2;
+        }
+        if (layer == 1) {
+            if (ph1 > 6.9) ph += 2;
+            if (ph2 > 5.9) ph += 2;
+            if (ph2 > 7.9) ph += 2;
+            if (ph2 > 11.9) ph += 2;
+        }
+        if (layer == 2) {
+            if (ph1 > 6.9) ph += 2;
+            if (ph2 > 6.9) ph += 2;
+            if (ph2 > 8.9) ph += 2;
+        }
+        return ph;
     }
-    return ph;
-  }
 
-}
-#endif 
+}  // namespace Muon
+#endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternFinderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternFinderTool.cxx
index 52af74221629e930dbd859fc2fee8b16b4718984..92be4046268dcb2a7e00c4002b659c2c29d3286a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternFinderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternFinderTool.cxx
@@ -4,6 +4,10 @@
 
 #include "MuonHoughPatternTools/MuonHoughPatternFinderTool.h"
 
+#include <map>
+#include <memory>
+#include <set>
+
 #include "EventPrimitives/EventPrimitivesHelpers.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "MuonHoughPatternEvent/MuonHoughHitContainer.h"
@@ -13,1966 +17,1574 @@
 #include "MuonRIO_OnTrack/MdtDriftCircleOnTrack.h"
 #include "MuonReadoutGeometry/MdtReadoutElement.h"
 #include "MuonSegment/MuonSegment.h"
-#include "MuonSegment/MuonSegmentCombination.h" // for csc's
+#include "MuonSegment/MuonSegmentCombination.h"  // for csc's
+#include "TFile.h"
+#include "TH1F.h"
 #include "TrkDriftCircleMath/DriftCircle.h"
 #include "TrkDriftCircleMath/MatchDCWithLine.h"
 #include "TrkDriftCircleMath/TangentToCircles.h"
 #include "TrkSurfaces/Surface.h"
 
-#include "TFile.h"
-#include "TH1F.h"
+using namespace TrkDriftCircleMath;
 
-#include <map>
-#include <memory>
+namespace Muon {
 
-#include <set>
+    MuonHoughPatternFinderTool::MuonHoughPatternFinderTool(const std::string& t, const std::string& n, const IInterface* p) :
+        AthAlgTool(t, n, p), m_weight_csc_on_segment(2.) {
+        declareInterface<IMuonHoughPatternFinderTool>(this);
+    }
 
-using namespace TrkDriftCircleMath;
+    StatusCode MuonHoughPatternFinderTool::initialize() {
+        if (m_use_histos == true) {
+            m_file = new TFile("Hough_histos.root", "RECREATE");
+            m_weighthistogram = new TH1F("weighthisto", "weighthisto", 100, -0.5, 2);
+            m_weighthistogrammdt = new TH1F("weighthistomdt", "weighthistomdt", 100, -0.3, 2.2);
+            m_weighthistogramrpc = new TH1F("weighthistorpc", "weighthistorpc", 100, -0.3, 2.2);
+            m_weighthistogramcsc = new TH1F("weighthistocsc", "weighthistocsc", 100, -0.3, 2.2);
+            m_weighthistogramtgc = new TH1F("weighthistotgc", "weighthistotgc", 100, -0.3, 2.2);
+        }
 
-namespace Muon {
+        ATH_MSG_VERBOSE("MuonHoughPatternFinderTool::Initializing");
+        ATH_CHECK(m_muonCombinePatternTool.retrieve());
+        ATH_MSG_VERBOSE("found Service MuonCombinePatternTool " << m_muonCombinePatternTool);
 
-MuonHoughPatternFinderTool::MuonHoughPatternFinderTool(const std::string& t,
-                                                       const std::string& n,
-                                                       const IInterface* p)
-  : AthAlgTool(t, n, p)
-  , m_weight_csc_on_segment(2.)
-{
-  declareInterface<IMuonHoughPatternFinderTool>(this);
-}
-
-StatusCode
-MuonHoughPatternFinderTool::initialize()
-{
-  if (m_use_histos == true) {
-    m_file = new TFile("Hough_histos.root", "RECREATE");
-    m_weighthistogram = new TH1F("weighthisto", "weighthisto", 100, -0.5, 2);
-    m_weighthistogrammdt =
-      new TH1F("weighthistomdt", "weighthistomdt", 100, -0.3, 2.2);
-    m_weighthistogramrpc =
-      new TH1F("weighthistorpc", "weighthistorpc", 100, -0.3, 2.2);
-    m_weighthistogramcsc =
-      new TH1F("weighthistocsc", "weighthistocsc", 100, -0.3, 2.2);
-    m_weighthistogramtgc =
-      new TH1F("weighthistotgc", "weighthistotgc", 100, -0.3, 2.2);
-  }
-
-  ATH_MSG_VERBOSE("MuonHoughPatternFinderTool::Initializing");
-  ATH_CHECK(m_muonCombinePatternTool.retrieve());
-  ATH_MSG_VERBOSE("found Service MuonCombinePatternTool "
-                  << m_muonCombinePatternTool);
-
-  ATH_CHECK(m_muonHoughPatternTool.retrieve());
-  ATH_MSG_VERBOSE(
-    "found Service muonHoughPatternTool: " << m_muonHoughPatternTool);
-
-  ATH_CHECK(m_idHelperSvc.retrieve());
-  ATH_MSG_DEBUG("Retrieved " << m_idHelperSvc);
-
-  ATH_CHECK(m_printer.retrieve());
-  ATH_MSG_DEBUG("Retrieved " << m_printer);
-
-  if (m_hit_reweights) {
-    ATH_MSG_DEBUG("Hit Reweighting " << m_hit_reweights);
-  }
-
-  ATH_CHECK(m_CosmicPhiPatternsKey.initialize(m_recordAllOutput));
-  ATH_CHECK(m_CosmicEtaPatternsKey.initialize(m_recordAllOutput));
-  ATH_CHECK(m_COMBINED_PATTERNSKey.initialize(m_recordAllOutput));
-
-  ATH_MSG_VERBOSE("End of Initializing");
-  return StatusCode::SUCCESS;
-}
-
-std::pair<std::unique_ptr<MuonPatternCombinationCollection>,
-          std::unique_ptr<Muon::HoughDataPerSectorVec>>
-MuonHoughPatternFinderTool::find(
-  const std::vector<const MdtPrepDataCollection*>& mdtCols,
-  const std::vector<const CscPrepDataCollection*>& cscCols,
-  const std::vector<const TgcPrepDataCollection*>& tgcCols,
-  const std::vector<const RpcPrepDataCollection*>& rpcCols,
-  const MuonSegmentCombinationCollection* cscSegmentCombis,
-  const EventContext& ctx) const
-{
-
-  /** map between mdt chamber identifiers and corresponding rpc hits
-   * (hit_no_begin and hit_no_end)*/
-  std::map<int, std::vector<std::pair<int, int>>> rpcmdtstationmap;
-  /** map between mdt chamber identifiers and corresponding tgc hits
-   * (hit_no_begin and hit_no_end)*/
-  std::map<int, std::vector<std::pair<int, int>>> tgcmdtstationmap;
-
-  /** map for association between trigger eta hits (first) and phi hits (second)
-   * within the same gasgap, used for combining patterns in
-   * MuonCombinePatternTool */
-  auto phietahitassociation = std::make_unique<
-    std::map<const Trk::PrepRawData*,
-             std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>>();
-
-  // read event_data:
-  const MuonHoughHitContainer* hitcontainer =
-    getAllHits(mdtCols,
-               cscCols,
-               tgcCols,
-               rpcCols,
-               cscSegmentCombis,
-               rpcmdtstationmap,
-               tgcmdtstationmap,
-               phietahitassociation.get());
-  // analyse data
-  std::unique_ptr<MuonPatternCombinationCollection> patCombiCol;
-  if (hitcontainer) {
-    patCombiCol.reset(analyse(*hitcontainer, phietahitassociation.get(), ctx));
-  } else {
-    ATH_MSG_INFO(" No hit container created! ");
-  }
-  // clear hit container
-  delete hitcontainer;
-  hitcontainer = nullptr;
-
-  // ensure we always output a collection
-  if (!patCombiCol) {
-    ATH_MSG_DEBUG(" NO pattern combinations found, creating empty collection ");
-    patCombiCol = std::make_unique<MuonPatternCombinationCollection>();
-  }
-
-  // summary
-  if (m_summary == true || this->msgLvl(MSG::DEBUG)) {
-    if (patCombiCol->empty())
-      ATH_MSG_DEBUG(" summarizing output: Combined pattern combination empty");
-    else
-      ATH_MSG_DEBUG(" summarizing Combined pattern combination output: "
-                    << m_printer->print(*patCombiCol));
-  }
-
-  // clean up tool for next call
-
-  // clear stationmaps
-  rpcmdtstationmap.clear();
-  tgcmdtstationmap.clear();
-  // clear etaphi association map
-  phietahitassociation->clear();
-
-  ATH_MSG_VERBOSE("execute(end) ");
-
-  // return result
-  return { std::move(patCombiCol), nullptr };
-}
-
-StatusCode
-MuonHoughPatternFinderTool::finalize()
-{
-  if (m_use_histos == true) {
-    m_file->Write();
-    m_file->Close();
-    ATH_MSG_DEBUG("MuonHoughPatternFinderTool:: delete rootfile");
-    delete m_file;
-    m_file = nullptr;
-    ATH_MSG_DEBUG("MuonHoughPatternFinderTool::delete Histogram: ");
-  }
-  ATH_MSG_VERBOSE("finalize()");
-
-  return StatusCode::SUCCESS;
-}
-
-MuonPatternCombinationCollection*
-MuonHoughPatternFinderTool::analyse(
-  const MuonHoughHitContainer& hitcontainer,
-  const std::map<const Trk::PrepRawData*,
-                 std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phietahitassociation,
-  const EventContext& ctx) const
-{
-
-  ATH_MSG_DEBUG("size of event: " << hitcontainer.size());
-
-  /** reconstructed patterns stored per [number_of_ids][level][which_segment] */
-  MuonHoughPatternContainerShip houghpattern =
-    m_muonHoughPatternTool->emptyHoughPattern();
-  //  pass through hitcontainer (better still: preprawdata and only after make
-  //  internal hitcontainer)
-  m_muonHoughPatternTool->makePatterns(&hitcontainer, houghpattern);
-
-  MuonPrdPatternCollection* phipatterns =
-    m_muonHoughPatternTool->getPhiMuonPatterns(houghpattern);
-  MuonPrdPatternCollection* etapatterns =
-    m_muonHoughPatternTool->getEtaMuonPatterns(houghpattern);
-
-  if (m_summary == true || this->msgLvl(MSG::DEBUG)) {
-    if (phipatterns->empty())
-      ATH_MSG_DEBUG(" summarizing input: Phi pattern combination empty");
-    else
-      ATH_MSG_DEBUG(" summarizing Phi pattern combination input: "
-                    << std::endl
-                    << m_printer->print(*phipatterns));
-    if (etapatterns->empty())
-      ATH_MSG_DEBUG(" summarizing input: Eta pattern combination empty");
-    else
-      ATH_MSG_DEBUG(" summarizing Eta pattern combination input: "
-                    << std::endl
-                    << m_printer->print(*etapatterns));
-  }
-
-  ATH_MSG_DEBUG("writePatterns");
-  ATH_MSG_DEBUG("size: phi: " << phipatterns->size()
-                              << " eta: " << etapatterns->size());
-
-  MuonPrdPatternCollection* combinedpatterns = nullptr;
-  MuonPatternCombinationCollection* patterncombinations = nullptr;
-
-  // make + write muonpatterncombinations
-  if (!etapatterns->empty()) {
-
-    combinedpatterns = m_muonCombinePatternTool->combineEtaPhiPatterns(
-      phipatterns, etapatterns, phietahitassociation);
-  }
-
-  if (combinedpatterns) {
-    patterncombinations =
-      m_muonCombinePatternTool->makePatternCombinations(combinedpatterns);
-  } else {
-    ATH_MSG_DEBUG("No combined patterns, creating dummy.");
-    combinedpatterns = new MuonPrdPatternCollection();
-  }
-
-  record(phipatterns, m_CosmicPhiPatternsKey, ctx);
-  record(etapatterns, m_CosmicEtaPatternsKey, ctx);
-  record(combinedpatterns, m_COMBINED_PATTERNSKey, ctx);
-
-  /** empty and clear the houghpattern vectors */
-  m_muonHoughPatternTool->reset(houghpattern);
-  return patterncombinations;
-}
-
-const MuonHoughHitContainer*
-MuonHoughPatternFinderTool::getAllHits(
-  const std::vector<const MdtPrepDataCollection*>& mdtCols,
-  const std::vector<const CscPrepDataCollection*>& cscCols,
-  const std::vector<const TgcPrepDataCollection*>& tgcCols,
-  const std::vector<const RpcPrepDataCollection*>& rpcCols,
-  const MuonSegmentCombinationCollection* cscSegmentCombis,
-  std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
-  std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
-  std::map<const Trk::PrepRawData*,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phietahitassociation) const
-{
-  ATH_MSG_VERBOSE("getAllHits()");
-
-  MuonHoughHitContainer* hitcontainer = new MuonHoughHitContainer;
-  // reserve space for 5000 hits (arbitrary), this should gain some cpu/memory
-  // for background, but will lose for lower occupancy. If anyone knows a way to
-  // predict the number of muon hits, I'd like to hear it.
-  hitcontainer->reserve(5000);
-
-  bool use_csc_segments = cscSegmentCombis != nullptr;
-
-  if (use_csc_segments && m_use_csc == true) {
-
-    // m_csc_segments = cscSegmentCombis;
-    MuonSegmentCombinationCollection::const_iterator msc =
-      cscSegmentCombis->begin();
-    MuonSegmentCombinationCollection::const_iterator msc_end =
-      cscSegmentCombis->end();
-
-    std::set<Identifier> csc_set; // set to make sure every csc hit is only
-                                  // passed to hitcontainer once
-    std::pair<std::set<Identifier>::iterator, bool> csc_pair;
-    std::map<int, int>
-      number_of_hits_per_layer; // map that connect layer number (1000*eta +
-                                // 100*phi + 10*chamberlayer+ 2*wirelayer +
-                                // eta/phi)
-
-    std::vector<const Muon::CscClusterOnTrack*> csc_rots; // csc rots
-    std::vector<const Muon::CscPrepData*> csc_prds;
-
-    std::vector<int> layer_ids; // if 0 then prd already added
-
-    csc_rots.reserve(400); // again arbitrary, atm (May 2008), the max number of
-                           // csc segments is 50 (times 8 hits = 400)
-    csc_prds.reserve(400);
-    layer_ids.reserve(400);
-
-    // two loops needed as number of hits per layer needs to be known
-
-    for (; msc != msc_end; ++msc) {
-      ATH_MSG_VERBOSE("CSC combo segments loop, segmentcombo " << (*msc));
-      for (unsigned int ss = 0; ss < (*msc)->numberOfStations(); ss++) {
-        Muon::MuonSegmentCombination::SegmentVec* segmentsInCombo =
-          (*msc)->stationSegments(ss);
-
-        Muon::MuonSegmentCombination::SegmentVec::iterator ms =
-          segmentsInCombo->begin();
-        Muon::MuonSegmentCombination::SegmentVec::iterator ms_end =
-          segmentsInCombo->end();
-
-        for (; ms != ms_end; ++ms) {
-          ATH_MSG_VERBOSE("CSC segments loop, segment: " << (*ms).get());
-          std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> phi_set;
-          std::vector<const Trk::PrepRawData*> eta_vector;
-          std::pair<std::set<const Trk::PrepRawData*,
-                             Muon::IdentifierPrdLess>::iterator,
-                    bool>
-            phi_pair;
-
-          int nRoTs = (*ms)->numberOfContainedROTs();
-          for (int i = 0; i < nRoTs; ++i) {
-            const Muon::CscClusterOnTrack* cscOnSeg =
-              dynamic_cast<const Muon::CscClusterOnTrack*>(
-                (*ms)->rioOnTrack(i));
-            if (!cscOnSeg) {
-              ATH_MSG_INFO("Dynamic cast to CscClusterOnTrack failed!");
-              continue;
-            }
-            const Muon::CscPrepData* prd =
-              dynamic_cast<const Muon::CscPrepData*>(cscOnSeg->prepRawData());
-            if (!prd) {
-              ATH_MSG_INFO("Dynamic cast to CscPrepData failed!");
-              continue;
+        ATH_CHECK(m_muonHoughPatternTool.retrieve());
+        ATH_MSG_VERBOSE("found Service muonHoughPatternTool: " << m_muonHoughPatternTool);
+
+        ATH_CHECK(m_idHelperSvc.retrieve());
+        ATH_MSG_DEBUG("Retrieved " << m_idHelperSvc);
+
+        ATH_CHECK(m_printer.retrieve());
+        ATH_MSG_DEBUG("Retrieved " << m_printer);
+
+        if (m_hit_reweights) { ATH_MSG_DEBUG("Hit Reweighting " << m_hit_reweights); }
+
+        ATH_CHECK(m_CosmicPhiPatternsKey.initialize(m_recordAllOutput));
+        ATH_CHECK(m_CosmicEtaPatternsKey.initialize(m_recordAllOutput));
+        ATH_CHECK(m_COMBINED_PATTERNSKey.initialize(m_recordAllOutput));
+
+        ATH_MSG_VERBOSE("End of Initializing");
+        return StatusCode::SUCCESS;
+    }
+
+    std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<Muon::HoughDataPerSectorVec>>
+    MuonHoughPatternFinderTool::find(const std::vector<const MdtPrepDataCollection*>& mdtCols,
+                                     const std::vector<const CscPrepDataCollection*>& cscCols,
+                                     const std::vector<const TgcPrepDataCollection*>& tgcCols,
+                                     const std::vector<const RpcPrepDataCollection*>& rpcCols,
+                                     const MuonSegmentCombinationCollection* cscSegmentCombis, const EventContext& ctx) const {
+        /** map between mdt chamber identifiers and corresponding rpc hits
+         * (hit_no_begin and hit_no_end)*/
+        std::map<int, std::vector<std::pair<int, int>>> rpcmdtstationmap;
+        /** map between mdt chamber identifiers and corresponding tgc hits
+         * (hit_no_begin and hit_no_end)*/
+        std::map<int, std::vector<std::pair<int, int>>> tgcmdtstationmap;
+
+        /** map for association between trigger eta hits (first) and phi hits (second)
+         * within the same gasgap, used for combining patterns in
+         * MuonCombinePatternTool */
+        auto phietahitassociation =
+            std::make_unique<std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>>();
+
+        // read event_data:
+        const MuonHoughHitContainer* hitcontainer = getAllHits(mdtCols, cscCols, tgcCols, rpcCols, cscSegmentCombis, rpcmdtstationmap,
+                                                               tgcmdtstationmap, phietahitassociation.get());
+        // analyse data
+        std::unique_ptr<MuonPatternCombinationCollection> patCombiCol;
+        if (hitcontainer) {
+            patCombiCol.reset(analyse(*hitcontainer, phietahitassociation.get(), ctx));
+        } else {
+            ATH_MSG_INFO(" No hit container created! ");
+        }
+        // clear hit container
+        delete hitcontainer;
+        hitcontainer = nullptr;
+
+        // ensure we always output a collection
+        if (!patCombiCol) {
+            ATH_MSG_DEBUG(" NO pattern combinations found, creating empty collection ");
+            patCombiCol = std::make_unique<MuonPatternCombinationCollection>();
+        }
+
+        // summary
+        if (m_summary == true || this->msgLvl(MSG::DEBUG)) {
+            if (patCombiCol->empty())
+                ATH_MSG_DEBUG(" summarizing output: Combined pattern combination empty");
+            else
+                ATH_MSG_DEBUG(" summarizing Combined pattern combination output: " << m_printer->print(*patCombiCol));
+        }
+
+        // clean up tool for next call
+
+        // clear stationmaps
+        rpcmdtstationmap.clear();
+        tgcmdtstationmap.clear();
+        // clear etaphi association map
+        phietahitassociation->clear();
+
+        ATH_MSG_VERBOSE("execute(end) ");
+
+        // return result
+        return {std::move(patCombiCol), nullptr};
+    }
+
+    StatusCode MuonHoughPatternFinderTool::finalize() {
+        if (m_use_histos == true) {
+            m_file->Write();
+            m_file->Close();
+            ATH_MSG_DEBUG("MuonHoughPatternFinderTool:: delete rootfile");
+            delete m_file;
+            m_file = nullptr;
+            ATH_MSG_DEBUG("MuonHoughPatternFinderTool::delete Histogram: ");
+        }
+        ATH_MSG_VERBOSE("finalize()");
+
+        return StatusCode::SUCCESS;
+    }
+
+    MuonPatternCombinationCollection* MuonHoughPatternFinderTool::analyse(
+        const MuonHoughHitContainer& hitcontainer,
+        const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation,
+        const EventContext& ctx) const {
+        ATH_MSG_DEBUG("size of event: " << hitcontainer.size());
+
+        /** reconstructed patterns stored per [number_of_ids][level][which_segment] */
+        MuonHoughPatternContainerShip houghpattern = m_muonHoughPatternTool->emptyHoughPattern();
+        //  pass through hitcontainer (better still: preprawdata and only after make
+        //  internal hitcontainer)
+        m_muonHoughPatternTool->makePatterns(&hitcontainer, houghpattern);
+
+        MuonPrdPatternCollection* phipatterns = m_muonHoughPatternTool->getPhiMuonPatterns(houghpattern);
+        MuonPrdPatternCollection* etapatterns = m_muonHoughPatternTool->getEtaMuonPatterns(houghpattern);
+
+        if (m_summary == true || this->msgLvl(MSG::DEBUG)) {
+            if (phipatterns->empty())
+                ATH_MSG_DEBUG(" summarizing input: Phi pattern combination empty");
+            else
+                ATH_MSG_DEBUG(" summarizing Phi pattern combination input: " << std::endl << m_printer->print(*phipatterns));
+            if (etapatterns->empty())
+                ATH_MSG_DEBUG(" summarizing input: Eta pattern combination empty");
+            else
+                ATH_MSG_DEBUG(" summarizing Eta pattern combination input: " << std::endl << m_printer->print(*etapatterns));
+        }
+
+        ATH_MSG_DEBUG("writePatterns");
+        ATH_MSG_DEBUG("size: phi: " << phipatterns->size() << " eta: " << etapatterns->size());
+
+        MuonPrdPatternCollection* combinedpatterns = nullptr;
+        MuonPatternCombinationCollection* patterncombinations = nullptr;
+
+        // make + write muonpatterncombinations
+        if (!etapatterns->empty()) {
+            combinedpatterns = m_muonCombinePatternTool->combineEtaPhiPatterns(phipatterns, etapatterns, phietahitassociation);
+        }
+
+        if (combinedpatterns) {
+            patterncombinations = m_muonCombinePatternTool->makePatternCombinations(combinedpatterns);
+        } else {
+            ATH_MSG_DEBUG("No combined patterns, creating dummy.");
+            combinedpatterns = new MuonPrdPatternCollection();
+        }
+
+        record(phipatterns, m_CosmicPhiPatternsKey, ctx);
+        record(etapatterns, m_CosmicEtaPatternsKey, ctx);
+        record(combinedpatterns, m_COMBINED_PATTERNSKey, ctx);
+
+        /** empty and clear the houghpattern vectors */
+        m_muonHoughPatternTool->reset(houghpattern);
+        return patterncombinations;
+    }
+
+    const MuonHoughHitContainer* MuonHoughPatternFinderTool::getAllHits(
+        const std::vector<const MdtPrepDataCollection*>& mdtCols, const std::vector<const CscPrepDataCollection*>& cscCols,
+        const std::vector<const TgcPrepDataCollection*>& tgcCols, const std::vector<const RpcPrepDataCollection*>& rpcCols,
+        const MuonSegmentCombinationCollection* cscSegmentCombis, std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
+        std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
+        std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const {
+        ATH_MSG_VERBOSE("getAllHits()");
+
+        MuonHoughHitContainer* hitcontainer = new MuonHoughHitContainer;
+        // reserve space for 5000 hits (arbitrary), this should gain some cpu/memory
+        // for background, but will lose for lower occupancy. If anyone knows a way to
+        // predict the number of muon hits, I'd like to hear it.
+        hitcontainer->reserve(5000);
+
+        bool use_csc_segments = cscSegmentCombis != nullptr;
+
+        if (use_csc_segments && m_use_csc == true) {
+            // m_csc_segments = cscSegmentCombis;
+            MuonSegmentCombinationCollection::const_iterator msc = cscSegmentCombis->begin();
+            MuonSegmentCombinationCollection::const_iterator msc_end = cscSegmentCombis->end();
+
+            std::set<Identifier> csc_set;  // set to make sure every csc hit is only
+                                           // passed to hitcontainer once
+            std::pair<std::set<Identifier>::iterator, bool> csc_pair;
+            std::map<int, int> number_of_hits_per_layer;  // map that connect layer number (1000*eta +
+                                                          // 100*phi + 10*chamberlayer+ 2*wirelayer +
+                                                          // eta/phi)
+
+            std::vector<const Muon::CscClusterOnTrack*> csc_rots;  // csc rots
+            std::vector<const Muon::CscPrepData*> csc_prds;
+
+            std::vector<int> layer_ids;  // if 0 then prd already added
+
+            csc_rots.reserve(400);  // again arbitrary, atm (May 2008), the max number of
+                                    // csc segments is 50 (times 8 hits = 400)
+            csc_prds.reserve(400);
+            layer_ids.reserve(400);
+
+            // two loops needed as number of hits per layer needs to be known
+
+            for (; msc != msc_end; ++msc) {
+                ATH_MSG_VERBOSE("CSC combo segments loop, segmentcombo " << (*msc));
+                for (unsigned int ss = 0; ss < (*msc)->numberOfStations(); ss++) {
+                    Muon::MuonSegmentCombination::SegmentVec* segmentsInCombo = (*msc)->stationSegments(ss);
+
+                    Muon::MuonSegmentCombination::SegmentVec::iterator ms = segmentsInCombo->begin();
+                    Muon::MuonSegmentCombination::SegmentVec::iterator ms_end = segmentsInCombo->end();
+
+                    for (; ms != ms_end; ++ms) {
+                        ATH_MSG_VERBOSE("CSC segments loop, segment: " << (*ms).get());
+                        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> phi_set;
+                        std::vector<const Trk::PrepRawData*> eta_vector;
+                        std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator, bool> phi_pair;
+
+                        int nRoTs = (*ms)->numberOfContainedROTs();
+                        for (int i = 0; i < nRoTs; ++i) {
+                            const Muon::CscClusterOnTrack* cscOnSeg = dynamic_cast<const Muon::CscClusterOnTrack*>((*ms)->rioOnTrack(i));
+                            if (!cscOnSeg) {
+                                ATH_MSG_INFO("Dynamic cast to CscClusterOnTrack failed!");
+                                continue;
+                            }
+                            const Muon::CscPrepData* prd = dynamic_cast<const Muon::CscPrepData*>(cscOnSeg->prepRawData());
+                            if (!prd) {
+                                ATH_MSG_INFO("Dynamic cast to CscPrepData failed!");
+                                continue;
+                            }
+
+                            csc_rots.push_back(cscOnSeg);
+                            csc_prds.push_back(prd);
+
+                            Identifier id = prd->identify();
+                            bool channel_type = m_idHelperSvc->cscIdHelper().measuresPhi(id);
+                            csc_pair = csc_set.insert(id);
+                            if (!csc_pair.second) {
+                                ATH_MSG_DEBUG(" CSC hit was already added, weight set to 0");
+                                layer_ids.push_back(0);
+                            } else {
+                                const int layer_id = 1000 * m_idHelperSvc->cscIdHelper().stationEta(id) +
+                                                     100 * m_idHelperSvc->cscIdHelper().stationPhi(id) +
+                                                     10 * m_idHelperSvc->cscIdHelper().chamberLayer(id) +
+                                                     2 * m_idHelperSvc->cscIdHelper().wireLayer(id) + channel_type;
+                                ATH_MSG_DEBUG("csc layer_id: " << layer_id);
+                                ++number_of_hits_per_layer[layer_id];
+                                layer_ids.push_back(layer_id);
+                            }
+
+                            if (channel_type) {  // phi hit
+                                phi_pair = phi_set.insert(prd);
+                                if (!phi_pair.second) { ATH_MSG_INFO(" CSC phi hit was already added"); }
+                            } else {  // eta hit
+                                eta_vector.push_back(prd);
+                            }
+                        }  // rots
+                        // add hit association from segment to map:
+                        if (!phi_set.empty()) {
+                            ATH_MSG_VERBOSE("Number of Phi Csc hits in segment: " << phi_set.size());
+                            std::vector<const Trk::PrepRawData*>::iterator vec_it = eta_vector.begin();
+                            for (; vec_it != eta_vector.end(); ++vec_it) { phietahitassociation->insert(std::make_pair(*vec_it, phi_set)); }
+                        }
+                    }
+                }
             }
 
-            csc_rots.push_back(cscOnSeg);
-            csc_prds.push_back(prd);
+            for (unsigned int i = 0; i < csc_rots.size(); i++) {
+                const Muon::CscPrepData* prd = csc_prds[i];
 
-            Identifier id = prd->identify();
-            bool channel_type = m_idHelperSvc->cscIdHelper().measuresPhi(id);
-            csc_pair = csc_set.insert(id);
-            if (!csc_pair.second) {
-              ATH_MSG_DEBUG(" CSC hit was already added, weight set to 0");
-              layer_ids.push_back(0);
-            } else {
-              const int layer_id =
-                1000 * m_idHelperSvc->cscIdHelper().stationEta(id) +
-                100 * m_idHelperSvc->cscIdHelper().stationPhi(id) +
-                10 * m_idHelperSvc->cscIdHelper().chamberLayer(id) +
-                2 * m_idHelperSvc->cscIdHelper().wireLayer(id) + channel_type;
-              ATH_MSG_DEBUG("csc layer_id: " << layer_id);
-              ++number_of_hits_per_layer[layer_id];
-              layer_ids.push_back(layer_id);
+                const Amg::Vector3D globalpos = csc_rots[i]->globalPosition();
+                double hitx = globalpos.x();
+                double hity = globalpos.y();
+                double hitz = globalpos.z();
+
+                bool channel_type = m_idHelperSvc->cscIdHelper().measuresPhi(csc_rots[i]->identify());
+
+                double weight = 0.;
+                if (layer_ids[i] != 0) {  // not yet added
+                    double number_of_hits = (double)number_of_hits_per_layer[layer_ids[i]];
+                    weight = m_weight_csc_on_segment / (0.75 * std::sqrt(number_of_hits) + 0.25 * number_of_hits);
+                }
+
+                ATH_MSG_DEBUG(m_printer->print(*prd) << " weight " << weight);
+                MuonHoughHit* hit = new MuonHoughHit(hitx, hity, hitz, channel_type, MuonHough::CSC, 1., weight, prd);
+
+                hitcontainer->addHit(hit);
+                if (m_use_histos == true) {
+                    m_weighthistogram->Fill(weight);
+                    m_weighthistogramcsc->Fill(weight);
+                }
             }
+        }  // use_csc_segments
+        // taken and modified from
+        // DetectorDescription/GeoModel/HitDisplay/src/HitDisplaySystem.cxx
+
+        if (m_use_rpc == true) {
+            std::vector<const RpcPrepDataCollection*>::const_iterator it = rpcCols.begin();
+            std::vector<const RpcPrepDataCollection*>::const_iterator it_end = rpcCols.end();
+            for (; it != it_end; ++it) {
+                Muon::RpcPrepDataCollection::const_iterator cit_begin = (*it)->begin();
+                Muon::RpcPrepDataCollection::const_iterator cit_end = (*it)->end();
+                addRpcCollection(cit_begin, cit_end, hitcontainer, rpcmdtstationmap, phietahitassociation);
+            }
+        }
 
-            if (channel_type) { // phi hit
-              phi_pair = phi_set.insert(prd);
-              if (!phi_pair.second) {
-                ATH_MSG_INFO(" CSC phi hit was already added");
-              }
-            } else { // eta hit
-              eta_vector.push_back(prd);
+        if (m_use_tgc == true) {
+            std::vector<const TgcPrepDataCollection*>::const_iterator it = tgcCols.begin();
+            std::vector<const TgcPrepDataCollection*>::const_iterator it_end = tgcCols.end();
+            for (; it != it_end; ++it) {
+                Muon::TgcPrepDataCollection::const_iterator cit_begin = (*it)->begin();
+                Muon::TgcPrepDataCollection::const_iterator cit_end = (*it)->end();
+                addTgcCollection(cit_begin, cit_end, hitcontainer, tgcmdtstationmap, phietahitassociation);
             }
-          } // rots
-          // add hit association from segment to map:
-          if (!phi_set.empty()) {
-            ATH_MSG_VERBOSE(
-              "Number of Phi Csc hits in segment: " << phi_set.size());
-            std::vector<const Trk::PrepRawData*>::iterator vec_it =
-              eta_vector.begin();
-            for (; vec_it != eta_vector.end(); ++vec_it) {
-              phietahitassociation->insert(std::make_pair(*vec_it, phi_set));
+        }
+
+        if (m_use_mdt == true) {
+            std::vector<const MdtPrepDataCollection*>::const_iterator it = mdtCols.begin();
+            std::vector<const MdtPrepDataCollection*>::const_iterator it_end = mdtCols.end();
+            for (; it != it_end; ++it) {
+                Muon::MdtPrepDataCollection::const_iterator cit_begin = (*it)->begin();
+                Muon::MdtPrepDataCollection::const_iterator cit_end = (*it)->end();
+                addMdtCollection(cit_begin, cit_end, hitcontainer, rpcmdtstationmap, tgcmdtstationmap);
             }
-          }
         }
-      }
-    }
 
-    for (unsigned int i = 0; i < csc_rots.size(); i++) {
-      const Muon::CscPrepData* prd = csc_prds[i];
-
-      const Amg::Vector3D globalpos = csc_rots[i]->globalPosition();
-      double hitx = globalpos.x();
-      double hity = globalpos.y();
-      double hitz = globalpos.z();
-
-      bool channel_type =
-        m_idHelperSvc->cscIdHelper().measuresPhi(csc_rots[i]->identify());
-
-      double weight = 0.;
-      if (layer_ids[i] != 0) { // not yet added
-        double number_of_hits = (double)number_of_hits_per_layer[layer_ids[i]];
-        weight = m_weight_csc_on_segment /
-                 (0.75 * std::sqrt(number_of_hits) + 0.25 * number_of_hits);
-      }
-
-      ATH_MSG_DEBUG(m_printer->print(*prd) << " weight " << weight);
-      MuonHoughHit* hit = new MuonHoughHit(
-        hitx, hity, hitz, channel_type, MuonHough::CSC, 1., weight, prd);
-
-      hitcontainer->addHit(hit);
-      if (m_use_histos == true) {
-        m_weighthistogram->Fill(weight);
-        m_weighthistogramcsc->Fill(weight);
-      }
-    }
-  } // use_csc_segments
-  // taken and modified from
-  // DetectorDescription/GeoModel/HitDisplay/src/HitDisplaySystem.cxx
-
-  if (m_use_rpc == true) {
-    std::vector<const RpcPrepDataCollection*>::const_iterator it =
-      rpcCols.begin();
-    std::vector<const RpcPrepDataCollection*>::const_iterator it_end =
-      rpcCols.end();
-    for (; it != it_end; ++it) {
-      Muon::RpcPrepDataCollection::const_iterator cit_begin = (*it)->begin();
-      Muon::RpcPrepDataCollection::const_iterator cit_end = (*it)->end();
-      addRpcCollection(cit_begin,
-                       cit_end,
-                       hitcontainer,
-                       rpcmdtstationmap,
-                       phietahitassociation);
-    }
-  }
-
-  if (m_use_tgc == true) {
-    std::vector<const TgcPrepDataCollection*>::const_iterator it =
-      tgcCols.begin();
-    std::vector<const TgcPrepDataCollection*>::const_iterator it_end =
-      tgcCols.end();
-    for (; it != it_end; ++it) {
-      Muon::TgcPrepDataCollection::const_iterator cit_begin = (*it)->begin();
-      Muon::TgcPrepDataCollection::const_iterator cit_end = (*it)->end();
-      addTgcCollection(cit_begin,
-                       cit_end,
-                       hitcontainer,
-                       tgcmdtstationmap,
-                       phietahitassociation);
-    }
-  }
-
-  if (m_use_mdt == true) {
-    std::vector<const MdtPrepDataCollection*>::const_iterator it =
-      mdtCols.begin();
-    std::vector<const MdtPrepDataCollection*>::const_iterator it_end =
-      mdtCols.end();
-    for (; it != it_end; ++it) {
-      Muon::MdtPrepDataCollection::const_iterator cit_begin = (*it)->begin();
-      Muon::MdtPrepDataCollection::const_iterator cit_end = (*it)->end();
-      addMdtCollection(
-        cit_begin, cit_end, hitcontainer, rpcmdtstationmap, tgcmdtstationmap);
-    }
-  }
-
-  if (m_use_csc == true && !use_csc_segments) {
-    std::vector<const CscPrepDataCollection*>::const_iterator it =
-      cscCols.begin();
-    std::vector<const CscPrepDataCollection*>::const_iterator it_end =
-      cscCols.end();
-    for (; it != it_end; ++it) {
-      Muon::CscPrepDataCollection::const_iterator cit_begin = (*it)->begin();
-      Muon::CscPrepDataCollection::const_iterator cit_end = (*it)->end();
-      addCscCollection(cit_begin, cit_end, hitcontainer, phietahitassociation);
-    }
-  }
-
-  ATH_MSG_VERBOSE("MuonHoughPatternFinderTool::getAllHits() saving "
-                  << hitcontainer->size() << " converted hits");
-
-  for (unsigned int i = 0; i < hitcontainer->size(); i++) {
-    ATH_MSG_VERBOSE(" hit "
-                    << hitcontainer->getHit(i)->getWhichDetector() << " ("
-                    << hitcontainer->getHit(i)->getHitx() << ","
-                    << hitcontainer->getHit(i)->getHity() << ","
-                    << hitcontainer->getHit(i)->getHitz() << ") "
-                    << " weight: " << hitcontainer->getHit(i)->getWeight()
-                    << " measures phi: "
-                    << hitcontainer->getHit(i)->getMeasuresPhi());
-  }
-
-  ATH_MSG_VERBOSE("MuonHoughPatternFinderTool::getAllHits() saving "
-                  << phietahitassociation->size() << "associated hits ");
-  return hitcontainer;
-
-} // getAllHits
-
-void
-MuonHoughPatternFinderTool::record(
-  MuonPrdPatternCollection* patCol,
-  const SG::WriteHandleKey<MuonPrdPatternCollection>& key,
-  const EventContext& ctx) const
-{
-
-  if (!patCol) {
-    ATH_MSG_WARNING("Zero pointer, could not save patterns!!! ");
-    return;
-  }
-
-  // check whether we are writing patterns to storegate, if not delete pattern
-  if (!m_recordAllOutput) {
-    ATH_MSG_DEBUG("Deleted patterns: " << patCol->size() << "  at "
-                                       << key.key());
-
-    // since patCol Datavector, it owns (by defaults its elements)
-    delete patCol;
-  } else {
-    SG::WriteHandle<MuonPrdPatternCollection> handle(key, ctx);
-    StatusCode sc = handle.record(std::unique_ptr<MuonPrdPatternCollection>(patCol));
-    if (sc.isFailure()) {
-      ATH_MSG_WARNING("Could not save patterns at " << key.key());
-    } else {
-      ATH_MSG_DEBUG("Saved patterns: " << patCol->size() << "  at "
-                                       << key.key());
-    }
-  }
-}
-
-bool
-MuonHoughPatternFinderTool::cut() 
-{
-  return 1 != 0;
-}
-
-void
-MuonHoughPatternFinderTool::addRpcCollection(
-  Muon::RpcPrepDataCollection::const_iterator cit_begin,
-  Muon::RpcPrepDataCollection::const_iterator cit_end,
-  MuonHoughHitContainer* hitcontainer,
-  std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
-  std::map<const Trk::PrepRawData*,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phietahitassociation) const
-{
-  if (cit_begin == cit_end)
-    return;
-  Muon::RpcPrepDataCollection::const_iterator cit = cit_begin;
-  std::map<int, int> number_of_hits_per_layer;
-  std::set<int> layers; // different layer definition between the two!!
-
-  int size_begin = hitcontainer->size();
-
-  if (m_hit_reweights) // reweight  hits, according to Peter's new algorithm
-  {
-    std::vector<double> strips(
-      2 * m_idHelperSvc->rpcIdHelper().stripMax() +
-      2); // filled strips, to determine whether it was no noise rpc hit
-          // (confirmation of ((neighbouring) layer))
-
-    for (; cit != cit_end; ++cit) {
-      const Muon::RpcPrepData* prd = *cit;
-      const bool channel_type =
-        m_idHelperSvc->rpcIdHelper().measuresPhi(prd->identify());
-      const Identifier id = prd->identify();
-      int strip =
-        m_idHelperSvc->rpcIdHelper().strip(id); // strip between 1 and 99!!
-      if (channel_type) {
-        strip += m_idHelperSvc->rpcIdHelper().stripMax();
-      }
-      strips[strip] += 1.;
-      strips[strip + 1] += 0.5;
-      strips[strip - 1] += 0.5;
-    }
-    cit = cit_begin;
-    for (; cit != cit_end; ++cit) {
-      const Muon::RpcPrepData* prd = *cit;
-      Identifier id = prd->identify();
-      const bool channel_type =
-        m_idHelperSvc->rpcIdHelper().measuresPhi(prd->identify());
-      int strip =
-        m_idHelperSvc->rpcIdHelper().strip(id); // strip between 1 and 99!!
-      if (channel_type) {
-        strip += m_idHelperSvc->rpcIdHelper().stripMax();
-      }
-
-      if (strips[strip] > 1) {
-
-        const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(id);
-        const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(id);
-        const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(id);
-        const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(id);
-        int layer_number = (gasGap - 1) * 12 + (doubletR - 1) * 6 +
-                           (doubletPhi - 1) * 3 +
-                           (doubletZ - 1); // layer_number ranges from 0..35
-        if (channel_type)
-          layer_number = layer_number + 36;
-
-        ++number_of_hits_per_layer[layer_number];
-
-        int layer = 2 * (doubletR - 1) + (gasGap - 1); // layer ranges from 0..8
-        if (channel_type)
-          layer = layer + 4;
-
-        layers.insert(layer);
-        ATH_MSG_VERBOSE("layer_number: "
-                        << layer_number << " doubletR: " << doubletR
-                        << " doubletZ: " << doubletZ << " doubletPhi "
-                        << doubletPhi << " gasGap " << gasGap << " layer "
-                        << layer);
-      }
-    }
-  }
-
-  std::map<const Identifier,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>
-    gasgapphimap; // map between gasgapidentifier and phi hits
-  std::map<const Identifier,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::iterator
-    gg_it;
-  std::pair<
-    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator,
-    bool>
-    gg_insert;
-
-  cit = cit_begin;
-
-  for (; cit != cit_end; ++cit) {
-    const Muon::RpcPrepData* prd = *cit;
-
-    const Amg::Vector3D globalpos = prd->globalPosition();
-    const Identifier id = prd->identify();
-    const double hitx = globalpos.x();
-    const double hity = globalpos.y();
-    const double hitz = globalpos.z();
-
-    const bool channel_type = m_idHelperSvc->rpcIdHelper().measuresPhi(id);
-
-    // gasgapmap
-
-    if (channel_type) // phi hit
-    {
-      const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
-      gg_it = gasgapphimap.find(gasGapId);
-      if (gg_it == gasgapphimap.end()) { // gasgapid not yet in map
-        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hitset;
-        hitset.insert(prd);
-        gasgapphimap.insert(std::make_pair(gasGapId, hitset));
-      } else { // gasgapid already in set
-        gg_insert = (*gg_it).second.insert(prd);
-        if (!gg_insert.second) {
-          ATH_MSG_DEBUG("WARNING::RPC hit already in set? ");
+        if (m_use_csc == true && !use_csc_segments) {
+            std::vector<const CscPrepDataCollection*>::const_iterator it = cscCols.begin();
+            std::vector<const CscPrepDataCollection*>::const_iterator it_end = cscCols.end();
+            for (; it != it_end; ++it) {
+                Muon::CscPrepDataCollection::const_iterator cit_begin = (*it)->begin();
+                Muon::CscPrepDataCollection::const_iterator cit_end = (*it)->end();
+                addCscCollection(cit_begin, cit_end, hitcontainer, phietahitassociation);
+            }
         }
-      }
-    }
 
-    double weight = 1.;
-    double prob = 1.;
-
-    if (m_hit_reweights) {
-      if (layers.size() <= 1) {
-        weight = 0.;
-        prob = 0.;
-      } else {
-
-        const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(id);
-        const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(id);
-        const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(id);
-        const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(id);
-        int layer_number = (gasGap - 1) * 12 + (doubletR - 1) * 6 +
-                           (doubletPhi - 1) * 3 +
-                           (doubletZ - 1); // layer_number ranges from 0..35
-        if (channel_type)
-          layer_number = layer_number + 36;
-
-        double number_of_hits = (double)number_of_hits_per_layer[layer_number];
-
-        if (number_of_hits > 0) {
-          //	      weight = 1. /
-          //(0.75*std::sqrt(number_of_hits)+0.25*number_of_hits);
-          weight =
-            1. / (0.25 * std::sqrt(number_of_hits) + 0.75 * number_of_hits);
-          if (layers.size() == 2)
-            weight = weight / 2.;
+        ATH_MSG_VERBOSE("MuonHoughPatternFinderTool::getAllHits() saving " << hitcontainer->size() << " converted hits");
+
+        for (unsigned int i = 0; i < hitcontainer->size(); i++) {
+            ATH_MSG_VERBOSE(" hit " << hitcontainer->getHit(i)->getWhichDetector() << " (" << hitcontainer->getHit(i)->getHitx() << ","
+                                    << hitcontainer->getHit(i)->getHity() << "," << hitcontainer->getHit(i)->getHitz() << ") "
+                                    << " weight: " << hitcontainer->getHit(i)->getWeight()
+                                    << " measures phi: " << hitcontainer->getHit(i)->getMeasuresPhi());
+        }
+
+        ATH_MSG_VERBOSE("MuonHoughPatternFinderTool::getAllHits() saving " << phietahitassociation->size() << "associated hits ");
+        return hitcontainer;
+
+    }  // getAllHits
+
+    void MuonHoughPatternFinderTool::record(MuonPrdPatternCollection* patCol, const SG::WriteHandleKey<MuonPrdPatternCollection>& key,
+                                            const EventContext& ctx) const {
+        if (!patCol) {
+            ATH_MSG_WARNING("Zero pointer, could not save patterns!!! ");
+            return;
+        }
+
+        // check whether we are writing patterns to storegate, if not delete pattern
+        if (!m_recordAllOutput) {
+            ATH_MSG_DEBUG("Deleted patterns: " << patCol->size() << "  at " << key.key());
+
+            // since patCol Datavector, it owns (by defaults its elements)
+            delete patCol;
         } else {
-          weight = 0.;
-          prob = 0.;
+            SG::WriteHandle<MuonPrdPatternCollection> handle(key, ctx);
+            StatusCode sc = handle.record(std::unique_ptr<MuonPrdPatternCollection>(patCol));
+            if (sc.isFailure()) {
+                ATH_MSG_WARNING("Could not save patterns at " << key.key());
+            } else {
+                ATH_MSG_DEBUG("Saved patterns: " << patCol->size() << "  at " << key.key());
+            }
         }
-      }
-    }
-    MuonHoughHit* hit = new MuonHoughHit(
-      hitx, hity, hitz, channel_type, MuonHough::RPC, prob, weight, prd);
-    hitcontainer->addHit(hit);
-    ATH_MSG_DEBUG(m_printer->print(*prd) << " NEW weight " << weight);
-
-    if (m_use_histos == true) {
-      m_weighthistogram->Fill(weight);
-      m_weighthistogramrpc->Fill(weight);
     }
-  }
 
-  int size_end = hitcontainer->size();
+    bool MuonHoughPatternFinderTool::cut() { return 1 != 0; }
+
+    void MuonHoughPatternFinderTool::addRpcCollection(
+        Muon::RpcPrepDataCollection::const_iterator cit_begin, Muon::RpcPrepDataCollection::const_iterator cit_end,
+        MuonHoughHitContainer* hitcontainer, std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
+        std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const {
+        if (cit_begin == cit_end) return;
+        Muon::RpcPrepDataCollection::const_iterator cit = cit_begin;
+        std::map<int, int> number_of_hits_per_layer;
+        std::set<int> layers;  // different layer definition between the two!!
+
+        int size_begin = hitcontainer->size();
+
+        if (m_hit_reweights)  // reweight  hits, according to Peter's new algorithm
+        {
+            std::vector<double> strips(2 * m_idHelperSvc->rpcIdHelper().stripMax() +
+                                       2);  // filled strips, to determine whether it was no noise rpc hit
+                                            // (confirmation of ((neighbouring) layer))
+
+            for (; cit != cit_end; ++cit) {
+                const Muon::RpcPrepData* prd = *cit;
+                const bool channel_type = m_idHelperSvc->rpcIdHelper().measuresPhi(prd->identify());
+                const Identifier id = prd->identify();
+                int strip = m_idHelperSvc->rpcIdHelper().strip(id);  // strip between 1 and 99!!
+                if (channel_type) { strip += m_idHelperSvc->rpcIdHelper().stripMax(); }
+                strips[strip] += 1.;
+                strips[strip + 1] += 0.5;
+                strips[strip - 1] += 0.5;
+            }
+            cit = cit_begin;
+            for (; cit != cit_end; ++cit) {
+                const Muon::RpcPrepData* prd = *cit;
+                Identifier id = prd->identify();
+                const bool channel_type = m_idHelperSvc->rpcIdHelper().measuresPhi(prd->identify());
+                int strip = m_idHelperSvc->rpcIdHelper().strip(id);  // strip between 1 and 99!!
+                if (channel_type) { strip += m_idHelperSvc->rpcIdHelper().stripMax(); }
+
+                if (strips[strip] > 1) {
+                    const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(id);
+                    const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(id);
+                    const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(id);
+                    const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(id);
+                    int layer_number =
+                        (gasGap - 1) * 12 + (doubletR - 1) * 6 + (doubletPhi - 1) * 3 + (doubletZ - 1);  // layer_number ranges from 0..35
+                    if (channel_type) layer_number = layer_number + 36;
+
+                    ++number_of_hits_per_layer[layer_number];
+
+                    int layer = 2 * (doubletR - 1) + (gasGap - 1);  // layer ranges from 0..8
+                    if (channel_type) layer = layer + 4;
+
+                    layers.insert(layer);
+                    ATH_MSG_VERBOSE("layer_number: " << layer_number << " doubletR: " << doubletR << " doubletZ: " << doubletZ
+                                                     << " doubletPhi " << doubletPhi << " gasGap " << gasGap << " layer " << layer);
+                }
+            }
+        }
+
+        std::map<const Identifier, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>
+            gasgapphimap;  // map between gasgapidentifier and phi hits
+        std::map<const Identifier, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::iterator gg_it;
+        std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator, bool> gg_insert;
+
+        cit = cit_begin;
+
+        for (; cit != cit_end; ++cit) {
+            const Muon::RpcPrepData* prd = *cit;
+
+            const Amg::Vector3D globalpos = prd->globalPosition();
+            const Identifier id = prd->identify();
+            const double hitx = globalpos.x();
+            const double hity = globalpos.y();
+            const double hitz = globalpos.z();
+
+            const bool channel_type = m_idHelperSvc->rpcIdHelper().measuresPhi(id);
+
+            // gasgapmap
+
+            if (channel_type)  // phi hit
+            {
+                const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+                gg_it = gasgapphimap.find(gasGapId);
+                if (gg_it == gasgapphimap.end()) {  // gasgapid not yet in map
+                    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hitset;
+                    hitset.insert(prd);
+                    gasgapphimap.insert(std::make_pair(gasGapId, hitset));
+                } else {  // gasgapid already in set
+                    gg_insert = (*gg_it).second.insert(prd);
+                    if (!gg_insert.second) { ATH_MSG_DEBUG("WARNING::RPC hit already in set? "); }
+                }
+            }
+
+            double weight = 1.;
+            double prob = 1.;
+
+            if (m_hit_reweights) {
+                if (layers.size() <= 1) {
+                    weight = 0.;
+                    prob = 0.;
+                } else {
+                    const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(id);
+                    const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(id);
+                    const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(id);
+                    const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(id);
+                    int layer_number =
+                        (gasGap - 1) * 12 + (doubletR - 1) * 6 + (doubletPhi - 1) * 3 + (doubletZ - 1);  // layer_number ranges from 0..35
+                    if (channel_type) layer_number = layer_number + 36;
+
+                    double number_of_hits = (double)number_of_hits_per_layer[layer_number];
+
+                    if (number_of_hits > 0) {
+                        //	      weight = 1. /
+                        //(0.75*std::sqrt(number_of_hits)+0.25*number_of_hits);
+                        weight = 1. / (0.25 * std::sqrt(number_of_hits) + 0.75 * number_of_hits);
+                        if (layers.size() == 2) weight = weight / 2.;
+                    } else {
+                        weight = 0.;
+                        prob = 0.;
+                    }
+                }
+            }
+            MuonHoughHit* hit = new MuonHoughHit(hitx, hity, hitz, channel_type, MuonHough::RPC, prob, weight, prd);
+            hitcontainer->addHit(hit);
+            ATH_MSG_DEBUG(m_printer->print(*prd) << " NEW weight " << weight);
+
+            if (m_use_histos == true) {
+                m_weighthistogram->Fill(weight);
+                m_weighthistogramrpc->Fill(weight);
+            }
+        }
+
+        int size_end = hitcontainer->size();
 
-  updateRpcMdtStationMap(
-    (*cit_begin)->identify(), size_begin, size_end, rpcmdtstationmap);
+        updateRpcMdtStationMap((*cit_begin)->identify(), size_begin, size_end, rpcmdtstationmap);
 
-  // extract preprawdata from gasgapmap // might not be fastest way (filling
-  // immidiately saves this second loop)
+        // extract preprawdata from gasgapmap // might not be fastest way (filling
+        // immidiately saves this second loop)
 
-  cit = cit_begin;
+        cit = cit_begin;
 
-  for (; cit != cit_end; ++cit) {
-    const Muon::RpcPrepData* prd = *cit;
-    const Identifier id = prd->identify();
-    if (!m_idHelperSvc->rpcIdHelper().measuresPhi(id)) { // eta hit
+        for (; cit != cit_end; ++cit) {
+            const Muon::RpcPrepData* prd = *cit;
+            const Identifier id = prd->identify();
+            if (!m_idHelperSvc->rpcIdHelper().measuresPhi(id)) {  // eta hit
 
-      const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+                const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
 
-      gg_it = gasgapphimap.find(gasGapId);
-      if (gg_it != gasgapphimap.end()) {
-        phietahitassociation->insert(std::make_pair(prd, (*gg_it).second));
-      }
-    }
-  }
-}
-
-void
-MuonHoughPatternFinderTool::addTgcCollection(
-  Muon::TgcPrepDataCollection::const_iterator cit_begin,
-  Muon::TgcPrepDataCollection::const_iterator cit_end,
-  MuonHoughHitContainer* hitcontainer,
-  std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
-  std::map<const Trk::PrepRawData*,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phietahitassociation) const
-{
-  if (cit_begin == cit_end)
-    return;
-  Muon::TgcPrepDataCollection::const_iterator cit = cit_begin;
-  std::map<int, int> number_of_hits_per_layer;
-  std::set<int> layers; // different layer definition between the two!!
-
-  int size_begin = hitcontainer->size();
-
-  if (m_hit_reweights) {
-    std::vector<double> channels(
-      2 * m_idHelperSvc->tgcIdHelper().channelMax() +
-      2); // filled strips, to determine whether it was no noise rpc hit
-          // (confirmation of ((neighbouring) layer))
-    for (; cit != cit_end; ++cit) {
-      const Muon::TgcPrepData* prd = *cit;
-      Identifier id = prd->identify();
-      bool channel_type =
-        m_idHelperSvc->tgcIdHelper().isStrip(id); // like measuresPhi()
-      int channel =
-        m_idHelperSvc->tgcIdHelper().channel(id); // between 1 and 135!
-      if (channel_type) {
-        channel += m_idHelperSvc->tgcIdHelper().channelMax();
-      }
-      channels[channel] += 1.;
-      channels[channel + 1] += 0.55;
-      channels[channel - 1] += 0.55;
+                gg_it = gasgapphimap.find(gasGapId);
+                if (gg_it != gasgapphimap.end()) { phietahitassociation->insert(std::make_pair(prd, (*gg_it).second)); }
+            }
+        }
     }
-    cit = cit_begin;
-    for (; cit != cit_end; ++cit) {
-      const Muon::TgcPrepData* prd = *cit;
-      const Identifier id = prd->identify();
-      const bool channel_type =
-        m_idHelperSvc->tgcIdHelper().isStrip(id); // like measuresPhi()
-      int channel =
-        m_idHelperSvc->tgcIdHelper().channel(id); // between 1 and 135!
-      if (channel_type) {
-        channel += m_idHelperSvc->tgcIdHelper().channelMax();
-      }
-
-      if (channels[channel] > 1) {
-
-        const int gasgap = m_idHelperSvc->tgcIdHelper().gasGap(id);
-        int layer_number = (gasgap - 1); // layer_number ranges from 0..5
-        if (channel_type) {
-          layer_number = layer_number + 3;
+
+    void MuonHoughPatternFinderTool::addTgcCollection(
+        Muon::TgcPrepDataCollection::const_iterator cit_begin, Muon::TgcPrepDataCollection::const_iterator cit_end,
+        MuonHoughHitContainer* hitcontainer, std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap,
+        std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const {
+        if (cit_begin == cit_end) return;
+        Muon::TgcPrepDataCollection::const_iterator cit = cit_begin;
+        std::map<int, int> number_of_hits_per_layer;
+        std::set<int> layers;  // different layer definition between the two!!
+
+        int size_begin = hitcontainer->size();
+
+        if (m_hit_reweights) {
+            std::vector<double> channels(2 * m_idHelperSvc->tgcIdHelper().channelMax() +
+                                         2);  // filled strips, to determine whether it was no noise rpc hit
+                                              // (confirmation of ((neighbouring) layer))
+            for (; cit != cit_end; ++cit) {
+                const Muon::TgcPrepData* prd = *cit;
+                Identifier id = prd->identify();
+                bool channel_type = m_idHelperSvc->tgcIdHelper().isStrip(id);  // like measuresPhi()
+                int channel = m_idHelperSvc->tgcIdHelper().channel(id);        // between 1 and 135!
+                if (channel_type) { channel += m_idHelperSvc->tgcIdHelper().channelMax(); }
+                channels[channel] += 1.;
+                channels[channel + 1] += 0.55;
+                channels[channel - 1] += 0.55;
+            }
+            cit = cit_begin;
+            for (; cit != cit_end; ++cit) {
+                const Muon::TgcPrepData* prd = *cit;
+                const Identifier id = prd->identify();
+                const bool channel_type = m_idHelperSvc->tgcIdHelper().isStrip(id);  // like measuresPhi()
+                int channel = m_idHelperSvc->tgcIdHelper().channel(id);              // between 1 and 135!
+                if (channel_type) { channel += m_idHelperSvc->tgcIdHelper().channelMax(); }
+
+                if (channels[channel] > 1) {
+                    const int gasgap = m_idHelperSvc->tgcIdHelper().gasGap(id);
+                    int layer_number = (gasgap - 1);  // layer_number ranges from 0..5
+                    if (channel_type) { layer_number = layer_number + 3; }
+
+                    ++number_of_hits_per_layer[layer_number];
+
+                    const int layer = layer_number;  // layer ranges from 0..5
+
+                    layers.insert(layer);
+                    ATH_MSG_VERBOSE("gasgap: " << gasgap << " layer: " << layer_number);
+                }
+            }
         }
 
-        ++number_of_hits_per_layer[layer_number];
+        std::map<const Identifier, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>
+            gasgapphimap;  // map between gasgapidentifier and phi hits
+        std::map<const Identifier, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::iterator gg_it;
+        std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator, bool> gg_insert;
 
-        const int layer = layer_number; // layer ranges from 0..5
+        cit = cit_begin;
+        for (; cit != cit_end; ++cit) {
+            const Muon::TgcPrepData* prd = *cit;
+            Amg::Vector3D globalpos = prd->globalPosition();
+            Identifier id = prd->identify();
+            double hitx = globalpos.x();
+            double hity = globalpos.y();
+            double hitz = globalpos.z();
 
-        layers.insert(layer);
-        ATH_MSG_VERBOSE("gasgap: " << gasgap << " layer: " << layer_number);
-      }
-    }
-  }
-
-  std::map<const Identifier,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>
-    gasgapphimap; // map between gasgapidentifier and phi hits
-  std::map<const Identifier,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::iterator
-    gg_it;
-  std::pair<
-    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator,
-    bool>
-    gg_insert;
-
-  cit = cit_begin;
-  for (; cit != cit_end; ++cit) {
-    const Muon::TgcPrepData* prd = *cit;
-    Amg::Vector3D globalpos = prd->globalPosition();
-    Identifier id = prd->identify();
-    double hitx = globalpos.x();
-    double hity = globalpos.y();
-    double hitz = globalpos.z();
-
-    bool channel_type =
-      m_idHelperSvc->tgcIdHelper().isStrip(id); // like measuresPhi()
-
-    int big_number = 250000;
-
-    if (std::isnan(hitx) || std::abs(hitx) > big_number ||
-        std::abs(hity) > big_number ||
-        std::abs(hitz) > big_number) // to avoid crashing with TGC hits
-    {
-      ATH_MSG_WARNING("TGC hit not physical: hitx: "
-                      << hitx << " hity: " << hity << " hitz: " << hitz);
-    } else {
-      if (channel_type) // phi hit
-      {
-        const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
-        gg_it = gasgapphimap.find(gasGapId);
-        if (gg_it == gasgapphimap.end()) { // gasgapid not yet in map
-          std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hitset;
-          hitset.insert(prd);
-          gasgapphimap.insert(std::make_pair(gasGapId, hitset));
-        } else { // gasgapid already in set
-          gg_insert = (*gg_it).second.insert(prd);
-          if (!gg_insert.second) {
-            ATH_MSG_DEBUG("WARNING::TGC hit already in set? ");
-          }
+            bool channel_type = m_idHelperSvc->tgcIdHelper().isStrip(id);  // like measuresPhi()
+
+            int big_number = 250000;
+
+            if (std::isnan(hitx) || std::abs(hitx) > big_number || std::abs(hity) > big_number ||
+                std::abs(hitz) > big_number)  // to avoid crashing with TGC hits
+            {
+                ATH_MSG_WARNING("TGC hit not physical: hitx: " << hitx << " hity: " << hity << " hitz: " << hitz);
+            } else {
+                if (channel_type)  // phi hit
+                {
+                    const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+                    gg_it = gasgapphimap.find(gasGapId);
+                    if (gg_it == gasgapphimap.end()) {  // gasgapid not yet in map
+                        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hitset;
+                        hitset.insert(prd);
+                        gasgapphimap.insert(std::make_pair(gasGapId, hitset));
+                    } else {  // gasgapid already in set
+                        gg_insert = (*gg_it).second.insert(prd);
+                        if (!gg_insert.second) { ATH_MSG_DEBUG("WARNING::TGC hit already in set? "); }
+                    }
+                }
+                double weight = 1.;
+                double prob = 1.;
+                if (m_hit_reweights == true) {
+                    if (layers.size() <= 1) {
+                        weight = 0.;
+                        prob = 0.;
+                    } else {
+                        const int gasgap = m_idHelperSvc->tgcIdHelper().gasGap(id);
+                        int layer_number = (gasgap - 1);  // layer_number ranges from 0..1/2
+                        if (channel_type) layer_number = layer_number + 3;
+                        double number_of_hits = (double)number_of_hits_per_layer[layer_number];
+                        if (number_of_hits > 0) {
+                            weight = 1. / (0.25 * std::sqrt(number_of_hits) + 0.75 * number_of_hits);
+                            if (layers.size() == 2) weight = weight / 2.;
+                        } else {
+                            weight = 0.;
+                            prob = 0.;
+                        }
+                    }
+                }
+                MuonHoughHit* hit = new MuonHoughHit(hitx, hity, hitz, channel_type, MuonHough::TGC, prob, weight,
+                                                     prd);  // getPrd
+                hitcontainer->addHit(hit);
+                ATH_MSG_DEBUG(m_printer->print(*prd) << " NEW weight " << weight);
+                if (m_use_histos == true) {
+                    m_weighthistogram->Fill(weight);
+                    m_weighthistogramtgc->Fill(weight);
+                }
+            }
         }
-      }
-      double weight = 1.;
-      double prob = 1.;
-      if (m_hit_reweights == true) {
-        if (layers.size() <= 1) {
-          weight = 0.;
-          prob = 0.;
-        } else {
 
-          const int gasgap = m_idHelperSvc->tgcIdHelper().gasGap(id);
-          int layer_number = (gasgap - 1); // layer_number ranges from 0..1/2
-          if (channel_type)
-            layer_number = layer_number + 3;
-          double number_of_hits =
-            (double)number_of_hits_per_layer[layer_number];
-          if (number_of_hits > 0) {
-            weight =
-              1. / (0.25 * std::sqrt(number_of_hits) + 0.75 * number_of_hits);
-            if (layers.size() == 2)
-              weight = weight / 2.;
-          } else {
-            weight = 0.;
-            prob = 0.;
-          }
+        int size_end = hitcontainer->size();
+        updateTgcMdtStationMap((*cit_begin)->identify(), size_begin, size_end, tgcmdtstationmap);
+
+        // extract preprawdata from gasgapmap // might not be fastest way (filling
+        // immidiately saves this second loop)
+
+        cit = cit_begin;
+
+        for (; cit != cit_end; ++cit) {
+            const Muon::TgcPrepData* prd = *cit;
+            const Identifier id = prd->identify();
+            if (!static_cast<bool>(m_idHelperSvc->tgcIdHelper().isStrip(id))) {  // eta hit
+
+                const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+
+                gg_it = gasgapphimap.find(gasGapId);
+                if (gg_it != gasgapphimap.end()) { phietahitassociation->insert(std::make_pair(prd, (*gg_it).second)); }
+            }
         }
-      }
-      MuonHoughHit* hit = new MuonHoughHit(hitx,
-                                           hity,
-                                           hitz,
-                                           channel_type,
-                                           MuonHough::TGC,
-                                           prob,
-                                           weight,
-                                           prd); // getPrd
-      hitcontainer->addHit(hit);
-      ATH_MSG_DEBUG(m_printer->print(*prd) << " NEW weight " << weight);
-      if (m_use_histos == true) {
-        m_weighthistogram->Fill(weight);
-        m_weighthistogramtgc->Fill(weight);
-      }
     }
-  }
 
-  int size_end = hitcontainer->size();
-  updateTgcMdtStationMap(
-    (*cit_begin)->identify(), size_begin, size_end, tgcmdtstationmap);
+    void MuonHoughPatternFinderTool::addMdtCollection(Muon::MdtPrepDataCollection::const_iterator cit_begin,
+                                                      Muon::MdtPrepDataCollection::const_iterator cit_end,
+                                                      MuonHoughHitContainer* hitcontainer,
+                                                      std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
+                                                      std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const {
+        if (cit_begin == cit_end) return;
+
+        const int size = std::distance(cit_begin, cit_end);
+
+        if (m_showerskip == true) {
+            const Muon::MdtPrepData* mdt = (*cit_begin);
+            const MuonGM::MdtReadoutElement* detEl = mdt->detectorElement();
+            unsigned int channels = 2 * detEl->getNLayers() * detEl->getNtubesperlayer();  // Factor 2 for number of multilayers, should
+                                                                                           // be changed when only 1 detector element per
+                                                                                           // chamber (the chambers with only 1
+                                                                                           // multilayer have a twice less severe cut
+                                                                                           // (for convenience))
+            double occupancy = (double)size / (double)channels;
+
+            ATH_MSG_DEBUG(" size: " << size << " channels: " << channels << " occupancy: " << occupancy);
+
+            // if more than m_showerskipperc (default 30%) of all hits in the chamber is
+            // hit then all weights to 0 only done for large chambers (more than 50
+            // hits)
+            if (occupancy > m_showerskipperc && size > 50) {
+                ATH_MSG_DEBUG("Chamber skipped! Too high occupancy (>" << m_showerskipperc << "%): " << occupancy
+                                                                       << " association to pattern still possible");
+
+                Muon::MdtPrepDataCollection::const_iterator cit = cit_begin;
+                for (; cit != cit_end; ++cit)  // first
+                {
+                    const Muon::MdtPrepData* mdt = (*cit);
+
+                    if (m_mdt_tdc_cut == true && mdt->status() != Muon::MdtStatusDriftTime) continue;
+
+                    if ((m_mdt_adc_cut == true && (mdt->adc() > m_mdt_adc_min)) || m_mdt_adc_cut == false) {
+                        Identifier id = mdt->identify();
+                        const Trk::Surface& surface = mdt->detectorElement()->surface(id);
+                        const Amg::Vector3D& globalpos = surface.center();
+                        double hitx = globalpos.x();
+                        double hity = globalpos.y();
+                        double hitz = globalpos.z();
+
+                        MuonHoughHit* hit = new MuonHoughHit(hitx, hity, hitz, false, MuonHough::MDT, 0., 0., mdt);  // getPrd
+                        ATH_MSG_DEBUG(m_printer->print(*mdt));
+                        hitcontainer->addHit(hit);
+                    }
+                }
+                return;
+            }
+        }
 
-  // extract preprawdata from gasgapmap // might not be fastest way (filling
-  // immidiately saves this second loop)
+        std::map<int, int> number_of_hits_per_layer;
+        std::map<int, int> number_of_hots_per_layer;  // number of trigger confirmed or hits on segment
+                                                      // within layer (key)
+
+        std::vector<double> hitx;
+        std::vector<double> hity;
+        std::vector<double> hitz;
+        std::vector<double> radius;
+        std::vector<double> errradius;
+        std::vector<double> weights;
+        std::vector<double> prob;  // artificial probability that hit belongs to true muon
+        std::vector<int> multilayer;
+        std::vector<int> tubelayer;
+        std::vector<int> tubes;
+        std::vector<int> onsegment;  // non-zero if on segment, int indicates how many hits in same
+                                     // layer are on segment (used in weighting)
+        std::vector<double> psi;
+        std::vector<double> weight_trigger;
+        std::vector<int> tr_confirmation;  // 1 if confirmation from trigger hits else 0
+        std::vector<Identifier> ids;
+        std::vector<int> layers;
+        std::vector<const Muon::MdtPrepData*> prd;
+
+        hitx.reserve(size);
+        hity.reserve(size);
+        hitz.reserve(size);
+        radius.reserve(size);
+        errradius.reserve(size);
+        weights.reserve(size);
+        prob.reserve(size);
+        multilayer.reserve(size);
+        tubelayer.reserve(size);
+        tubes.reserve(size);
+        onsegment.reserve(size);
+        psi.reserve(size);
+        weight_trigger.reserve(size);
+        tr_confirmation.reserve(size);
+        ids.reserve(size);
+        layers.reserve(size);
+        prd.reserve(size);
+
+        std::vector<double> tubecount(m_idHelperSvc->mdtIdHelper().tubeMax() + 2);
+
+        Muon::MdtPrepDataCollection::const_iterator cit = cit_begin;
+        for (; cit != cit_end; ++cit)  // first
+        {
+            const Muon::MdtPrepData* mdt = (*cit);
+
+            if (m_mdt_tdc_cut == true && mdt->status() != Muon::MdtStatusDriftTime) continue;
+
+            if ((m_mdt_adc_cut == true && (mdt->adc() > m_mdt_adc_min)) || m_mdt_adc_cut == false) {
+                Identifier id = mdt->identify();
+
+                prd.push_back(mdt);
+                const Trk::Surface& surface = mdt->detectorElement()->surface(id);
+                const Amg::Vector3D& globalpos = surface.center();
+                hitx.push_back(globalpos.x());
+                hity.push_back(globalpos.y());
+                hitz.push_back(globalpos.z());
+                radius.push_back(mdt->localPosition()[0]);
+                errradius.push_back(Amg::error(mdt->localCovariance(), 0));
+                weights.push_back(1.);
+                prob.push_back(1.);
+                const int tube = m_idHelperSvc->mdtIdHelper().tube(id);
+                tubes.push_back(tube);
+                onsegment.push_back(0);
+                psi.push_back(0.);
+                weight_trigger.push_back(0.);
+                tr_confirmation.push_back(0);
+                ids.push_back(id);
+
+                const int multi_layer = m_idHelperSvc->mdtIdHelper().multilayer(id);
+                const int tube_layer = m_idHelperSvc->mdtIdHelper().tubeLayer(id);
+                multilayer.push_back(multi_layer);
+                tubelayer.push_back(tube_layer);
+
+                int layer_number =
+                    (multi_layer - 1) * m_idHelperSvc->mdtIdHelper().tubeLayerMax() + (tube_layer - 1);  // layer_number ranges from 0..5/7
+                layers.push_back(layer_number);
+
+                tubecount[tube] += 1.;
+                tubecount[tube - 1] += 0.5;
+                tubecount[tube + 1] += 0.5;
+
+                ATH_MSG_VERBOSE(" layer_number: " << layer_number << " multi_layer: " << multi_layer << " tube_layer: " << tube_layer);
+
+            }  // adc cut
+        }
 
-  cit = cit_begin;
+        const unsigned int prdsize = prd.size();
 
-  for (; cit != cit_end; ++cit) {
-    const Muon::TgcPrepData* prd = *cit;
-    const Identifier id = prd->identify();
-    if (!static_cast<bool>(m_idHelperSvc->tgcIdHelper().isStrip(id))) { // eta hit
+        if (prdsize == 0) return;
 
-      const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+        if (false == m_hit_reweights) {
+            for (unsigned int i = 0; i < prdsize; i++) {
+                MuonHoughHit* hit = new MuonHoughHit(hitx[i], hity[i], hitz[i], false, MuonHough::MDT, 1., 1.,
+                                                     prd[i]);  // getPrd
+                ATH_MSG_DEBUG(m_printer->print(*prd[i]));
+                hitcontainer->addHit(hit);
+            }
+            return;
+        }
 
-      gg_it = gasgapphimap.find(gasGapId);
-      if (gg_it != gasgapphimap.end()) {
-        phietahitassociation->insert(std::make_pair(prd, (*gg_it).second));
-      }
-    }
-  }
-}
-
-void
-MuonHoughPatternFinderTool::addMdtCollection(
-  Muon::MdtPrepDataCollection::const_iterator cit_begin,
-  Muon::MdtPrepDataCollection::const_iterator cit_end,
-  MuonHoughHitContainer* hitcontainer,
-  std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap,
-  std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const
-{
-  if (cit_begin == cit_end)
-    return;
-
-  const int size = std::distance(cit_begin, cit_end);
-
-  if (m_showerskip == true) {
-    const Muon::MdtPrepData* mdt = (*cit_begin);
-    const MuonGM::MdtReadoutElement* detEl = mdt->detectorElement();
-    unsigned int channels =
-      2 * detEl->getNLayers() *
-      detEl->getNtubesperlayer(); // Factor 2 for number of multilayers, should
-                                  // be changed when only 1 detector element per
-                                  // chamber (the chambers with only 1
-                                  // multilayer have a twice less severe cut
-                                  // (for convenience))
-    double occupancy = (double)size / (double)channels;
-
-    ATH_MSG_DEBUG(" size: " << size << " channels: " << channels
-                            << " occupancy: " << occupancy);
-
-    // if more than m_showerskipperc (default 30%) of all hits in the chamber is
-    // hit then all weights to 0 only done for large chambers (more than 50
-    // hits)
-    if (occupancy > m_showerskipperc && size > 50) {
-
-      ATH_MSG_DEBUG("Chamber skipped! Too high occupancy (>"
-                    << m_showerskipperc << "%): " << occupancy
-                    << " association to pattern still possible");
-
-      Muon::MdtPrepDataCollection::const_iterator cit = cit_begin;
-      for (; cit != cit_end; ++cit) // first
-      {
-        const Muon::MdtPrepData* mdt = (*cit);
-
-        if (m_mdt_tdc_cut == true && mdt->status() != Muon::MdtStatusDriftTime)
-          continue;
-
-        if ((m_mdt_adc_cut == true && (mdt->adc() > m_mdt_adc_min)) ||
-            m_mdt_adc_cut == false) {
-          Identifier id = mdt->identify();
-          const Trk::Surface& surface = mdt->detectorElement()->surface(id);
-          const Amg::Vector3D& globalpos = surface.center();
-          double hitx = globalpos.x();
-          double hity = globalpos.y();
-          double hitz = globalpos.z();
-
-          MuonHoughHit* hit = new MuonHoughHit(
-            hitx, hity, hitz, false, MuonHough::MDT, 0., 0., mdt); // getPrd
-          ATH_MSG_DEBUG(m_printer->print(*mdt));
-          hitcontainer->addHit(hit);
+        double tubem = *(std::max_element(tubecount.begin(), tubecount.end()));
+
+        if (tubem < 2.01)  // allweights 0
+        {
+            ATH_MSG_VERBOSE(" TOO SMALL tubem : " << tubem);
+            for (unsigned int i = 0; i < prdsize; i++) {
+                MuonHoughHit* hit = new MuonHoughHit(hitx[i], hity[i], hitz[i], false, MuonHough::MDT, 0., 0.,
+                                                     prd[i]);  // getPrd
+                ATH_MSG_DEBUG(m_printer->print(*prd[i]) << " weight " << 0 << " adc: " << prd[i]->adc());
+                hitcontainer->addHit(hit);
+                if (m_use_histos == true) {
+                    m_weighthistogram->Fill(0);
+                    m_weighthistogrammdt->Fill(0);
+                }
+
+            }  // collection
+            return;
         }
-      }
-      return;
-    }
-  }
-
-  std::map<int, int> number_of_hits_per_layer;
-  std::map<int, int>
-    number_of_hots_per_layer; // number of trigger confirmed or hits on segment
-                              // within layer (key)
-
-  std::vector<double> hitx;
-  std::vector<double> hity;
-  std::vector<double> hitz;
-  std::vector<double> radius;
-  std::vector<double> errradius;
-  std::vector<double> weights;
-  std::vector<double>
-    prob; // artificial probability that hit belongs to true muon
-  std::vector<int> multilayer;
-  std::vector<int> tubelayer;
-  std::vector<int> tubes;
-  std::vector<int>
-    onsegment; // non-zero if on segment, int indicates how many hits in same
-               // layer are on segment (used in weighting)
-  std::vector<double> psi;
-  std::vector<double> weight_trigger;
-  std::vector<int>
-    tr_confirmation; // 1 if confirmation from trigger hits else 0
-  std::vector<Identifier> ids;
-  std::vector<int> layers;
-  std::vector<const Muon::MdtPrepData*> prd;
-
-  hitx.reserve(size);
-  hity.reserve(size);
-  hitz.reserve(size);
-  radius.reserve(size);
-  errradius.reserve(size);
-  weights.reserve(size);
-  prob.reserve(size);
-  multilayer.reserve(size);
-  tubelayer.reserve(size);
-  tubes.reserve(size);
-  onsegment.reserve(size);
-  psi.reserve(size);
-  weight_trigger.reserve(size);
-  tr_confirmation.reserve(size);
-  ids.reserve(size);
-  layers.reserve(size);
-  prd.reserve(size);
-
-  std::vector<double> tubecount(m_idHelperSvc->mdtIdHelper().tubeMax() + 2);
-
-  Muon::MdtPrepDataCollection::const_iterator cit = cit_begin;
-  for (; cit != cit_end; ++cit) // first
-  {
-    const Muon::MdtPrepData* mdt = (*cit);
-
-    if (m_mdt_tdc_cut == true && mdt->status() != Muon::MdtStatusDriftTime)
-      continue;
-
-    if ((m_mdt_adc_cut == true && (mdt->adc() > m_mdt_adc_min)) ||
-        m_mdt_adc_cut == false) {
-      Identifier id = mdt->identify();
-
-      prd.push_back(mdt);
-      const Trk::Surface& surface = mdt->detectorElement()->surface(id);
-      const Amg::Vector3D& globalpos = surface.center();
-      hitx.push_back(globalpos.x());
-      hity.push_back(globalpos.y());
-      hitz.push_back(globalpos.z());
-      radius.push_back(mdt->localPosition()[0]);
-      errradius.push_back(Amg::error(mdt->localCovariance(), 0));
-      weights.push_back(1.);
-      prob.push_back(1.);
-      const int tube = m_idHelperSvc->mdtIdHelper().tube(id);
-      tubes.push_back(tube);
-      onsegment.push_back(0);
-      psi.push_back(0.);
-      weight_trigger.push_back(0.);
-      tr_confirmation.push_back(0);
-      ids.push_back(id);
-
-      const int multi_layer = m_idHelperSvc->mdtIdHelper().multilayer(id);
-      const int tube_layer = m_idHelperSvc->mdtIdHelper().tubeLayer(id);
-      multilayer.push_back(multi_layer);
-      tubelayer.push_back(tube_layer);
-
-      int layer_number =
-        (multi_layer - 1) * m_idHelperSvc->mdtIdHelper().tubeLayerMax() +
-        (tube_layer - 1); // layer_number ranges from 0..5/7
-      layers.push_back(layer_number);
-
-      tubecount[tube] += 1.;
-      tubecount[tube - 1] += 0.5;
-      tubecount[tube + 1] += 0.5;
-
-      ATH_MSG_VERBOSE(" layer_number: " << layer_number
-                                        << " multi_layer: " << multi_layer
-                                        << " tube_layer: " << tube_layer);
-
-    } // adc cut
-  }
-
-  const unsigned int prdsize = prd.size();
-
-  if (prdsize == 0)
-    return;
-
-  if (false == m_hit_reweights) {
-    for (unsigned int i = 0; i < prdsize; i++) {
-
-      MuonHoughHit* hit = new MuonHoughHit(hitx[i],
-                                           hity[i],
-                                           hitz[i],
-                                           false,
-                                           MuonHough::MDT,
-                                           1.,
-                                           1.,
-                                           prd[i]); // getPrd
-      ATH_MSG_DEBUG(m_printer->print(*prd[i]));
-      hitcontainer->addHit(hit);
-    }
-    return;
-  }
-
-  double tubem = *(std::max_element(tubecount.begin(), tubecount.end()));
-
-  if (tubem < 2.01) // allweights 0
-  {
-    ATH_MSG_VERBOSE(" TOO SMALL tubem : " << tubem);
-    for (unsigned int i = 0; i < prdsize; i++) {
-      MuonHoughHit* hit = new MuonHoughHit(hitx[i],
-                                           hity[i],
-                                           hitz[i],
-                                           false,
-                                           MuonHough::MDT,
-                                           0.,
-                                           0.,
-                                           prd[i]); // getPrd
-      ATH_MSG_DEBUG(m_printer->print(*prd[i])
-                    << " weight " << 0 << " adc: " << prd[i]->adc());
-      hitcontainer->addHit(hit);
-      if (m_use_histos == true) {
-        m_weighthistogram->Fill(0);
-        m_weighthistogrammdt->Fill(0);
-      }
-
-    } // collection
-    return;
-  }
-
-  // fast segment search:
-
-  for (unsigned int i = 0; i < prdsize; i++) {
-
-    if (tubecount[tubes[i]] > 1)
-      ++number_of_hits_per_layer[layers[i]];
-
-    // KILL 1 hit cases
-    if (tubecount[tubes[i]] <= 1)
-      prob[i] = 0;
-  } // end hit loop i
-
-  int ml1 = 0;
-  int ml2 = 0;
-
-  std::map<int, int>::iterator map_it = number_of_hits_per_layer.begin();
-  for (; map_it != number_of_hits_per_layer.end(); ++map_it) {
-
-    if ((*map_it).first >= m_idHelperSvc->mdtIdHelper().tubeLayerMax()) {
-      ml1++;
-    } else {
-      ml2++;
-    }
-  }
-
-  if (ml1 + ml2 < 2.01) // allweights = 0
-  {
-    ATH_MSG_VERBOSE(" TOO SMALL ml1 + ml2 : " << ml1 << " ml2 " << ml2);
-    for (unsigned int i = 0; i < prdsize; i++) {
-      MuonHoughHit* hit = new MuonHoughHit(hitx[i],
-                                           hity[i],
-                                           hitz[i],
-                                           false,
-                                           MuonHough::MDT,
-                                           0.,
-                                           0.,
-                                           prd[i]); // getPrd
-      ATH_MSG_DEBUG(m_printer->print(*prd[i]) << " weight " << 0);
-      hitcontainer->addHit(hit);
-      if (m_use_histos == true) {
-        m_weighthistogram->Fill(0);
-        m_weighthistogrammdt->Fill(0);
-      }
-    } // collection
-    return;
-  }
-
-  bool barrel = m_idHelperSvc->mdtIdHelper().isBarrel(ids[0]);
-
-  DCVec dcs;
-  dcs.reserve(prdsize);
-  for (unsigned int i = 0; i < prdsize; i++) {
-    if (prob[i] < 0.01)
-      continue;
-    double global_radius = std::hypot(hitx[i] , hity[i]); // global radius
-    const TrkDriftCircleMath::LocVec2D lpos(global_radius,
-                                          hitz[i]); // global coordinates
-    // create identifier
-    TrkDriftCircleMath::MdtId mdtid(
-      barrel, multilayer[i] - 1, tubelayer[i] - 1, tubes[i] - 1);
-    // create new DriftCircircleMath::DriftCircle::DriftState
-    TrkDriftCircleMath::DriftCircle dc(lpos,
-                                       radius[i],
-                                       errradius[i],
-                                       TrkDriftCircleMath::DriftCircle::InTime,
-                                       mdtid,
-                                       i);
-    dcs.emplace_back(std::move(dc));
-  }
-
-  bool seg_found = true;
-  while (seg_found) {
-
-    std::vector<int> sel(dcs.size());
-    double angleDif = 0.;
-
-    fastSegmentFinder(dcs, ml1, ml2, angleDif, sel);
-
-    if (ml1 + ml2 >= 2.1) {
-      int removed_hits = 0; // keeps track of number of removed hits
-      for (unsigned int i = 0; i < sel.size(); i++) {
-
-        if (sel[i] != 0) {
-
-          unsigned int j = (unsigned int)dcs[i - removed_hits]
-                             .index(); // index of position in prd vec
-          onsegment[j] = 1;
-          psi[j] = angleDif;
-
-          ++number_of_hots_per_layer[layers[j]];
-
-          // remove hit from dcs container for next iteration!!
-          dcs.erase(dcs.begin() + i - removed_hits);
-          removed_hits++;
+
+        // fast segment search:
+
+        for (unsigned int i = 0; i < prdsize; i++) {
+            if (tubecount[tubes[i]] > 1) ++number_of_hits_per_layer[layers[i]];
+
+            // KILL 1 hit cases
+            if (tubecount[tubes[i]] <= 1) prob[i] = 0;
+        }  // end hit loop i
+
+        int ml1 = 0;
+        int ml2 = 0;
+
+        std::map<int, int>::iterator map_it = number_of_hits_per_layer.begin();
+        for (; map_it != number_of_hits_per_layer.end(); ++map_it) {
+            if ((*map_it).first >= m_idHelperSvc->mdtIdHelper().tubeLayerMax()) {
+                ml1++;
+            } else {
+                ml2++;
+            }
         }
-      }
-    } else {
-      seg_found = false;
-    }
-  }
 
-  // trigger confirmation checks:
+        if (ml1 + ml2 < 2.01)  // allweights = 0
+        {
+            ATH_MSG_VERBOSE(" TOO SMALL ml1 + ml2 : " << ml1 << " ml2 " << ml2);
+            for (unsigned int i = 0; i < prdsize; i++) {
+                MuonHoughHit* hit = new MuonHoughHit(hitx[i], hity[i], hitz[i], false, MuonHough::MDT, 0., 0.,
+                                                     prd[i]);  // getPrd
+                ATH_MSG_DEBUG(m_printer->print(*prd[i]) << " weight " << 0);
+                hitcontainer->addHit(hit);
+                if (m_use_histos == true) {
+                    m_weighthistogram->Fill(0);
+                    m_weighthistogrammdt->Fill(0);
+                }
+            }  // collection
+            return;
+        }
+
+        bool barrel = m_idHelperSvc->mdtIdHelper().isBarrel(ids[0]);
+
+        DCVec dcs;
+        dcs.reserve(prdsize);
+        for (unsigned int i = 0; i < prdsize; i++) {
+            if (prob[i] < 0.01) continue;
+            double global_radius = std::hypot(hitx[i], hity[i]);  // global radius
+            const TrkDriftCircleMath::LocVec2D lpos(global_radius,
+                                                    hitz[i]);  // global coordinates
+            // create identifier
+            TrkDriftCircleMath::MdtId mdtid(barrel, multilayer[i] - 1, tubelayer[i] - 1, tubes[i] - 1);
+            // create new DriftCircircleMath::DriftCircle::DriftState
+            TrkDriftCircleMath::DriftCircle dc(lpos, radius[i], errradius[i], TrkDriftCircleMath::DriftCircle::InTime, mdtid, i);
+            dcs.emplace_back(std::move(dc));
+        }
+
+        bool seg_found = true;
+        while (seg_found) {
+            std::vector<int> sel(dcs.size());
+            double angleDif = 0.;
+
+            fastSegmentFinder(dcs, ml1, ml2, angleDif, sel);
+
+            if (ml1 + ml2 >= 2.1) {
+                int removed_hits = 0;  // keeps track of number of removed hits
+                for (unsigned int i = 0; i < sel.size(); i++) {
+                    if (sel[i] != 0) {
+                        unsigned int j = (unsigned int)dcs[i - removed_hits].index();  // index of position in prd vec
+                        onsegment[j] = 1;
+                        psi[j] = angleDif;
 
-  int stationcode = stationCode(ids[0]);
+                        ++number_of_hots_per_layer[layers[j]];
+
+                        // remove hit from dcs container for next iteration!!
+                        dcs.erase(dcs.begin() + i - removed_hits);
+                        removed_hits++;
+                    }
+                }
+            } else {
+                seg_found = false;
+            }
+        }
 
-  // rpc:
+        // trigger confirmation checks:
 
-  std::map<int, std::vector<std::pair<int, int>>>::const_iterator
-    stationmap_it = rpcmdtstationmap.find(stationcode);
+        int stationcode = stationCode(ids[0]);
 
-  if (stationmap_it != rpcmdtstationmap.end()) {
+        // rpc:
 
-    const std::vector<std::pair<int, int>>& stationhits =
-      (*stationmap_it).second;
+        std::map<int, std::vector<std::pair<int, int>>>::const_iterator stationmap_it = rpcmdtstationmap.find(stationcode);
 
-    // stationloop
-    for (unsigned int i = 0; i < stationhits.size(); i++) {
-      // rpc hit loop
-      for (int j = stationhits[i].first; j < stationhits[i].second; j++) {
+        if (stationmap_it != rpcmdtstationmap.end()) {
+            const std::vector<std::pair<int, int>>& stationhits = (*stationmap_it).second;
 
-        const MuonHoughHit* rpchit = hitcontainer->getHit(j);
-        if (rpchit->getWeight() < 0.01)
-          continue;
+            // stationloop
+            for (unsigned int i = 0; i < stationhits.size(); i++) {
+                // rpc hit loop
+                for (int j = stationhits[i].first; j < stationhits[i].second; j++) {
+                    const MuonHoughHit* rpchit = hitcontainer->getHit(j);
+                    if (rpchit->getWeight() < 0.01) continue;
 
-        const double rpcx = hitcontainer->getHitx(j);
-        const double rpcy = hitcontainer->getHity(j);
-        const double rpcz = hitcontainer->getHitz(j);
-        const double rpc_radius = std::sqrt(rpcx * rpcx + rpcy * rpcy);
-        const double rpc_rz_ratio = rpc_radius / rpcz;
-        const double rpc_inv_rz_ratio = 1. / rpc_rz_ratio;
+                    const double rpcx = hitcontainer->getHitx(j);
+                    const double rpcy = hitcontainer->getHity(j);
+                    const double rpcz = hitcontainer->getHitz(j);
+                    const double rpc_radius = std::sqrt(rpcx * rpcx + rpcy * rpcy);
+                    const double rpc_rz_ratio = rpc_radius / rpcz;
+                    const double rpc_inv_rz_ratio = 1. / rpc_rz_ratio;
 
-        for (unsigned int k = 0; k < prdsize; k++) {
-          // Mdt hit loop
-          double dis = 0.;
-          if (barrel) {
-            dis = hitz[k] - std::sqrt(hitx[k] * hitx[k] + hity[k] * hity[k]) *
-                              rpc_inv_rz_ratio;
-          } else { // can that happen?
-            dis = std::sqrt(hitx[k] * hitx[k] + hity[k] * hity[k]) -
-                  rpc_rz_ratio * hitz[k];
-          }
+                    for (unsigned int k = 0; k < prdsize; k++) {
+                        // Mdt hit loop
+                        double dis = 0.;
+                        if (barrel) {
+                            dis = hitz[k] - std::sqrt(hitx[k] * hitx[k] + hity[k] * hity[k]) * rpc_inv_rz_ratio;
+                        } else {  // can that happen?
+                            dis = std::sqrt(hitx[k] * hitx[k] + hity[k] * hity[k]) - rpc_rz_ratio * hitz[k];
+                        }
 
-          if (weight_trigger[k] < 0.1) {
-            weight_trigger[k] = 1.;
-          }
+                        if (weight_trigger[k] < 0.1) { weight_trigger[k] = 1.; }
 
-          if (std::abs(dis) < 250.) {
-            double wnew = 1.5 + (250. - std::abs(dis)) / 251.;
-            if (wnew > weight_trigger[k]) {
-              weight_trigger[k] = wnew;
+                        if (std::abs(dis) < 250.) {
+                            double wnew = 1.5 + (250. - std::abs(dis)) / 251.;
+                            if (wnew > weight_trigger[k]) { weight_trigger[k] = wnew; }
+                        }
+                    }
+                }
             }
-          }
         }
-      }
-    }
-  }
-
-  // tgc:
-
-  stationmap_it = tgcmdtstationmap.find(stationcode);
-
-  if (stationmap_it != tgcmdtstationmap.end()) {
-
-    const std::vector<std::pair<int, int>>& stationhits =
-      (*stationmap_it).second;
-
-    // stationloop
-    for (unsigned int i = 0; i < stationhits.size(); i++) {
-      // tgc hit loop
-      for (int j = stationhits[i].first; j < stationhits[i].second; j++) {
-
-        const MuonHoughHit* tgchit = hitcontainer->getHit(j);
-        if (tgchit) {
-          if (tgchit->getWeight() < 0.01)
-            continue;
-
-          const double tgcx = hitcontainer->getHitx(j);
-          const double tgcy = hitcontainer->getHity(j);
-          const double tgcz = hitcontainer->getHitz(j);
-          const double tgc_rz_ratio =
-            std::sqrt(tgcx * tgcx + tgcy * tgcy) / tgcz;
-
-          for (unsigned int k = 0; k < prdsize; k++) {
-            // Mdt hit loop
-            if (weight_trigger[k] < 0.1)
-              weight_trigger[k] = 3.;
-            double dis = std::sqrt(hitx[k] * hitx[k] + hity[k] * hity[k]) -
-                         tgc_rz_ratio * hitz[k]; // only endcap extrapolation
-            if (std::abs(dis) < 250.) {
-              double wnew = 3.5 + (250. - std::abs(dis)) / 251.;
-              if (wnew > weight_trigger[k])
-                weight_trigger[k] = wnew;
+
+        // tgc:
+
+        stationmap_it = tgcmdtstationmap.find(stationcode);
+
+        if (stationmap_it != tgcmdtstationmap.end()) {
+            const std::vector<std::pair<int, int>>& stationhits = (*stationmap_it).second;
+
+            // stationloop
+            for (unsigned int i = 0; i < stationhits.size(); i++) {
+                // tgc hit loop
+                for (int j = stationhits[i].first; j < stationhits[i].second; j++) {
+                    const MuonHoughHit* tgchit = hitcontainer->getHit(j);
+                    if (tgchit) {
+                        if (tgchit->getWeight() < 0.01) continue;
+
+                        const double tgcx = hitcontainer->getHitx(j);
+                        const double tgcy = hitcontainer->getHity(j);
+                        const double tgcz = hitcontainer->getHitz(j);
+                        const double tgc_rz_ratio = std::sqrt(tgcx * tgcx + tgcy * tgcy) / tgcz;
+
+                        for (unsigned int k = 0; k < prdsize; k++) {
+                            // Mdt hit loop
+                            if (weight_trigger[k] < 0.1) weight_trigger[k] = 3.;
+                            double dis =
+                                std::sqrt(hitx[k] * hitx[k] + hity[k] * hity[k]) - tgc_rz_ratio * hitz[k];  // only endcap extrapolation
+                            if (std::abs(dis) < 250.) {
+                                double wnew = 3.5 + (250. - std::abs(dis)) / 251.;
+                                if (wnew > weight_trigger[k]) weight_trigger[k] = wnew;
+                            }
+                        }
+                    }
+                }
             }
-          }
         }
-      }
-    }
-  }
 
-  // define trigger confirmation:
+        // define trigger confirmation:
+
+        for (unsigned int i = 0; i < prdsize; i++) {
+            // for MDTs require trigger chamber confirmation
+            //                  or segment with selected hits
+
+            if (weight_trigger[i] > 1.5 && weight_trigger[i] < 2.55) tr_confirmation[i] = 1;
+            if (weight_trigger[i] > 3.5 && weight_trigger[i] < 4.55) tr_confirmation[i] = 1;
 
-  for (unsigned int i = 0; i < prdsize; i++) {
+            // add confirmed hits to hots layer count:
+            if (tr_confirmation[i] == 1 && onsegment[i] == 0) {  // else already added
+                ++number_of_hots_per_layer[layers[i]];
+            }
+        }
 
-    // for MDTs require trigger chamber confirmation
-    //                  or segment with selected hits
+        // calculate final weights:
+
+        for (unsigned int i = 0; i < prdsize; i++) {
+            if (prob[i] < 0.01) {
+                weights[i] = 0;
+                continue;
+            }  // throw away hits that are not significant
+
+            // correct for several number of hits in layer:
+            map_it = number_of_hits_per_layer.find(layers[i]);
+            if (map_it != number_of_hits_per_layer.end()) {
+                int layerhits = (*map_it).second;
+                double layer_weight = 1. / (0.25 * layerhits + 0.75 * std::sqrt(layerhits));
+
+                if (0 == tr_confirmation[i] && onsegment[i] == 0) {
+                    // downweighting for non-confirmed hits:
+                    prob[i] = prob[i] - 0.2;
+                    if (prob[i] < 0) prob[i] = 0.;
+
+                    // correct for several number of hits in layer:
+                    weights[i] = prob[i] * layer_weight;
+                }
+
+                else {
+                    // Correct probabilities for hits on segment or confirmed by RPC/TGC
+                    double rej = 1. / (1. - layer_weight + 0.10);
+                    double rej0 = 1.;  // irrevelant value
+
+                    if (onsegment[i] != 0 && tr_confirmation[i] != 0) {
+                        rej0 = 30;
+                    } else if (onsegment[i] != 0) {
+                        rej0 = 1.75 / (psi[i] + 0.05);
+                    }  // 1.75 = 5*0.35
+                    else if (tr_confirmation[i] != 0) {
+                        rej0 = 8;
+                    }
+
+                    double rej_total = rej * rej0;
+                    prob[i] = rej_total / (1. + rej_total);
+
+                    // correct for several number of confirmed hits in layer:
+                    map_it = number_of_hots_per_layer.find(layers[i]);
+                    if (map_it != number_of_hots_per_layer.end()) {
+                        int layerhits_conf = (*map_it).second;
+                        weights[i] = prob[i] / (0.25 * layerhits_conf + 0.75 * std::sqrt(layerhits_conf));
+                    } else {
+                        ATH_MSG_INFO("Entry not in map! This should not happen");
+                        weights[i] = prob[i];
+                    }
+                }
+            } else {
+                ATH_MSG_INFO("Entry not in map! This should not happen");
+                weights[i] = prob[i];
+            }
+        }
 
-    if (weight_trigger[i] > 1.5 && weight_trigger[i] < 2.55)
-      tr_confirmation[i] = 1;
-    if (weight_trigger[i] > 3.5 && weight_trigger[i] < 4.55)
-      tr_confirmation[i] = 1;
+        // and finally add hits to container:
+
+        for (unsigned int i = 0; i < prdsize; i++) {
+            MuonHoughHit* hit = new MuonHoughHit(hitx[i], hity[i], hitz[i], false, MuonHough::MDT, prob[i], weights[i],
+                                                 prd[i]);  // getPrd
+            ATH_MSG_DEBUG(m_printer->print(*prd[i]) << " trigger weight " << weight_trigger[i] << " on segment " << onsegment[i] << " psi "
+                                                    << psi[i] << " prob " << prob[i] << " weight " << weights[i]);
+            hitcontainer->addHit(hit);
+            if (m_use_histos == true) {
+                m_weighthistogram->Fill(weights[i]);
+                m_weighthistogrammdt->Fill(weights[i]);
+            }
 
-    // add confirmed hits to hots layer count:
-    if (tr_confirmation[i] == 1 && onsegment[i] == 0) { // else already added
-      ++number_of_hots_per_layer[layers[i]];
+        }  // collection
     }
-  }
-
-  // calculate final weights:
-
-  for (unsigned int i = 0; i < prdsize; i++) {
-    if (prob[i] < 0.01) {
-      weights[i] = 0;
-      continue;
-    } // throw away hits that are not significant
-
-    // correct for several number of hits in layer:
-    map_it = number_of_hits_per_layer.find(layers[i]);
-    if (map_it != number_of_hits_per_layer.end()) {
-      int layerhits = (*map_it).second;
-      double layer_weight =
-        1. / (0.25 * layerhits + 0.75 * std::sqrt(layerhits));
-
-      if (0 == tr_confirmation[i] && onsegment[i] == 0) {
-        // downweighting for non-confirmed hits:
-        prob[i] = prob[i] - 0.2;
-        if (prob[i] < 0)
-          prob[i] = 0.;
-
-        // correct for several number of hits in layer:
-        weights[i] = prob[i] * layer_weight;
-      }
-
-      else {
-        // Correct probabilities for hits on segment or confirmed by RPC/TGC
-        double rej = 1. / (1. - layer_weight + 0.10);
-        double rej0 = 1.; // irrevelant value
-
-        if (onsegment[i] != 0 && tr_confirmation[i] != 0) {
-          rej0 = 30;
-        } else if (onsegment[i] != 0) {
-          rej0 = 1.75 / (psi[i] + 0.05);
-        } // 1.75 = 5*0.35
-        else if (tr_confirmation[i] != 0) {
-          rej0 = 8;
+
+    void MuonHoughPatternFinderTool::addCscCollection(
+        Muon::CscPrepDataCollection::const_iterator cit_begin, Muon::CscPrepDataCollection::const_iterator cit_end,
+        MuonHoughHitContainer* hitcontainer,
+        std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phietahitassociation) const {
+        if (cit_begin == cit_end) return;
+        std::map<int, int> number_of_hits_per_layer;
+        if (m_hit_reweights)  // reweight  hits, according to Niels' and Peters new
+                              // algorithm
+        {
+            Muon::CscPrepDataCollection::const_iterator cit = cit_begin;
+            for (; cit != cit_end; ++cit) {
+                const Muon::CscPrepData* prd = (*cit);
+                Identifier id = prd->identify();
+
+                bool channel_type = m_idHelperSvc->cscIdHelper().measuresPhi(prd->identify());
+
+                const int chamber_layer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
+                const int chamber_layer_max = m_idHelperSvc->cscIdHelper().chamberLayerMax(id);
+                const int wire_layer = m_idHelperSvc->cscIdHelper().wireLayer(id);
+                int layer_number = (chamber_layer - 1) + chamber_layer_max * (wire_layer - 1);  // layer_number ranges from 0..7
+                if (channel_type) layer_number = layer_number + 8;
+
+                ++number_of_hits_per_layer[layer_number];
+
+                ATH_MSG_DEBUG("chamber_layer: " << chamber_layer << " chamber_layer_max: " << chamber_layer_max
+                                                << " wire_layer: " << wire_layer);
+            }
         }
 
-        double rej_total = rej * rej0;
-        prob[i] = rej_total / (1. + rej_total);
+        std::map<const Identifier, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>
+            gasgapphimap;  // map between gasgapidentifier and phi hits
+        std::map<const Identifier, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::iterator gg_it;
+        std::pair<std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator, bool> gg_insert;
 
-        // correct for several number of confirmed hits in layer:
-        map_it = number_of_hots_per_layer.find(layers[i]);
-        if (map_it != number_of_hots_per_layer.end()) {
-          int layerhits_conf = (*map_it).second;
-          weights[i] = prob[i] / (0.25 * layerhits_conf +
-                                  0.75 * std::sqrt(layerhits_conf));
-        } else {
-          ATH_MSG_INFO("Entry not in map! This should not happen");
-          weights[i] = prob[i];
-        }
-      }
-    } else {
-      ATH_MSG_INFO("Entry not in map! This should not happen");
-      weights[i] = prob[i];
-    }
-  }
-
-  // and finally add hits to container:
-
-  for (unsigned int i = 0; i < prdsize; i++) {
-
-    MuonHoughHit* hit = new MuonHoughHit(hitx[i],
-                                         hity[i],
-                                         hitz[i],
-                                         false,
-                                         MuonHough::MDT,
-                                         prob[i],
-                                         weights[i],
-                                         prd[i]); // getPrd
-    ATH_MSG_DEBUG(m_printer->print(*prd[i])
-                  << " trigger weight " << weight_trigger[i] << " on segment "
-                  << onsegment[i] << " psi " << psi[i] << " prob " << prob[i]
-                  << " weight " << weights[i]);
-    hitcontainer->addHit(hit);
-    if (m_use_histos == true) {
-      m_weighthistogram->Fill(weights[i]);
-      m_weighthistogrammdt->Fill(weights[i]);
-    }
+        Muon::CscPrepDataCollection::const_iterator cit = cit_begin;
+        for (; cit != cit_end; ++cit) {
+            const Muon::CscPrepData* prd = *cit;
+            Amg::Vector3D globalpos = prd->globalPosition();
+            Identifier id = prd->identify();
+            double hitx = globalpos.x();
+            double hity = globalpos.y();
+            double hitz = globalpos.z();
 
-  } // collection
-}
-
-void
-MuonHoughPatternFinderTool::addCscCollection(
-  Muon::CscPrepDataCollection::const_iterator cit_begin,
-  Muon::CscPrepDataCollection::const_iterator cit_end,
-  MuonHoughHitContainer* hitcontainer,
-  std::map<const Trk::PrepRawData*,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-    phietahitassociation) const
-{
-  if (cit_begin == cit_end)
-    return;
-  std::map<int, int> number_of_hits_per_layer;
-  if (m_hit_reweights) // reweight  hits, according to Niels' and Peters new
-                       // algorithm
-  {
-    Muon::CscPrepDataCollection::const_iterator cit = cit_begin;
-    for (; cit != cit_end; ++cit) {
-      const Muon::CscPrepData* prd = (*cit);
-      Identifier id = prd->identify();
-
-      bool channel_type =
-        m_idHelperSvc->cscIdHelper().measuresPhi(prd->identify());
-
-      const int chamber_layer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
-      const int chamber_layer_max =
-        m_idHelperSvc->cscIdHelper().chamberLayerMax(id);
-      const int wire_layer = m_idHelperSvc->cscIdHelper().wireLayer(id);
-      int layer_number =
-        (chamber_layer - 1) +
-        chamber_layer_max * (wire_layer - 1); // layer_number ranges from 0..7
-      if (channel_type)
-        layer_number = layer_number + 8;
-
-      ++number_of_hits_per_layer[layer_number];
-
-      ATH_MSG_DEBUG("chamber_layer: " << chamber_layer << " chamber_layer_max: "
-                                      << chamber_layer_max
-                                      << " wire_layer: " << wire_layer);
-    }
-  }
-
-  std::map<const Identifier,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>
-    gasgapphimap; // map between gasgapidentifier and phi hits
-  std::map<const Identifier,
-           std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>::iterator
-    gg_it;
-  std::pair<
-    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>::iterator,
-    bool>
-    gg_insert;
-
-  Muon::CscPrepDataCollection::const_iterator cit = cit_begin;
-  for (; cit != cit_end; ++cit) {
-    const Muon::CscPrepData* prd = *cit;
-    Amg::Vector3D globalpos = prd->globalPosition();
-    Identifier id = prd->identify();
-    double hitx = globalpos.x();
-    double hity = globalpos.y();
-    double hitz = globalpos.z();
-
-    bool channel_type = m_idHelperSvc->cscIdHelper().measuresPhi(id);
-
-    if (channel_type) // phi hit
-    {
-      const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
-      gg_it = gasgapphimap.find(gasGapId);
-      if (gg_it == gasgapphimap.end()) { // gasgapid not yet in map
-        std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hitset;
-        hitset.insert(prd);
-        gasgapphimap.insert(std::make_pair(gasGapId, hitset));
-      } else { // gasgapid already in set
-        gg_insert = (*gg_it).second.insert(prd);
-        if (!gg_insert.second) {
-          ATH_MSG_DEBUG("WARNING::CSC hit already in set? ");
+            bool channel_type = m_idHelperSvc->cscIdHelper().measuresPhi(id);
+
+            if (channel_type)  // phi hit
+            {
+                const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+                gg_it = gasgapphimap.find(gasGapId);
+                if (gg_it == gasgapphimap.end()) {  // gasgapid not yet in map
+                    std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess> hitset;
+                    hitset.insert(prd);
+                    gasgapphimap.insert(std::make_pair(gasGapId, hitset));
+                } else {  // gasgapid already in set
+                    gg_insert = (*gg_it).second.insert(prd);
+                    if (!gg_insert.second) { ATH_MSG_DEBUG("WARNING::CSC hit already in set? "); }
+                }
+            }
+            double weight = 1.;
+            if (m_hit_reweights) {
+                const int chamber_layer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
+                const int chamber_layer_max = m_idHelperSvc->cscIdHelper().chamberLayerMax(id);
+                const int wire_layer = m_idHelperSvc->cscIdHelper().wireLayer(id);
+                int layer_number = (chamber_layer - 1) + chamber_layer_max * (wire_layer - 1);  // layer_number ranges from 0..7
+                if (channel_type) layer_number = layer_number + 8;
+                double weight_factor_csc = 1.;
+                double number_of_hits = (double)number_of_hits_per_layer[layer_number];
+                weight = weight_factor_csc / std::sqrt(number_of_hits);
+
+                ATH_MSG_DEBUG("CSC weight: " << weight);
+            }
+
+            MuonHoughHit* hit = new MuonHoughHit(hitx, hity, hitz, channel_type, MuonHough::CSC, 1., weight,
+                                                 prd);  // getPrd
+            hitcontainer->addHit(hit);
+            ATH_MSG_DEBUG(m_printer->print(*prd) << " weight " << weight);
+            if (m_use_histos == true) {
+                m_weighthistogram->Fill(weight);
+                m_weighthistogramcsc->Fill(weight);
+            }
         }
-      }
-    }
-    double weight = 1.;
-    if (m_hit_reweights) {
-      const int chamber_layer = m_idHelperSvc->cscIdHelper().chamberLayer(id);
-      const int chamber_layer_max =
-        m_idHelperSvc->cscIdHelper().chamberLayerMax(id);
-      const int wire_layer = m_idHelperSvc->cscIdHelper().wireLayer(id);
-      int layer_number =
-        (chamber_layer - 1) +
-        chamber_layer_max * (wire_layer - 1); // layer_number ranges from 0..7
-      if (channel_type)
-        layer_number = layer_number + 8;
-      double weight_factor_csc = 1.;
-      double number_of_hits = (double)number_of_hits_per_layer[layer_number];
-      weight = weight_factor_csc / std::sqrt(number_of_hits);
-
-      ATH_MSG_DEBUG("CSC weight: " << weight);
-    }
+        // extract preprawdata from gasgapmap // might not be fastest way (filling
+        // immidiately saves this second loop)
 
-    MuonHoughHit* hit = new MuonHoughHit(hitx,
-                                         hity,
-                                         hitz,
-                                         channel_type,
-                                         MuonHough::CSC,
-                                         1.,
-                                         weight,
-                                         prd); // getPrd
-    hitcontainer->addHit(hit);
-    ATH_MSG_DEBUG(m_printer->print(*prd) << " weight " << weight);
-    if (m_use_histos == true) {
-      m_weighthistogram->Fill(weight);
-      m_weighthistogramcsc->Fill(weight);
-    }
-  }
-  // extract preprawdata from gasgapmap // might not be fastest way (filling
-  // immidiately saves this second loop)
+        cit = cit_begin;
 
-  cit = cit_begin;
+        for (; cit != cit_end; ++cit) {
+            const Muon::CscPrepData* prd = *cit;
+            const Identifier id = prd->identify();
+            if (!m_idHelperSvc->cscIdHelper().measuresPhi(id)) {  // eta hit
 
-  for (; cit != cit_end; ++cit) {
-    const Muon::CscPrepData* prd = *cit;
-    const Identifier id = prd->identify();
-    if (!m_idHelperSvc->cscIdHelper().measuresPhi(id)) { // eta hit
+                const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
 
-      const Identifier gasGapId = m_idHelperSvc->gasGapId(id);
+                gg_it = gasgapphimap.find(gasGapId);
+                if (gg_it != gasgapphimap.end()) { phietahitassociation->insert(std::make_pair(prd, (*gg_it).second)); }
+            }
+        }
+    }
 
-      gg_it = gasgapphimap.find(gasGapId);
-      if (gg_it != gasgapphimap.end()) {
-        phietahitassociation->insert(std::make_pair(prd, (*gg_it).second));
-      }
+    void MuonHoughPatternFinderTool::updateRpcMdtStationMap(const Identifier rpcid, const int hit_begin, const int hit_end,
+                                                            std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap) const {
+        //  input is a RPC identifier, begin container and end container
+        //  rpcmdtstationmap is updated
+        //
+        // called once per rpc collection/station
+
+        std::string st = m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(rpcid));
+        ATH_MSG_VERBOSE("updateRpcMdtStationMap" << st);
+        if (st[0] != 'B') return;  // no rpc for endcap chambers
+
+        std::map<int, std::vector<std::pair<int, int>>>::iterator it;
+        int stationcode = stationCode(rpcid);
+
+        // store station code
+
+        addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
+
+        int idphi = m_idHelperSvc->rpcIdHelper().stationPhi(rpcid);
+        int ideta = m_idHelperSvc->rpcIdHelper().stationEta(rpcid);
+
+        int idphi1 = idphi - 1;
+        if (idphi1 == 0) idphi1 = 8;
+        int idphi2 = idphi + 1;
+        if (idphi2 > 8) idphi2 = 1;
+
+        std::string station;
+        if (st == "BOL") {
+            station = "BOS";
+        } else if (st == "BOS") {
+            station = "BOL";
+        } else if (st == "BMS") {
+            station = "BML";
+        } else if (st == "BML") {
+            station = "BMS";
+        } else
+            return;
+
+        // store Neighbouring station codes
+        int stationNameMDT = m_idHelperSvc->mdtIdHelper().stationNameIndex(station);
+
+        stationcode = stationCode(stationNameMDT, idphi1, ideta);
+        addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
+
+        stationcode = stationCode(stationNameMDT, idphi2, ideta);
+        addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
+
+        //  Also look into Inner station
+
+        if (st == "BMS") {
+            station = "BIS";
+        } else if (st == "BML") {
+            station = "BIL";
+        } else
+            return;
+
+        stationNameMDT = m_idHelperSvc->mdtIdHelper().stationNameIndex(station);
+        stationcode = stationCode(stationNameMDT, idphi, ideta);
+        addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
     }
-  }
-}
-
-void
-MuonHoughPatternFinderTool::updateRpcMdtStationMap(
-  const Identifier rpcid,
-  const int hit_begin,
-  const int hit_end,
-  std::map<int, std::vector<std::pair<int, int>>>& rpcmdtstationmap) const
-{
-  //  input is a RPC identifier, begin container and end container
-  //  rpcmdtstationmap is updated
-  //
-  // called once per rpc collection/station
-
-  std::string st = m_idHelperSvc->rpcIdHelper().stationNameString(
-    m_idHelperSvc->rpcIdHelper().stationName(rpcid));
-  ATH_MSG_VERBOSE("updateRpcMdtStationMap" << st);
-  if (st[0] != 'B')
-    return; // no rpc for endcap chambers
-
-  std::map<int, std::vector<std::pair<int, int>>>::iterator it;
-  int stationcode = stationCode(rpcid);
-
-  // store station code
-
-  addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
-
-  int idphi = m_idHelperSvc->rpcIdHelper().stationPhi(rpcid);
-  int ideta = m_idHelperSvc->rpcIdHelper().stationEta(rpcid);
-
-  int idphi1 = idphi - 1;
-  if (idphi1 == 0)
-    idphi1 = 8;
-  int idphi2 = idphi + 1;
-  if (idphi2 > 8)
-    idphi2 = 1;
-
-  std::string station;
-  if (st == "BOL") {
-    station = "BOS";
-  } else if (st == "BOS") {
-    station = "BOL";
-  } else if (st == "BMS") {
-    station = "BML";
-  } else if (st == "BML") {
-    station = "BMS";
-  } else
-    return;
-
-  // store Neighbouring station codes
-  int stationNameMDT = m_idHelperSvc->mdtIdHelper().stationNameIndex(station);
-
-  stationcode = stationCode(stationNameMDT, idphi1, ideta);
-  addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
-
-  stationcode = stationCode(stationNameMDT, idphi2, ideta);
-  addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
-
-  //  Also look into Inner station
-
-  if (st == "BMS") {
-    station = "BIS";
-  } else if (st == "BML") {
-    station = "BIL";
-  } else
-    return;
-
-  stationNameMDT = m_idHelperSvc->mdtIdHelper().stationNameIndex(station);
-  stationcode = stationCode(stationNameMDT, idphi, ideta);
-  addToStationMap(rpcmdtstationmap, it, stationcode, hit_begin, hit_end);
-}
-
-void
-MuonHoughPatternFinderTool::updateTgcMdtStationMap(
-  const Identifier tgcid,
-  int hit_begin,
-  int hit_end,
-  std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const
-{
-  //  input is a TGC identifier, begin container and end container
-  //  tgcmdtstationmap is updated
-  //
-  // called once per tgc collection/station
-  std::string st = m_idHelperSvc->tgcIdHelper().stationNameString(
-    m_idHelperSvc->tgcIdHelper().stationName(tgcid));
-  if (st[0] != 'T')
-    return;
-
-  std::vector<int> T31(5);
-  T31[0] = 2;
-  T31[1] = 3;
-  T31[2] = 3;
-  T31[3] = 4;
-  T31[4] = 4;
-  std::vector<int> T32(5);
-  T32[0] = 3;
-  T32[1] = 4;
-  T32[2] = 4;
-  T32[3] = 5;
-  T32[4] = 5;
-  std::vector<int> T11(5);
-  T11[0] = 2;
-  T11[1] = 3;
-  T11[2] = 4;
-  T11[3] = 4;
-  T11[4] = 4;
-  std::vector<int> T12(5);
-  T12[0] = 3;
-  T12[1] = 4;
-  T12[2] = 5;
-  T12[3] = 5;
-  T12[4] = 5;
-
-  std::map<int, std::vector<std::pair<int, int>>>::iterator it;
-
-  // Determine station phi in MDT
-
-  int modphiTGC = 48;
-  if (st[2] == 'F')
-    modphiTGC = 24;
-  if (st[1] == '4')
-    modphiTGC = 24;
-
-  int idphi = m_idHelperSvc->tgcIdHelper().stationPhi(tgcid);
-  int ideta = m_idHelperSvc->tgcIdHelper().stationEta(tgcid);
-  int index = abs(ideta) - 1;
-  int idphi1MDT = 1 + int(8. * (idphi + 1) / modphiTGC);
-  int idphi2MDT = 1 + int(8. * (idphi - 1) / modphiTGC);
-  if (idphi1MDT > 8)
-    idphi1MDT = 1;
-  if (idphi2MDT > 8)
-    idphi2MDT = 1;
-
-  int sign = 1;
-  if (ideta < 0)
-    sign = -1;
-
-  // Determine two station etas  in MDT
-
-  int ideta1MDT = 0;
-  int ideta2MDT = 0;
-  if (st[2] == 'F') {
-    ideta1MDT = sign * 1;
-    ideta2MDT = sign * 2;
-  }
-  if (st[2] == 'E') {
-    if (st[1] == '4') {
-      // T4
-      ideta1MDT = sign * 4;
-      ideta2MDT = sign * 5;
-    } else if (st[1] == '3') {
-      // T3
-      ideta1MDT = sign * T31[index];
-      ideta2MDT = sign * T32[index];
-    } else {
-      // T1 or T2
-      ideta1MDT = sign * T11[index];
-      ideta2MDT = sign * T12[index];
+
+    void MuonHoughPatternFinderTool::updateTgcMdtStationMap(const Identifier tgcid, int hit_begin, int hit_end,
+                                                            std::map<int, std::vector<std::pair<int, int>>>& tgcmdtstationmap) const {
+        //  input is a TGC identifier, begin container and end container
+        //  tgcmdtstationmap is updated
+        //
+        // called once per tgc collection/station
+        std::string st = m_idHelperSvc->tgcIdHelper().stationNameString(m_idHelperSvc->tgcIdHelper().stationName(tgcid));
+        if (st[0] != 'T') return;
+
+        std::vector<int> T31(5);
+        T31[0] = 2;
+        T31[1] = 3;
+        T31[2] = 3;
+        T31[3] = 4;
+        T31[4] = 4;
+        std::vector<int> T32(5);
+        T32[0] = 3;
+        T32[1] = 4;
+        T32[2] = 4;
+        T32[3] = 5;
+        T32[4] = 5;
+        std::vector<int> T11(5);
+        T11[0] = 2;
+        T11[1] = 3;
+        T11[2] = 4;
+        T11[3] = 4;
+        T11[4] = 4;
+        std::vector<int> T12(5);
+        T12[0] = 3;
+        T12[1] = 4;
+        T12[2] = 5;
+        T12[3] = 5;
+        T12[4] = 5;
+
+        std::map<int, std::vector<std::pair<int, int>>>::iterator it;
+
+        // Determine station phi in MDT
+
+        int modphiTGC = 48;
+        if (st[2] == 'F') modphiTGC = 24;
+        if (st[1] == '4') modphiTGC = 24;
+
+        int idphi = m_idHelperSvc->tgcIdHelper().stationPhi(tgcid);
+        int ideta = m_idHelperSvc->tgcIdHelper().stationEta(tgcid);
+        int index = abs(ideta) - 1;
+        int idphi1MDT = 1 + int(8. * (idphi + 1) / modphiTGC);
+        int idphi2MDT = 1 + int(8. * (idphi - 1) / modphiTGC);
+        if (idphi1MDT > 8) idphi1MDT = 1;
+        if (idphi2MDT > 8) idphi2MDT = 1;
+
+        int sign = 1;
+        if (ideta < 0) sign = -1;
+
+        // Determine two station etas  in MDT
+
+        int ideta1MDT = 0;
+        int ideta2MDT = 0;
+        if (st[2] == 'F') {
+            ideta1MDT = sign * 1;
+            ideta2MDT = sign * 2;
+        }
+        if (st[2] == 'E') {
+            if (st[1] == '4') {
+                // T4
+                ideta1MDT = sign * 4;
+                ideta2MDT = sign * 5;
+            } else if (st[1] == '3') {
+                // T3
+                ideta1MDT = sign * T31[index];
+                ideta2MDT = sign * T32[index];
+            } else {
+                // T1 or T2
+                ideta1MDT = sign * T11[index];
+                ideta2MDT = sign * T12[index];
+            }
+        }
+        std::string station1 = "EML";
+        std::string station2 = "EMS";
+        if (st[1] == '4') {
+            station1 = "EIL";
+            station2 = "EIS";
+        }
+        int stationNameMDT1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station1);
+        int stationNameMDT2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station2);
+
+        // store station Inner and Middle codes
+
+        int stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta1MDT);
+        addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+        stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta1MDT);
+        addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+        if (ideta1MDT != ideta2MDT) {
+            stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta2MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta2MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+        }
+        if (idphi1MDT != idphi2MDT) {
+            stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta1MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta1MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            if (ideta1MDT != ideta2MDT) {
+                stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta2MDT);
+                addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+                stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta2MDT);
+                addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            }
+        }
+        // Store corresponding Outer stations
+
+        if (station1 == "EMS") { station1 = "EOS"; }
+        if (station2 == "EML") {
+            station2 = "EOL";
+        } else
+            return;
+
+        stationNameMDT1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station1);
+        stationNameMDT2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station2);
+
+        stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta1MDT);
+        addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+        stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta1MDT);
+        addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+        if (ideta1MDT != ideta2MDT) {
+            stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta2MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta2MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+        }
+        if (idphi1MDT != idphi2MDT) {
+            stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta1MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta1MDT);
+            addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+
+            if (ideta1MDT != ideta2MDT) {
+                stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta2MDT);
+                addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+                stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta2MDT);
+                addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+            }
+        }
     }
-  }
-  std::string station1 = "EML";
-  std::string station2 = "EMS";
-  if (st[1] == '4') {
-    station1 = "EIL";
-    station2 = "EIS";
-  }
-  int stationNameMDT1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station1);
-  int stationNameMDT2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station2);
-
-  // store station Inner and Middle codes
-
-  int stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta1MDT);
-  addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-  stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta1MDT);
-  addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-  if (ideta1MDT != ideta2MDT) {
-    stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta2MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-    stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta2MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-  }
-  if (idphi1MDT != idphi2MDT) {
-    stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta1MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-    stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta1MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-    if (ideta1MDT != ideta2MDT) {
-      stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta2MDT);
-      addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-      stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta2MDT);
-      addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+
+    int MuonHoughPatternFinderTool::stationCode(Identifier id) const {
+        return 10000000 * m_idHelperSvc->mdtIdHelper().stationName(id) + 100000 * m_idHelperSvc->mdtIdHelper().stationPhi(id) +
+               1000 * (m_idHelperSvc->mdtIdHelper().stationEta(id) + 10);
     }
-  }
-  // Store corresponding Outer stations
-
-  if (station1 == "EMS") {
-    station1 = "EOS";
-  }
-  if (station2 == "EML") {
-    station2 = "EOL";
-  } else
-    return;
-
-  stationNameMDT1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station1);
-  stationNameMDT2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(station2);
-
-  stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta1MDT);
-  addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-  stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta1MDT);
-  addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-  if (ideta1MDT != ideta2MDT) {
-    stationcode = stationCode(stationNameMDT1, idphi1MDT, ideta2MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-    stationcode = stationCode(stationNameMDT2, idphi1MDT, ideta2MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-  }
-  if (idphi1MDT != idphi2MDT) {
-    stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta1MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-    stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta1MDT);
-    addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-
-    if (ideta1MDT != ideta2MDT) {
-      stationcode = stationCode(stationNameMDT1, idphi2MDT, ideta2MDT);
-      addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
-      stationcode = stationCode(stationNameMDT2, idphi2MDT, ideta2MDT);
-      addToStationMap(tgcmdtstationmap, it, stationcode, hit_begin, hit_end);
+
+    int MuonHoughPatternFinderTool::stationCode(int stationname, int phi, int eta) {
+        return 10000000 * stationname + 100000 * phi + 1000 * (eta + 10);
     }
-  }
-}
-
-int
-MuonHoughPatternFinderTool::stationCode(Identifier id) const
-{
-  return 10000000 * m_idHelperSvc->mdtIdHelper().stationName(id) +
-         100000 * m_idHelperSvc->mdtIdHelper().stationPhi(id) +
-         1000 * (m_idHelperSvc->mdtIdHelper().stationEta(id) + 10);
-}
-
-int
-MuonHoughPatternFinderTool::stationCode(int stationname, int phi, int eta) 
-{
-  return 10000000 * stationname + 100000 * phi + 1000 * (eta + 10);
-}
-
-void
-MuonHoughPatternFinderTool::addToStationMap(
-  std::map<int, std::vector<std::pair<int, int>>>& stationmap,
-  std::map<int, std::vector<std::pair<int, int>>>::iterator& it,
-  int& stationcode,
-  const int& hit_begin,
-  const int& hit_end) 
-{
-  it = stationmap.find(stationcode);
-  if (it == stationmap.end()) {
-    std::vector<std::pair<int, int>> dummyvec;
-    dummyvec.emplace_back(hit_begin, hit_end);
-    stationmap[stationcode] = dummyvec;
-  } else {
-    (*it).second.emplace_back(hit_begin, hit_end);
-  }
-}
-
-void
-MuonHoughPatternFinderTool::fastSegmentFinder(TrkDriftCircleMath::DCVec& dcs,
-                                              int& nl1,
-                                              int& nl2,
-                                              double& angleDif,
-                                              std::vector<int>& sel) const
-{
-  //
-  // Input:  vector of driftcircles per chamber
-  // Output: nl1 = segment hits in multilayer 1 and nl2 = segment hits in
-  // multilayer 2
-  //       : sel(1:dcs.size)  = 0 NOT selected  = 1 on segment
-  //
-  // Method: constructs the tangent lines to all driftcircle combinations and
-  // counts hits in a road of 1.5 mm
-  //         segment = combination with most hits
-  //         uses TrkDriftCircleMath software
-  //
-
-  // Layers with more than 10 hits are skipped as seed, if all layers have more
-  // than 10 hits, no fits are tried
-
-  nl1 = 0;
-  nl2 = 0;
-  angleDif = -1.;
-  if (dcs.empty())
-    return;
-
-  DCCit it_end = dcs.end();
-  DCCit it1 = dcs.begin();
-  std::map<int, DCVec> layerHits; // map between layer and driftcircles
-  std::map<int, int> dcsId;       // map between 'idnumber' and position
-
-  std::map<int, DCVec>::iterator map_it;
-  int nhits = 0;
-  for (; it1 != it_end; ++it1, nhits++) {
-    sel[nhits] = 0;
-    int isort = MdtIdHelper::maxNTubesPerLayer * (4 * (it1->id().ml()) + it1->id().lay()) +
-                it1->id().tube();
-    dcsId[isort] = nhits;
-    int ilay = 4 * (it1->id().ml()) + it1->id().lay();
-    ATH_MSG_VERBOSE(" ilay " << ilay << " isort " << isort);
-
-    map_it = layerHits.find(ilay);
-    if (map_it != layerHits.end()) {
-      (*map_it).second.push_back(*it1);
-    } else {
-      DCVec dcl;
-      dcl.reserve(dcs.size());
-      dcl.push_back(*it1);
-      layerHits[ilay] = dcl;
+
+    void MuonHoughPatternFinderTool::addToStationMap(std::map<int, std::vector<std::pair<int, int>>>& stationmap,
+                                                     std::map<int, std::vector<std::pair<int, int>>>::iterator& it, int& stationcode,
+                                                     const int& hit_begin, const int& hit_end) {
+        it = stationmap.find(stationcode);
+        if (it == stationmap.end()) {
+            std::vector<std::pair<int, int>> dummyvec;
+            dummyvec.emplace_back(hit_begin, hit_end);
+            stationmap[stationcode] = dummyvec;
+        } else {
+            (*it).second.emplace_back(hit_begin, hit_end);
+        }
     }
-  }
-
-  unsigned int nHits = 0; // is maximalized
-  unsigned int nHitsLine = 0;
-  unsigned int nPassedTubes = 0;
-  double roadWidth = 1.5;
-  TrkDriftCircleMath::DCOnTrackVec hitsOnLineSel;
-  TrkDriftCircleMath::TangentToCircles tanCreator;
-  TrkDriftCircleMath::MatchDCWithLine matchWithLine;
-  bool stop = false;
-  for (int i = 0; i < 8; i++) {
-    if (layerHits.count(i) != 1)
-      continue;
-    DCVec& dci = layerHits[i];
-    if (dci.size() > 10)
-      continue;
-    DCCit iti = dci.begin();
-    DCCit iti_end = dci.end();
-    for (; iti != iti_end; ++iti) {
-      // One seed selected
-      float tubeRadius = 14.6;
-      if ((*iti).rot()) { // if no access to rot, can't do anything here
-        tubeRadius = (*iti).rot()->detectorElement()->innerTubeRadius();
-      }
-      for (int j = 7; j > i; j--) {
-        if (layerHits.count(j) != 1)
-          continue;
-        DCVec& dcj = layerHits[j];
-        if (dcj.size() > 10)
-          continue;
-        DCCit itj = dcj.begin();
-        DCCit itj_end = dcj.end();
-        for (; itj != itj_end; ++itj) {
-          // Second seed selected
-          double hitx = (*itj).x();
-          double hity = (*itj).y();
-          double norm = std::sqrt(hitx * hitx + hity * hity);
-          double cphi = hitx / norm;
-          double sphi = hity / norm;
-          TrkDriftCircleMath::TangentToCircles::LineVec lines =
-            tanCreator.tangentLines(*iti, *itj);
-          for (TrkDriftCircleMath::TangentToCircles::LineVec::const_iterator
-                 lit = lines.begin();
-               lit != lines.end();
-               ++lit) {
-            double coshit = std::cos((*lit).phi());
-            double sinhit = std::sin((*lit).phi());
-            double cospsi = coshit * cphi + sinhit * sphi;
-            if (cospsi > 1.)
-              cospsi = 1.;
-            else if (cospsi < -1.)
-              cospsi = -1.;
-            double psi = std::acos(cospsi);
-            if (psi > 0.3)
-              continue;
-            matchWithLine.set(*lit,
-                              roadWidth,
-                              TrkDriftCircleMath::MatchDCWithLine::Road,
-                              tubeRadius);
-            const TrkDriftCircleMath::DCOnTrackVec& hitsOnLine =
-              matchWithLine.match(dcs);
-            unsigned int matchedHits = matchWithLine.hitsOnTrack();
-            ATH_MSG_VERBOSE(" Summary nHits "
-                            << matchedHits << " nl1 " << matchWithLine.hitsMl1()
-                            << " nl2 " << matchWithLine.hitsMl2());
-            if (matchedHits > nHits ||
-                (matchedHits == nHits && psi < angleDif)) {
-              int dnl = std::abs(static_cast<int>(matchWithLine.hitsMl1()) -
-                                 static_cast<int>(matchWithLine.hitsMl2()));
-              ATH_MSG_DEBUG(" matchWithLine.hitsOnTrack() >  nHits old "
-                            << nHits << " new: " << matchedHits);
-              ATH_MSG_DEBUG(" dnl " << dnl << " old dnl "
-                                    << std::abs(nl1 - nl2));
-              ATH_MSG_DEBUG(" hit cos phi " << cphi << " line " << coshit
-                                            << " sin phi " << sphi << " line "
-                                            << sinhit << " psi " << psi);
-
-              // update of variables:
-              nHits = matchedHits;
-              nl1 = matchWithLine.hitsMl1();
-              nl2 = matchWithLine.hitsMl2();
-              nHitsLine = hitsOnLine.size();
-              nPassedTubes = matchWithLine.passedTubes();
-              hitsOnLineSel = hitsOnLine;
-              angleDif = psi;
+
+    void MuonHoughPatternFinderTool::fastSegmentFinder(TrkDriftCircleMath::DCVec& dcs, int& nl1, int& nl2, double& angleDif,
+                                                       std::vector<int>& sel) const {
+        //
+        // Input:  vector of driftcircles per chamber
+        // Output: nl1 = segment hits in multilayer 1 and nl2 = segment hits in
+        // multilayer 2
+        //       : sel(1:dcs.size)  = 0 NOT selected  = 1 on segment
+        //
+        // Method: constructs the tangent lines to all driftcircle combinations and
+        // counts hits in a road of 1.5 mm
+        //         segment = combination with most hits
+        //         uses TrkDriftCircleMath software
+        //
+
+        // Layers with more than 10 hits are skipped as seed, if all layers have more
+        // than 10 hits, no fits are tried
+
+        nl1 = 0;
+        nl2 = 0;
+        angleDif = -1.;
+        if (dcs.empty()) return;
+
+        DCCit it_end = dcs.end();
+        DCCit it1 = dcs.begin();
+        std::map<int, DCVec> layerHits;  // map between layer and driftcircles
+        std::map<int, int> dcsId;        // map between 'idnumber' and position
+
+        std::map<int, DCVec>::iterator map_it;
+        int nhits = 0;
+        for (; it1 != it_end; ++it1, nhits++) {
+            sel[nhits] = 0;
+            int isort = MdtIdHelper::maxNTubesPerLayer * (4 * (it1->id().ml()) + it1->id().lay()) + it1->id().tube();
+            dcsId[isort] = nhits;
+            int ilay = 4 * (it1->id().ml()) + it1->id().lay();
+            ATH_MSG_VERBOSE(" ilay " << ilay << " isort " << isort);
+
+            map_it = layerHits.find(ilay);
+            if (map_it != layerHits.end()) {
+                (*map_it).second.push_back(*it1);
+            } else {
+                DCVec dcl;
+                dcl.reserve(dcs.size());
+                dcl.push_back(*it1);
+                layerHits[ilay] = dcl;
             }
+        }
 
-            ATH_MSG_VERBOSE(" Select nHits " << nHits << " nl1 " << nl1
-                                             << " nl2 " << nl2);
-            if (nHits >= dcs.size())
-              stop = true;
-          } // end lines
-          if (stop)
-            break;
-        } // end itj
-        if (stop)
-          break;
-      } // end j
-      if (stop)
-        break;
-    } // end iti
-    if (stop)
-      break;
-  } // end i
-
-  ATH_MSG_DEBUG(" Fast segment finder Max Layers hit "
-                << dcs.size() << " nHitsLine - nHits " << nHitsLine - nl1 - nl2
-                << " passed Tubes -nHits " << nPassedTubes - nl1 - nl2
-                << " nl1 " << nl1 << " nl2 " << nl2 << " angleDif "
-                << angleDif);
-
-  TrkDriftCircleMath::DCOnTrackIt itt = hitsOnLineSel.begin();
-  TrkDriftCircleMath::DCOnTrackIt itt_end = hitsOnLineSel.end();
-  int i = 0;
-  for (; itt != itt_end; ++itt, i++) {
-    int isort = MdtIdHelper::maxNTubesPerLayer * (4 * (itt->id().ml()) + itt->id().lay()) +
-                itt->id().tube();
-    if (dcsId.count(isort) == 1) {
-      int dcsIndex = dcsId[isort];
-      sel[dcsIndex] = 1;
-
-      ATH_MSG_DEBUG(" Selected Hit index "
-                    << dcsIndex << " MultiLayer " << itt->id().ml() << " layer "
-                    << itt->id().lay() << " tube " << itt->id().tube());
-    } else {
-      ATH_MSG_WARNING(" ALARM fastSegmentFinder hit NOT found "
-                      << i << " isort " << isort);
+        unsigned int nHits = 0;  // is maximalized
+        unsigned int nHitsLine = 0;
+        unsigned int nPassedTubes = 0;
+        double roadWidth = 1.5;
+        TrkDriftCircleMath::DCOnTrackVec hitsOnLineSel;
+        TrkDriftCircleMath::TangentToCircles tanCreator;
+        TrkDriftCircleMath::MatchDCWithLine matchWithLine;
+        bool stop = false;
+        for (int i = 0; i < 8; i++) {
+            if (layerHits.count(i) != 1) continue;
+            DCVec& dci = layerHits[i];
+            if (dci.size() > 10) continue;
+            DCCit iti = dci.begin();
+            DCCit iti_end = dci.end();
+            for (; iti != iti_end; ++iti) {
+                // One seed selected
+                float tubeRadius = 14.6;
+                if ((*iti).rot()) {  // if no access to rot, can't do anything here
+                    tubeRadius = (*iti).rot()->detectorElement()->innerTubeRadius();
+                }
+                for (int j = 7; j > i; j--) {
+                    if (layerHits.count(j) != 1) continue;
+                    DCVec& dcj = layerHits[j];
+                    if (dcj.size() > 10) continue;
+                    DCCit itj = dcj.begin();
+                    DCCit itj_end = dcj.end();
+                    for (; itj != itj_end; ++itj) {
+                        // Second seed selected
+                        double hitx = (*itj).x();
+                        double hity = (*itj).y();
+                        double norm = std::sqrt(hitx * hitx + hity * hity);
+                        double cphi = hitx / norm;
+                        double sphi = hity / norm;
+                        TrkDriftCircleMath::TangentToCircles::LineVec lines = tanCreator.tangentLines(*iti, *itj);
+                        for (TrkDriftCircleMath::TangentToCircles::LineVec::const_iterator lit = lines.begin(); lit != lines.end(); ++lit) {
+                            double coshit = std::cos((*lit).phi());
+                            double sinhit = std::sin((*lit).phi());
+                            double cospsi = coshit * cphi + sinhit * sphi;
+                            if (cospsi > 1.)
+                                cospsi = 1.;
+                            else if (cospsi < -1.)
+                                cospsi = -1.;
+                            double psi = std::acos(cospsi);
+                            if (psi > 0.3) continue;
+                            matchWithLine.set(*lit, roadWidth, TrkDriftCircleMath::MatchDCWithLine::Road, tubeRadius);
+                            const TrkDriftCircleMath::DCOnTrackVec& hitsOnLine = matchWithLine.match(dcs);
+                            unsigned int matchedHits = matchWithLine.hitsOnTrack();
+                            ATH_MSG_VERBOSE(" Summary nHits " << matchedHits << " nl1 " << matchWithLine.hitsMl1() << " nl2 "
+                                                              << matchWithLine.hitsMl2());
+                            if (matchedHits > nHits || (matchedHits == nHits && psi < angleDif)) {
+                                int dnl = std::abs(static_cast<int>(matchWithLine.hitsMl1()) - static_cast<int>(matchWithLine.hitsMl2()));
+                                ATH_MSG_DEBUG(" matchWithLine.hitsOnTrack() >  nHits old " << nHits << " new: " << matchedHits);
+                                ATH_MSG_DEBUG(" dnl " << dnl << " old dnl " << std::abs(nl1 - nl2));
+                                ATH_MSG_DEBUG(" hit cos phi " << cphi << " line " << coshit << " sin phi " << sphi << " line " << sinhit
+                                                              << " psi " << psi);
+
+                                // update of variables:
+                                nHits = matchedHits;
+                                nl1 = matchWithLine.hitsMl1();
+                                nl2 = matchWithLine.hitsMl2();
+                                nHitsLine = hitsOnLine.size();
+                                nPassedTubes = matchWithLine.passedTubes();
+                                hitsOnLineSel = hitsOnLine;
+                                angleDif = psi;
+                            }
+
+                            ATH_MSG_VERBOSE(" Select nHits " << nHits << " nl1 " << nl1 << " nl2 " << nl2);
+                            if (nHits >= dcs.size()) stop = true;
+                        }  // end lines
+                        if (stop) break;
+                    }  // end itj
+                    if (stop) break;
+                }  // end j
+                if (stop) break;
+            }  // end iti
+            if (stop) break;
+        }  // end i
+
+        ATH_MSG_DEBUG(" Fast segment finder Max Layers hit " << dcs.size() << " nHitsLine - nHits " << nHitsLine - nl1 - nl2
+                                                             << " passed Tubes -nHits " << nPassedTubes - nl1 - nl2 << " nl1 " << nl1
+                                                             << " nl2 " << nl2 << " angleDif " << angleDif);
+
+        TrkDriftCircleMath::DCOnTrackIt itt = hitsOnLineSel.begin();
+        TrkDriftCircleMath::DCOnTrackIt itt_end = hitsOnLineSel.end();
+        int i = 0;
+        for (; itt != itt_end; ++itt, i++) {
+            int isort = MdtIdHelper::maxNTubesPerLayer * (4 * (itt->id().ml()) + itt->id().lay()) + itt->id().tube();
+            if (dcsId.count(isort) == 1) {
+                int dcsIndex = dcsId[isort];
+                sel[dcsIndex] = 1;
+
+                ATH_MSG_DEBUG(" Selected Hit index " << dcsIndex << " MultiLayer " << itt->id().ml() << " layer " << itt->id().lay()
+                                                     << " tube " << itt->id().tube());
+            } else {
+                ATH_MSG_WARNING(" ALARM fastSegmentFinder hit NOT found " << i << " isort " << isort);
+            }
+        }
     }
-  }
-}
-}
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternTool.cxx
index 8cfb78fa71615dcf19a936acf1fffd340651e549..ccb8130f83a7438b8b51f4d7e52829c675422dba 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonHoughPatternTool.cxx
@@ -4,1745 +4,1593 @@
 
 #include "MuonHoughPatternTools/MuonHoughPatternTool.h"
 
-#include "MuonHoughPatternEvent/MuonHoughTransformer_xy.h"
-#include "MuonHoughPatternEvent/MuonHoughTransformer_yz.h"
-#include "MuonHoughPatternEvent/MuonHoughTransformer_rz.h"
-#include "MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h"
-#include "MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h"
-
 #include "CxxUtils/sincos.h"
-#include "TDirectory.h"
-#include "TString.h"
-#include "TH2F.h"
-#include "TFile.h"
-#include "MuonHoughPatternEvent/MuonHoughTransformSteering.h"
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "MuonHoughPatternEvent/MuonHoughPattern.h"
-
+#include "MuonHoughPatternEvent/MuonHoughTransformSteering.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer_rz.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer_xy.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer_yz.h"
 #include "MuonPrepRawData/MdtPrepData.h"
 #include "MuonPrepRawData/MuonCluster.h"
-
-#include "GeoPrimitives/GeoPrimitives.h"
-
+#include "TDirectory.h"
+#include "TFile.h"
+#include "TH2F.h"
+#include "TString.h"
 #include "TrkSurfaces/Surface.h"
 
-MuonHoughPatternTool::MuonHoughPatternTool(const std::string& type, const std::string& name, const IInterface* parent):
-  AthAlgTool(type,name,parent),
-  m_number_of_ids(7),
-  //m_use_rpc_measures_phi(true),
-  m_use_rpc_measures_eta(true),
-  m_use_ip(false),
-  m_maximum_residu_mm(500.),
-  m_maximum_residu_mm_cosmics(2000.),
-  m_maximum_residu_angle(3.),
-  m_maximum_level(5),
-  //m_use_hough_correction(true),
-  m_z_cor_constant(-10000.),
-  m_z_cor_constant2(6000.),
-  m_theta_cor_constant(-0.042),
-  m_theta_cor_constant2(4000.), 
-  m_detectorsize_xy_full(15000.),
-  m_detectorsize_yz_full(25000.),
-  m_detectorsize_rz_full(27750.),
-  m_detectorsize_xy_ip(600.),
-  m_detectorsize_yz_ip(1000.),
-  m_detectorsize_rz_ip(1500.),
-  m_detectorsize_angle_xyz(360.),
-  m_detectorsize_angle_rz(180.),
-  //m_detectorsize_inv_sqrt_curvature(0.015),
-  m_stepsize_xy(75.),
-  m_stepsize_yz(250.),
-  m_stepsize_rz(75.),
-  m_stepsize_xy_cosmics(150.),
-  m_stepsize_rz_cosmics(150.),
-  m_stepsize_per_angle_xyz(0.25),
-  m_stepsize_per_angle_rz(0.25),
-  m_stepsize_per_angle_xy_cosmics(1.),
-  m_stepsize_per_angle_rz_cosmics(2.),
-  //m_stepsize_per_inv_sqrt_curvature(0.001),
-  m_nbins_curved(160),
-  m_number_of_sectors_rz_cosmics(12)
-{
-  declareInterface<IMuonHoughPatternTool>(this);
-  
-  m_detectorsize_xy = m_detectorsize_xy_full;
-  m_detectorsize_yz = m_detectorsize_yz_full;
-  m_detectorsize_rz = m_detectorsize_rz_full;
-  
+MuonHoughPatternTool::MuonHoughPatternTool(const std::string& type, const std::string& name, const IInterface* parent) :
+    AthAlgTool(type, name, parent),
+    m_number_of_ids(7),
+    // m_use_rpc_measures_phi(true),
+    m_use_rpc_measures_eta(true),
+    m_use_ip(false),
+    m_maximum_residu_mm(500.),
+    m_maximum_residu_mm_cosmics(2000.),
+    m_maximum_residu_angle(3.),
+    m_maximum_level(5),
+    // m_use_hough_correction(true),
+    m_z_cor_constant(-10000.),
+    m_z_cor_constant2(6000.),
+    m_theta_cor_constant(-0.042),
+    m_theta_cor_constant2(4000.),
+    m_detectorsize_xy_full(15000.),
+    m_detectorsize_yz_full(25000.),
+    m_detectorsize_rz_full(27750.),
+    m_detectorsize_xy_ip(600.),
+    m_detectorsize_yz_ip(1000.),
+    m_detectorsize_rz_ip(1500.),
+    m_detectorsize_angle_xyz(360.),
+    m_detectorsize_angle_rz(180.),
+    // m_detectorsize_inv_sqrt_curvature(0.015),
+    m_stepsize_xy(75.),
+    m_stepsize_yz(250.),
+    m_stepsize_rz(75.),
+    m_stepsize_xy_cosmics(150.),
+    m_stepsize_rz_cosmics(150.),
+    m_stepsize_per_angle_xyz(0.25),
+    m_stepsize_per_angle_rz(0.25),
+    m_stepsize_per_angle_xy_cosmics(1.),
+    m_stepsize_per_angle_rz_cosmics(2.),
+    // m_stepsize_per_inv_sqrt_curvature(0.001),
+    m_nbins_curved(160),
+    m_number_of_sectors_rz_cosmics(12) {
+    declareInterface<IMuonHoughPatternTool>(this);
+
+    m_detectorsize_xy = m_detectorsize_xy_full;
+    m_detectorsize_yz = m_detectorsize_yz_full;
+    m_detectorsize_rz = m_detectorsize_rz_full;
 }
 
-void MuonHoughPatternTool::useIPMuons()
-{
-  m_detectorsize_xy = m_detectorsize_xy_ip;
-  m_detectorsize_yz = m_detectorsize_yz_ip;
-  m_detectorsize_rz = m_detectorsize_rz_ip;
-  m_use_ip = true;
+void MuonHoughPatternTool::useIPMuons() {
+    m_detectorsize_xy = m_detectorsize_xy_ip;
+    m_detectorsize_yz = m_detectorsize_yz_ip;
+    m_detectorsize_rz = m_detectorsize_rz_ip;
+    m_use_ip = true;
 }
 
-void MuonHoughPatternTool::makePatterns(const MuonHoughHitContainer* hitcontainer, MuonHoughPatternContainerShip& houghpattern) const
-{
-  /** the original hit container */
-  const MuonHoughHitContainer* event = hitcontainer;
-
-  /** skip cosmic events that have more than 1000 phi hits */
-  if (m_use_cosmics == true && m_maxNumberOfPhiHits >= 0 ) {
-    int phihits = 0;
-    for (unsigned int hitid=0; hitid<event->size(); hitid++) {
-      if (event->getMeasuresPhi(hitid)==1) {
-	phihits++;
-      }
+void MuonHoughPatternTool::makePatterns(const MuonHoughHitContainer* hitcontainer, MuonHoughPatternContainerShip& houghpattern) const {
+    /** the original hit container */
+    const MuonHoughHitContainer* event = hitcontainer;
+
+    /** skip cosmic events that have more than 1000 phi hits */
+    if (m_use_cosmics == true && m_maxNumberOfPhiHits >= 0) {
+        int phihits = 0;
+        for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+            if (event->getMeasuresPhi(hitid) == 1) { phihits++; }
+        }
+        if (phihits > m_maxNumberOfPhiHits) {
+            ATH_MSG_DEBUG("Cosmic event has more than 1000 phi hits: " << phihits << " event is not reconstructed!");
+            return;
+        }
     }
-    if (phihits > m_maxNumberOfPhiHits ) {
-      ATH_MSG_DEBUG("Cosmic event has more than 1000 phi hits: " << phihits << " event is not reconstructed!");
-      return;
+
+    /** value of mdt weight cut, dependent on # hits in event */
+    double weightmdt = 0.0;
+    if (m_weightcutmdt == true) { setWeightMdtCutValue(event, weightmdt); }
+
+    ATH_MSG_DEBUG("Mdt Cut Value: " << weightmdt);
+
+    // reset weights, based on rejection factor and weightmdt
+    calculateWeights(event, weightmdt);
+
+    ATH_MSG_VERBOSE("Event Info");
+
+    ATH_MSG_VERBOSE("Size: " << event->size());
+
+    for (unsigned int i = 0; i < event->size(); i++) {
+        ATH_MSG_VERBOSE(event->getHit(i)->getHitx() << " " << event->getHit(i)->getHity() << " " << event->getHit(i)->getHitz() << " "
+                                                    << event->getHit(i)->getMeasuresPhi() << " " << event->getHit(i)->getWhichDetector()
+                                                    << " " << event->getHit(i)->getProbability() << " " << event->getHit(i)->getWeight()
+                                                    << " " << event->getHit(i)->getAssociated());
     }
-  }
-
-  /** value of mdt weight cut, dependent on # hits in event */
-  double weightmdt=0.0;
-  if (m_weightcutmdt == true) {setWeightMdtCutValue(event,weightmdt);}
-
-  ATH_MSG_DEBUG("Mdt Cut Value: " << weightmdt);
-
-  // reset weights, based on rejection factor and weightmdt
-  calculateWeights(event,weightmdt);
-
-  ATH_MSG_VERBOSE("Event Info");
-  
-  ATH_MSG_VERBOSE("Size: " << event->size());
-  
-  for (unsigned int i=0; i<event->size(); i++) {
-    ATH_MSG_VERBOSE(event->getHit(i)->getHitx() << " " 
-		    << event->getHit(i)->getHity() << " " 
-		    << event->getHit(i)->getHitz() << " " 
-		    << event->getHit(i)->getMeasuresPhi() << " " 
-		    << event->getHit(i)->getWhichDetector() <<  " "
-		    << event->getHit(i)->getProbability() <<  " "
-		    << event->getHit(i)->getWeight() <<  " "
-		    << event->getHit(i)->getAssociated());
-  }
-
-  makePatterns(MuonHough::hough_xy, weightmdt, event, houghpattern);
-  
-  if (m_use_cosmics == true)
-    {
-      makePatterns(MuonHough::hough_rzcosmics, weightmdt, event, houghpattern);
+
+    makePatterns(MuonHough::hough_xy, weightmdt, event, houghpattern);
+
+    if (m_use_cosmics == true) {
+        makePatterns(MuonHough::hough_rzcosmics, weightmdt, event, houghpattern);
+    } else if (m_use_curvedhough == true) {
+        makePatterns(MuonHough::hough_curved_at_a_cylinder, weightmdt, event, houghpattern);
+    } else {
+        makePatterns(MuonHough::hough_rz, weightmdt, event, houghpattern);
     }
-  else if (m_use_curvedhough == true)
-    {
-      makePatterns(MuonHough::hough_curved_at_a_cylinder, weightmdt, event, houghpattern);
+
+    ATH_MSG_VERBOSE("End makePatterns ");
+}
+
+void MuonHoughPatternTool::makePatterns(int id_number, double weightmdt, const MuonHoughHitContainer* event,
+                                        MuonHoughPatternContainerShip& houghpattern) const {
+    ATH_MSG_DEBUG("makePatterns");
+
+    resetAssociation(event);  // resets association, for hits that are already assigned to pattern in a previous hough
+
+    MuonHoughHitContainer* event_for_hough = whichEventHough(id_number, event, weightmdt);
+    MuonHoughHitContainer* event_for_association = whichEventAssociation(id_number, event);
+
+    ATH_MSG_VERBOSE("Size event fill: " << event_for_hough->size());
+    for (unsigned int i = 0; i < event_for_hough->size(); i++) {
+        ATH_MSG_VERBOSE(event_for_hough->getHit(i)->getHitx()
+                        << " " << event_for_hough->getHit(i)->getHity() << " " << event_for_hough->getHit(i)->getHitz() << " "
+                        << event_for_hough->getHit(i)->getMeasuresPhi() << " " << event_for_hough->getHit(i)->getWhichDetector() << " "
+                        << event_for_hough->getHit(i)->getProbability() << " " << event_for_hough->getHit(i)->getWeight() << " "
+                        << event_for_hough->getHit(i)->getAssociated());
     }
-  else 
-    {
-      makePatterns(MuonHough::hough_rz, weightmdt, event, houghpattern);
+
+    ATH_MSG_VERBOSE("Size event association: " << event_for_association->size());
+    for (unsigned int i = 0; i < event_for_association->size(); i++) {
+        ATH_MSG_VERBOSE(event_for_association->getHit(i)->getHitx()
+                        << " " << event_for_association->getHit(i)->getHity() << " " << event_for_association->getHit(i)->getHitz() << " "
+                        << event_for_association->getHit(i)->getMeasuresPhi() << " " << event_for_association->getHit(i)->getWhichDetector()
+                        << " " << event_for_association->getHit(i)->getProbability() << " " << event_for_association->getHit(i)->getWeight()
+                        << " " << event_for_association->getHit(i)->getAssociated());
     }
-  
-  ATH_MSG_VERBOSE("End makePatterns ");
-}
 
-void MuonHoughPatternTool::makePatterns(int id_number, double weightmdt, const MuonHoughHitContainer* event, MuonHoughPatternContainerShip& houghpattern) const
-{
-  ATH_MSG_DEBUG("makePatterns");
-
-  resetAssociation(event); // resets association, for hits that are already assigned to pattern in a previous hough
-
-  MuonHoughHitContainer* event_for_hough = whichEventHough(id_number, event, weightmdt);
-  MuonHoughHitContainer* event_for_association = whichEventAssociation(id_number, event);
-
-  ATH_MSG_VERBOSE("Size event fill: " << event_for_hough->size());
-  for (unsigned int i=0; i<event_for_hough->size(); i++) {
-    ATH_MSG_VERBOSE(event_for_hough->getHit(i)->getHitx() << " " 
-		    << event_for_hough->getHit(i)->getHity() << " " 
-		    << event_for_hough->getHit(i)->getHitz() << " " 
-		    << event_for_hough->getHit(i)->getMeasuresPhi() << " " 
-		    << event_for_hough->getHit(i)->getWhichDetector() <<  " "
-		    << event_for_hough->getHit(i)->getProbability() <<  " "
-		    << event_for_hough->getHit(i)->getWeight() <<  " "
-		    << event_for_hough->getHit(i)->getAssociated());
-  }
-  
-  ATH_MSG_VERBOSE("Size event association: " << event_for_association->size());
-  for (unsigned int i=0; i<event_for_association->size(); i++) {
-    ATH_MSG_VERBOSE(event_for_association->getHit(i)->getHitx() << " " 
-		    << event_for_association->getHit(i)->getHity() << " " 
-		    << event_for_association->getHit(i)->getHitz() << " " 
-		    << event_for_association->getHit(i)->getMeasuresPhi() << " " 
-		    << event_for_association->getHit(i)->getWhichDetector() <<  " "
-		    << event_for_association->getHit(i)->getProbability() <<  " "
-		    << event_for_association->getHit(i)->getWeight() <<  " "
-		    << event_for_association->getHit(i)->getAssociated());
-  }
-
-  ATH_MSG_DEBUG("size of event: " << event_for_association->size() << " id_number: " << id_number);
-  
-  MuonHoughTransformSteering* houghtransform = whichHoughTransform(id_number); //const?
-
-  ATH_MSG_DEBUG("HoughTransform chosen");  
-
-  bool test_for_next_level=true;
-
-  for (int level = 0; level < m_maximum_level; level++)
-    {
-      if (test_for_next_level)
-	{
-	  ATH_MSG_DEBUG("Iteration number: " << level);
-	  fillHistos(id_number,level,event_for_hough,houghtransform);
-	  //if( level == 0 ) fillHistos(id_number,level,event_for_hough,houghtransform);
-	  
-
-	  if( m_use_histos && level == 0 && id_number == MuonHough::hough_curved_at_a_cylinder ){
-	    const MuonHoughHisto2DContainer& histos = houghtransform->histos();
-	    TDirectory* dir = gDirectory;
-	    m_file->cd();
-	    for( int i=0;i<histos.size();++i ){
-
-	      TString hname = "hough_call_";
-	      hname += m_ncalls;
-	      hname += "_hist_";
-	      hname += i;
-	      histos.getHisto(i)->bookAndFillRootHistogram(std::string(hname))->Write();
-	    }
-	    gDirectory = dir;
-	    ++m_ncalls;
-	  }
-
-	  // hitcontainer for association not updated
-	  test_for_next_level = analyseHisto(id_number,level,event_for_association,houghtransform, houghpattern);
-	  
-	  if (test_for_next_level) {
-	    MuonHoughHitContainer* old_event_hough = event_for_hough;
-	    event_for_hough = whichEventHough(id_number, old_event_hough, weightmdt);
-	    ATH_MSG_DEBUG("New event size for transform: " << event_for_hough->size());
-	    delete old_event_hough;
-	  }
-	}
-      else {break;}
+    ATH_MSG_DEBUG("size of event: " << event_for_association->size() << " id_number: " << id_number);
+
+    MuonHoughTransformSteering* houghtransform = whichHoughTransform(id_number);  // const?
+
+    ATH_MSG_DEBUG("HoughTransform chosen");
+
+    bool test_for_next_level = true;
+
+    for (int level = 0; level < m_maximum_level; level++) {
+        if (test_for_next_level) {
+            ATH_MSG_DEBUG("Iteration number: " << level);
+            fillHistos(id_number, level, event_for_hough, houghtransform);
+            // if( level == 0 ) fillHistos(id_number,level,event_for_hough,houghtransform);
+
+            if (m_use_histos && level == 0 && id_number == MuonHough::hough_curved_at_a_cylinder) {
+                const MuonHoughHisto2DContainer& histos = houghtransform->histos();
+                TDirectory* dir = gDirectory;
+                m_file->cd();
+                for (int i = 0; i < histos.size(); ++i) {
+                    TString hname = "hough_call_";
+                    hname += m_ncalls;
+                    hname += "_hist_";
+                    hname += i;
+                    histos.getHisto(i)->bookAndFillRootHistogram(std::string(hname))->Write();
+                }
+                gDirectory = dir;
+                ++m_ncalls;
+            }
+
+            // hitcontainer for association not updated
+            test_for_next_level = analyseHisto(id_number, level, event_for_association, houghtransform, houghpattern);
+
+            if (test_for_next_level) {
+                MuonHoughHitContainer* old_event_hough = event_for_hough;
+                event_for_hough = whichEventHough(id_number, old_event_hough, weightmdt);
+                ATH_MSG_DEBUG("New event size for transform: " << event_for_hough->size());
+                delete old_event_hough;
+            }
+        } else {
+            break;
+        }
     }
-  
-  delete event_for_hough;      
-  delete event_for_association;
-  delete houghtransform;
-  houghtransform=nullptr;
 
-}// id_number
+    delete event_for_hough;
+    delete event_for_association;
+    delete houghtransform;
+    houghtransform = nullptr;
 
-StatusCode MuonHoughPatternTool::initialize()
-{
-  if (m_use_histos == true) // debug histos
+}  // id_number
+
+StatusCode MuonHoughPatternTool::initialize() {
+    if (m_use_histos == true)  // debug histos
     {
-      TString file = "HoughPattern.root";
-      m_file = new TFile(file,"RECREATE");
+        TString file = "HoughPattern.root";
+        m_file = new TFile(file, "RECREATE");
     }
 
-  ATH_MSG_DEBUG("Use Cosmic Settings: " << m_use_cosmics);
+    ATH_MSG_DEBUG("Use Cosmic Settings: " << m_use_cosmics);
 
-  if (m_use_cosmics == false)
-    {
-      // change histogram sizes:
-      useIPMuons();
+    if (m_use_cosmics == false) {
+        // change histogram sizes:
+        useIPMuons();
     }
 
-  else 
-    {
-      m_number_of_sectors_xyz = 1;
-      m_number_of_sectors_rz = 1;
-      // only 1 maximum search (number of sectors ==1):
-      m_number_of_maxima = 1;
-      // no curved hough for cosmics (muons assumed from ip):
-      m_use_curvedhough = false;
+    else {
+        m_number_of_sectors_xyz = 1;
+        m_number_of_sectors_rz = 1;
+        // only 1 maximum search (number of sectors ==1):
+        m_number_of_maxima = 1;
+        // no curved hough for cosmics (muons assumed from ip):
+        m_use_curvedhough = false;
     }
 
-  ATH_MSG_VERBOSE("Thresholds for histo: xyz: " << m_thresholdhisto_xyz << " rz: " << m_thresholdhisto_rz); 
+    ATH_MSG_VERBOSE("Thresholds for histo: xyz: " << m_thresholdhisto_xyz << " rz: " << m_thresholdhisto_rz);
 
-  ATH_MSG_VERBOSE("Thresholds for pattern: xyz: " << m_thresholdpattern_xyz << " rz: " << m_thresholdpattern_rz); 
+    ATH_MSG_VERBOSE("Thresholds for pattern: xyz: " << m_thresholdpattern_xyz << " rz: " << m_thresholdpattern_rz);
 
-  ATH_MSG_DEBUG("Number of iterations: " << m_maximum_level << " Maxima per iteration: " << m_number_of_maxima);
+    ATH_MSG_DEBUG("Number of iterations: " << m_maximum_level << " Maxima per iteration: " << m_number_of_maxima);
 
-  StatusCode sc = StatusCode::SUCCESS;
+    StatusCode sc = StatusCode::SUCCESS;
 
-  return sc;
+    return sc;
 }
 
-void MuonHoughPatternTool::resetAssociation(const MuonHoughHitContainer* event) 
-{
-  for (unsigned int i=0; i<event->size(); i++)
-    {
-      event->getHit(i)->setAssociated(false);
-      event->getHit(i)->setId(-1); // ugly, to be changed?
+void MuonHoughPatternTool::resetAssociation(const MuonHoughHitContainer* event) {
+    for (unsigned int i = 0; i < event->size(); i++) {
+        event->getHit(i)->setAssociated(false);
+        event->getHit(i)->setId(-1);  // ugly, to be changed?
     }
 }
 
-StatusCode MuonHoughPatternTool::finalize()
-{
-  StatusCode sc = StatusCode::SUCCESS;
-  ATH_MSG_VERBOSE("finalize()");
+StatusCode MuonHoughPatternTool::finalize() {
+    StatusCode sc = StatusCode::SUCCESS;
+    ATH_MSG_VERBOSE("finalize()");
 
-  if (m_use_histos == true)
-    {
-      m_file->Write();
-      m_file->Close();
-      delete m_file;
-      m_file=nullptr;
+    if (m_use_histos == true) {
+        m_file->Write();
+        m_file->Close();
+        delete m_file;
+        m_file = nullptr;
     }
 
-  return sc;
+    return sc;
 }
 
-void MuonHoughPatternTool::reset(MuonHoughPatternContainerShip& houghpattern) const
-{
-  ATH_MSG_VERBOSE("reset()");
-  
-  if (!houghpattern.empty())
-    {
-      for (unsigned int i=0; i<houghpattern.size(); i++)
-	{
-	  for (unsigned int j=0; j<houghpattern[i].size(); j++)
-	    {
-	      for (unsigned int k=0; k<houghpattern[i][j].size(); k++)
-		{
-		  delete houghpattern[i][j][k];
-		  houghpattern[i][j][k]=nullptr;
-		}
-	    }
-	}
-
-      houghpattern.clear();
+void MuonHoughPatternTool::reset(MuonHoughPatternContainerShip& houghpattern) const {
+    ATH_MSG_VERBOSE("reset()");
+
+    if (!houghpattern.empty()) {
+        for (unsigned int i = 0; i < houghpattern.size(); i++) {
+            for (unsigned int j = 0; j < houghpattern[i].size(); j++) {
+                for (unsigned int k = 0; k < houghpattern[i][j].size(); k++) {
+                    delete houghpattern[i][j][k];
+                    houghpattern[i][j][k] = nullptr;
+                }
+            }
+        }
+
+        houghpattern.clear();
     }
 }
 
-MuonHoughPatternContainerShip MuonHoughPatternTool::emptyHoughPattern() const
-{
-  MuonHoughPatternContainerShip houghpattern;
-  houghpattern.reserve(m_number_of_ids);
-  for (int i=0; i<m_number_of_ids; i++)
-    {
-      MuonHoughPatternContainer which_segment_vector;
-      which_segment_vector.reserve(m_maximum_level);
-      houghpattern.push_back(which_segment_vector);
-
-      for(int lvl=0; lvl<m_maximum_level; lvl++)
-	{
-	  MuonHoughPatternCollection level_vector;
-	  level_vector.reserve(m_number_of_maxima);
-	  houghpattern[i].push_back(level_vector);
-	  
-	  for (int maximum_number=0; maximum_number<m_number_of_maxima; maximum_number++)
-	    {
-	      MuonHoughPattern* houghpattern_level = nullptr;
-	      houghpattern[i][lvl].push_back(houghpattern_level);
-
-	    } // maximum_number
-	} // maximum_level
-    } // number_of_ids
-  return houghpattern;
-} //emptyHoughPattern
-
-void MuonHoughPatternTool::fillHistos(int /*id_number*/, int level, const MuonHoughHitContainer* event_to_analyse, MuonHoughTransformSteering* houghtransform) const
-{
-  ATH_MSG_DEBUG("fillHistos , level: " << level);
+MuonHoughPatternContainerShip MuonHoughPatternTool::emptyHoughPattern() const {
+    MuonHoughPatternContainerShip houghpattern;
+    houghpattern.reserve(m_number_of_ids);
+    for (int i = 0; i < m_number_of_ids; i++) {
+        MuonHoughPatternContainer which_segment_vector;
+        which_segment_vector.reserve(m_maximum_level);
+        houghpattern.push_back(which_segment_vector);
 
-  //  histograms shouldn't need to be reset for first iteration , but somehow necessary
-  //  if (level!=0) { 
-  houghtransform->resetHisto();
-  // }
+        for (int lvl = 0; lvl < m_maximum_level; lvl++) {
+            MuonHoughPatternCollection level_vector;
+            level_vector.reserve(m_number_of_maxima);
+            houghpattern[i].push_back(level_vector);
 
-  // weightRescaling is switched off (11-1-2008), since now reweighting method done only once per event
-  //  weightRescaling(event_to_analyse,id_number,level);
+            for (int maximum_number = 0; maximum_number < m_number_of_maxima; maximum_number++) {
+                MuonHoughPattern* houghpattern_level = nullptr;
+                houghpattern[i][lvl].push_back(houghpattern_level);
 
-  ATH_MSG_DEBUG("fillHistos size hits not in patterns " << event_to_analyse->size());
+            }  // maximum_number
+        }      // maximum_level
+    }          // number_of_ids
+    return houghpattern;
+}  // emptyHoughPattern
 
-  houghtransform->fill(event_to_analyse);
+void MuonHoughPatternTool::fillHistos(int /*id_number*/, int level, const MuonHoughHitContainer* event_to_analyse,
+                                      MuonHoughTransformSteering* houghtransform) const {
+    ATH_MSG_DEBUG("fillHistos , level: " << level);
 
-  ATH_MSG_VERBOSE("fillHistos::end of filling, now analyse histo: ");
+    //  histograms shouldn't need to be reset for first iteration , but somehow necessary
+    //  if (level!=0) {
+    houghtransform->resetHisto();
+    // }
+
+    // weightRescaling is switched off (11-1-2008), since now reweighting method done only once per event
+    //  weightRescaling(event_to_analyse,id_number,level);
+
+    ATH_MSG_DEBUG("fillHistos size hits not in patterns " << event_to_analyse->size());
+
+    houghtransform->fill(event_to_analyse);
+
+    ATH_MSG_VERBOSE("fillHistos::end of filling, now analyse histo: ");
 }
 
-bool MuonHoughPatternTool::analyseHisto(int id_number,int level,const MuonHoughHitContainer* event_to_analyse,MuonHoughTransformSteering* houghtransform, MuonHoughPatternContainerShip& houghpatterns_all) const
-{
-  ATH_MSG_VERBOSE("analyseHisto MuonHoughPatternTool (start)");
-
-  /** The Analyse-fillHistos loop is at three times ended for each id:
-      1- if the maximum_number of hhistos[id] ==0
-      2- if the houghpattern.size() < threshold_for_next_houghpattern
-      3 - if level == maximum_level 
-      at all these 3 times an array[number_of_ids] of int levelmax will be houghpattern has to be deleted.. (all in level>0)
-      4- if level not gets to 1  // but then no houghpatterns made.. ?
-      5- if numberOfHits left ==0 */
-
-  bool test_for_next_level=false;
-
-  const unsigned int threshold_for_next_houghpattern = getThresholdHoughPattern(id_number);
-  bool which_segment=0;
-  double numberofmaxima = 0;
-  double maximum_residu = m_maximum_residu_mm;
-  if (m_use_cosmics) {
-    maximum_residu = m_maximum_residu_mm_cosmics;
-  }
-  MuonHoughPatternCollection houghpatterns = houghtransform->constructHoughPatterns(event_to_analyse,maximum_residu,m_maximum_residu_angle,m_number_of_maxima,which_segment,m_printlevel);
-
-  for (unsigned int maximum_number=0; maximum_number < houghpatterns.size(); maximum_number++)
-    {
-      //      bool which_segment = maximum_number;
- 
-      MuonHoughPattern* houghpattern = houghpatterns[maximum_number];
-      if (houghpattern)
-	{
-	  numberofmaxima = houghpattern->getMaximumHistogram();
-
-	  houghpatterns_all[id_number][level][maximum_number] = houghpattern;
-	  ATH_MSG_DEBUG("id_number: " << id_number << " maximum_number: " << maximum_number << " size patternseg: " << houghpattern->size());
-
-	  if (houghpattern->empty()) {ATH_MSG_DEBUG("houghpattern==0");}
-	  
-	  // some print statements
-	  
-	  if (houghpattern->size()<numberofmaxima){
-	    ATH_MSG_DEBUG("ERROR: houghpattern smaller than maximum, id: " << id_number << " houghpattern.size(): " << houghpattern->size() << " numberofmaxima: " << numberofmaxima);}
-	  
-	  ATH_MSG_DEBUG(" level: " << level << " which_segment: " << which_segment);
-	  if (m_printlevel >=4) {houghpattern->printHoughPattern();}
-	  
-	  // checks for next level / maximum
-
-	  if (houghpattern->size()>=threshold_for_next_houghpattern)
-	    {
-	      if (level+1>=m_maximum_level)
-		{
-		  ATH_MSG_DEBUG("possibly more levels");
-		}
-	      else 
-		{
-		  if (hitsLeft(event_to_analyse)) // any hits left
-		    {
-		      test_for_next_level=true;
-		    }
-		  else
-		    {
-		      test_for_next_level = false;
-		    }
-		} 
-	    }
-	  
-	  else if (maximum_number == 0)
-	    {
-	      ATH_MSG_DEBUG("houghpattern too small for next level : " << level << " id: " << id_number);
-	    }
-	  
-	  // print_of houghpatterns:
-	  ATH_MSG_DEBUG("Size of HoughPatterns: " << houghpattern->size());
-	  
-	} // check op houghpattern pointer
-    } //maximum_number 
-  
-      
-  ATH_MSG_DEBUG(" Test for next level: " << test_for_next_level);
-  
-  return test_for_next_level;
-
-} //analyseHisto
-
-void MuonHoughPatternTool::analyseTrack(int /*id_number*/,const MuonHoughHitContainer* /*event_to_analyse*/,MuonHoughTransformSteering* /*houghtransform*/) const
-{
-} //analyseTrack
+bool MuonHoughPatternTool::analyseHisto(int id_number, int level, const MuonHoughHitContainer* event_to_analyse,
+                                        MuonHoughTransformSteering* houghtransform,
+                                        MuonHoughPatternContainerShip& houghpatterns_all) const {
+    ATH_MSG_VERBOSE("analyseHisto MuonHoughPatternTool (start)");
 
-bool MuonHoughPatternTool::hitsLeft(const MuonHoughHitContainer* event)
-{
-  int number_of_hits=event->size();
-  for (int hitid=0; hitid<number_of_hits; hitid++) {
-    if (!event->getHit(hitid)->getAssociated()) {
-      return true;
+    /** The Analyse-fillHistos loop is at three times ended for each id:
+        1- if the maximum_number of hhistos[id] ==0
+        2- if the houghpattern.size() < threshold_for_next_houghpattern
+        3 - if level == maximum_level
+        at all these 3 times an array[number_of_ids] of int levelmax will be houghpattern has to be deleted.. (all in level>0)
+        4- if level not gets to 1  // but then no houghpatterns made.. ?
+        5- if numberOfHits left ==0 */
+
+    bool test_for_next_level = false;
+
+    const unsigned int threshold_for_next_houghpattern = getThresholdHoughPattern(id_number);
+    bool which_segment = 0;
+    double numberofmaxima = 0;
+    double maximum_residu = m_maximum_residu_mm;
+    if (m_use_cosmics) { maximum_residu = m_maximum_residu_mm_cosmics; }
+    MuonHoughPatternCollection houghpatterns = houghtransform->constructHoughPatterns(
+        event_to_analyse, maximum_residu, m_maximum_residu_angle, m_number_of_maxima, which_segment, m_printlevel);
+
+    for (unsigned int maximum_number = 0; maximum_number < houghpatterns.size(); maximum_number++) {
+        //      bool which_segment = maximum_number;
+
+        MuonHoughPattern* houghpattern = houghpatterns[maximum_number];
+        if (houghpattern) {
+            numberofmaxima = houghpattern->getMaximumHistogram();
+
+            houghpatterns_all[id_number][level][maximum_number] = houghpattern;
+            ATH_MSG_DEBUG("id_number: " << id_number << " maximum_number: " << maximum_number
+                                        << " size patternseg: " << houghpattern->size());
+
+            if (houghpattern->empty()) { ATH_MSG_DEBUG("houghpattern==0"); }
+
+            // some print statements
+
+            if (houghpattern->size() < numberofmaxima) {
+                ATH_MSG_DEBUG("ERROR: houghpattern smaller than maximum, id: "
+                              << id_number << " houghpattern.size(): " << houghpattern->size() << " numberofmaxima: " << numberofmaxima);
+            }
+
+            ATH_MSG_DEBUG(" level: " << level << " which_segment: " << which_segment);
+            if (m_printlevel >= 4) { houghpattern->printHoughPattern(); }
+
+            // checks for next level / maximum
+
+            if (houghpattern->size() >= threshold_for_next_houghpattern) {
+                if (level + 1 >= m_maximum_level) {
+                    ATH_MSG_DEBUG("possibly more levels");
+                } else {
+                    if (hitsLeft(event_to_analyse))  // any hits left
+                    {
+                        test_for_next_level = true;
+                    } else {
+                        test_for_next_level = false;
+                    }
+                }
+            }
+
+            else if (maximum_number == 0) {
+                ATH_MSG_DEBUG("houghpattern too small for next level : " << level << " id: " << id_number);
+            }
+
+            // print_of houghpatterns:
+            ATH_MSG_DEBUG("Size of HoughPatterns: " << houghpattern->size());
+
+        }  // check op houghpattern pointer
+    }      // maximum_number
+
+    ATH_MSG_DEBUG(" Test for next level: " << test_for_next_level);
+
+    return test_for_next_level;
+
+}  // analyseHisto
+
+void MuonHoughPatternTool::analyseTrack(int /*id_number*/, const MuonHoughHitContainer* /*event_to_analyse*/,
+                                        MuonHoughTransformSteering* /*houghtransform*/) const {}  // analyseTrack
+
+bool MuonHoughPatternTool::hitsLeft(const MuonHoughHitContainer* event) {
+    int number_of_hits = event->size();
+    for (int hitid = 0; hitid < number_of_hits; hitid++) {
+        if (!event->getHit(hitid)->getAssociated()) { return true; }
     }
-  }
-  return false;
+    return false;
 }
 
-int MuonHoughPatternTool::numberOfHits(const MuonHoughHitContainer* event)const
-{
-  int number_of_hits_left=0;
-  int number_of_hits=event->size();
+int MuonHoughPatternTool::numberOfHits(const MuonHoughHitContainer* event) const {
+    int number_of_hits_left = 0;
+    int number_of_hits = event->size();
 
-  for (int hitid=0; hitid<number_of_hits; hitid++) {
-    if (!event->getHit(hitid)->getAssociated()) {
-      number_of_hits_left++;
+    for (int hitid = 0; hitid < number_of_hits; hitid++) {
+        if (!event->getHit(hitid)->getAssociated()) { number_of_hits_left++; }
     }
-  }
-  
-  // logically impossible --- if (number_of_hits_left <0) {ATH_MSG_WARNING("number of hits smaller than 0");}
 
-  ATH_MSG_VERBOSE("numberOfHits left: " << number_of_hits_left);
-  ATH_MSG_VERBOSE("number_of_hits: " << number_of_hits);
-  return number_of_hits_left;
-}
+    // logically impossible --- if (number_of_hits_left <0) {ATH_MSG_WARNING("number of hits smaller than 0");}
 
-bool MuonHoughPatternTool::hitInHoughPattern(MuonHoughHit* hit,const MuonHoughPatternContainer &houghpattern)const
-{
-  //checks if hit is already assigned to a houghpattern
+    ATH_MSG_VERBOSE("numberOfHits left: " << number_of_hits_left);
+    ATH_MSG_VERBOSE("number_of_hits: " << number_of_hits);
+    return number_of_hits_left;
+}
 
-  for (unsigned int i=0; i<houghpattern.size(); i++)
-    {
-      for (unsigned int j=0; j<houghpattern[i].size(); j++)
-	{
-	  if( houghpattern[i][j] )
-	    {
-	      if (houghpattern[i][j]->hitInHoughPattern(hit))
-		{
-		  ATH_MSG_VERBOSE("Hit in hough pattern found level " << i <<  " max " << j << "hitid: " << hit->getId());
-		  return true;
-		  
-		}
-	    }
-	}
+bool MuonHoughPatternTool::hitInHoughPattern(MuonHoughHit* hit, const MuonHoughPatternContainer& houghpattern) const {
+    // checks if hit is already assigned to a houghpattern
+
+    for (unsigned int i = 0; i < houghpattern.size(); i++) {
+        for (unsigned int j = 0; j < houghpattern[i].size(); j++) {
+            if (houghpattern[i][j]) {
+                if (houghpattern[i][j]->hitInHoughPattern(hit)) {
+                    ATH_MSG_VERBOSE("Hit in hough pattern found level " << i << " max " << j << "hitid: " << hit->getId());
+                    return true;
+                }
+            }
+        }
     }
-  return false;
+    return false;
 }
 
-void MuonHoughPatternTool::weightRescaling(const MuonHoughHitContainer* event, int id_number, int level)const
-{
-  double weight_trigger_hits = 1.; 
-  double weight_mdt_hits = 1.;
-
-  switch (id_number)
-    {
-    case MuonHough::hough_xy: case MuonHough::hough_yz: 
-      weight_trigger_hits = 1 - (level-1) * (1./(m_maximum_level+0.0)); // 1 , 1, 0.8, 0.6 , 0.4 
-      if (weight_trigger_hits > 1 ) weight_trigger_hits = 1.;
-      weight_mdt_hits = weight_trigger_hits;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      switch (level)
-	{
-	case 0:
-	  weight_trigger_hits = 1.;
-	  weight_mdt_hits = 1.;
-	  break;
-	case 1:
-	  weight_trigger_hits = 1.;
-	  weight_mdt_hits = 1.;
-	  break;
-	case 2:
-	  weight_trigger_hits = 1.;
-	  weight_mdt_hits = 0.75;
-	  break;
-	case 3:
-	  weight_trigger_hits = 0.75;
-	  weight_mdt_hits = 0.5;
-	  break;
-	case 4:
-	  weight_trigger_hits = 0.5;
-	  weight_mdt_hits = 0.25;
-	  break;
-	default: ATH_MSG_DEBUG("no weight defined for this level");
-	  weight_trigger_hits = 0.5;
-	  weight_mdt_hits = 0.25;
-	}
-      break;
-    default: ATH_MSG_WARNING("no valid id (id_number)");
+void MuonHoughPatternTool::weightRescaling(const MuonHoughHitContainer* event, int id_number, int level) const {
+    double weight_trigger_hits = 1.;
+    double weight_mdt_hits = 1.;
+
+    switch (id_number) {
+        case MuonHough::hough_xy:
+        case MuonHough::hough_yz:
+            weight_trigger_hits = 1 - (level - 1) * (1. / (m_maximum_level + 0.0));  // 1 , 1, 0.8, 0.6 , 0.4
+            if (weight_trigger_hits > 1) weight_trigger_hits = 1.;
+            weight_mdt_hits = weight_trigger_hits;
+            break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder:
+            switch (level) {
+                case 0:
+                    weight_trigger_hits = 1.;
+                    weight_mdt_hits = 1.;
+                    break;
+                case 1:
+                    weight_trigger_hits = 1.;
+                    weight_mdt_hits = 1.;
+                    break;
+                case 2:
+                    weight_trigger_hits = 1.;
+                    weight_mdt_hits = 0.75;
+                    break;
+                case 3:
+                    weight_trigger_hits = 0.75;
+                    weight_mdt_hits = 0.5;
+                    break;
+                case 4:
+                    weight_trigger_hits = 0.5;
+                    weight_mdt_hits = 0.25;
+                    break;
+                default:
+                    ATH_MSG_DEBUG("no weight defined for this level");
+                    weight_trigger_hits = 0.5;
+                    weight_mdt_hits = 0.25;
+            }
+            break;
+        default: ATH_MSG_WARNING("no valid id (id_number)");
     }
 
-  for (unsigned int i=0; i<event->size(); i++)
-    {
-      MuonHough::DetectorTechnology technology = event->getHit(i)->getDetectorId();
-      switch (technology)
-	{
-	case MuonHough::CSC: case MuonHough::RPC: case MuonHough::TGC:
-	  event->getHit(i)->setWeight(event->getHit(i)->getOrigWeight()*weight_trigger_hits);
-	  break;
-	case MuonHough::MDT:
-	  event->getHit(i)->setWeight(event->getHit(i)->getOrigWeight()*weight_mdt_hits);
-	  break;
-	default: ATH_MSG_WARNING("no valid detector technology");
-	}
+    for (unsigned int i = 0; i < event->size(); i++) {
+        MuonHough::DetectorTechnology technology = event->getHit(i)->getDetectorId();
+        switch (technology) {
+            case MuonHough::CSC:
+            case MuonHough::RPC:
+            case MuonHough::TGC: event->getHit(i)->setWeight(event->getHit(i)->getOrigWeight() * weight_trigger_hits); break;
+            case MuonHough::MDT: event->getHit(i)->setWeight(event->getHit(i)->getOrigWeight() * weight_mdt_hits); break;
+            default: ATH_MSG_WARNING("no valid detector technology");
+        }
     }
-  
 }
 
-void MuonHoughPatternTool::calculateWeights(const MuonHoughHitContainer* event, double weightmdt)const
-{
-  if (weightmdt >= 0.5) { // else do nothing (e.g. cosmics case)
-    for (unsigned int i=0; i<event->size(); i++)
-      {
-	MuonHough::DetectorTechnology technology = event->getHit(i)->getDetectorId();
-	if (technology == MuonHough::MDT)
-	  {
-	    // recalculate weight, especially important for cavern background MDT events
-	    double p_old = event->getHit(i)->getOrigWeight();
-	    double p_calc = 0.25*p_old*(1.- weightmdt);
-	    double p_new = p_calc/(p_calc + weightmdt*(1-p_old));
-	    ATH_MSG_VERBOSE(" MDT probability old " <<  p_old  << " Recalculated " << p_new);
-	    event->getHit(i)->setWeight(p_new);
-	  }
-      }
-  }
+void MuonHoughPatternTool::calculateWeights(const MuonHoughHitContainer* event, double weightmdt) const {
+    if (weightmdt >= 0.5) {  // else do nothing (e.g. cosmics case)
+        for (unsigned int i = 0; i < event->size(); i++) {
+            MuonHough::DetectorTechnology technology = event->getHit(i)->getDetectorId();
+            if (technology == MuonHough::MDT) {
+                // recalculate weight, especially important for cavern background MDT events
+                double p_old = event->getHit(i)->getOrigWeight();
+                double p_calc = 0.25 * p_old * (1. - weightmdt);
+                double p_new = p_calc / (p_calc + weightmdt * (1 - p_old));
+                ATH_MSG_VERBOSE(" MDT probability old " << p_old << " Recalculated " << p_new);
+                event->getHit(i)->setWeight(p_new);
+            }
+        }
+    }
 }
 
-int MuonHoughPatternTool::overlapHoughPatterns(const MuonHoughPattern *houghpattern1, const MuonHoughPattern *houghpattern2)const
-{
-  // both vectors houghpatterns->m_hitid[] are ordered, asked is the percentage of overlap between both vectors
-
-  int overlap=0;
-  unsigned int j=0;
-
-  for (unsigned int i=0; i<houghpattern1->size(); i++)  
-    {
-      while(j<houghpattern2->size())
-	{
-	  if (houghpattern1->getHitId(i) == houghpattern2->getHitId(j))
-	    {
-	      overlap++;
-	      j++; // this j cant be found again
-	      break;
-	    }
-	  if (houghpattern1->getHitId(i) < houghpattern2->getHitId(j))
-	    {
-	      break;
-	    }
-	  j++;
-	}
+int MuonHoughPatternTool::overlapHoughPatterns(const MuonHoughPattern* houghpattern1, const MuonHoughPattern* houghpattern2) const {
+    // both vectors houghpatterns->m_hitid[] are ordered, asked is the percentage of overlap between both vectors
+
+    int overlap = 0;
+    unsigned int j = 0;
+
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        while (j < houghpattern2->size()) {
+            if (houghpattern1->getHitId(i) == houghpattern2->getHitId(j)) {
+                overlap++;
+                j++;  // this j cant be found again
+                break;
+            }
+            if (houghpattern1->getHitId(i) < houghpattern2->getHitId(j)) { break; }
+            j++;
+        }
     }
-  double percentage1 = (1.0*overlap)/houghpattern1->size(); //size() gives double
-  double percentage2 = (1.0*overlap)/houghpattern2->size();
+    double percentage1 = (1.0 * overlap) / houghpattern1->size();  // size() gives double
+    double percentage2 = (1.0 * overlap) / houghpattern2->size();
 
-  ATH_MSG_DEBUG("Percentage Overlap: " << percentage1 << " " << percentage2);
-  return overlap;
+    ATH_MSG_DEBUG("Percentage Overlap: " << percentage1 << " " << percentage2);
+    return overlap;
 }
 
-MuonHoughHitContainer* MuonHoughPatternTool::whichEventAssociation(int id_number,const MuonHoughHitContainer* event)const
-{
-  MuonHoughHitContainer* event_to_analyse = new MuonHoughHitContainer(false);
-
-  switch(id_number)
-    {
-    case MuonHough::hough_xy:
-
-      for (unsigned int hitid=0; hitid<event->size(); hitid++)
-	{
-	  MuonHoughHit * hit = event->getHit(hitid);
-	  if (hit->getMeasuresPhi())
-	    {
-	      if (m_use_csc_in_pattern == true || (m_use_csc_in_pattern == false && hit->getDetectorId() != MuonHough::CSC))
-		{
-		  event_to_analyse->addHit(hit);
-		}	      
-	    } 	    
-	}
-      break;
-    case MuonHough::hough_yz:
-      for (unsigned int hitid=0; hitid<event->size(); hitid++) {
-	MuonHoughHit * hit = event->getHit(hitid);
-	event_to_analyse->addHit(hit);
-      }
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_curved_at_a_cylinder:
-      for (unsigned int hitid=0; hitid<event->size(); hitid++)
-	{
-	  MuonHoughHit * hit = event->getHit(hitid);
-	  if(!hit->getMeasuresPhi())
-	    {
-	      if (m_use_csc_in_pattern == true || (m_use_csc_in_pattern == false && hit->getDetectorId() != MuonHough::CSC))
-		{
-		  event_to_analyse->addHit(hit);
-		}
-	    }
-	}
-      break;
-    case MuonHough::hough_rz_rpc:
-      if (m_use_rpc_measures_eta == 1)
-	{
-	  for (unsigned int hitid=0; hitid<event->size(); hitid++)
-	    {
-	      MuonHoughHit * hit = event->getHit(hitid);
-	      if (hit->getDetectorId()==MuonHough::RPC)
-		{
-		  if (!hit->getMeasuresPhi())
-		    {
-		      event_to_analyse->addHit(hit);
-		    }
-		}
-	    }
-	}
-      else 
-	{
-	  for (unsigned int hitid=0; hitid<event->size(); hitid++)
-	    {
-	      MuonHoughHit * hit = event->getHit(hitid);
-	      if (hit->getDetectorId()==MuonHough::RPC)
-		{
-		  event_to_analyse->addHit(hit);
-		}
-	    }
-	}
-      break;
-    case MuonHough::hough_rz_mdt:
-      for (unsigned int hitid=0; hitid<event->size(); hitid++)
-	{
-	  MuonHoughHit * hit = event->getHit(hitid);
-	  if (hit->getDetectorId()==MuonHough::MDT)
-	    {
-	      event_to_analyse->addHit(hit);
-	    }
-	}
-      break;
-    default: ATH_MSG_WARNING(" no valid id");
+MuonHoughHitContainer* MuonHoughPatternTool::whichEventAssociation(int id_number, const MuonHoughHitContainer* event) const {
+    MuonHoughHitContainer* event_to_analyse = new MuonHoughHitContainer(false);
+
+    switch (id_number) {
+        case MuonHough::hough_xy:
+
+            for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+                MuonHoughHit* hit = event->getHit(hitid);
+                if (hit->getMeasuresPhi()) {
+                    if (m_use_csc_in_pattern == true || (m_use_csc_in_pattern == false && hit->getDetectorId() != MuonHough::CSC)) {
+                        event_to_analyse->addHit(hit);
+                    }
+                }
+            }
+            break;
+        case MuonHough::hough_yz:
+            for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+                MuonHoughHit* hit = event->getHit(hitid);
+                event_to_analyse->addHit(hit);
+            }
+            break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_curved_at_a_cylinder:
+            for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+                MuonHoughHit* hit = event->getHit(hitid);
+                if (!hit->getMeasuresPhi()) {
+                    if (m_use_csc_in_pattern == true || (m_use_csc_in_pattern == false && hit->getDetectorId() != MuonHough::CSC)) {
+                        event_to_analyse->addHit(hit);
+                    }
+                }
+            }
+            break;
+        case MuonHough::hough_rz_rpc:
+            if (m_use_rpc_measures_eta == 1) {
+                for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+                    MuonHoughHit* hit = event->getHit(hitid);
+                    if (hit->getDetectorId() == MuonHough::RPC) {
+                        if (!hit->getMeasuresPhi()) { event_to_analyse->addHit(hit); }
+                    }
+                }
+            } else {
+                for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+                    MuonHoughHit* hit = event->getHit(hitid);
+                    if (hit->getDetectorId() == MuonHough::RPC) { event_to_analyse->addHit(hit); }
+                }
+            }
+            break;
+        case MuonHough::hough_rz_mdt:
+            for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+                MuonHoughHit* hit = event->getHit(hitid);
+                if (hit->getDetectorId() == MuonHough::MDT) { event_to_analyse->addHit(hit); }
+            }
+            break;
+        default: ATH_MSG_WARNING(" no valid id");
     }
 
-  return event_to_analyse;
+    return event_to_analyse;
 }
 
-MuonHoughHitContainer* MuonHoughPatternTool::whichEventHough(int id_number,const MuonHoughHitContainer* event, double weightmdt)const
-{
-  ATH_MSG_DEBUG("whichEventHough::size of event: " << event->size());
-  const MuonHoughHitContainer* hits_not_in_patterns = hitsNotInPattern(event,id_number);
-  ATH_MSG_DEBUG("whichEventHough::hitsNotInPattern: " << hits_not_in_patterns->size());
-  MuonHoughHitContainer* event_to_analyse = new MuonHoughHitContainer(false);
-
-  switch(id_number)
-    {
-    case MuonHough::hough_xy:
-
-      for (unsigned int hitid=0; hitid<hits_not_in_patterns->size(); hitid++)
-	{
-	  MuonHoughHit * hit = hits_not_in_patterns->getHit(hitid);
-	  if (hit->getMeasuresPhi()==1) {
-	    if (hitThroughCut(hit, weightmdt)) {
-	      if (m_use_csc_in_hough == true || (m_use_csc_in_hough == false && hit->getDetectorId()==MuonHough::CSC))
-		{
-		  event_to_analyse->addHit(hit);
-		}
-	    }
-	  }
-	}
-      break;
-    case MuonHough::hough_yz:
-      for (unsigned int hitid=0; hitid<hits_not_in_patterns->size(); hitid++) {
-	MuonHoughHit * hit = hits_not_in_patterns->getHit(hitid);
-	if (hitThroughCut(hit, weightmdt)) {
-	  event_to_analyse->addHit(hit);
-	}
-      }
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_curved_at_a_cylinder:
-      for (unsigned int hitid=0; hitid<hits_not_in_patterns->size(); hitid++)
-	{
-	  MuonHoughHit * hit = hits_not_in_patterns->getHit(hitid);
-	  if (hitThroughCut(hit,weightmdt)) {
-	    if (hit->getMeasuresPhi()==0)
-	      {
-		if (m_use_csc_in_hough == true || (m_use_csc_in_hough == false && hit->getDetectorId()==MuonHough::CSC))
-		  {
-		    event_to_analyse->addHit(hit);
-		  }
-	      }
-	  }
-	}
-      break;
-    case MuonHough::hough_rz_rpc:
-      if (m_use_rpc_measures_eta == 1)
-	{
-	  for (unsigned int hitid=0; hitid<hits_not_in_patterns->size(); hitid++)
-	    {
-	      if (hits_not_in_patterns->getDetectorId(hitid)==MuonHough::RPC) {
-		MuonHoughHit * hit = hits_not_in_patterns->getHit(hitid);
-		if (hit->getMeasuresPhi()==0)
-		  {
-		    event_to_analyse->addHit(hit);
-		  }
-	      }
-	    }
-	}
-      else 
-	{
-	  for (unsigned int hitid=0; hitid<hits_not_in_patterns->size(); hitid++)
-	    {
-	      if (hits_not_in_patterns->getDetectorId(hitid)==MuonHough::RPC) {
-		MuonHoughHit * hit = hits_not_in_patterns->getHit(hitid);
-		event_to_analyse->addHit(hit);
-	      }
-	    }
-	}
-      break;
-    case MuonHough::hough_rz_mdt:
-      for (unsigned int hitid=0; hitid<hits_not_in_patterns->size(); hitid++)
-	{
-	  if (hits_not_in_patterns->getDetectorId(hitid)==MuonHough::MDT)
-	    {
-	      MuonHoughHit * hit = hits_not_in_patterns->getHit(hitid);
-	      if (hitThroughCut(hit, weightmdt)) {
-		event_to_analyse->addHit(hit);
-	      }
-	    }
-	}
-      break;
-    default: ATH_MSG_WARNING(" no valid id");
+MuonHoughHitContainer* MuonHoughPatternTool::whichEventHough(int id_number, const MuonHoughHitContainer* event, double weightmdt) const {
+    ATH_MSG_DEBUG("whichEventHough::size of event: " << event->size());
+    const MuonHoughHitContainer* hits_not_in_patterns = hitsNotInPattern(event, id_number);
+    ATH_MSG_DEBUG("whichEventHough::hitsNotInPattern: " << hits_not_in_patterns->size());
+    MuonHoughHitContainer* event_to_analyse = new MuonHoughHitContainer(false);
+
+    switch (id_number) {
+        case MuonHough::hough_xy:
+
+            for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); hitid++) {
+                MuonHoughHit* hit = hits_not_in_patterns->getHit(hitid);
+                if (hit->getMeasuresPhi() == 1) {
+                    if (hitThroughCut(hit, weightmdt)) {
+                        if (m_use_csc_in_hough == true || (m_use_csc_in_hough == false && hit->getDetectorId() == MuonHough::CSC)) {
+                            event_to_analyse->addHit(hit);
+                        }
+                    }
+                }
+            }
+            break;
+        case MuonHough::hough_yz:
+            for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); hitid++) {
+                MuonHoughHit* hit = hits_not_in_patterns->getHit(hitid);
+                if (hitThroughCut(hit, weightmdt)) { event_to_analyse->addHit(hit); }
+            }
+            break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_curved_at_a_cylinder:
+            for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); hitid++) {
+                MuonHoughHit* hit = hits_not_in_patterns->getHit(hitid);
+                if (hitThroughCut(hit, weightmdt)) {
+                    if (hit->getMeasuresPhi() == 0) {
+                        if (m_use_csc_in_hough == true || (m_use_csc_in_hough == false && hit->getDetectorId() == MuonHough::CSC)) {
+                            event_to_analyse->addHit(hit);
+                        }
+                    }
+                }
+            }
+            break;
+        case MuonHough::hough_rz_rpc:
+            if (m_use_rpc_measures_eta == 1) {
+                for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); hitid++) {
+                    if (hits_not_in_patterns->getDetectorId(hitid) == MuonHough::RPC) {
+                        MuonHoughHit* hit = hits_not_in_patterns->getHit(hitid);
+                        if (hit->getMeasuresPhi() == 0) { event_to_analyse->addHit(hit); }
+                    }
+                }
+            } else {
+                for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); hitid++) {
+                    if (hits_not_in_patterns->getDetectorId(hitid) == MuonHough::RPC) {
+                        MuonHoughHit* hit = hits_not_in_patterns->getHit(hitid);
+                        event_to_analyse->addHit(hit);
+                    }
+                }
+            }
+            break;
+        case MuonHough::hough_rz_mdt:
+            for (unsigned int hitid = 0; hitid < hits_not_in_patterns->size(); hitid++) {
+                if (hits_not_in_patterns->getDetectorId(hitid) == MuonHough::MDT) {
+                    MuonHoughHit* hit = hits_not_in_patterns->getHit(hitid);
+                    if (hitThroughCut(hit, weightmdt)) { event_to_analyse->addHit(hit); }
+                }
+            }
+            break;
+        default: ATH_MSG_WARNING(" no valid id");
     }
 
-  delete hits_not_in_patterns;
-  hits_not_in_patterns = nullptr;
+    delete hits_not_in_patterns;
+    hits_not_in_patterns = nullptr;
 
-  return event_to_analyse;
+    return event_to_analyse;
 }
 
-MuonHoughTransformSteering* MuonHoughPatternTool::whichHoughTransform(int id_number) const
-{
-  MuonHoughTransformer* houghtransformer=nullptr;
-
-  int nbins=0;
-  int nbins_angle=0;
-  double detectorsize_angle_xy= m_detectorsize_angle_xyz;  
-  double stepsize_per_angle_xy= m_stepsize_per_angle_xyz;
-  double detectorsize_curved = m_nbins_curved/2.;
-  double stepsize_xy = m_stepsize_xy;
-  // additional histograms for overlaps:
-  int number_of_histos_rz = 2*m_number_of_sectors_rz;
-
-  switch(id_number)
-    {
-    case MuonHough::hough_xy:
-      if (m_use_cosmics == true) {
-	stepsize_xy = m_stepsize_xy_cosmics;
-	stepsize_per_angle_xy = m_stepsize_per_angle_xy_cosmics;
-	detectorsize_angle_xy = (m_detectorsize_angle_xyz / 2.); // patterns not split for cosmics
-      }
-      nbins = static_cast<int> (2*m_detectorsize_xy/stepsize_xy);
-      nbins_angle = static_cast<int> (detectorsize_angle_xy / stepsize_per_angle_xy);
-      houghtransformer = new MuonHoughTransformer_xy(nbins,nbins_angle,m_detectorsize_xy,detectorsize_angle_xy,m_thresholdhisto_xyz,m_number_of_sectors_xyz);
-      break;
-
-    case MuonHough::hough_yz:
-      nbins = static_cast<int> (2*m_detectorsize_yz/m_stepsize_yz);
-      nbins_angle = static_cast<int> (m_detectorsize_angle_xyz / m_stepsize_per_angle_xyz);
-      houghtransformer = new MuonHoughTransformer_yz(nbins,nbins_angle,m_detectorsize_yz,m_detectorsize_angle_xyz,m_thresholdhisto_xyz,m_number_of_sectors_xyz);
-      break;
-
-    case MuonHough::hough_rz: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt:
-      nbins = static_cast<int> (2*m_detectorsize_rz/m_stepsize_rz);
-      nbins_angle = static_cast<int> (m_detectorsize_angle_rz/m_stepsize_per_angle_rz);
-      houghtransformer = new MuonHoughTransformer_rz(nbins,nbins_angle,m_detectorsize_rz,m_detectorsize_angle_rz,m_thresholdhisto_rz,m_number_of_sectors_rz);
-      break;
-
-    case MuonHough::hough_rzcosmics:
-      nbins = static_cast<int> (2*m_detectorsize_rz/m_stepsize_rz_cosmics);
-      nbins_angle = static_cast<int> (m_detectorsize_angle_rz/m_stepsize_per_angle_rz_cosmics);
-      houghtransformer = new MuonHoughTransformer_rzcosmics(nbins,nbins_angle,m_detectorsize_rz,m_detectorsize_angle_rz,m_thresholdhisto_rz,m_number_of_sectors_rz_cosmics);
-      break;
-      
-    case MuonHough::hough_curved_at_a_cylinder:
-      nbins = m_nbins_curved;
-      nbins_angle = static_cast<int> (m_detectorsize_angle_rz/(2*m_stepsize_per_angle_rz));
-      houghtransformer = new MuonHoughTransformer_CurvedAtACylinder(nbins,nbins_angle,detectorsize_curved,m_detectorsize_angle_rz,m_thresholdhisto_rz,number_of_histos_rz);
-      break;
-
-    default: ATH_MSG_WARNING("no valid id");    
+MuonHoughTransformSteering* MuonHoughPatternTool::whichHoughTransform(int id_number) const {
+    MuonHoughTransformer* houghtransformer = nullptr;
+
+    int nbins = 0;
+    int nbins_angle = 0;
+    double detectorsize_angle_xy = m_detectorsize_angle_xyz;
+    double stepsize_per_angle_xy = m_stepsize_per_angle_xyz;
+    double detectorsize_curved = m_nbins_curved / 2.;
+    double stepsize_xy = m_stepsize_xy;
+    // additional histograms for overlaps:
+    int number_of_histos_rz = 2 * m_number_of_sectors_rz;
+
+    switch (id_number) {
+        case MuonHough::hough_xy:
+            if (m_use_cosmics == true) {
+                stepsize_xy = m_stepsize_xy_cosmics;
+                stepsize_per_angle_xy = m_stepsize_per_angle_xy_cosmics;
+                detectorsize_angle_xy = (m_detectorsize_angle_xyz / 2.);  // patterns not split for cosmics
+            }
+            nbins = static_cast<int>(2 * m_detectorsize_xy / stepsize_xy);
+            nbins_angle = static_cast<int>(detectorsize_angle_xy / stepsize_per_angle_xy);
+            houghtransformer = new MuonHoughTransformer_xy(nbins, nbins_angle, m_detectorsize_xy, detectorsize_angle_xy,
+                                                           m_thresholdhisto_xyz, m_number_of_sectors_xyz);
+            break;
+
+        case MuonHough::hough_yz:
+            nbins = static_cast<int>(2 * m_detectorsize_yz / m_stepsize_yz);
+            nbins_angle = static_cast<int>(m_detectorsize_angle_xyz / m_stepsize_per_angle_xyz);
+            houghtransformer = new MuonHoughTransformer_yz(nbins, nbins_angle, m_detectorsize_yz, m_detectorsize_angle_xyz,
+                                                           m_thresholdhisto_xyz, m_number_of_sectors_xyz);
+            break;
+
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+            nbins = static_cast<int>(2 * m_detectorsize_rz / m_stepsize_rz);
+            nbins_angle = static_cast<int>(m_detectorsize_angle_rz / m_stepsize_per_angle_rz);
+            houghtransformer = new MuonHoughTransformer_rz(nbins, nbins_angle, m_detectorsize_rz, m_detectorsize_angle_rz,
+                                                           m_thresholdhisto_rz, m_number_of_sectors_rz);
+            break;
+
+        case MuonHough::hough_rzcosmics:
+            nbins = static_cast<int>(2 * m_detectorsize_rz / m_stepsize_rz_cosmics);
+            nbins_angle = static_cast<int>(m_detectorsize_angle_rz / m_stepsize_per_angle_rz_cosmics);
+            houghtransformer = new MuonHoughTransformer_rzcosmics(nbins, nbins_angle, m_detectorsize_rz, m_detectorsize_angle_rz,
+                                                                  m_thresholdhisto_rz, m_number_of_sectors_rz_cosmics);
+            break;
+
+        case MuonHough::hough_curved_at_a_cylinder:
+            nbins = m_nbins_curved;
+            nbins_angle = static_cast<int>(m_detectorsize_angle_rz / (2 * m_stepsize_per_angle_rz));
+            houghtransformer = new MuonHoughTransformer_CurvedAtACylinder(nbins, nbins_angle, detectorsize_curved, m_detectorsize_angle_rz,
+                                                                          m_thresholdhisto_rz, number_of_histos_rz);
+            break;
+
+        default: ATH_MSG_WARNING("no valid id");
     }
 
-  if(houghtransformer) {
-    houghtransformer->useNegativeWeights(m_use_negative_weights);
-    houghtransformer->setIP(!m_use_cosmics);
-  }
+    if (houghtransformer) {
+        houghtransformer->useNegativeWeights(m_use_negative_weights);
+        houghtransformer->setIP(!m_use_cosmics);
+    }
 
-  ATH_MSG_DEBUG("**** histo houghtransformer: ****");
-  ATH_MSG_DEBUG("Id number: " << id_number); 
-  ATH_MSG_DEBUG("NBins: " << nbins << " angle: " << nbins_angle);
-  if (m_use_negative_weights == true) ATH_MSG_DEBUG(" Negative weights are used ");
-  ATH_MSG_DEBUG("IP setting: " << !m_use_cosmics);
-  ATH_MSG_DEBUG("*********************************");
-  MuonHoughTransformSteering* houghtransform = new MuonHoughTransformSteering(houghtransformer);
+    ATH_MSG_DEBUG("**** histo houghtransformer: ****");
+    ATH_MSG_DEBUG("Id number: " << id_number);
+    ATH_MSG_DEBUG("NBins: " << nbins << " angle: " << nbins_angle);
+    if (m_use_negative_weights == true) ATH_MSG_DEBUG(" Negative weights are used ");
+    ATH_MSG_DEBUG("IP setting: " << !m_use_cosmics);
+    ATH_MSG_DEBUG("*********************************");
+    MuonHoughTransformSteering* houghtransform = new MuonHoughTransformSteering(houghtransformer);
 
-  return houghtransform;
+    return houghtransform;
 }
 
-std::vector <int> MuonHoughPatternTool::maxLevelHoughPattern(const MuonHoughPatternContainerShip &houghpattern)const   // obsolete?
+std::vector<int> MuonHoughPatternTool::maxLevelHoughPattern(const MuonHoughPatternContainerShip& houghpattern) const  // obsolete?
 {
-  std::vector <int> maxlevel_houghpattern(m_number_of_ids);
+    std::vector<int> maxlevel_houghpattern(m_number_of_ids);
 
-  for (int id_number=0; id_number < m_number_of_ids; id_number++)
-    {
-      maxlevel_houghpattern[id_number]=maxLevelHoughPattern(houghpattern,id_number);
-    } // number_of_ids
-  return maxlevel_houghpattern;
+    for (int id_number = 0; id_number < m_number_of_ids; id_number++) {
+        maxlevel_houghpattern[id_number] = maxLevelHoughPattern(houghpattern, id_number);
+    }  // number_of_ids
+    return maxlevel_houghpattern;
 }
 
-int MuonHoughPatternTool::maxLevelHoughPattern(const MuonHoughPatternContainerShip &houghpattern, int id_number)const  
-{
-  int maxlevel = houghpattern[id_number].size();
-  bool continu = true;
-  while(maxlevel>=1 && continu == 1)
-    {
-      unsigned int maximum_number=0;
-      
-      while (continu  && maximum_number < houghpattern[id_number][maxlevel-1].size()) //m_number_of_maxima)
-	{
-	      
-	  ATH_MSG_DEBUG("maximum_number: " << maximum_number << " " << "maxlevel_houghpattern: " << maxlevel << " id: " << id_number);
-	  if (!houghpattern[id_number][maxlevel-1][maximum_number]->empty())
-	    {continu=false;}
-
-	  maximum_number++;
-
-	} //number_of_maxima
- 
-      if (continu){maxlevel--;}
-    }// while
-  return maxlevel;
-} //maxLevelHoughPattern
-
-void MuonHoughPatternTool::transformCoordsMaximum(std::pair <double,double> &coordsmaximum,double r0_true)const
-{
-  double z_true = coordsmaximum.first;
-  double theta_true = coordsmaximum.second;
+int MuonHoughPatternTool::maxLevelHoughPattern(const MuonHoughPatternContainerShip& houghpattern, int id_number) const {
+    int maxlevel = houghpattern[id_number].size();
+    bool continu = true;
+    while (maxlevel >= 1 && continu == 1) {
+        unsigned int maximum_number = 0;
 
-  //  double theta_cor = - 0.042*(r0_true/4000.)*(r0_true/4000);
-  double theta_cor = m_theta_cor_constant*(r0_true/m_theta_cor_constant2)*(r0_true/m_theta_cor_constant2);
+        while (continu && maximum_number < houghpattern[id_number][maxlevel - 1].size())  // m_number_of_maxima)
+        {
+            ATH_MSG_DEBUG("maximum_number: " << maximum_number << " "
+                                             << "maxlevel_houghpattern: " << maxlevel << " id: " << id_number);
+            if (!houghpattern[id_number][maxlevel - 1][maximum_number]->empty()) { continu = false; }
 
-  //  double z_cor = - 10000 * (std::cos(theta_true) * r0_true/6000.) * (std::cos(theta_true)*r0_true/6000.);
-  double z_cor = m_z_cor_constant * (std::cos(theta_true) * r0_true/m_z_cor_constant2) * (std::cos(theta_true)*r0_true/m_z_cor_constant2);
+            maximum_number++;
 
-  double z_rec = z_true + z_cor;
-  double theta_rec = theta_true + theta_cor;
+        }  // number_of_maxima
 
-  if (std::cos(theta_true) < 0)
-    {
-      z_rec = z_true - z_cor;
-      theta_rec = theta_true - theta_cor;
+        if (continu) { maxlevel--; }
+    }  // while
+    return maxlevel;
+}  // maxLevelHoughPattern
+
+void MuonHoughPatternTool::transformCoordsMaximum(std::pair<double, double>& coordsmaximum, double r0_true) const {
+    double z_true = coordsmaximum.first;
+    double theta_true = coordsmaximum.second;
+
+    //  double theta_cor = - 0.042*(r0_true/4000.)*(r0_true/4000);
+    double theta_cor = m_theta_cor_constant * (r0_true / m_theta_cor_constant2) * (r0_true / m_theta_cor_constant2);
+
+    //  double z_cor = - 10000 * (std::cos(theta_true) * r0_true/6000.) * (std::cos(theta_true)*r0_true/6000.);
+    double z_cor =
+        m_z_cor_constant * (std::cos(theta_true) * r0_true / m_z_cor_constant2) * (std::cos(theta_true) * r0_true / m_z_cor_constant2);
+
+    double z_rec = z_true + z_cor;
+    double theta_rec = theta_true + theta_cor;
+
+    if (std::cos(theta_true) < 0) {
+        z_rec = z_true - z_cor;
+        theta_rec = theta_true - theta_cor;
     }
 
-  coordsmaximum.first = z_rec;
-  coordsmaximum.second = theta_rec;
-} // transformCoordsMaximum
+    coordsmaximum.first = z_rec;
+    coordsmaximum.second = theta_rec;
+}  // transformCoordsMaximum
 
-MuonPrdPatternCollection* MuonHoughPatternTool::getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const
-{
-  MuonPrdPatternCollection* phipatterncollection = new MuonPrdPatternCollection();
-  phipatterncollection->reserve(m_maximum_level * m_number_of_maxima);
+MuonPrdPatternCollection* MuonHoughPatternTool::getPhiMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const {
+    MuonPrdPatternCollection* phipatterncollection = new MuonPrdPatternCollection();
+    phipatterncollection->reserve(m_maximum_level * m_number_of_maxima);
 
-  MuonHoughPatternContainer &phipatterns = houghpatterns[MuonHough::hough_xy];
+    MuonHoughPatternContainer& phipatterns = houghpatterns[MuonHough::hough_xy];
 
+    // Bookkeeping for merged or double phi pattersn
 
-  // Bookkeeping for merged or double phi pattersn
-  
-  std::map<MuonHoughPattern*,int> mergedpatterns;
-  for (unsigned int i=0; i<phipatterns.size(); i++) {
-    for (unsigned int j=0; j<phipatterns[i].size(); j++) {
-      MuonHoughPattern* houghpattern = phipatterns[i][j];
-      if( !houghpattern ) continue; 
-      mergedpatterns[houghpattern] = 0;
+    std::map<MuonHoughPattern*, int> mergedpatterns;
+    for (unsigned int i = 0; i < phipatterns.size(); i++) {
+        for (unsigned int j = 0; j < phipatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern = phipatterns[i][j];
+            if (!houghpattern) continue;
+            mergedpatterns[houghpattern] = 0;
+        }
     }
-  }     
-
-  // Search for identical phi patterns and remove them
-  // and search for overlapping phi patterns and merge them for IP constraint (10-1-2008, does merging ever happen? JS)
-  
-  for (unsigned int i=0; i<phipatterns.size(); i++) {
-    for (unsigned int j=0; j<phipatterns[i].size(); j++) {
-      MuonHoughPattern* houghpattern1 = phipatterns[i][j];
-      if( !houghpattern1 ) continue; 
-      if (phipatterns[i][j]->size()<m_thresholdpattern_xyz) continue;
-      ATH_MSG_DEBUG(" patterns size before Merge " << phipatterns[i][j]->size());
-      for (unsigned int k=i; k<phipatterns.size(); k++) {
-	for (unsigned int l=0; l<phipatterns[k].size(); l++) {
-	  MuonHoughPattern* houghpattern2 = phipatterns[k][l];
-	  if( !houghpattern2 ) continue; 
-	  if (phipatterns[k][l]->size()<m_thresholdpattern_xyz) continue;
-	  if( houghpattern1 == houghpattern2 ) continue; 
-	  if( mergedpatterns[houghpattern1] == 1) continue ;
-	  if( mergedpatterns[houghpattern2] == 1) continue ;
-	  const double phi1 = houghpattern1->getEPhi();
-	  const double phi2 = houghpattern2->getEPhi();
-	  CxxUtils::sincos scphi1(phi1);
-	  CxxUtils::sincos scphi2(phi2);
-	  double dotprod = scphi1.cs*scphi2.cs+scphi1.sn*scphi2.sn;
-	  if( dotprod > 1. ) dotprod = 1.;
-	  else if( dotprod < -1. ) dotprod = -1.;
-	  double psi = std::acos(dotprod);
-	  const double the1 = houghpattern1->getETheta();
-	  const double the2 = houghpattern2->getETheta();
-	  CxxUtils::sincos scthe1(the1);
-	  CxxUtils::sincos scthe2(the2);
-	  dotprod = scthe1.cs*scthe2.cs+scthe1.sn*scthe2.sn;
-	  if( dotprod > 1. ) dotprod = 1.;
-	  else if( dotprod < -1. ) dotprod = -1.;
-	  double chi = std::acos(dotprod);
-	  ATH_MSG_DEBUG(" patterns phi1 " << phi1 << " phi2 " << phi2 << " psi " << psi );
-	  ATH_MSG_DEBUG(" patterns the1 " << the1 << " the2 " << the2 << " chi " << chi );
-	  if ( chi < 0.5 ||  psi < 0.5 ) {
-	    int overlap = overlapHoughPatterns(houghpattern1,houghpattern2); 
-	    ATH_MSG_DEBUG(" Phi Overlap " << overlap << " size1 "  << houghpattern1->size() << " size2 " << houghpattern2->size());
-	    int ns1 = houghpattern1->size();
-	    int ns2 = houghpattern2->size();
-	    if (overlap <= ns1 && overlap == ns2){
-	      ATH_MSG_DEBUG(" DROP patterns same hits " );
-	      mergedpatterns[houghpattern2] = 1;
-	      continue;
-	    }
-	    if (overlap == ns1 && overlap < ns2){
-	      ATH_MSG_DEBUG(" DROP patterns same hits " );
-	      mergedpatterns[houghpattern1] = 1;
-	      continue;
-	    }
-	    if ( m_use_ip) {
-	      // Merge and do cleaning  (IP constraint)
-	      Muon::MuonPrdPattern* muonpattern = nullptr;
-	      if ((overlap > 0.8*ns1 || overlap >0.8*ns2)&&  ns1 >= ns2){
-		muonpattern = houghPatternsToOnePhiPattern(phipatterns[i][j],phipatterns[k][l]);
-	      }
-	      if ((overlap > 0.8*ns1 || overlap >0.8*ns2)&&  ns1 < ns2){
-		// Merge and do cleaning  (IP constraint)
-		muonpattern = houghPatternsToOnePhiPattern(phipatterns[k][l],phipatterns[i][j]);
-	      }
-	      if (muonpattern) {
-		phipatterncollection->push_back(muonpattern);
-		mergedpatterns[houghpattern1] = 1;
-		mergedpatterns[houghpattern2] = 1;
-		continue;
-	      }
-	    } // use IP 
-	  } // angular cut 
-	}
-      } // end k 
-    }  
-  } // end i 
-
-  for (unsigned int i=0; i<phipatterns.size(); i++)
-    {
-      for (unsigned int j=0; j<phipatterns[i].size(); j++)
-	{
-	  MuonHoughPattern* houghpattern = phipatterns[i][j];
-	  if( houghpattern==nullptr ) {
-	    continue;
-	  }
-	  if( mergedpatterns[houghpattern] == 1) continue ;
-
-	  if (!phipatterns[i][j]->empty())
-	    {
-	      Muon::MuonPrdPattern* muonpattern=nullptr;
-
-	      if( !m_use_ip ) {muonpattern = houghPatternToPhiPattern(phipatterns[i][j]);}
-	      else {muonpattern= houghPatternToCleanPhiPattern(phipatterns[i][j]);}
-
-	      if (muonpattern!=nullptr) {phipatterncollection->push_back(muonpattern);
-
-		ATH_MSG_DEBUG(" Lift MuonPhiPattern size " << muonpattern->numberOfContainedPrds()); 
-		if(msgLvl(MSG::VERBOSE)) {printPattern(muonpattern);}
-	      }
-	    }
-	}
+
+    // Search for identical phi patterns and remove them
+    // and search for overlapping phi patterns and merge them for IP constraint (10-1-2008, does merging ever happen? JS)
+
+    for (unsigned int i = 0; i < phipatterns.size(); i++) {
+        for (unsigned int j = 0; j < phipatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern1 = phipatterns[i][j];
+            if (!houghpattern1) continue;
+            if (phipatterns[i][j]->size() < m_thresholdpattern_xyz) continue;
+            ATH_MSG_DEBUG(" patterns size before Merge " << phipatterns[i][j]->size());
+            for (unsigned int k = i; k < phipatterns.size(); k++) {
+                for (unsigned int l = 0; l < phipatterns[k].size(); l++) {
+                    MuonHoughPattern* houghpattern2 = phipatterns[k][l];
+                    if (!houghpattern2) continue;
+                    if (phipatterns[k][l]->size() < m_thresholdpattern_xyz) continue;
+                    if (houghpattern1 == houghpattern2) continue;
+                    if (mergedpatterns[houghpattern1] == 1) continue;
+                    if (mergedpatterns[houghpattern2] == 1) continue;
+                    const double phi1 = houghpattern1->getEPhi();
+                    const double phi2 = houghpattern2->getEPhi();
+                    CxxUtils::sincos scphi1(phi1);
+                    CxxUtils::sincos scphi2(phi2);
+                    double dotprod = scphi1.cs * scphi2.cs + scphi1.sn * scphi2.sn;
+                    if (dotprod > 1.)
+                        dotprod = 1.;
+                    else if (dotprod < -1.)
+                        dotprod = -1.;
+                    double psi = std::acos(dotprod);
+                    const double the1 = houghpattern1->getETheta();
+                    const double the2 = houghpattern2->getETheta();
+                    CxxUtils::sincos scthe1(the1);
+                    CxxUtils::sincos scthe2(the2);
+                    dotprod = scthe1.cs * scthe2.cs + scthe1.sn * scthe2.sn;
+                    if (dotprod > 1.)
+                        dotprod = 1.;
+                    else if (dotprod < -1.)
+                        dotprod = -1.;
+                    double chi = std::acos(dotprod);
+                    ATH_MSG_DEBUG(" patterns phi1 " << phi1 << " phi2 " << phi2 << " psi " << psi);
+                    ATH_MSG_DEBUG(" patterns the1 " << the1 << " the2 " << the2 << " chi " << chi);
+                    if (chi < 0.5 || psi < 0.5) {
+                        int overlap = overlapHoughPatterns(houghpattern1, houghpattern2);
+                        ATH_MSG_DEBUG(" Phi Overlap " << overlap << " size1 " << houghpattern1->size() << " size2 "
+                                                      << houghpattern2->size());
+                        int ns1 = houghpattern1->size();
+                        int ns2 = houghpattern2->size();
+                        if (overlap <= ns1 && overlap == ns2) {
+                            ATH_MSG_DEBUG(" DROP patterns same hits ");
+                            mergedpatterns[houghpattern2] = 1;
+                            continue;
+                        }
+                        if (overlap == ns1 && overlap < ns2) {
+                            ATH_MSG_DEBUG(" DROP patterns same hits ");
+                            mergedpatterns[houghpattern1] = 1;
+                            continue;
+                        }
+                        if (m_use_ip) {
+                            // Merge and do cleaning  (IP constraint)
+                            Muon::MuonPrdPattern* muonpattern = nullptr;
+                            if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 >= ns2) {
+                                muonpattern = houghPatternsToOnePhiPattern(phipatterns[i][j], phipatterns[k][l]);
+                            }
+                            if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 < ns2) {
+                                // Merge and do cleaning  (IP constraint)
+                                muonpattern = houghPatternsToOnePhiPattern(phipatterns[k][l], phipatterns[i][j]);
+                            }
+                            if (muonpattern) {
+                                phipatterncollection->push_back(muonpattern);
+                                mergedpatterns[houghpattern1] = 1;
+                                mergedpatterns[houghpattern2] = 1;
+                                continue;
+                            }
+                        }  // use IP
+                    }      // angular cut
+                }
+            }  // end k
+        }
+    }  // end i
+
+    for (unsigned int i = 0; i < phipatterns.size(); i++) {
+        for (unsigned int j = 0; j < phipatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern = phipatterns[i][j];
+            if (houghpattern == nullptr) { continue; }
+            if (mergedpatterns[houghpattern] == 1) continue;
+
+            if (!phipatterns[i][j]->empty()) {
+                Muon::MuonPrdPattern* muonpattern = nullptr;
+
+                if (!m_use_ip) {
+                    muonpattern = houghPatternToPhiPattern(phipatterns[i][j]);
+                } else {
+                    muonpattern = houghPatternToCleanPhiPattern(phipatterns[i][j]);
+                }
+
+                if (muonpattern != nullptr) {
+                    phipatterncollection->push_back(muonpattern);
+
+                    ATH_MSG_DEBUG(" Lift MuonPhiPattern size " << muonpattern->numberOfContainedPrds());
+                    if (msgLvl(MSG::VERBOSE)) { printPattern(muonpattern); }
+                }
+            }
+        }
     }
-   
-  return phipatterncollection;
+
+    return phipatterncollection;
 }
 
-MuonPrdPatternCollection* MuonHoughPatternTool::getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const
-{
-  MuonPrdPatternCollection* etapatterncollection = new MuonPrdPatternCollection();
-  
-  int maximum_number_of_patterns = m_maximum_level * m_number_of_maxima;
-  
-  if (m_use_curvedhough) maximum_number_of_patterns = 2 * maximum_number_of_patterns;
-  
-  etapatterncollection->reserve(maximum_number_of_patterns);
-  
-  int id = MuonHough::hough_rz;
-  if (m_use_cosmics == true) {
-    id = MuonHough::hough_rzcosmics;
-    ATH_MSG_DEBUG(" GetEtaMuonPatterns Use RZ curved hough patterns "); 
-  }
-  else if (m_use_curvedhough) {
-    id = MuonHough::hough_curved_at_a_cylinder;
-    ATH_MSG_DEBUG(" GetEtaMuonPatterns Use curved hough patterns "); 
-  } 
-  else { 
-    ATH_MSG_DEBUG(" GetEtaMuonPatterns Use RZ hough patterns "); 
-  } 
-  
-  MuonHoughPatternContainer &etapatterns = houghpatterns[id];
-  
-  // Bookkeeping for merged or double eta patterns
-  
-  std::map<MuonHoughPattern*,int> mergedpatterns;
-  for (unsigned int i=0; i<etapatterns.size(); i++) {
-    for (unsigned int j=0; j<etapatterns[i].size(); j++) {
-      MuonHoughPattern* houghpattern = etapatterns[i][j];
-      if( !houghpattern ) continue; 
-      mergedpatterns[houghpattern] = 0;
+MuonPrdPatternCollection* MuonHoughPatternTool::getEtaMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const {
+    MuonPrdPatternCollection* etapatterncollection = new MuonPrdPatternCollection();
+
+    int maximum_number_of_patterns = m_maximum_level * m_number_of_maxima;
+
+    if (m_use_curvedhough) maximum_number_of_patterns = 2 * maximum_number_of_patterns;
+
+    etapatterncollection->reserve(maximum_number_of_patterns);
+
+    int id = MuonHough::hough_rz;
+    if (m_use_cosmics == true) {
+        id = MuonHough::hough_rzcosmics;
+        ATH_MSG_DEBUG(" GetEtaMuonPatterns Use RZ curved hough patterns ");
+    } else if (m_use_curvedhough) {
+        id = MuonHough::hough_curved_at_a_cylinder;
+        ATH_MSG_DEBUG(" GetEtaMuonPatterns Use curved hough patterns ");
+    } else {
+        ATH_MSG_DEBUG(" GetEtaMuonPatterns Use RZ hough patterns ");
     }
-  }  
-  
-  // Search for identical eta patterns and remove them
-  // and search for overlapping eta patterns and merge them (10-1-2008, does merging ever happen? JS, yes it does!)
-  
-  for (unsigned int i=0; i<etapatterns.size(); i++) {
-    for (unsigned int j=0; j<etapatterns[i].size(); j++) {
-      MuonHoughPattern* houghpattern1 = etapatterns[i][j];
-      if( !houghpattern1 ) continue; 
-      if (etapatterns[i][j]->size()<m_thresholdpattern_rz) continue;
-      ATH_MSG_DEBUG(" Eta patterns size before Merge " << etapatterns[i][j]->size());
-      for (unsigned int k=i; k<etapatterns.size(); k++) {
-	for (unsigned int l=0; l<etapatterns[k].size(); l++) {
-	  MuonHoughPattern* houghpattern2 = etapatterns[k][l];
-	  if( !houghpattern2 ) continue; 
-	  if (etapatterns[k][l]->size()<m_thresholdpattern_rz) continue;
-	  if( houghpattern1 == houghpattern2 ) continue; 
-	  if( mergedpatterns[houghpattern1] == 1) continue ;
-	  if( mergedpatterns[houghpattern2] == 1) continue ;
-	  
-	  // calculate if curvatures are compatible, not done for cosmics
-	  double alpha = 0.;
-	  if (!m_use_cosmics) {
-	    double curv1 = houghpattern1->getECurvature();
-	    double curv2 = houghpattern2->getECurvature();
-	    if (std::abs(curv1) < 1001. || std::abs(curv2) < 1001.) {
-	      ATH_MSG_DEBUG("Curvature too small, should not be possible: " << curv1 << " " << curv2); 
-	      continue;
-	    }
-	    
-	    double angle1 = std::acos( (std::abs(curv1)-1000.) / curv1); // angle change after 1000 (mm) 
-	    double angle2 = std::acos( (std::abs(curv2)-1000.) / curv2);
-	    alpha = std::abs(std::sin(angle1 - angle2));
-	    
-	    ATH_MSG_DEBUG(" patterns curv1 " << curv1 << " curv2 " << curv2 << " alpha " << alpha );
-	  }
-	  
-	  double phi1 = houghpattern1->getEPhi();
-	  double phi2 = houghpattern2->getEPhi();
-	  double dotprod = std::cos(phi1)*std::cos(phi2)+std::sin(phi1)*std::sin(phi2);
-	  if( dotprod > 1. ) dotprod = 1.;
-	  else if( dotprod < -1. ) dotprod = -1.;
-	  double psi = std::acos(dotprod);
-	  double the1 = houghpattern1->getETheta();
-	  double the2 = houghpattern2->getETheta();
-	  dotprod = std::cos(the1)*std::cos(the2)+std::sin(the1)*std::sin(the2);
-	  if( dotprod > 1. ) dotprod = 1.;
-	  else if( dotprod < -1. ) dotprod = -1.;
-	  double chi = std::acos(dotprod);
-	  
-	  ATH_MSG_DEBUG(" patterns phi1 " << phi1 << " phi2 " << phi2 << " psi " << psi );
-	  ATH_MSG_DEBUG(" patterns the1 " << the1 << " the2 " << the2 << " chi " << chi );
-	  
-	  if ( chi < 0.5 && psi < 0.5 && alpha < 0.05) { // 0.05 (rad) corresponds with 3 degrees per m
-	    
-	    int overlap = overlapHoughPatterns(houghpattern1,houghpattern2); 
-	    ATH_MSG_DEBUG(" Eta Overlap " << overlap << " size1 "  << houghpattern1->size() << " size2 " << houghpattern2->size());
-	    int ns1 = houghpattern1->size();
-	    int ns2 = houghpattern2->size();
-	    
-	    if (overlap == ns2 && overlap <= ns1){
-	      ATH_MSG_DEBUG(" DROP patterns overlapping hits " );
-	      mergedpatterns[houghpattern2] = 1;
-	      continue;
-	    }
-	    if (overlap == ns1 && overlap < ns2){
-	      ATH_MSG_DEBUG(" DROP patterns overlapping hits " );
-	      mergedpatterns[houghpattern1] = 1;
-	      continue;
-	    }
-	    Muon::MuonPrdPattern* muonpattern = nullptr;
-	    // Look for 80% or more overlap
-	    if ( (overlap > 0.8*ns1 || overlap > 0.8*ns2) && ns1 >= ns2) {
-	      muonpattern = houghPatternsToOneEtaPattern(etapatterns[i][j],etapatterns[k][l]);
-	    } 
-	    if ( (overlap > 0.8*ns1 || overlap > 0.8*ns2) && ns1 < ns2) {
-	      muonpattern = houghPatternsToOneEtaPattern(etapatterns[k][l],etapatterns[i][j]);
-	    } 
-	    if (muonpattern) {
-	      etapatterncollection->push_back(muonpattern);
-	      mergedpatterns[houghpattern1] = 1;
-	      mergedpatterns[houghpattern2] = 1;
-	      continue;
-	    } 
-	  } // end angular cut
-	}
-      } // end k 
-    }  
-  } // end i 
-  
-  for (unsigned int i=0; i< etapatterns.size(); i++) {
-    for (unsigned int j=0; j<etapatterns[i].size(); j++) {
-      MuonHoughPattern* houghpattern = etapatterns[i][j];
-      if( !houghpattern ) {
-	//	    std::cout << " zero pointer to eta HoughPattern " << houghpattern << std::endl;
-	continue;
-      }	  
-      if( mergedpatterns[houghpattern] == 1) continue ;
-      
-      if (!etapatterns[i][j]->empty()) {
-	Muon::MuonPrdPattern* muonpattern= houghPatternToEtaPattern(etapatterns[i][j]);
-	etapatterncollection->push_back(muonpattern);
-
-	ATH_MSG_DEBUG(" Lift MuonEtaPattern size " << etapatterns[i][j]->size());
-	if (msgLvl(MSG::VERBOSE)) {printPattern(muonpattern);}
-      }
+
+    MuonHoughPatternContainer& etapatterns = houghpatterns[id];
+
+    // Bookkeeping for merged or double eta patterns
+
+    std::map<MuonHoughPattern*, int> mergedpatterns;
+    for (unsigned int i = 0; i < etapatterns.size(); i++) {
+        for (unsigned int j = 0; j < etapatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern = etapatterns[i][j];
+            if (!houghpattern) continue;
+            mergedpatterns[houghpattern] = 0;
+        }
     }
-  }
-  
-  return etapatterncollection;
-} 
 
-MuonPrdPatternCollection* MuonHoughPatternTool::getCurvedMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const
-{
-  MuonPrdPatternCollection* curvedpatterncollection = new MuonPrdPatternCollection();
-  
-  int maximum_number_of_patterns = m_maximum_level * m_number_of_maxima;
-  
-  curvedpatterncollection->reserve(maximum_number_of_patterns);
-
-  MuonHoughPatternContainer &curvedpatterns = houghpatterns[MuonHough::hough_curved_at_a_cylinder];
-  for (unsigned int i=0; i< curvedpatterns.size(); i++)
-    {
-      for (unsigned int j=0; j<curvedpatterns[i].size(); j++)
-	{
-	  MuonHoughPattern* houghpattern = curvedpatterns[i][j];
-	  if( !houghpattern ) {
-	    //	    std::cout << " zero pointer to curved HoughPattern " << houghpattern << std::endl;
-	    continue;
-	  }	  
-	  
-	  if (!curvedpatterns[i][j]->empty())
-	    {
-	      Muon::MuonPrdPattern* muonpattern= houghPatternToEtaPattern(curvedpatterns[i][j]);
-	      curvedpatterncollection->push_back(muonpattern);
-	      ATH_MSG_DEBUG(" Lift MuoncurvedPattern size " << curvedpatterns[i][j]->size());
-	    }
-	}
+    // Search for identical eta patterns and remove them
+    // and search for overlapping eta patterns and merge them (10-1-2008, does merging ever happen? JS, yes it does!)
+
+    for (unsigned int i = 0; i < etapatterns.size(); i++) {
+        for (unsigned int j = 0; j < etapatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern1 = etapatterns[i][j];
+            if (!houghpattern1) continue;
+            if (etapatterns[i][j]->size() < m_thresholdpattern_rz) continue;
+            ATH_MSG_DEBUG(" Eta patterns size before Merge " << etapatterns[i][j]->size());
+            for (unsigned int k = i; k < etapatterns.size(); k++) {
+                for (unsigned int l = 0; l < etapatterns[k].size(); l++) {
+                    MuonHoughPattern* houghpattern2 = etapatterns[k][l];
+                    if (!houghpattern2) continue;
+                    if (etapatterns[k][l]->size() < m_thresholdpattern_rz) continue;
+                    if (houghpattern1 == houghpattern2) continue;
+                    if (mergedpatterns[houghpattern1] == 1) continue;
+                    if (mergedpatterns[houghpattern2] == 1) continue;
+
+                    // calculate if curvatures are compatible, not done for cosmics
+                    double alpha = 0.;
+                    if (!m_use_cosmics) {
+                        double curv1 = houghpattern1->getECurvature();
+                        double curv2 = houghpattern2->getECurvature();
+                        if (std::abs(curv1) < 1001. || std::abs(curv2) < 1001.) {
+                            ATH_MSG_DEBUG("Curvature too small, should not be possible: " << curv1 << " " << curv2);
+                            continue;
+                        }
+
+                        double angle1 = std::acos((std::abs(curv1) - 1000.) / curv1);  // angle change after 1000 (mm)
+                        double angle2 = std::acos((std::abs(curv2) - 1000.) / curv2);
+                        alpha = std::abs(std::sin(angle1 - angle2));
+
+                        ATH_MSG_DEBUG(" patterns curv1 " << curv1 << " curv2 " << curv2 << " alpha " << alpha);
+                    }
+
+                    double phi1 = houghpattern1->getEPhi();
+                    double phi2 = houghpattern2->getEPhi();
+                    double dotprod = std::cos(phi1) * std::cos(phi2) + std::sin(phi1) * std::sin(phi2);
+                    if (dotprod > 1.)
+                        dotprod = 1.;
+                    else if (dotprod < -1.)
+                        dotprod = -1.;
+                    double psi = std::acos(dotprod);
+                    double the1 = houghpattern1->getETheta();
+                    double the2 = houghpattern2->getETheta();
+                    dotprod = std::cos(the1) * std::cos(the2) + std::sin(the1) * std::sin(the2);
+                    if (dotprod > 1.)
+                        dotprod = 1.;
+                    else if (dotprod < -1.)
+                        dotprod = -1.;
+                    double chi = std::acos(dotprod);
+
+                    ATH_MSG_DEBUG(" patterns phi1 " << phi1 << " phi2 " << phi2 << " psi " << psi);
+                    ATH_MSG_DEBUG(" patterns the1 " << the1 << " the2 " << the2 << " chi " << chi);
+
+                    if (chi < 0.5 && psi < 0.5 && alpha < 0.05) {  // 0.05 (rad) corresponds with 3 degrees per m
+
+                        int overlap = overlapHoughPatterns(houghpattern1, houghpattern2);
+                        ATH_MSG_DEBUG(" Eta Overlap " << overlap << " size1 " << houghpattern1->size() << " size2 "
+                                                      << houghpattern2->size());
+                        int ns1 = houghpattern1->size();
+                        int ns2 = houghpattern2->size();
+
+                        if (overlap == ns2 && overlap <= ns1) {
+                            ATH_MSG_DEBUG(" DROP patterns overlapping hits ");
+                            mergedpatterns[houghpattern2] = 1;
+                            continue;
+                        }
+                        if (overlap == ns1 && overlap < ns2) {
+                            ATH_MSG_DEBUG(" DROP patterns overlapping hits ");
+                            mergedpatterns[houghpattern1] = 1;
+                            continue;
+                        }
+                        Muon::MuonPrdPattern* muonpattern = nullptr;
+                        // Look for 80% or more overlap
+                        if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 >= ns2) {
+                            muonpattern = houghPatternsToOneEtaPattern(etapatterns[i][j], etapatterns[k][l]);
+                        }
+                        if ((overlap > 0.8 * ns1 || overlap > 0.8 * ns2) && ns1 < ns2) {
+                            muonpattern = houghPatternsToOneEtaPattern(etapatterns[k][l], etapatterns[i][j]);
+                        }
+                        if (muonpattern) {
+                            etapatterncollection->push_back(muonpattern);
+                            mergedpatterns[houghpattern1] = 1;
+                            mergedpatterns[houghpattern2] = 1;
+                            continue;
+                        }
+                    }  // end angular cut
+                }
+            }  // end k
+        }
+    }  // end i
+
+    for (unsigned int i = 0; i < etapatterns.size(); i++) {
+        for (unsigned int j = 0; j < etapatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern = etapatterns[i][j];
+            if (!houghpattern) {
+                //	    std::cout << " zero pointer to eta HoughPattern " << houghpattern << std::endl;
+                continue;
+            }
+            if (mergedpatterns[houghpattern] == 1) continue;
+
+            if (!etapatterns[i][j]->empty()) {
+                Muon::MuonPrdPattern* muonpattern = houghPatternToEtaPattern(etapatterns[i][j]);
+                etapatterncollection->push_back(muonpattern);
+
+                ATH_MSG_DEBUG(" Lift MuonEtaPattern size " << etapatterns[i][j]->size());
+                if (msgLvl(MSG::VERBOSE)) { printPattern(muonpattern); }
+            }
+        }
     }
-  return curvedpatterncollection;
+
+    return etapatterncollection;
 }
 
-Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternToEtaPattern(MuonHoughPattern *houghpattern)const
-{
-  ATH_MSG_VERBOSE("houghPatternToEtaPattern");
+MuonPrdPatternCollection* MuonHoughPatternTool::getCurvedMuonPatterns(MuonHoughPatternContainerShip& houghpatterns) const {
+    MuonPrdPatternCollection* curvedpatterncollection = new MuonPrdPatternCollection();
+
+    int maximum_number_of_patterns = m_maximum_level * m_number_of_maxima;
 
-  std::vector <double> position = houghpattern->getEPos();
-  std::vector <double> direction = houghpattern->getEDir();
+    curvedpatterncollection->reserve(maximum_number_of_patterns);
 
-  double curvature = houghpattern->getECurvature();
-  double charge = 1.;
-  if (curvature < 0) charge = -1;
-  double pscale = std::abs(curvature);
+    MuonHoughPatternContainer& curvedpatterns = houghpatterns[MuonHough::hough_curved_at_a_cylinder];
+    for (unsigned int i = 0; i < curvedpatterns.size(); i++) {
+        for (unsigned int j = 0; j < curvedpatterns[i].size(); j++) {
+            MuonHoughPattern* houghpattern = curvedpatterns[i][j];
+            if (!houghpattern) {
+                //	    std::cout << " zero pointer to curved HoughPattern " << houghpattern << std::endl;
+                continue;
+            }
 
-  double r0 = 0.001; 
+            if (!curvedpatterns[i][j]->empty()) {
+                Muon::MuonPrdPattern* muonpattern = houghPatternToEtaPattern(curvedpatterns[i][j]);
+                curvedpatterncollection->push_back(muonpattern);
+                ATH_MSG_DEBUG(" Lift MuoncurvedPattern size " << curvedpatterns[i][j]->size());
+            }
+        }
+    }
+    return curvedpatterncollection;
+}
 
-  if (m_use_cosmics) {r0=houghpattern->getERPhi();}
+Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternToEtaPattern(MuonHoughPattern* houghpattern) const {
+    ATH_MSG_VERBOSE("houghPatternToEtaPattern");
 
-  double x0 = charge*r0 *  std::sin(houghpattern->getEPhi()); 
-  double y0 = -charge*r0 * std::cos(houghpattern->getEPhi()); 
+    std::vector<double> position = houghpattern->getEPos();
+    std::vector<double> direction = houghpattern->getEDir();
 
-  const Amg::Vector3D pos = Amg::Vector3D(x0,y0,position[2]);
-  const Amg::Vector3D dir = Amg::Vector3D(pscale*direction[0],pscale*direction[1],pscale*direction[2]);
-  
-  ATH_MSG_DEBUG("position: " << x0  << " " << y0 << " " << position[2]);
-  ATH_MSG_DEBUG("direction: " << direction[0] << " " << direction[1] << " " << direction[2]);
-  
-  ATH_MSG_DEBUG(" Lift Eta Hough Pattern with charge " << charge << " Curvature " << pscale);
-  Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos,dir);
+    double curvature = houghpattern->getECurvature();
+    double charge = 1.;
+    if (curvature < 0) charge = -1;
+    double pscale = std::abs(curvature);
 
-  for (unsigned int i=0; i<houghpattern->size(); i++)
-    {
-      muonpattern->addPrd(houghpattern->getPrd(i));
-    }
+    double r0 = 0.001;
+
+    if (m_use_cosmics) { r0 = houghpattern->getERPhi(); }
+
+    double x0 = charge * r0 * std::sin(houghpattern->getEPhi());
+    double y0 = -charge * r0 * std::cos(houghpattern->getEPhi());
+
+    const Amg::Vector3D pos = Amg::Vector3D(x0, y0, position[2]);
+    const Amg::Vector3D dir = Amg::Vector3D(pscale * direction[0], pscale * direction[1], pscale * direction[2]);
 
-  return muonpattern;
+    ATH_MSG_DEBUG("position: " << x0 << " " << y0 << " " << position[2]);
+    ATH_MSG_DEBUG("direction: " << direction[0] << " " << direction[1] << " " << direction[2]);
+
+    ATH_MSG_DEBUG(" Lift Eta Hough Pattern with charge " << charge << " Curvature " << pscale);
+    Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos, dir);
+
+    for (unsigned int i = 0; i < houghpattern->size(); i++) { muonpattern->addPrd(houghpattern->getPrd(i)); }
+
+    return muonpattern;
 }
-Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternToPhiPattern(MuonHoughPattern *houghpattern)const
-{
-  ATH_MSG_VERBOSE("houghPatternToPhiPattern");
+Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternToPhiPattern(MuonHoughPattern* houghpattern) const {
+    ATH_MSG_VERBOSE("houghPatternToPhiPattern");
 
-  std::vector <double> position = houghpattern->getEPos();
-  std::vector <double> direction = houghpattern->getEDir();
+    std::vector<double> position = houghpattern->getEPos();
+    std::vector<double> direction = houghpattern->getEDir();
 
-  const Amg::Vector3D pos = Amg::Vector3D(position[0],position[1],position[2]);
-  const Amg::Vector3D dir = Amg::Vector3D(direction[0],direction[1],direction[2]);
+    const Amg::Vector3D pos = Amg::Vector3D(position[0], position[1], position[2]);
+    const Amg::Vector3D dir = Amg::Vector3D(direction[0], direction[1], direction[2]);
 
-  ATH_MSG_DEBUG("position: " << position[0] << " " << position[1] << " " << position[2]);
-  ATH_MSG_DEBUG("direction: " << direction[0] << " " << direction[1] << " " << direction[2]);
-  Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos,dir);
+    ATH_MSG_DEBUG("position: " << position[0] << " " << position[1] << " " << position[2]);
+    ATH_MSG_DEBUG("direction: " << direction[0] << " " << direction[1] << " " << direction[2]);
+    Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos, dir);
 
-  for (unsigned int i=0; i<houghpattern->size(); i++)
-    {
-      muonpattern->addPrd(houghpattern->getPrd(i));
+    for (unsigned int i = 0; i < houghpattern->size(); i++) {
+        muonpattern->addPrd(houghpattern->getPrd(i));
 
-      ATH_MSG_VERBOSE("PrepRawData Added " << houghpattern->getPrd(i));
-    } 
-  
-  return muonpattern;
+        ATH_MSG_VERBOSE("PrepRawData Added " << houghpattern->getPrd(i));
+    }
+
+    return muonpattern;
 }
 
-Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternsToOneEtaPattern(MuonHoughPattern *houghpattern1, MuonHoughPattern *houghpattern2)const
-{ 
-  ATH_MSG_DEBUG("houghPatternsToOneEtaPattern");
+Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternsToOneEtaPattern(MuonHoughPattern* houghpattern1,
+                                                                         MuonHoughPattern* houghpattern2) const {
+    ATH_MSG_DEBUG("houghPatternsToOneEtaPattern");
 
-  int ns1 = houghpattern1->size(); 
-  int ns2 = houghpattern2->size(); 
+    int ns1 = houghpattern1->size();
+    int ns2 = houghpattern2->size();
 
-  double the1 = houghpattern1->getETheta();
-  double the2 = houghpattern2->getETheta();
-  double theta = (ns1*the1 + ns2*the2)/(ns1+ns2);
+    double the1 = houghpattern1->getETheta();
+    double the2 = houghpattern2->getETheta();
+    double theta = (ns1 * the1 + ns2 * the2) / (ns1 + ns2);
 
-  double phi1 = houghpattern1->getEPhi();
-  double phi2 = houghpattern2->getEPhi();
-  double cos_phi = (ns1*std::cos(phi1)+ns2*std::cos(phi2))/(ns1+ns2);
-  double sin_phi = (ns1*std::sin(phi1)+ns2*std::sin(phi2))/(ns1+ns2);
-  double phi = std::atan2 (sin_phi,cos_phi);
+    double phi1 = houghpattern1->getEPhi();
+    double phi2 = houghpattern2->getEPhi();
+    double cos_phi = (ns1 * std::cos(phi1) + ns2 * std::cos(phi2)) / (ns1 + ns2);
+    double sin_phi = (ns1 * std::sin(phi1) + ns2 * std::sin(phi2)) / (ns1 + ns2);
+    double phi = std::atan2(sin_phi, cos_phi);
 
-  double invcur1 = 1./houghpattern1->getECurvature();
-  double invcur2 = 1./houghpattern2->getECurvature();
+    double invcur1 = 1. / houghpattern1->getECurvature();
+    double invcur2 = 1. / houghpattern2->getECurvature();
 
-  std::vector <double> position1 = houghpattern1->getEPos();
-  std::vector <double> position2 = houghpattern2->getEPos();
-  double z0 = (ns1*position1[2]+ns2*position2[2])/(ns1+ns2); 
+    std::vector<double> position1 = houghpattern1->getEPos();
+    std::vector<double> position2 = houghpattern2->getEPos();
+    double z0 = (ns1 * position1[2] + ns2 * position2[2]) / (ns1 + ns2);
 
-  double invcur = (ns1*invcur1+ns2*invcur2)/(ns1+ns2);
+    double invcur = (ns1 * invcur1 + ns2 * invcur2) / (ns1 + ns2);
 
-  ATH_MSG_DEBUG("Start Making one eta pattern theta " << theta << " phi " << phi  << " invcur " << invcur);
+    ATH_MSG_DEBUG("Start Making one eta pattern theta " << theta << " phi " << phi << " invcur " << invcur);
 
-  ATH_MSG_DEBUG("eta patterns theta1  " << the1  << " theta2 " << the2 << " phi1 " << phi1 << " phi2 " << phi2 << " invcur1 " << invcur1 << " invcur2 " << invcur2 << " ns1 " << ns1 << " ns2 " << ns2 );
+    ATH_MSG_DEBUG("eta patterns theta1  " << the1 << " theta2 " << the2 << " phi1 " << phi1 << " phi2 " << phi2 << " invcur1 " << invcur1
+                                          << " invcur2 " << invcur2 << " ns1 " << ns1 << " ns2 " << ns2);
 
-  ATH_MSG_DEBUG(" z values " << z0  << " z1 " << position1[2] << " z2 " << position2[2]); 
+    ATH_MSG_DEBUG(" z values " << z0 << " z1 " << position1[2] << " z2 " << position2[2]);
 
-  // require at least two eta hits on muon pattern
+    // require at least two eta hits on muon pattern
 
-  if ( ns1+ns2 < 2) return nullptr;
+    if (ns1 + ns2 < 2) return nullptr;
 
-  double invcurvature = invcur;
-  double charge = 1.;
-  if (invcurvature < 0) charge = -1;
-  double pscale = 1.;
-  if (invcurvature!=0) pscale = 1./std::abs(invcurvature);
+    double invcurvature = invcur;
+    double charge = 1.;
+    if (invcurvature < 0) charge = -1;
+    double pscale = 1.;
+    if (invcurvature != 0) pscale = 1. / std::abs(invcurvature);
 
-  double r0 = 0.001; 
+    double r0 = 0.001;
 
-  if (m_use_cosmics) { // calculate new r0
-    r0 = (ns1*houghpattern1->getERPhi() + ns2*houghpattern2->getERPhi()) / (ns1+ns2);
-    ATH_MSG_DEBUG("New r0: " << r0);
-  }
+    if (m_use_cosmics) {  // calculate new r0
+        r0 = (ns1 * houghpattern1->getERPhi() + ns2 * houghpattern2->getERPhi()) / (ns1 + ns2);
+        ATH_MSG_DEBUG("New r0: " << r0);
+    }
 
-  double x0 = charge*r0 *  sin_phi; 
-  double y0 = -charge*r0 * cos_phi; 
+    double x0 = charge * r0 * sin_phi;
+    double y0 = -charge * r0 * cos_phi;
 
-  ATH_MSG_DEBUG(" Lift one Eta pattern charge " << charge << " curvature  " << pscale);
+    ATH_MSG_DEBUG(" Lift one Eta pattern charge " << charge << " curvature  " << pscale);
 
-  const Amg::Vector3D pos = Amg::Vector3D(x0,y0,z0);
-  const Amg::Vector3D dir = Amg::Vector3D(pscale*sin(theta)*cos_phi,pscale*sin(theta)*sin_phi, pscale*cos(theta));
-  
-  Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos,dir);
-  int neta = 0;
+    const Amg::Vector3D pos = Amg::Vector3D(x0, y0, z0);
+    const Amg::Vector3D dir = Amg::Vector3D(pscale * sin(theta) * cos_phi, pscale * sin(theta) * sin_phi, pscale * cos(theta));
 
-  for (unsigned int i=0; i<houghpattern1->size(); i++)
-    {
-      double the = houghpattern1->getTheta(i);
-      muonpattern->addPrd(houghpattern1->getPrd(i));
-      neta++;
-      ATH_MSG_VERBOSE("PrepRawData Added theta " << the);
-    } 
+    Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos, dir);
+    int neta = 0;
 
-  for (unsigned int i=0; i<houghpattern2->size(); i++)
-    {
-      bool accept = true;
-      double the = houghpattern2->getTheta(i);
-      for (unsigned int j=0; j<houghpattern1->size(); j++) {
-	if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false; 
-      }
-      if ( accept ) { 
-	muonpattern->addPrd(houghpattern2->getPrd(i));
-	neta++;
-	ATH_MSG_VERBOSE("PrepRawData Added theta " << the);
-      } else {
-	ATH_MSG_VERBOSE(" PrepRawData already there " << the);
-      }
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        double the = houghpattern1->getTheta(i);
+        muonpattern->addPrd(houghpattern1->getPrd(i));
+        neta++;
+        ATH_MSG_VERBOSE("PrepRawData Added theta " << the);
     }
 
-  ATH_MSG_VERBOSE(" END make One Eta pattern hits " << neta);
+    for (unsigned int i = 0; i < houghpattern2->size(); i++) {
+        bool accept = true;
+        double the = houghpattern2->getTheta(i);
+        for (unsigned int j = 0; j < houghpattern1->size(); j++) {
+            if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false;
+        }
+        if (accept) {
+            muonpattern->addPrd(houghpattern2->getPrd(i));
+            neta++;
+            ATH_MSG_VERBOSE("PrepRawData Added theta " << the);
+        } else {
+            ATH_MSG_VERBOSE(" PrepRawData already there " << the);
+        }
+    }
+
+    ATH_MSG_VERBOSE(" END make One Eta pattern hits " << neta);
 
-  return muonpattern;
+    return muonpattern;
 }
 
-Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternsToOnePhiPattern(MuonHoughPattern *houghpattern1, MuonHoughPattern *houghpattern2)const
-{
-  /** IP constraint used, should not be used for cosmics! */
+Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternsToOnePhiPattern(MuonHoughPattern* houghpattern1,
+                                                                         MuonHoughPattern* houghpattern2) const {
+    /** IP constraint used, should not be used for cosmics! */
+
+    ATH_MSG_DEBUG("houghPatternsToOnePhiPattern");
+
+    double theta = (houghpattern1->getETheta() + houghpattern2->getETheta()) / 2.;
+    double cos_phi = 0.;
+    double sin_phi = 0.;
+    int nphi = 0;
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        double phi = houghpattern1->getPhi(i);
+        cos_phi += std::cos(phi);
+        sin_phi += std::sin(phi);
+        nphi++;
+    }
+    for (unsigned int i = 0; i < houghpattern2->size(); i++) {
+        double phi = houghpattern2->getPhi(i);
+        bool accept = true;
+        for (unsigned int j = 0; j < houghpattern1->size(); j++) {
+            if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false;
+        }
+        if (accept) {
+            cos_phi += std::cos(phi);
+            sin_phi += std::sin(phi);
+            nphi++;
+        }
+    }
 
-  ATH_MSG_DEBUG("houghPatternsToOnePhiPattern");
+    ATH_MSG_VERBOSE("Start Merged Phi hits cleaning with " << nphi << " hits ");
+    // require at least two phi hits on muon phi pattern
 
-  double theta = (houghpattern1->getETheta() + houghpattern2->getETheta())/2.;
-  double cos_phi = 0.;
-  double sin_phi = 0.;
-  int nphi = 0;
-  for (unsigned int i=0; i<houghpattern1->size(); i++)
-    {
-      double phi = houghpattern1->getPhi(i);
-      cos_phi += std::cos(phi);
-      sin_phi += std::sin(phi);
-      nphi++;
-    } 
-  for (unsigned int i=0; i<houghpattern2->size(); i++)
-    {
-      double phi = houghpattern2->getPhi(i);
-      bool accept = true;
-      for (unsigned int j=0; j<houghpattern1->size(); j++) {
-	if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false; 
-      }
-      if ( accept ) { 
-	cos_phi += std::cos(phi);
-	sin_phi += std::sin(phi);
-	nphi++;
-      } 
-    } 
-
-  ATH_MSG_VERBOSE("Start Merged Phi hits cleaning with " << nphi << " hits ");
-  // require at least two phi hits on muon phi pattern
-
-  if ( nphi <  2) return nullptr;
-
-  double cphit = cos_phi / nphi;
-  double sphit = sin_phi / nphi;
-  
-  cos_phi = 0.;
-  sin_phi = 0.;
-  nphi = 0;
-
-  for (unsigned int i=0; i<houghpattern1->size(); i++)
-    {
-      double phi = houghpattern1->getPhi(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.95) { 
-	cos_phi += std::cos(phi);
-	sin_phi += std::sin(phi);
-	nphi++;
-      }
-    }
+    if (nphi < 2) return nullptr;
 
-  for (unsigned int i=0; i<houghpattern2->size(); i++)
-    {
-      double phi = houghpattern2->getPhi(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.95) { 
-	bool accept = true;
-	for (unsigned int j=0; j<houghpattern1->size(); j++) {
-	  if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false; 
-	}
-	if ( accept ) { 
-	  cos_phi += std::cos(phi);
-	  sin_phi += std::sin(phi);
-	  nphi++;
-	} 
-      }
+    double cphit = cos_phi / nphi;
+    double sphit = sin_phi / nphi;
+
+    cos_phi = 0.;
+    sin_phi = 0.;
+    nphi = 0;
+
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        double phi = houghpattern1->getPhi(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.95) {
+            cos_phi += std::cos(phi);
+            sin_phi += std::sin(phi);
+            nphi++;
+        }
     }
 
-  if ( nphi <  2) return nullptr;
-  cphit = cos_phi / nphi;
-  sphit = sin_phi / nphi;
+    for (unsigned int i = 0; i < houghpattern2->size(); i++) {
+        double phi = houghpattern2->getPhi(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.95) {
+            bool accept = true;
+            for (unsigned int j = 0; j < houghpattern1->size(); j++) {
+                if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false;
+            }
+            if (accept) {
+                cos_phi += std::cos(phi);
+                sin_phi += std::sin(phi);
+                nphi++;
+            }
+        }
+    }
 
-  cos_phi = 0.;
-  sin_phi = 0.;
-  nphi = 0;
-  for (unsigned int i=0; i<houghpattern1->size(); i++)
-    {
-      double phi = houghpattern1->getPhi(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.99) { 
-	cos_phi += std::cos(phi);
-	sin_phi += std::sin(phi);
-	nphi++;
-      }
+    if (nphi < 2) return nullptr;
+    cphit = cos_phi / nphi;
+    sphit = sin_phi / nphi;
+
+    cos_phi = 0.;
+    sin_phi = 0.;
+    nphi = 0;
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        double phi = houghpattern1->getPhi(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.99) {
+            cos_phi += std::cos(phi);
+            sin_phi += std::sin(phi);
+            nphi++;
+        }
     }
-  for (unsigned int i=0; i<houghpattern2->size(); i++)
-    {
-      double phi = houghpattern2->getPhi(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.99) { 
-	bool accept = true;
-	for (unsigned int j=0; j<houghpattern1->size(); j++) {
-	  if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false; 
-	}
-	if ( accept ) { 
-	  cos_phi += std::cos(phi);
-	  sin_phi += std::sin(phi);
-	  nphi++;
-	} 
-      }
+    for (unsigned int i = 0; i < houghpattern2->size(); i++) {
+        double phi = houghpattern2->getPhi(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.99) {
+            bool accept = true;
+            for (unsigned int j = 0; j < houghpattern1->size(); j++) {
+                if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false;
+            }
+            if (accept) {
+                cos_phi += std::cos(phi);
+                sin_phi += std::sin(phi);
+                nphi++;
+            }
+        }
     }
-  if ( nphi <  2) return nullptr;
-  cphit = cos_phi / nphi;
-  sphit = sin_phi / nphi;
-
-  theta = 0; 
-  cos_phi = 0.;
-  sin_phi = 0.;
-  nphi = 0;
-  for (unsigned int i=0; i<houghpattern1->size(); i++)
-    {
-      double phi = houghpattern1->getPhi(i);
-      double thetah = houghpattern1->getTheta(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.995) { 
-	cos_phi += std::cos(phi);
-	sin_phi += std::sin(phi);
-	theta += thetah;  
-	nphi++;
-      }
+    if (nphi < 2) return nullptr;
+    cphit = cos_phi / nphi;
+    sphit = sin_phi / nphi;
+
+    theta = 0;
+    cos_phi = 0.;
+    sin_phi = 0.;
+    nphi = 0;
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        double phi = houghpattern1->getPhi(i);
+        double thetah = houghpattern1->getTheta(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.995) {
+            cos_phi += std::cos(phi);
+            sin_phi += std::sin(phi);
+            theta += thetah;
+            nphi++;
+        }
     }
-  for (unsigned int i=0; i<houghpattern2->size(); i++)
-    {
-      double phi = houghpattern2->getPhi(i);
-      double thetah = houghpattern2->getTheta(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.995) { 
-	bool accept = true;
-	for (unsigned int j=0; j<houghpattern1->size(); j++) {
-	  if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false; 
-	}
-	if ( accept ) { 
-	  cos_phi += std::cos(phi);
-	  sin_phi += std::sin(phi);
-	  theta += thetah;  
-	  nphi++;
-	} 
-      }
+    for (unsigned int i = 0; i < houghpattern2->size(); i++) {
+        double phi = houghpattern2->getPhi(i);
+        double thetah = houghpattern2->getTheta(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.995) {
+            bool accept = true;
+            for (unsigned int j = 0; j < houghpattern1->size(); j++) {
+                if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false;
+            }
+            if (accept) {
+                cos_phi += std::cos(phi);
+                sin_phi += std::sin(phi);
+                theta += thetah;
+                nphi++;
+            }
+        }
     }
-  if ( nphi <  2) return nullptr;
-  cphit = cos_phi / nphi;
-  sphit = sin_phi / nphi;
-  theta = theta / nphi;
-
-  double r0 = 1.; // put 1 mm r0 value
-  double x0 = r0 * sphit ; 
-  double y0 = -r0 * cphit ; 
-  double z0 = 0.;
- 
-  const Amg::Vector3D pos = Amg::Vector3D(x0,y0,z0); 
-  const Amg::Vector3D dir = Amg::Vector3D(sin(theta)*cphit,sin(theta)*sphit, cos(theta));
-  
-  Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos,dir);
-  nphi = 0;
-
-  for (unsigned int i=0; i<houghpattern1->size(); i++)
-    {
-      double phi = houghpattern1->getPhi(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.995) { 
-	muonpattern->addPrd(houghpattern1->getPrd(i));
-	nphi++;
-	ATH_MSG_VERBOSE("PrepRawData Merged Clean Phi Added " << phi);
-      } else {
-	ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
-      }
-    } 
-
-  for (unsigned int i=0; i<houghpattern2->size(); i++)
-    {
-      double phi = houghpattern2->getPhi(i);
-      double dotprod = cphit*std::cos(phi)+sphit*std::sin(phi);
-      if (dotprod > 0.995) { 
-	bool accept = true;
-	for (unsigned int j=0; j<houghpattern1->size(); j++) {
-	  if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false; 
-	}
-	if ( accept ) { 
-	  muonpattern->addPrd(houghpattern2->getPrd(i));
-	  nphi++;
-	  ATH_MSG_VERBOSE("PrepRawData Merged Clean Phi Added " << phi);
-	} else {
-	  ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
-	}
-      } else {
-	ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
-      }
+    if (nphi < 2) return nullptr;
+    cphit = cos_phi / nphi;
+    sphit = sin_phi / nphi;
+    theta = theta / nphi;
+
+    double r0 = 1.;  // put 1 mm r0 value
+    double x0 = r0 * sphit;
+    double y0 = -r0 * cphit;
+    double z0 = 0.;
+
+    const Amg::Vector3D pos = Amg::Vector3D(x0, y0, z0);
+    const Amg::Vector3D dir = Amg::Vector3D(sin(theta) * cphit, sin(theta) * sphit, cos(theta));
+
+    Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos, dir);
+    nphi = 0;
+
+    for (unsigned int i = 0; i < houghpattern1->size(); i++) {
+        double phi = houghpattern1->getPhi(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.995) {
+            muonpattern->addPrd(houghpattern1->getPrd(i));
+            nphi++;
+            ATH_MSG_VERBOSE("PrepRawData Merged Clean Phi Added " << phi);
+        } else {
+            ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
+        }
     }
 
-  ATH_MSG_VERBOSE("END Clean Merged Phi hits " << nphi);
+    for (unsigned int i = 0; i < houghpattern2->size(); i++) {
+        double phi = houghpattern2->getPhi(i);
+        double dotprod = cphit * std::cos(phi) + sphit * std::sin(phi);
+        if (dotprod > 0.995) {
+            bool accept = true;
+            for (unsigned int j = 0; j < houghpattern1->size(); j++) {
+                if (houghpattern2->getPrd(i) == houghpattern1->getPrd(j)) accept = false;
+            }
+            if (accept) {
+                muonpattern->addPrd(houghpattern2->getPrd(i));
+                nphi++;
+                ATH_MSG_VERBOSE("PrepRawData Merged Clean Phi Added " << phi);
+            } else {
+                ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
+            }
+        } else {
+            ATH_MSG_VERBOSE("PrepRawData Merged Phi Dropped " << phi);
+        }
+    }
+
+    ATH_MSG_VERBOSE("END Clean Merged Phi hits " << nphi);
 
-  return muonpattern;
+    return muonpattern;
 }
 
-Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternToCleanPhiPattern(MuonHoughPattern *houghpattern)const
-{
-  /** IP constraint used, should not be used for cosmics! */
-
-  // TODO: rewrite with removing hits from patterns, instead of building up
-
-  ATH_MSG_DEBUG("houghPatternToCleanPhiPattern");
-
-  for (unsigned int i=0; i<houghpattern->size(); i++) {
-    ATH_MSG_VERBOSE(houghpattern->getHit(i)->getHitx() << " " 
-		    << houghpattern->getHit(i)->getHity() << " " 
-		    << houghpattern->getHit(i)->getHitz() << " " 
-		    << houghpattern->getHit(i)->getPhi() << " " 
-		    << houghpattern->getHit(i)->getMeasuresPhi() << " " 
-		    << houghpattern->getHit(i)->getWhichDetector() <<  " "
-		    << houghpattern->getHit(i)->getWeight() <<  " "
-		    << houghpattern->getHit(i)->getAssociated());
-  }
-
-  double theta = houghpattern->getETheta();
-  unsigned int size = houghpattern->size();
-
-  ATH_MSG_DEBUG("Start Phi hits cleaning with " << size << " hits " << " theta " << theta);
-  ATH_MSG_DEBUG("Start Phi: " << houghpattern->getEPhi() << " r0: " << houghpattern->getERPhi());
-  houghpattern->updateParametersRPhi();
-  double phi = houghpattern->getEPhi();
-  double r0 = houghpattern->getERPhi();
-  unsigned int newsize = houghpattern->size();
-
-  ATH_MSG_VERBOSE("size: " << newsize << " r0: " << r0 << " phi: " << phi);
-
-  CxxUtils::sincos scphi(phi);
-
-  const int number_of_iterations = 4;
-  double cutvalues[number_of_iterations] = {1000.,500.,250.,125.};
-
-  bool first = true;
-  MuonHoughPattern* newpattern = houghpattern;
-  for (int it=0; it<number_of_iterations; it++) {
-    bool change = true;
-    while (change) {
-      ATH_MSG_VERBOSE("size: " << newsize << " r0: " << r0 << " phi: " << phi);
-
-      double max_dist = 0.;
-      unsigned int max_i =99999;
-      for (unsigned int i=0; i<newpattern->size(); i++)
-	{
-	  double dist = newpattern->getHitx(i) * scphi.sn - newpattern->getHity(i) * scphi.cs - r0;
-	  ATH_MSG_VERBOSE("Dist: " << dist);
-	  if (dist > max_dist) {max_dist=dist; max_i=i;}
-	}
-      if (max_dist < cutvalues[it]) {
-	change = false; }
-      else {
-	MuonHoughPattern* newpattern2 = new MuonHoughPattern(MuonHough::hough_xy);
-	for (unsigned int i=0; i<newpattern->size(); i++) {
-	  if (i!=max_i) {
-	    newpattern2->addHit(newpattern->getHit(i));
-	  }
-	}
-	newpattern2->updateParametersRPhi();
-	phi = newpattern2->getEPhi();
-	r0 = newpattern2->getERPhi();
-	newsize = newpattern2->size();
-	if (!first) delete newpattern;
-	else {first = false;}
-	newpattern = newpattern2;
-	scphi = CxxUtils::sincos(phi);
-      }
-    }
-  }
+Muon::MuonPrdPattern* MuonHoughPatternTool::houghPatternToCleanPhiPattern(MuonHoughPattern* houghpattern) const {
+    /** IP constraint used, should not be used for cosmics! */
 
-  ATH_MSG_DEBUG("Final size: " << newsize << " r0: " << r0 << " phi: " << phi);
+    // TODO: rewrite with removing hits from patterns, instead of building up
 
-  double thetanew=0.;
-  for (unsigned int i=0; i<newpattern->size(); i++) {
-    double thetah = newpattern->getTheta(i);
-    thetanew += thetah;
-  }
+    ATH_MSG_DEBUG("houghPatternToCleanPhiPattern");
 
-  thetanew = thetanew / (newpattern->size()+1e-7);
+    for (unsigned int i = 0; i < houghpattern->size(); i++) {
+        ATH_MSG_VERBOSE(houghpattern->getHit(i)->getHitx()
+                        << " " << houghpattern->getHit(i)->getHity() << " " << houghpattern->getHit(i)->getHitz() << " "
+                        << houghpattern->getHit(i)->getPhi() << " " << houghpattern->getHit(i)->getMeasuresPhi() << " "
+                        << houghpattern->getHit(i)->getWhichDetector() << " " << houghpattern->getHit(i)->getWeight() << " "
+                        << houghpattern->getHit(i)->getAssociated());
+    }
 
-  double r0_new = 1.; // put 1 mm r0 value
-  double x0_new = r0_new * scphi.sn; 
-  double y0_new = -r0_new * scphi.cs; 
-  double z0_new = 0.;
+    double theta = houghpattern->getETheta();
+    unsigned int size = houghpattern->size();
+
+    ATH_MSG_DEBUG("Start Phi hits cleaning with " << size << " hits "
+                                                  << " theta " << theta);
+    ATH_MSG_DEBUG("Start Phi: " << houghpattern->getEPhi() << " r0: " << houghpattern->getERPhi());
+    houghpattern->updateParametersRPhi();
+    double phi = houghpattern->getEPhi();
+    double r0 = houghpattern->getERPhi();
+    unsigned int newsize = houghpattern->size();
+
+    ATH_MSG_VERBOSE("size: " << newsize << " r0: " << r0 << " phi: " << phi);
+
+    CxxUtils::sincos scphi(phi);
+
+    const int number_of_iterations = 4;
+    double cutvalues[number_of_iterations] = {1000., 500., 250., 125.};
+
+    bool first = true;
+    MuonHoughPattern* newpattern = houghpattern;
+    for (int it = 0; it < number_of_iterations; it++) {
+        bool change = true;
+        while (change) {
+            ATH_MSG_VERBOSE("size: " << newsize << " r0: " << r0 << " phi: " << phi);
+
+            double max_dist = 0.;
+            unsigned int max_i = 99999;
+            for (unsigned int i = 0; i < newpattern->size(); i++) {
+                double dist = newpattern->getHitx(i) * scphi.sn - newpattern->getHity(i) * scphi.cs - r0;
+                ATH_MSG_VERBOSE("Dist: " << dist);
+                if (dist > max_dist) {
+                    max_dist = dist;
+                    max_i = i;
+                }
+            }
+            if (max_dist < cutvalues[it]) {
+                change = false;
+            } else {
+                MuonHoughPattern* newpattern2 = new MuonHoughPattern(MuonHough::hough_xy);
+                for (unsigned int i = 0; i < newpattern->size(); i++) {
+                    if (i != max_i) { newpattern2->addHit(newpattern->getHit(i)); }
+                }
+                newpattern2->updateParametersRPhi();
+                phi = newpattern2->getEPhi();
+                r0 = newpattern2->getERPhi();
+                newsize = newpattern2->size();
+                if (!first)
+                    delete newpattern;
+                else {
+                    first = false;
+                }
+                newpattern = newpattern2;
+                scphi = CxxUtils::sincos(phi);
+            }
+        }
+    }
 
-  CxxUtils::sincos sctheta(thetanew);
- 
-  const Amg::Vector3D pos = Amg::Vector3D(x0_new,y0_new,z0_new); 
-  const Amg::Vector3D dir = Amg::Vector3D(sctheta.sn*scphi.cs,sctheta.sn*scphi.sn, sctheta.cs);
-  
-  Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos,dir);
+    ATH_MSG_DEBUG("Final size: " << newsize << " r0: " << r0 << " phi: " << phi);
 
-  for (unsigned int i=0; i<newpattern->size(); i++)
-    {
-      muonpattern->addPrd(newpattern->getPrd(i));
+    double thetanew = 0.;
+    for (unsigned int i = 0; i < newpattern->size(); i++) {
+        double thetah = newpattern->getTheta(i);
+        thetanew += thetah;
     }
-  
-  ATH_MSG_DEBUG("END Clean Phi hits " << newsize << " theta " << thetanew);
-  
-  ATH_MSG_VERBOSE("cleaned pattern: ");
-  if (msgLvl(MSG::VERBOSE)) {
-    printPattern(muonpattern);
-  }
-
-  if (!first) delete newpattern;
-  
-  return muonpattern;
+
+    thetanew = thetanew / (newpattern->size() + 1e-7);
+
+    double r0_new = 1.;  // put 1 mm r0 value
+    double x0_new = r0_new * scphi.sn;
+    double y0_new = -r0_new * scphi.cs;
+    double z0_new = 0.;
+
+    CxxUtils::sincos sctheta(thetanew);
+
+    const Amg::Vector3D pos = Amg::Vector3D(x0_new, y0_new, z0_new);
+    const Amg::Vector3D dir = Amg::Vector3D(sctheta.sn * scphi.cs, sctheta.sn * scphi.sn, sctheta.cs);
+
+    Muon::MuonPrdPattern* muonpattern = new Muon::MuonPrdPattern(pos, dir);
+
+    for (unsigned int i = 0; i < newpattern->size(); i++) { muonpattern->addPrd(newpattern->getPrd(i)); }
+
+    ATH_MSG_DEBUG("END Clean Phi hits " << newsize << " theta " << thetanew);
+
+    ATH_MSG_VERBOSE("cleaned pattern: ");
+    if (msgLvl(MSG::VERBOSE)) { printPattern(muonpattern); }
+
+    if (!first) delete newpattern;
+
+    return muonpattern;
 }
 
-MuonHoughHitContainer* MuonHoughPatternTool::hitsNotInPattern(const MuonHoughHitContainer* event, int /*id_number*/ )
-{
-  MuonHoughHitContainer* hits_not_in_patterns = new MuonHoughHitContainer(false);
-  
-  for (unsigned int hitid=0; hitid<event->size(); hitid++) {
-    if (!event->getHit(hitid)->getAssociated()) {
-      hits_not_in_patterns->addHit(event->getHit(hitid));
+MuonHoughHitContainer* MuonHoughPatternTool::hitsNotInPattern(const MuonHoughHitContainer* event, int /*id_number*/) {
+    MuonHoughHitContainer* hits_not_in_patterns = new MuonHoughHitContainer(false);
+
+    for (unsigned int hitid = 0; hitid < event->size(); hitid++) {
+        if (!event->getHit(hitid)->getAssociated()) { hits_not_in_patterns->addHit(event->getHit(hitid)); }
     }
-  }
-  return hits_not_in_patterns;
+    return hits_not_in_patterns;
 }
-unsigned int MuonHoughPatternTool::getThresholdHoughPattern(int id_number)const
-{
-  unsigned int thresholdpattern = 0;
-  switch (id_number)
-    {
-    case MuonHough::hough_xy: case MuonHough::hough_yz: 
-      thresholdpattern = m_thresholdpattern_xyz;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      thresholdpattern = m_thresholdpattern_rz;
-      break;
-    default: ATH_MSG_WARNING("no valid id (id_number)");
-    } //switch
-  return thresholdpattern;
+unsigned int MuonHoughPatternTool::getThresholdHoughPattern(int id_number) const {
+    unsigned int thresholdpattern = 0;
+    switch (id_number) {
+        case MuonHough::hough_xy:
+        case MuonHough::hough_yz: thresholdpattern = m_thresholdpattern_xyz; break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder: thresholdpattern = m_thresholdpattern_rz; break;
+        default: ATH_MSG_WARNING("no valid id (id_number)");
+    }  // switch
+    return thresholdpattern;
 }
 
-double MuonHoughPatternTool::getThresholdHisto(int id_number)const
-{
-  double thresholdhisto = 0.;
-  switch (id_number)
-    {
-    case MuonHough::hough_xy: case MuonHough::hough_yz: 
-      thresholdhisto = m_thresholdhisto_xyz;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      thresholdhisto = m_thresholdhisto_rz;
-      break;
-    default: ATH_MSG_WARNING("no valid id (id_number)");
-    } //switch
-  return thresholdhisto;
+double MuonHoughPatternTool::getThresholdHisto(int id_number) const {
+    double thresholdhisto = 0.;
+    switch (id_number) {
+        case MuonHough::hough_xy:
+        case MuonHough::hough_yz: thresholdhisto = m_thresholdhisto_xyz; break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder: thresholdhisto = m_thresholdhisto_rz; break;
+        default: ATH_MSG_WARNING("no valid id (id_number)");
+    }  // switch
+    return thresholdhisto;
 }
 
-void MuonHoughPatternTool::setWeightMdtCutValue(const MuonHoughHitContainer* event, double& weightmdt) const
-{
-  if (m_use_cosmics == true) {
-    weightmdt = 0.;
-    return;
-  }
-  int mdthits = event->getMDThitno(); // slow function!
-  weightmdt = mdthits > 0 ? 1. - 5./std::sqrt(mdthits) : 0;
+void MuonHoughPatternTool::setWeightMdtCutValue(const MuonHoughHitContainer* event, double& weightmdt) const {
+    if (m_use_cosmics == true) {
+        weightmdt = 0.;
+        return;
+    }
+    int mdthits = event->getMDThitno();  // slow function!
+    weightmdt = mdthits > 0 ? 1. - 5. / std::sqrt(mdthits) : 0;
 }
 
-bool MuonHoughPatternTool::hitThroughCut(MuonHoughHit* hit, double weightmdt)const
-{
-  if (false == m_weightcutmdt || hit->getDetectorId()!=MuonHough::MDT || hit->getProbability() >= weightmdt) {
-    if (false == m_weightcut || hit->getProbability() >= m_weight) {
-      return true;
+bool MuonHoughPatternTool::hitThroughCut(MuonHoughHit* hit, double weightmdt) const {
+    if (false == m_weightcutmdt || hit->getDetectorId() != MuonHough::MDT || hit->getProbability() >= weightmdt) {
+        if (false == m_weightcut || hit->getProbability() >= m_weight) { return true; }
     }
-  }
-  return false;
+    return false;
 }
 
-void MuonHoughPatternTool::printPattern(Muon::MuonPrdPattern* muonpattern)const
-{
-  ATH_MSG_VERBOSE("Printout of Pattern: ");
-  for (unsigned int k=0; k<muonpattern->numberOfContainedPrds(); k++) {
-    const Trk::PrepRawData* prd = muonpattern->prd(k);
-    const Muon::MdtPrepData* mdtprd = dynamic_cast <const Muon::MdtPrepData*>(prd);
-    if (mdtprd) {
-      const Trk::Surface& surface = mdtprd->detectorElement()->surface(mdtprd->identify());
-      const Amg::Vector3D& gpos = surface.center();
-      ATH_MSG_VERBOSE("mdt " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
-    }
-    else if (!mdtprd){
-      const Muon::MuonCluster* muoncluster = dynamic_cast <const Muon::MuonCluster*>(prd);
-      if (muoncluster) {
-	const Amg::Vector3D& gpos = muoncluster->globalPosition();
-	ATH_MSG_VERBOSE("cluster " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
-      }
-      if(!muoncluster) {
-	ATH_MSG_DEBUG("no muon prd? ");
-      }
+void MuonHoughPatternTool::printPattern(Muon::MuonPrdPattern* muonpattern) const {
+    ATH_MSG_VERBOSE("Printout of Pattern: ");
+    for (unsigned int k = 0; k < muonpattern->numberOfContainedPrds(); k++) {
+        const Trk::PrepRawData* prd = muonpattern->prd(k);
+        const Muon::MdtPrepData* mdtprd = dynamic_cast<const Muon::MdtPrepData*>(prd);
+        if (mdtprd) {
+            const Trk::Surface& surface = mdtprd->detectorElement()->surface(mdtprd->identify());
+            const Amg::Vector3D& gpos = surface.center();
+            ATH_MSG_VERBOSE("mdt " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
+        } else if (!mdtprd) {
+            const Muon::MuonCluster* muoncluster = dynamic_cast<const Muon::MuonCluster*>(prd);
+            if (muoncluster) {
+                const Amg::Vector3D& gpos = muoncluster->globalPosition();
+                ATH_MSG_VERBOSE("cluster " << k << " x: " << gpos.x() << " y: " << gpos.y() << " z: " << gpos.z());
+            }
+            if (!muoncluster) { ATH_MSG_DEBUG("no muon prd? "); }
+        }
     }
-  }
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.cxx
index 09240564a70eb61b33ad41d82807dc11d55245ce..f993269780ec85f1e2eac16184a695ef8c08ebae 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.cxx
@@ -3,82 +3,72 @@
 */
 
 #include "MuonLayerHoughAlg.h"
-#include "MuonPrepRawData/MuonPrepDataContainer.h"
+
 #include "MuonPrepRawData/CscPrepDataCollection.h"
+#include "MuonPrepRawData/MMPrepDataCollection.h"
 #include "MuonPrepRawData/MdtPrepDataCollection.h"
+#include "MuonPrepRawData/MuonPrepDataContainer.h"
 #include "MuonPrepRawData/RpcPrepDataCollection.h"
 #include "MuonPrepRawData/TgcPrepDataCollection.h"
 #include "MuonPrepRawData/sTgcPrepDataCollection.h"
-#include "MuonPrepRawData/MMPrepDataCollection.h"
 
-MuonLayerHoughAlg::MuonLayerHoughAlg(const std::string& name, ISvcLocator* pSvcLocator):
-  AthReentrantAlgorithm(name,pSvcLocator)
-{
-}
+MuonLayerHoughAlg::MuonLayerHoughAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {}
 
-StatusCode MuonLayerHoughAlg::initialize()
-{
-  if (m_layerTool.empty()) {
-    ATH_MSG_ERROR("MuonLayerScanTool property is empty");
-    return StatusCode::FAILURE;
-  }
-  ATH_CHECK( m_layerTool.retrieve() );
-  ATH_CHECK( m_printer.retrieve() );
-  ATH_CHECK( m_keyRpc.initialize() );
-  ATH_CHECK( m_keyMdt.initialize() );
-  ATH_CHECK( m_keyTgc.initialize() );
-  if (!m_keyCsc.empty()) ATH_CHECK( m_keyCsc.initialize() );
-  if (!m_keysTgc.empty()) ATH_CHECK( m_keysTgc.initialize());
-  if (!m_keyMM.empty()) ATH_CHECK( m_keyMM.initialize()  );
-  ATH_CHECK( m_combis.initialize() );
-  ATH_CHECK( m_houghDataPerSectorVecKey.initialize() );
+StatusCode MuonLayerHoughAlg::initialize() {
+    if (m_layerTool.empty()) {
+        ATH_MSG_ERROR("MuonLayerScanTool property is empty");
+        return StatusCode::FAILURE;
+    }
+    ATH_CHECK(m_layerTool.retrieve());
+    ATH_CHECK(m_printer.retrieve());
+    ATH_CHECK(m_keyRpc.initialize());
+    ATH_CHECK(m_keyMdt.initialize());
+    ATH_CHECK(m_keyTgc.initialize());
+    if (!m_keyCsc.empty()) ATH_CHECK(m_keyCsc.initialize());
+    if (!m_keysTgc.empty()) ATH_CHECK(m_keysTgc.initialize());
+    if (!m_keyMM.empty()) ATH_CHECK(m_keyMM.initialize());
+    ATH_CHECK(m_combis.initialize());
+    ATH_CHECK(m_houghDataPerSectorVecKey.initialize());
 
-  return StatusCode::SUCCESS; 
+    return StatusCode::SUCCESS;
 }
 
-StatusCode MuonLayerHoughAlg::execute(const EventContext& ctx) const
-{
-  const Muon::RpcPrepDataContainer* rpcPrds = GetObject(m_keyRpc, ctx);
-  const Muon::MdtPrepDataContainer* mdtPrds = GetObject(m_keyMdt, ctx);
-  const Muon::TgcPrepDataContainer* tgcPrds = GetObject(m_keyTgc, ctx);
-  const Muon::CscPrepDataContainer* cscPrds = m_keyCsc.empty() ? nullptr : GetObject(m_keyCsc, ctx);      
-  const Muon::sTgcPrepDataContainer* stgcPrds = m_keysTgc.empty() ? nullptr : GetObject(m_keysTgc, ctx);
-  const Muon::MMPrepDataContainer* mmPrds = m_keyMM.empty() ? nullptr : GetObject(m_keyMM, ctx);
-  ATH_MSG_VERBOSE("calling layer tool ");
-  auto [combis, houghDataPerSectorVec] = m_layerTool->analyse(mdtPrds,cscPrds,tgcPrds,rpcPrds,stgcPrds,mmPrds, ctx);
-  SG::WriteHandle<MuonPatternCombinationCollection> Handle(m_combis, ctx);
-  if( combis ){
-    if (Handle.record(std::move(combis)).isFailure()) {
-      ATH_MSG_WARNING("Failed to record MuonPatternCombinationCollection at MuonLayerHoughCombis");
-    }else{
-      ATH_MSG_DEBUG("Recorded MuonPatternCombinationCollection at MuonLayerHoughCombis: size " << Handle->size());
-      if( m_printSummary || msgLvl(MSG::DEBUG) ){
-        ATH_MSG_DEBUG("Number of MuonPatternCombinations  " << Handle->size() << std::endl << m_printer->print(*Handle));
-      }
+StatusCode MuonLayerHoughAlg::execute(const EventContext& ctx) const {
+    const Muon::RpcPrepDataContainer* rpcPrds = GetObject(m_keyRpc, ctx);
+    const Muon::MdtPrepDataContainer* mdtPrds = GetObject(m_keyMdt, ctx);
+    const Muon::TgcPrepDataContainer* tgcPrds = GetObject(m_keyTgc, ctx);
+    const Muon::CscPrepDataContainer* cscPrds = m_keyCsc.empty() ? nullptr : GetObject(m_keyCsc, ctx);
+    const Muon::sTgcPrepDataContainer* stgcPrds = m_keysTgc.empty() ? nullptr : GetObject(m_keysTgc, ctx);
+    const Muon::MMPrepDataContainer* mmPrds = m_keyMM.empty() ? nullptr : GetObject(m_keyMM, ctx);
+    ATH_MSG_VERBOSE("calling layer tool ");
+    auto [combis, houghDataPerSectorVec] = m_layerTool->analyse(mdtPrds, cscPrds, tgcPrds, rpcPrds, stgcPrds, mmPrds, ctx);
+    SG::WriteHandle<MuonPatternCombinationCollection> Handle(m_combis, ctx);
+    if (combis) {
+        if (Handle.record(std::move(combis)).isFailure()) {
+            ATH_MSG_WARNING("Failed to record MuonPatternCombinationCollection at MuonLayerHoughCombis");
+        } else {
+            ATH_MSG_DEBUG("Recorded MuonPatternCombinationCollection at MuonLayerHoughCombis: size " << Handle->size());
+            if (m_printSummary || msgLvl(MSG::DEBUG)) {
+                ATH_MSG_DEBUG("Number of MuonPatternCombinations  " << Handle->size() << std::endl << m_printer->print(*Handle));
+            }
+        }
+    } else {
+        ATH_MSG_VERBOSE("CombinationCollection " << m_combis << " is empty, recording");
+        ATH_CHECK(Handle.record(std::make_unique<MuonPatternCombinationCollection>()));
     }
-  }
-  else{
-    ATH_MSG_VERBOSE("CombinationCollection "<<m_combis<<" is empty, recording");
-    ATH_CHECK(Handle.record(std::make_unique<MuonPatternCombinationCollection>()));
-  }
-
-  // write hough data to SG
-  SG::WriteHandle<Muon::MuonLayerHoughTool::HoughDataPerSectorVec> handle {m_houghDataPerSectorVecKey, ctx};
-  if (houghDataPerSectorVec) {
-    ATH_CHECK(handle.record(std::move(houghDataPerSectorVec)));
-  }
-  else{
-    ATH_MSG_VERBOSE("HoughDataPerSectorVec "<<m_houghDataPerSectorVecKey<<" is empty, recording");
-    ATH_CHECK(handle.record(std::make_unique<Muon::MuonLayerHoughTool::HoughDataPerSectorVec>()));
-  }
 
-  m_layerTool->reset();
+    // write hough data to SG
+    SG::WriteHandle<Muon::MuonLayerHoughTool::HoughDataPerSectorVec> handle{m_houghDataPerSectorVecKey, ctx};
+    if (houghDataPerSectorVec) {
+        ATH_CHECK(handle.record(std::move(houghDataPerSectorVec)));
+    } else {
+        ATH_MSG_VERBOSE("HoughDataPerSectorVec " << m_houghDataPerSectorVecKey << " is empty, recording");
+        ATH_CHECK(handle.record(std::make_unique<Muon::MuonLayerHoughTool::HoughDataPerSectorVec>()));
+    }
 
-  return StatusCode::SUCCESS;
-} // execute
+    m_layerTool->reset();
 
-StatusCode MuonLayerHoughAlg::finalize()
-{
-  return StatusCode::SUCCESS;
-}
+    return StatusCode::SUCCESS;
+}  // execute
 
+StatusCode MuonLayerHoughAlg::finalize() { return StatusCode::SUCCESS; }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.h b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.h
index d3a0fcf3222af006f1634fd45e1d4d727b229b6c..0ed51cdbdc5421ad55c5a86a2bcd81b51a74df0c 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughAlg.h
@@ -10,45 +10,41 @@
 #include "MuonHoughPatternTools/MuonLayerHoughTool.h"
 #include "MuonRecHelperTools/MuonEDMPrinterTool.h"
 
-class MuonLayerHoughAlg : public AthReentrantAlgorithm
-{
- public:
-  MuonLayerHoughAlg(const std::string& name, ISvcLocator* pSvcLocator);
-
-  virtual ~MuonLayerHoughAlg() = default;
-
-  virtual StatusCode initialize() override;
-  virtual StatusCode execute(const EventContext& ctx) const override;
-  virtual StatusCode finalize() override;
-
- private:
-  template<class T> 
-    const T* GetObject(const SG::ReadHandleKey<T> &key, const EventContext& ctx) const;
-
-  SG::ReadHandleKey<Muon::TgcPrepDataContainer>   m_keyTgc{this,"TgcPrepDataContainer","TGC_Measurements"};
-  SG::ReadHandleKey<Muon::RpcPrepDataContainer>   m_keyRpc{this,"RpcPrepDataContainer","RPC_Measurements"};
-  SG::ReadHandleKey<Muon::CscPrepDataContainer>   m_keyCsc{this,"CscPrepDataContainer","CSC_Clusters"};
-  SG::ReadHandleKey<Muon::MdtPrepDataContainer>   m_keyMdt{this,"MdtPrepDataContainer","MDT_DriftCircles"};
-  SG::ReadHandleKey<Muon::sTgcPrepDataContainer>  m_keysTgc{this,"sTgcPrepDataContainer","STGC_Measurements"};
-  SG::ReadHandleKey<Muon::MMPrepDataContainer>    m_keyMM{this,"MMPrepDataContainer","MM_Measurements"};
-
-  SG::WriteHandleKey<MuonPatternCombinationCollection> m_combis{this,"MuonPatternCombinationCollection","MuonLayerHoughCombis"};
-  SG::WriteHandleKey<Muon::MuonLayerHoughTool::HoughDataPerSectorVec> m_houghDataPerSectorVecKey {this, 
-    "Key_MuonLayerHoughToolHoughDataPerSectorVec", "HoughDataPerSectorVec", "HoughDataPerSectorVec key"};
-  ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this,"printerTool","Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
-  ToolHandle<Muon::MuonLayerHoughTool> m_layerTool{this,"MuonLayerScanTool","Muon::MuonLayerHoughTool/MuonLayerHoughTool"};
-  Gaudi::Property<bool> m_printSummary{this,"PrintSummary",false};
+class MuonLayerHoughAlg : public AthReentrantAlgorithm {
+public:
+    MuonLayerHoughAlg(const std::string& name, ISvcLocator* pSvcLocator);
+
+    virtual ~MuonLayerHoughAlg() = default;
+
+    virtual StatusCode initialize() override;
+    virtual StatusCode execute(const EventContext& ctx) const override;
+    virtual StatusCode finalize() override;
+
+private:
+    template <class T> const T* GetObject(const SG::ReadHandleKey<T>& key, const EventContext& ctx) const;
+
+    SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_keyTgc{this, "TgcPrepDataContainer", "TGC_Measurements"};
+    SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_keyRpc{this, "RpcPrepDataContainer", "RPC_Measurements"};
+    SG::ReadHandleKey<Muon::CscPrepDataContainer> m_keyCsc{this, "CscPrepDataContainer", "CSC_Clusters"};
+    SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_keyMdt{this, "MdtPrepDataContainer", "MDT_DriftCircles"};
+    SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_keysTgc{this, "sTgcPrepDataContainer", "STGC_Measurements"};
+    SG::ReadHandleKey<Muon::MMPrepDataContainer> m_keyMM{this, "MMPrepDataContainer", "MM_Measurements"};
+
+    SG::WriteHandleKey<MuonPatternCombinationCollection> m_combis{this, "MuonPatternCombinationCollection", "MuonLayerHoughCombis"};
+    SG::WriteHandleKey<Muon::MuonLayerHoughTool::HoughDataPerSectorVec> m_houghDataPerSectorVecKey{
+        this, "Key_MuonLayerHoughToolHoughDataPerSectorVec", "HoughDataPerSectorVec", "HoughDataPerSectorVec key"};
+    ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
+    ToolHandle<Muon::MuonLayerHoughTool> m_layerTool{this, "MuonLayerScanTool", "Muon::MuonLayerHoughTool/MuonLayerHoughTool"};
+    Gaudi::Property<bool> m_printSummary{this, "PrintSummary", false};
 };
 
-
-template<class T>
-const T* MuonLayerHoughAlg::GetObject(const SG::ReadHandleKey<T> &key, const EventContext& ctx) const{
-  SG::ReadHandle<T> handle( key, ctx);
-  if( handle.isPresent() && !handle.isValid()) {
-    ATH_MSG_WARNING("MuonLayerHoughAlg Cannot retrieve " << handle.key() );
-    return nullptr;
-  }
-  return handle.cptr();
+template <class T> const T* MuonLayerHoughAlg::GetObject(const SG::ReadHandleKey<T>& key, const EventContext& ctx) const {
+    SG::ReadHandle<T> handle(key, ctx);
+    if (handle.isPresent() && !handle.isValid()) {
+        ATH_MSG_WARNING("MuonLayerHoughAlg Cannot retrieve " << handle.key());
+        return nullptr;
+    }
+    return handle.cptr();
 }
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
index 0a0b572deba23d9c18311bd510fe6cda45d9bfa8..e4e99a433aed9b48f09dd16364939be6f661a384 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx
@@ -3,319 +3,344 @@
 */
 
 #include "MuonHoughPatternTools/MuonLayerHoughTool.h"
-#include "MuonReadoutGeometry/MuonDetectorManager.h"
-#include "MuonReadoutGeometry/sTgcReadoutElement.h"
+
+#include "AtlasHepMC/GenEvent.h"
+#include "CxxUtils/sincos.h"
+#include "GaudiKernel/ConcurrencyFlags.h"
+#include "MuonPattern/MuonPatternChamberIntersect.h"
+#include "MuonPattern/MuonPatternCombination.h"
 #include "MuonReadoutGeometry/MuonChannelDesign.h"
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonReadoutGeometry/MuonPadDesign.h"
-#include "MuonPattern/MuonPatternCombination.h"
-#include "MuonPattern/MuonPatternChamberIntersect.h"
+#include "MuonReadoutGeometry/sTgcReadoutElement.h"
 #include "TFile.h"
-#include "TTree.h"
 #include "TMath.h"
-#include "AtlasHepMC/GenEvent.h"
-#include "GaudiKernel/ConcurrencyFlags.h"
-#include "CxxUtils/sincos.h"
+#include "TTree.h"
+#include "xAODMuon/MuonSegmentContainer.h"
 #include "xAODTruth/TruthParticle.h"
 #include "xAODTruth/TruthParticleContainer.h"
-#include "xAODMuon/MuonSegmentContainer.h"
 namespace Muon {
 
-  MuonLayerHoughTool::MuonLayerHoughTool(const std::string& type, const std::string& name, const IInterface* parent):
-    AthAlgTool(type,name,parent),
-    m_ntechnologies(UINT_MAX), // gets set inside initialize()
-    m_techToTruthNameIdx()
-  {
-    declareInterface<MuonLayerHoughTool>(this);
-    declareInterface<IMuonHoughPatternFinderTool>(this);
-  }
-
-  StatusCode MuonLayerHoughTool::initialize() {
-
-    ATH_CHECK( m_idHelperSvc.retrieve() );
-    m_ntechnologies = m_idHelperSvc->mdtIdHelper().technologyNameIndexMax()+1;
-    ATH_CHECK( m_printer.retrieve() );
-    const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
-    ATH_CHECK( detStore()->retrieve( muDetMgr ) );
-
-    if( m_doNtuple ){
-      if (Gaudi::Concurrency::ConcurrencyFlags::concurrent() && Gaudi::Concurrency::ConcurrencyFlags::numThreads()>1) {
-        // Disabled for >1 threads due to thread-safety concerns, but we want to keep it as a debug tool
-        ATH_MSG_DEBUG("HitNtuple disabled because of concurrency");
-	m_file = nullptr;
-	m_tree = nullptr;
-	m_ntuple = nullptr;
-      } else {
-        TDirectory* cdir = gDirectory;
-        m_file = new TFile("HitNtuple.root","RECREATE");
-        m_tree = new TTree("data","data");
-        m_ntuple = new MuonHough::HitNtuple();
-        m_ntuple->initForWrite(*m_tree);
-        gDirectory = cdir;
-      }
-    }else{
-      m_file = nullptr;
-      m_tree = nullptr;
-      m_ntuple = nullptr;
+    MuonLayerHoughTool::MuonLayerHoughTool(const std::string& type, const std::string& name, const IInterface* parent) :
+        AthAlgTool(type, name, parent),
+        m_ntechnologies(UINT_MAX),  // gets set inside initialize()
+        m_techToTruthNameIdx() {
+        declareInterface<MuonLayerHoughTool>(this);
+        declareInterface<IMuonHoughPatternFinderTool>(this);
     }
-    
-    initializeSectorMapping(muDetMgr);
-
-    // if m_truthNames is empty, fill it if running on truth
-    if( m_truthNames.empty() && m_doTruth ){
-      std::string postfix = "_TruthMap";
-      std::string allNames("");
-      unsigned int i=0;
-      for( unsigned int tech=0; tech<m_ntechnologies;++tech ){
-        // check if technology is part of layout
-        if (tech==MuonStationIndex::CSC && !m_idHelperSvc->hasCSC()) continue;
-        else if (tech==MuonStationIndex::STGC && !m_idHelperSvc->hasSTgc()) continue;
-        else if (tech==MuonStationIndex::MM && !m_idHelperSvc->hasMM()) continue;
-        std::string thisname = std::string(m_idHelperSvc->mdtIdHelper().technologyString(tech)) + postfix;
-        m_truthNames.emplace_back( thisname );
-        // since we need to access the elements of m_truthNames later on, we need to remember 
-        // which technology is saved at which index of the vector
-        m_techToTruthNameIdx.insert(std::make_pair(tech, i));
-        ++i;
-        allNames += " ";
-        allNames += thisname;
-      }
-      ATH_MSG_DEBUG("TruthMaps " << allNames );
-    }
-    if(!m_doTruth){ m_truthNames.clear(); } //Nullify if not using collections
 
-    ATH_CHECK( m_truthNames.initialize() );
-    if(m_doNtuple && m_doTruth){
-      ATH_CHECK(m_MuonTruthParticlesKey.initialize());
-      ATH_CHECK(m_MuonTruthSegmentsKey.initialize());
-    }
-    else{
-      m_MuonTruthParticlesKey="";
-      m_MuonTruthSegmentsKey="";
-    }
+    StatusCode MuonLayerHoughTool::initialize() {
+        ATH_CHECK(m_idHelperSvc.retrieve());
+        m_ntechnologies = m_idHelperSvc->mdtIdHelper().technologyNameIndexMax() + 1;
+        ATH_CHECK(m_printer.retrieve());
+        const MuonGM::MuonDetectorManager* muDetMgr = nullptr;
+        ATH_CHECK(detStore()->retrieve(muDetMgr));
+
+        if (m_doNtuple) {
+            if (Gaudi::Concurrency::ConcurrencyFlags::concurrent() && Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
+                // Disabled for >1 threads due to thread-safety concerns, but we want to keep it as a debug tool
+                ATH_MSG_DEBUG("HitNtuple disabled because of concurrency");
+                m_file = nullptr;
+                m_tree = nullptr;
+                m_ntuple = nullptr;
+            } else {
+                TDirectory* cdir = gDirectory;
+                m_file = new TFile("HitNtuple.root", "RECREATE");
+                m_tree = new TTree("data", "data");
+                m_ntuple = new MuonHough::HitNtuple();
+                m_ntuple->initForWrite(*m_tree);
+                gDirectory = cdir;
+            }
+        } else {
+            m_file = nullptr;
+            m_tree = nullptr;
+            m_ntuple = nullptr;
+        }
 
-    // initialize cuts, if only one cut, use make_pair to avoid compiler issues, format is (position, cut)
-    m_selectors.resize(MuonStationIndex::ChIndexMax);
-    m_selectors[MuonStationIndex::BIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,5.9)}); // old values: 6.9; optimized: 7.9
-    m_selectors[MuonStationIndex::BIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,5.9)}); // old values: 6.9; optimized: 7.9
-    m_selectors[MuonStationIndex::BMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 7.9; optimized: 7.9
-    m_selectors[MuonStationIndex::BML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 7.9; optimized: 7.9 
-    m_selectors[MuonStationIndex::BOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 4.9; optimized: 5.9
-    m_selectors[MuonStationIndex::BOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 4.9; optimized: 5.9
-    m_selectors[MuonStationIndex::BEE] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,3.9)}); // old values: 5.9; optimized: 5.9
-    m_selectors[MuonStationIndex::EIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,5.9)}); // old values: 6.9; optimized: 7.9
-    m_selectors[MuonStationIndex::EIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,5.9)}); // old values: 6.9; optimized: 7.9
-    m_selectors[MuonStationIndex::EMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 7.9; optimized: 5.9
-    m_selectors[MuonStationIndex::EML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 7.9; optimized: 5.9
-    m_selectors[MuonStationIndex::EOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 4.9; optimized: 5.9
-    m_selectors[MuonStationIndex::EOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 4.9; optimized: 5.9
-    m_selectors[MuonStationIndex::EES] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 4.9; optimized: 5.9
-    m_selectors[MuonStationIndex::EEL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,4.9)}); // old values: 4.9; optimized: 5.9
-
-    m_selectorsLoose.resize(MuonStationIndex::ChIndexMax);
-    m_selectorsLoose[MuonStationIndex::BIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)}); // old values: 2.9; optimized: 3.9
-    m_selectorsLoose[MuonStationIndex::BIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 2.9; optimized: 3.9
-    m_selectorsLoose[MuonStationIndex::BMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)}); // old values: 4.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::BML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 4.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::BOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)}); // old values: 2.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::BOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 2.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::BEE] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)}); // old values: 3.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::EIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)}); // old values: 4.9; optimized: 3.9
-    m_selectorsLoose[MuonStationIndex::EIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)}); // old values: 4.9; optimized: 3.9
-    m_selectorsLoose[MuonStationIndex::EMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 5.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::EML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 5.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::EOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 2.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::EOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 2.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::EES] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 2.9; optimized: 2.9
-    m_selectorsLoose[MuonStationIndex::EEL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,2.9)}); // old values: 2.9; optimized: 2.9
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode MuonLayerHoughTool::finalize() {
-    // ??? finalizeNTuple -> may be moved somewhere
-    if( m_doNtuple && m_ntuple){
-      TDirectory* cdir = gDirectory;
-      m_file->cd();
-      m_tree->Write();
-      m_file->Write();
-      m_file->Close();
-      delete m_ntuple;
-      gDirectory = cdir;
-    }
-    return StatusCode::SUCCESS;
-  }
-
-  void MuonLayerHoughTool::getTruth(const EventContext& ctx) const {
-    if(m_ntuple){
-      SG::ReadHandle<xAOD::TruthParticleContainer> truthMuons(m_MuonTruthParticlesKey, ctx);
-      if (truthMuons.isValid()) {
-        ATH_MSG_DEBUG("Retrieved truth muons " << truthMuons->size());
-        int nmuons = 0;
-        for (const auto *const truthMu: *truthMuons){
-          m_ntuple->tpdgId[nmuons] = truthMu->pdgId();
-          m_ntuple->tbarcode[nmuons] = truthMu->barcode();
-          m_ntuple->tmuonIndex[nmuons] = nmuons;
-          m_ntuple->pt[nmuons] = truthMu->pt();
-          m_ntuple->eta[nmuons] = truthMu->eta();
-          m_ntuple->phi[nmuons] = truthMu->phi();
-          m_ntuple->nmdts[nmuons] = 0;
-          m_ntuple->nrpcs[nmuons] = 0;
-          m_ntuple->ntgcs[nmuons] = 0;
-          m_ntuple->ncscs[nmuons] = 0;
-          m_ntuple->ntmdts[nmuons] = 0;
-          m_ntuple->ntrpcs[nmuons] = 0;
-          m_ntuple->nttgcs[nmuons] = 0;
-          m_ntuple->ntcscs[nmuons] = 0;
-          ++nmuons;
+        initializeSectorMapping(muDetMgr);
+
+        // if m_truthNames is empty, fill it if running on truth
+        if (m_truthNames.empty() && m_doTruth) {
+            std::string postfix = "_TruthMap";
+            std::string allNames("");
+            unsigned int i = 0;
+            for (unsigned int tech = 0; tech < m_ntechnologies; ++tech) {
+                // check if technology is part of layout
+                if (tech == MuonStationIndex::CSC && !m_idHelperSvc->hasCSC())
+                    continue;
+                else if (tech == MuonStationIndex::STGC && !m_idHelperSvc->hasSTgc())
+                    continue;
+                else if (tech == MuonStationIndex::MM && !m_idHelperSvc->hasMM())
+                    continue;
+                std::string thisname = std::string(m_idHelperSvc->mdtIdHelper().technologyString(tech)) + postfix;
+                m_truthNames.emplace_back(thisname);
+                // since we need to access the elements of m_truthNames later on, we need to remember
+                // which technology is saved at which index of the vector
+                m_techToTruthNameIdx.insert(std::make_pair(tech, i));
+                ++i;
+                allNames += " ";
+                allNames += thisname;
+            }
+            ATH_MSG_DEBUG("TruthMaps " << allNames);
         }
-        m_ntuple->nmuons = nmuons;
-        SG::ReadHandle<xAOD::MuonSegmentContainer> truthSegments(m_MuonTruthSegmentsKey, ctx);
-        if (truthSegments.isValid()) {
-          ATH_MSG_DEBUG("Retrieved truth Segments " << truthSegments->size());
-          int nsegs = 0;
-          for (const auto *const truthSeg: *truthSegments){
-            m_ntuple->sbarcode[nsegs] = 0;
-            m_ntuple->sposx[nsegs] = truthSeg->x();
-            m_ntuple->sposy[nsegs] = truthSeg->y();
-            m_ntuple->sposz[nsegs] = truthSeg->z();
-            m_ntuple->sdirx[nsegs] = truthSeg->px();
-            m_ntuple->sdiry[nsegs] = truthSeg->py();
-            m_ntuple->sdirz[nsegs] = truthSeg->pz();
-            m_ntuple->snPrecHits[nsegs] = truthSeg->nPrecisionHits();
-            m_ntuple->snTrigHits[nsegs] = truthSeg->nPhiLayers() + truthSeg->nTrigEtaLayers();
-            m_ntuple->sSector[nsegs] = truthSeg->sector();
-            m_ntuple->sChIndex[nsegs] = truthSeg->chamberIndex();
-            ++nsegs;
-          }
-          m_ntuple->nsegs = nsegs;
+        if (!m_doTruth) { m_truthNames.clear(); }  // Nullify if not using collections
+
+        ATH_CHECK(m_truthNames.initialize());
+        if (m_doNtuple && m_doTruth) {
+            ATH_CHECK(m_MuonTruthParticlesKey.initialize());
+            ATH_CHECK(m_MuonTruthSegmentsKey.initialize());
+        } else {
+            m_MuonTruthParticlesKey = "";
+            m_MuonTruthSegmentsKey = "";
         }
-      }
+
+        // initialize cuts, if only one cut, use make_pair to avoid compiler issues, format is (position, cut)
+        m_selectors.resize(MuonStationIndex::ChIndexMax);
+        m_selectors[MuonStationIndex::BIS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 5.9)});  // old values: 6.9; optimized: 7.9
+        m_selectors[MuonStationIndex::BIL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 5.9)});  // old values: 6.9; optimized: 7.9
+        m_selectors[MuonStationIndex::BMS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 7.9; optimized: 7.9
+        m_selectors[MuonStationIndex::BML] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 7.9; optimized: 7.9
+        m_selectors[MuonStationIndex::BOS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 4.9; optimized: 5.9
+        m_selectors[MuonStationIndex::BOL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 4.9; optimized: 5.9
+        m_selectors[MuonStationIndex::BEE] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 3.9)});  // old values: 5.9; optimized: 5.9
+        m_selectors[MuonStationIndex::EIS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 5.9)});  // old values: 6.9; optimized: 7.9
+        m_selectors[MuonStationIndex::EIL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 5.9)});  // old values: 6.9; optimized: 7.9
+        m_selectors[MuonStationIndex::EMS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 7.9; optimized: 5.9
+        m_selectors[MuonStationIndex::EML] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 7.9; optimized: 5.9
+        m_selectors[MuonStationIndex::EOS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 4.9; optimized: 5.9
+        m_selectors[MuonStationIndex::EOL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 4.9; optimized: 5.9
+        m_selectors[MuonStationIndex::EES] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 4.9; optimized: 5.9
+        m_selectors[MuonStationIndex::EEL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 4.9)});  // old values: 4.9; optimized: 5.9
+
+        m_selectorsLoose.resize(MuonStationIndex::ChIndexMax);
+        m_selectorsLoose[MuonStationIndex::BIS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});  // old values: 2.9; optimized: 3.9
+        m_selectorsLoose[MuonStationIndex::BIL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 2.9; optimized: 3.9
+        m_selectorsLoose[MuonStationIndex::BMS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});  // old values: 4.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::BML] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 4.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::BOS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});  // old values: 2.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::BOL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 2.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::BEE] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});  // old values: 3.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::EIS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});  // old values: 4.9; optimized: 3.9
+        m_selectorsLoose[MuonStationIndex::EIL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});  // old values: 4.9; optimized: 3.9
+        m_selectorsLoose[MuonStationIndex::EMS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 5.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::EML] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 5.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::EOS] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 2.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::EOL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 2.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::EES] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 2.9; optimized: 2.9
+        m_selectorsLoose[MuonStationIndex::EEL] =
+            MuonHough::MuonLayerHoughSelector({std::make_pair(0, 2.9)});  // old values: 2.9; optimized: 2.9
+
+        return StatusCode::SUCCESS;
     }
 
-  }
-  
-  void MuonLayerHoughTool::reset() const {
-    if( m_ntuple )  m_ntuple->reset();
-  }
-
-
-  auto MuonLayerHoughTool::find( 
-      const std::vector<const MdtPrepDataCollection*>& mdtCols,  
-      const std::vector<const CscPrepDataCollection*>& ,  
-      const std::vector<const TgcPrepDataCollection*>& tgcCols,  
-      const std::vector<const RpcPrepDataCollection*>& rpcCols,  
-      const MuonSegmentCombinationCollection*, const EventContext& ctx ) const 
-      -> std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> {
-    reset();
-    State state;
-    ATH_MSG_DEBUG("MuonLayerHoughTool::find");
-    if( m_doTruth ) getTruth(ctx);
-
-
-    // create structure to hold data per sector and set the sector indices
-    state.houghDataPerSectorVec->vec.resize(16);
-    for( unsigned int i=0;i<state.houghDataPerSectorVec->vec.size();++i ) state.houghDataPerSectorVec->vec[i].sector=i+1;
-
-    // return DetectorRegionIndex and sectorLayerHash
-    auto getHashes = [this]( const Identifier& id ){
-      MuonStationIndex::DetectorRegionIndex regionIndex = m_idHelperSvc->regionIndex(id);
-      MuonStationIndex::LayerIndex layerIndex = m_idHelperSvc->layerIndex(id);
-      unsigned int sectorLayerHash = MuonStationIndex::sectorLayerHash(regionIndex,layerIndex);
-      return std::make_pair(regionIndex,sectorLayerHash);
-    };
-
-    for( const auto *col : mdtCols ){
-      if( !col ) continue;
-      Identifier id = col->identify();
-      int sector = m_idHelperSvc->sector(id);
-      auto hashes = getHashes(id);
-      fill(state.truthHits,*col,state.houghDataPerSectorVec->vec[sector-1].hitVec[hashes.second]);
+    StatusCode MuonLayerHoughTool::finalize() {
+        // ??? finalizeNTuple -> may be moved somewhere
+        if (m_doNtuple && m_ntuple) {
+            TDirectory* cdir = gDirectory;
+            m_file->cd();
+            m_tree->Write();
+            m_file->Write();
+            m_file->Close();
+            delete m_ntuple;
+            gDirectory = cdir;
+        }
+        return StatusCode::SUCCESS;
     }
 
-    for( const auto *col : rpcCols ){
-      if( !col ) continue;
-      Identifier id = col->identify();
-      int sector = m_idHelperSvc->sector(id);
-      auto hashes = getHashes(id);
-      fill(state.truthHits,*col,state.houghDataPerSectorVec->vec[sector-1].hitVec[hashes.second],state.houghDataPerSectorVec->vec[sector-1].phiHitVec[hashes.first]);
+    void MuonLayerHoughTool::getTruth(const EventContext& ctx) const {
+        if (m_ntuple) {
+            SG::ReadHandle<xAOD::TruthParticleContainer> truthMuons(m_MuonTruthParticlesKey, ctx);
+            if (truthMuons.isValid()) {
+                ATH_MSG_DEBUG("Retrieved truth muons " << truthMuons->size());
+                int nmuons = 0;
+                for (const auto* const truthMu : *truthMuons) {
+                    m_ntuple->tpdgId[nmuons] = truthMu->pdgId();
+                    m_ntuple->tbarcode[nmuons] = truthMu->barcode();
+                    m_ntuple->tmuonIndex[nmuons] = nmuons;
+                    m_ntuple->pt[nmuons] = truthMu->pt();
+                    m_ntuple->eta[nmuons] = truthMu->eta();
+                    m_ntuple->phi[nmuons] = truthMu->phi();
+                    m_ntuple->nmdts[nmuons] = 0;
+                    m_ntuple->nrpcs[nmuons] = 0;
+                    m_ntuple->ntgcs[nmuons] = 0;
+                    m_ntuple->ncscs[nmuons] = 0;
+                    m_ntuple->ntmdts[nmuons] = 0;
+                    m_ntuple->ntrpcs[nmuons] = 0;
+                    m_ntuple->nttgcs[nmuons] = 0;
+                    m_ntuple->ntcscs[nmuons] = 0;
+                    ++nmuons;
+                }
+                m_ntuple->nmuons = nmuons;
+                SG::ReadHandle<xAOD::MuonSegmentContainer> truthSegments(m_MuonTruthSegmentsKey, ctx);
+                if (truthSegments.isValid()) {
+                    ATH_MSG_DEBUG("Retrieved truth Segments " << truthSegments->size());
+                    int nsegs = 0;
+                    for (const auto* const truthSeg : *truthSegments) {
+                        m_ntuple->sbarcode[nsegs] = 0;
+                        m_ntuple->sposx[nsegs] = truthSeg->x();
+                        m_ntuple->sposy[nsegs] = truthSeg->y();
+                        m_ntuple->sposz[nsegs] = truthSeg->z();
+                        m_ntuple->sdirx[nsegs] = truthSeg->px();
+                        m_ntuple->sdiry[nsegs] = truthSeg->py();
+                        m_ntuple->sdirz[nsegs] = truthSeg->pz();
+                        m_ntuple->snPrecHits[nsegs] = truthSeg->nPrecisionHits();
+                        m_ntuple->snTrigHits[nsegs] = truthSeg->nPhiLayers() + truthSeg->nTrigEtaLayers();
+                        m_ntuple->sSector[nsegs] = truthSeg->sector();
+                        m_ntuple->sChIndex[nsegs] = truthSeg->chamberIndex();
+                        ++nsegs;
+                    }
+                    m_ntuple->nsegs = nsegs;
+                }
+            }
+        }
     }
 
-    auto hashInSector = [this]( IdentifierHash hash, int sector, unsigned int sectorLayerHash ) {
-      const std::vector<IdentifierHash>& hashes = m_collectionsPerSector[sector-1].technologyRegionHashVecs[MuonStationIndex::TGC][sectorLayerHash];
-      return std::binary_search(hashes.begin(),hashes.end(),hash);
-    };
-
-    for( const auto *col : tgcCols ){
-      if( !col ) continue;
-      Identifier id = col->identify();
-      int sector = m_idHelperSvc->sector(id);
-      auto hashes = getHashes(id);
-      // fill current sector
-      fill(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *col,state.houghDataPerSectorVec->vec[sector-1].hitVec[hashes.second],
-          state.houghDataPerSectorVec->vec[sector-1].phiHitVec[hashes.first],sector);
-
-      // fill neighbours if in overlap
-      int neighbourSectorDown = sector == 1 ? 16 : sector-1;
-      if( hashInSector(col->identifyHash(),neighbourSectorDown,hashes.second) ) 
-        fill(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *col,state.houghDataPerSectorVec->vec[neighbourSectorDown-1].hitVec[hashes.second],
-             state.houghDataPerSectorVec->vec[neighbourSectorDown-1].phiHitVec[hashes.first],neighbourSectorDown);
-
-      int neighbourSectorUp   = sector == 16 ? 1 : sector+1;
-      if( hashInSector(col->identifyHash(),neighbourSectorUp,hashes.second) ) 
-        fill(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *col,state.houghDataPerSectorVec->vec[neighbourSectorUp-1].hitVec[hashes.second],
-             state.houghDataPerSectorVec->vec[neighbourSectorUp-1].phiHitVec[hashes.first],neighbourSectorUp);
-      
+    void MuonLayerHoughTool::reset() const {
+        if (m_ntuple) m_ntuple->reset();
     }
-    
-    return analyse(state);
-  }
-
-  auto MuonLayerHoughTool::analyse(
-      const MdtPrepDataContainer*  mdtCont,
-      const CscPrepDataContainer*  cscCont,
-      const TgcPrepDataContainer*  tgcCont,
-      const RpcPrepDataContainer*  rpcCont,
-      const sTgcPrepDataContainer* stgcCont,  
-      const MMPrepDataContainer*   mmCont, const EventContext& ctx ) const 
-      -> std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> {
-    reset();
-    State state; 
-    ATH_MSG_DEBUG("MuonLayerHoughTool::analyse");
-    if( m_doTruth ) getTruth(ctx);
-
-    state.houghDataPerSectorVec->vec.resize(16);
-
-    // loops over all sectors, contains hashes for technology and region and chamber (?)
-    CollectionsPerSectorCit sit = m_collectionsPerSector.begin();
-    CollectionsPerSectorCit sit_end = m_collectionsPerSector.end();
-    for( ;sit!=sit_end;++sit){
-            
-      ATH_MSG_DEBUG("analyse: Filling hits sector " << sit->sector);
-
-      HoughDataPerSector& houghData = state.houghDataPerSectorVec->vec[sit->sector-1]; 
-      houghData.sector = sit->sector;
-
-      // fill hits for this sector -> hitsVec and PhiHitsVec are known now
-      fillHitsPerSector( state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *sit, mdtCont,cscCont,tgcCont,rpcCont,stgcCont,mmCont,houghData);
 
+    auto MuonLayerHoughTool::find(const std::vector<const MdtPrepDataCollection*>& mdtCols,
+                                  const std::vector<const CscPrepDataCollection*>&,
+                                  const std::vector<const TgcPrepDataCollection*>& tgcCols,
+                                  const std::vector<const RpcPrepDataCollection*>& rpcCols, const MuonSegmentCombinationCollection*,
+                                  const EventContext& ctx) const
+        -> std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> {
+        reset();
+        State state;
+        ATH_MSG_DEBUG("MuonLayerHoughTool::find");
+        if (m_doTruth) getTruth(ctx);
+
+        // create structure to hold data per sector and set the sector indices
+        state.houghDataPerSectorVec->vec.resize(16);
+        for (unsigned int i = 0; i < state.houghDataPerSectorVec->vec.size(); ++i) state.houghDataPerSectorVec->vec[i].sector = i + 1;
+
+        // return DetectorRegionIndex and sectorLayerHash
+        auto getHashes = [this](const Identifier& id) {
+            MuonStationIndex::DetectorRegionIndex regionIndex = m_idHelperSvc->regionIndex(id);
+            MuonStationIndex::LayerIndex layerIndex = m_idHelperSvc->layerIndex(id);
+            unsigned int sectorLayerHash = MuonStationIndex::sectorLayerHash(regionIndex, layerIndex);
+            return std::make_pair(regionIndex, sectorLayerHash);
+        };
+
+        for (const auto* col : mdtCols) {
+            if (!col) continue;
+            Identifier id = col->identify();
+            int sector = m_idHelperSvc->sector(id);
+            auto hashes = getHashes(id);
+            fill(state.truthHits, *col, state.houghDataPerSectorVec->vec[sector - 1].hitVec[hashes.second]);
+        }
+
+        for (const auto* col : rpcCols) {
+            if (!col) continue;
+            Identifier id = col->identify();
+            int sector = m_idHelperSvc->sector(id);
+            auto hashes = getHashes(id);
+            fill(state.truthHits, *col, state.houghDataPerSectorVec->vec[sector - 1].hitVec[hashes.second],
+                 state.houghDataPerSectorVec->vec[sector - 1].phiHitVec[hashes.first]);
+        }
+
+        auto hashInSector = [this](IdentifierHash hash, int sector, unsigned int sectorLayerHash) {
+            const std::vector<IdentifierHash>& hashes =
+                m_collectionsPerSector[sector - 1].technologyRegionHashVecs[MuonStationIndex::TGC][sectorLayerHash];
+            return std::binary_search(hashes.begin(), hashes.end(), hash);
+        };
+
+        for (const auto* col : tgcCols) {
+            if (!col) continue;
+            Identifier id = col->identify();
+            int sector = m_idHelperSvc->sector(id);
+            auto hashes = getHashes(id);
+            // fill current sector
+            fill(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *col,
+                 state.houghDataPerSectorVec->vec[sector - 1].hitVec[hashes.second],
+                 state.houghDataPerSectorVec->vec[sector - 1].phiHitVec[hashes.first], sector);
+
+            // fill neighbours if in overlap
+            int neighbourSectorDown = sector == 1 ? 16 : sector - 1;
+            if (hashInSector(col->identifyHash(), neighbourSectorDown, hashes.second))
+                fill(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *col,
+                     state.houghDataPerSectorVec->vec[neighbourSectorDown - 1].hitVec[hashes.second],
+                     state.houghDataPerSectorVec->vec[neighbourSectorDown - 1].phiHitVec[hashes.first], neighbourSectorDown);
+
+            int neighbourSectorUp = sector == 16 ? 1 : sector + 1;
+            if (hashInSector(col->identifyHash(), neighbourSectorUp, hashes.second))
+                fill(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *col,
+                     state.houghDataPerSectorVec->vec[neighbourSectorUp - 1].hitVec[hashes.second],
+                     state.houghDataPerSectorVec->vec[neighbourSectorUp - 1].phiHitVec[hashes.first], neighbourSectorUp);
+        }
+
+        return analyse(state);
     }
-    return analyse(state);
-  }
 
-    auto MuonLayerHoughTool::analyse(State &state) const -> std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> {
+    auto MuonLayerHoughTool::analyse(const MdtPrepDataContainer* mdtCont, const CscPrepDataContainer* cscCont,
+                                     const TgcPrepDataContainer* tgcCont, const RpcPrepDataContainer* rpcCont,
+                                     const sTgcPrepDataContainer* stgcCont, const MMPrepDataContainer* mmCont,
+                                     const EventContext& ctx) const
+        -> std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> {
+        reset();
+        State state;
+        ATH_MSG_DEBUG("MuonLayerHoughTool::analyse");
+        if (m_doTruth) getTruth(ctx);
+
+        state.houghDataPerSectorVec->vec.resize(16);
+
+        // loops over all sectors, contains hashes for technology and region and chamber (?)
+        CollectionsPerSectorCit sit = m_collectionsPerSector.begin();
+        CollectionsPerSectorCit sit_end = m_collectionsPerSector.end();
+        for (; sit != sit_end; ++sit) {
+            ATH_MSG_DEBUG("analyse: Filling hits sector " << sit->sector);
+
+            HoughDataPerSector& houghData = state.houghDataPerSectorVec->vec[sit->sector - 1];
+            houghData.sector = sit->sector;
+
+            // fill hits for this sector -> hitsVec and PhiHitsVec are known now
+            fillHitsPerSector(state.truthHits, state.houghDataPerSectorVec->tgcClusteringObjs, *sit, mdtCont, cscCont, tgcCont, rpcCont,
+                              stgcCont, mmCont, houghData);
+        }
+        return analyse(state);
+    }
 
+    auto MuonLayerHoughTool::analyse(State& state) const
+        -> std::pair<std::unique_ptr<MuonPatternCombinationCollection>, std::unique_ptr<HoughDataPerSectorVec>> {
         auto patternCombis = std::make_unique<MuonPatternCombinationCollection>();
 
         // loop over data and fill the hough transform
-        for (auto &houghData : state.houghDataPerSectorVec->vec) {
-
+        for (auto& houghData : state.houghDataPerSectorVec->vec) {
             ATH_MSG_DEBUG("analyse: Filling Hough sector " << houghData.sector);
 
             // loop over all possible station layers in the sector and run the eta transform
             for (unsigned int layerHash = 0; layerHash < MuonStationIndex::sectorLayerHashMax(); ++layerHash) {
-
                 // get hits for layer, skip empty layers
-                HitVec &hits = houghData.hitVec[layerHash];
+                HitVec& hits = houghData.hitVec[layerHash];
                 if (hits.empty()) continue;
 
                 // decompose hash, calculate indices etc
@@ -325,27 +350,36 @@ namespace Muon {
                 MuonStationIndex::StIndex index = MuonStationIndex::toStationIndex(region, layer);
 
                 // get Hough transform
-                MuonHough::MuonLayerHough &hough = state.houghDataPerSectorVec->detectorHoughTransforms.hough(houghData.sector, region, layer);
+                MuonHough::MuonLayerHough& hough =
+                    state.houghDataPerSectorVec->detectorHoughTransforms.hough(houghData.sector, region, layer);
 
-                ATH_MSG_DEBUG("analyse: Filling Summary: loc s" << houghData.sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> stIndex: " << MuonStationIndex::stName(index) << " etaHits: " << hits.size());
+                ATH_MSG_DEBUG("analyse: Filling Summary: loc s" << houghData.sector << " " << MuonStationIndex::regionName(region) << " "
+                                                                << MuonStationIndex::layerName(layer) << " -> stIndex: "
+                                                                << MuonStationIndex::stName(index) << " etaHits: " << hits.size());
 
                 // look for maxima using hough in eta per layer
-                if (!findMaxima(state.truthHits, state.foundTruthHits, state.seedMaxima, hough, hits, houghData.maxVec[layerHash]) || houghData.maxVec[layerHash].empty()) continue;
+                if (!findMaxima(state.truthHits, state.foundTruthHits, state.seedMaxima, hough, hits, houghData.maxVec[layerHash]) ||
+                    houghData.maxVec[layerHash].empty())
+                    continue;
 
                 ++houghData.nlayersWithMaxima[region];
                 houghData.nmaxHitsInRegion[region] += houghData.maxVec[layerHash].front()->max;
 
-                ATH_MSG_DEBUG("analyse: Eta maxima Summary: loc s" << houghData.sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> stIndex: " << MuonStationIndex::stName(index) << " hash: " << layerHash << " nMaxima: " << houghData.maxVec[layerHash].size());
+                ATH_MSG_DEBUG("analyse: Eta maxima Summary: loc s"
+                              << houghData.sector << " " << MuonStationIndex::regionName(region) << " "
+                              << MuonStationIndex::layerName(layer) << " -> stIndex: " << MuonStationIndex::stName(index)
+                              << " hash: " << layerHash << " nMaxima: " << houghData.maxVec[layerHash].size());
             }  // loop over layerHash -> maxima per layer in eta are known now
-        } // loop over sectors
+        }      // loop over sectors
 
         if (m_useSeeds) {
             std::vector<Road> roads;
-            buildRoads(state.seedMaxima, state.houghDataPerSectorVec->detectorHoughTransforms, state.truthHits, state.foundTruthHits, state.houghDataPerSectorVec, roads);
+            buildRoads(state.seedMaxima, state.houghDataPerSectorVec->detectorHoughTransforms, state.truthHits, state.foundTruthHits,
+                       state.houghDataPerSectorVec, roads);
 
             // create association map
             ATH_MSG_DEBUG("analyse: Building pattern combinations using roads " << roads.size());
-            for (auto &road : roads) {
+            for (auto& road : roads) {
                 std::map<MuonHough::MuonPhiLayerHough::Maximum*, MuonLayerHoughTool::MaximumVec> phiEtaAssMap;
                 MuonLayerHoughTool::RegionMaximumVec unassociatedEtaMaxima;
 
@@ -353,13 +387,15 @@ namespace Muon {
                 MuonStationIndex::ChIndex chIndex = road.seed->hough->m_descriptor.chIndex;
                 MuonStationIndex::LayerIndex layer = Muon::MuonStationIndex::toLayerIndex(chIndex);
                 MuonStationIndex::DetectorRegionIndex region = road.seed->hough->m_descriptor.region;
-                ATH_MSG_DEBUG("analyse: Seeding new road: eta maxima " << road.maxima.size() << " phi " << road.phiMaxima.size() << " seed : sector " << sector << " " << Muon::MuonStationIndex::regionName(region) << " " << Muon::MuonStationIndex::layerName(layer) << " maximum " << road.seed->max << " position " << road.seed->pos << " angle " << road.seed->theta);
+                ATH_MSG_DEBUG("analyse: Seeding new road: eta maxima "
+                              << road.maxima.size() << " phi " << road.phiMaxima.size() << " seed : sector " << sector << " "
+                              << Muon::MuonStationIndex::regionName(region) << " " << Muon::MuonStationIndex::layerName(layer)
+                              << " maximum " << road.seed->max << " position " << road.seed->pos << " angle " << road.seed->theta);
 
-                if (road.phiMaxima.empty()) unassociatedEtaMaxima.push_back(road.maxima);
+                if (road.phiMaxima.empty())
+                    unassociatedEtaMaxima.push_back(road.maxima);
                 else {
-                    for (auto &max : road.mergedPhiMaxima) {
-                        phiEtaAssMap[&max] = road.maxima;
-                    }
+                    for (auto& max : road.mergedPhiMaxima) { phiEtaAssMap[&max] = road.maxima; }
                 }
                 createPatternCombinations(state.truthHits, state.outputTruthHits, phiEtaAssMap, *patternCombis);
                 createPatternCombinations(unassociatedEtaMaxima, *patternCombis);
@@ -368,25 +404,26 @@ namespace Muon {
         } else {
             // now that the full hough transform is filled, order sectors by maxima
             std::vector<HoughDataPerSector*> sectorData(state.houghDataPerSectorVec->vec.size());
-            for (unsigned int i = 0; i < state.houghDataPerSectorVec->vec.size(); ++i)
-                sectorData[i] = &state.houghDataPerSectorVec->vec[i];
+            for (unsigned int i = 0; i < state.houghDataPerSectorVec->vec.size(); ++i) sectorData[i] = &state.houghDataPerSectorVec->vec[i];
             std::stable_sort(sectorData.begin(), sectorData.end(), SortHoughDataPerSector());
 
             std::vector<HoughDataPerSector*>::iterator spit = sectorData.begin();
             std::vector<HoughDataPerSector*>::iterator spit_end = sectorData.end();
             for (; spit != spit_end; ++spit) {
-
                 // get data for this sector
-                HoughDataPerSector &houghData = **spit;
+                HoughDataPerSector& houghData = **spit;
 
                 // loop over regions
                 for (int reg = 0; reg < MuonStationIndex::DetectorRegionIndexMax; ++reg) {
-
                     MuonStationIndex::DetectorRegionIndex region = static_cast<MuonStationIndex::DetectorRegionIndex>(reg);
 
                     // only run analysis on sectors with maxima
                     if (houghData.nlayersWithMaxima[region] == 0) continue;
-                    ATH_MSG_DEBUG("Analyzing sector " << (*spit)->sector << " " << MuonStationIndex::regionName(region) << " nmax " << (*spit)->maxEtaHits() << " layers with eta maxima " << houghData.nlayersWithMaxima[region] << " hits " << houghData.nmaxHitsInRegion[region] << " layers with phi maxima " << houghData.nphilayersWithMaxima[region] << " hits " << houghData.nphimaxHitsInRegion[region]);
+                    ATH_MSG_DEBUG("Analyzing sector "
+                                  << (*spit)->sector << " " << MuonStationIndex::regionName(region) << " nmax " << (*spit)->maxEtaHits()
+                                  << " layers with eta maxima " << houghData.nlayersWithMaxima[region] << " hits "
+                                  << houghData.nmaxHitsInRegion[region] << " layers with phi maxima "
+                                  << houghData.nphilayersWithMaxima[region] << " hits " << houghData.nphimaxHitsInRegion[region]);
 
                     // look for maxima in the overlap regions of sectors
                     associateMaximaInNeighbouringSectors(houghData, state.houghDataPerSectorVec->vec);
@@ -425,11 +462,14 @@ namespace Muon {
         return {std::move(patternCombis), std::move(state.houghDataPerSectorVec)};
     }
 
-    void MuonLayerHoughTool::buildRoads(MaximumVec &seedMaxima, MuonHough::MuonDetectorHough &detectorHoughTransforms, std::set<Identifier> &truthHits, std::set<Identifier> &foundTruthHits, std::unique_ptr<HoughDataPerSectorVec> &houghDataPerSectorVec, std::vector<MuonLayerHoughTool::Road> &roads) const {
+    void MuonLayerHoughTool::buildRoads(MaximumVec& seedMaxima, MuonHough::MuonDetectorHough& detectorHoughTransforms,
+                                        std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits,
+                                        std::unique_ptr<HoughDataPerSectorVec>& houghDataPerSectorVec,
+                                        std::vector<MuonLayerHoughTool::Road>& roads) const {
         // sort maxima according to hits
-        std::stable_sort(seedMaxima.begin(), seedMaxima.end(), [](const MuonHough::MuonLayerHough::Maximum *m1, const MuonHough::MuonLayerHough::Maximum *m2) {
-            return m1->max > m2->max;
-        });
+        std::stable_sort(
+            seedMaxima.begin(), seedMaxima.end(),
+            [](const MuonHough::MuonLayerHough::Maximum* m1, const MuonHough::MuonLayerHough::Maximum* m2) { return m1->max > m2->max; });
         // loop over seed maxima (which are maxima) that pass certain thresholds detailed in cut_values
         std::set<const MuonHough::MuonLayerHough::Maximum*> associatedMaxima;
         for (auto maxit = seedMaxima.begin(); maxit != seedMaxima.end(); ++maxit) {
@@ -437,7 +477,7 @@ namespace Muon {
             if (associatedMaxima.count(*maxit)) continue;
 
             // maximum becomes our new seed
-            MuonHough::MuonLayerHough::Maximum &seed = **maxit;
+            MuonHough::MuonLayerHough::Maximum& seed = **maxit;
 
             // decomposing the locality information for the seed
             int sector = seed.hough->m_descriptor.sector;
@@ -447,20 +487,21 @@ namespace Muon {
 
             // creating new road with said seed
             Road road(seed);
-            ATH_MSG_DEBUG(" New seed: sector " << seed.hough->m_descriptor.sector << " " << Muon::MuonStationIndex::regionName(region) 
-                    << " " << Muon::MuonStationIndex::layerName(layer)
-                    << " maximum " << seed.max << " position " << seed.pos << " angle " << seed.theta << " ptr " << &seed );
+            ATH_MSG_DEBUG(" New seed: sector " << seed.hough->m_descriptor.sector << " " << Muon::MuonStationIndex::regionName(region)
+                                               << " " << Muon::MuonStationIndex::layerName(layer) << " maximum " << seed.max << " position "
+                                               << seed.pos << " angle " << seed.theta << " ptr " << &seed);
             /// In the NSW setup it can happen that the hits in the collection are only
             /// made up of TGCHits which are clustered beforehand and hence have no
             /// associated prd. In order to prevent later a crash in bool isNSW = ...
             /// let's first find a hit with associated PRD
-            std::vector<MuonHough::Hit*>::const_iterator ref_itr = std::find_if(seed.hits.begin(), seed.hits.end(),
-                    [](const MuonHough::Hit *hit)->bool {
-                            return hit->prd;});
+            std::vector<MuonHough::Hit*>::const_iterator ref_itr =
+                std::find_if(seed.hits.begin(), seed.hits.end(), [](const MuonHough::Hit* hit) -> bool { return hit->prd; });
 
-            bool isNSW = ref_itr != seed.hits.end() && (m_idHelperSvc->issTgc((*ref_itr)->prd->identify()) || m_idHelperSvc->isMM((*ref_itr)->prd->identify()));
+            bool isNSW = ref_itr != seed.hits.end() &&
+                         (m_idHelperSvc->issTgc((*ref_itr)->prd->identify()) || m_idHelperSvc->isMM((*ref_itr)->prd->identify()));
             // extend seed within the current sector
-            // sector indices have an offset of -1 because the numbering of the sectors are from 1 to 16 but the indices in the vertices are of course 0 to 15
+            // sector indices have an offset of -1 because the numbering of the sectors are from 1 to 16 but the indices in the vertices are
+            // of course 0 to 15
             extendSeed(detectorHoughTransforms, truthHits, foundTruthHits, road, houghDataPerSectorVec->vec[sector - 1]);
 
             // look for maxima in the overlap regions of sectors
@@ -485,7 +526,8 @@ namespace Muon {
             // if close to a sector boundary, try adding maxima in that sector as well
             if (road.neighbouringSector != -1) {
                 ATH_MSG_DEBUG("  Adding neighbouring sector " << road.neighbouringSector);
-                extendSeed(detectorHoughTransforms, truthHits, foundTruthHits, road, houghDataPerSectorVec->vec[road.neighbouringSector - 1]);
+                extendSeed(detectorHoughTransforms, truthHits, foundTruthHits, road,
+                           houghDataPerSectorVec->vec[road.neighbouringSector - 1]);
                 associatePhiMaxima(road, houghDataPerSectorVec->vec[road.neighbouringSector - 1].phiMaxVec[region]);
             }
 
@@ -501,27 +543,31 @@ namespace Muon {
             associatedMaxima.insert(road.maxima.begin(), road.maxima.end());
 
             ATH_MSG_DEBUG(" New road " << road.maxima.size());
-            for (auto *max : road.maxima) {
+            for (auto* max : road.maxima) {
                 MuonStationIndex::ChIndex chIndex = max->hough->m_descriptor.chIndex;
                 MuonStationIndex::LayerIndex layer = Muon::MuonStationIndex::toLayerIndex(chIndex);
                 MuonStationIndex::DetectorRegionIndex region = max->hough->m_descriptor.region;
-                ATH_MSG_DEBUG(" Sector " << max->hough->m_descriptor.sector << " " << Muon::MuonStationIndex::regionName(region) << " " << Muon::MuonStationIndex::layerName(layer) << " maximum " << max->max << " position " << max->pos << " angle " << max->theta << " ptr " << max);
+                ATH_MSG_DEBUG(" Sector " << max->hough->m_descriptor.sector << " " << Muon::MuonStationIndex::regionName(region) << " "
+                                         << Muon::MuonStationIndex::layerName(layer) << " maximum " << max->max << " position " << max->pos
+                                         << " angle " << max->theta << " ptr " << max);
             }
 
             bool insert = true;
-            for (auto &oldRoad : roads) {
+            for (auto& oldRoad : roads) {
                 std::vector<const MuonHough::MuonLayerHough::Maximum*> intersection;
-                std::set_intersection(oldRoad.maximumSet.begin(), oldRoad.maximumSet.end(), road.maximumSet.begin(), road.maximumSet.end(), std::back_inserter(intersection));
+                std::set_intersection(oldRoad.maximumSet.begin(), oldRoad.maximumSet.end(), road.maximumSet.begin(), road.maximumSet.end(),
+                                      std::back_inserter(intersection));
                 unsigned int intersectionSize = intersection.size();
                 unsigned int oldRoadSize = oldRoad.maximumSet.size();
                 unsigned int roadSize = road.maximumSet.size();
-                ATH_MSG_VERBOSE(" Overlap check " << intersectionSize << " old " << oldRoadSize << " new " << roadSize << " old ptr " << oldRoad.seed);
+                ATH_MSG_VERBOSE(" Overlap check " << intersectionSize << " old " << oldRoadSize << " new " << roadSize << " old ptr "
+                                                  << oldRoad.seed);
                 if (intersectionSize == 0) continue;
                 if (intersectionSize == roadSize) {
-                    insert = false; // discard
+                    insert = false;  // discard
                     break;
                 } else if (intersectionSize == oldRoadSize) {
-                    oldRoad = road; // replace
+                    oldRoad = road;  // replace
                     insert = false;
                     break;
                 }
@@ -532,1243 +578,1213 @@ namespace Muon {
         }
     }
 
+    void MuonLayerHoughTool::mergePhiMaxima(MuonLayerHoughTool::Road& road) const {
+        // input -> list of phiMaxima on road
+        // returns some mergedPhiMaxima -> is this "summed" over layers?
+
+        auto maximaSortingLambda = [road](const MuonHough::MuonPhiLayerHough::Maximum* m1,
+                                          const MuonHough::MuonPhiLayerHough::Maximum* m2) {
+            if (m1->max == m2->max) {
+                if (m1->sector == m2->sector) {  // prefer the same sector as the seed sector
+                    if (m1->hits.size() == m2->hits.size()) {
+                        if (m1->pos == m2->pos) {
+                            if (std::abs(m1->binposmax - m1->binposmin) == std::abs(m2->binposmax - m2->binposmin)) {
+                                return (m1->binposmin) < (m2->binposmin);
+                            }
+                            return std::abs(m1->binposmax - m1->binposmin) < std::abs(m2->binposmax - m2->binposmin);
+                        }
+                        return m1->pos < m2->pos;
+                    }
+                    return m1->hits.size() < m2->hits.size();  // least hits -> most collimated maximum
+                }
+                return m1->sector == road.seed->hough->m_descriptor.sector;
+            }
+            return m1->max > m2->max;
+        };
+
+        std::stable_sort(road.phiMaxima.begin(), road.phiMaxima.end(), maximaSortingLambda);
+
+        ATH_MSG_VERBOSE("Merging phi maxima " << road.phiMaxima.size());
+        std::set<MuonHough::MuonPhiLayerHough::Maximum*> associatedPhiMaxima;
+        for (auto pit = road.phiMaxima.begin(); pit != road.phiMaxima.end(); ++pit) {  // loop over phi maxima
+            if (associatedPhiMaxima.count(*pit)) continue;                             // check if maximum is already in associatedPhiMaxima
+            associatedPhiMaxima.insert(*pit);
+            MuonHough::MuonPhiLayerHough::Maximum phiMaximum = **pit;
+            ATH_MSG_VERBOSE("  phi maxima " << phiMaximum.pos << " val " << phiMaximum.max);
+
+            bool wasExtended = false;
+            for (auto pit1 = pit + 1; pit1 != road.phiMaxima.end(); ++pit1) {
+                if ((*pit1)->binposmax >= phiMaximum.binposmin && (*pit1)->binposmin <= phiMaximum.binposmax) {
+                    ATH_MSG_VERBOSE("    merging maxima " << phiMaximum.pos << " val " << phiMaximum.max << " " << (*pit1)->pos << " val "
+                                                          << (*pit1)->max);
+                    phiMaximum.hits.insert(phiMaximum.hits.end(), (*pit1)->hits.begin(), (*pit1)->hits.end());
+                    associatedPhiMaxima.insert(*pit1);
+                    wasExtended = true;
+                }
+            }
 
-  void MuonLayerHoughTool::mergePhiMaxima( MuonLayerHoughTool::Road& road ) const {
-    // input -> list of phiMaxima on road
-    // returns some mergedPhiMaxima -> is this "summed" over layers?
-    
-    auto maximaSortingLambda = [road]( const MuonHough::MuonPhiLayerHough::Maximum* m1, const MuonHough::MuonPhiLayerHough::Maximum* m2 ) { 
-                                   if( m1->max == m2->max ){
-                                     if (m1->sector == m2->sector){   // prefer the same sector as the seed sector
-                                       if( m1->hits.size() == m2->hits.size() ) {
-                                         if( m1->pos == m2->pos ) {
-                                           if( std::abs(m1->binposmax - m1->binposmin) == std::abs(m2->binposmax - m2->binposmin) ) {
-                                             return (m1->binposmin) < (m2->binposmin);
-                                           }
-                                           return std::abs(m1->binposmax - m1->binposmin) < std::abs(m2->binposmax - m2->binposmin);
-                                         }
-                                         return m1->pos < m2->pos;
-                                       }
-                                       return m1->hits.size() < m2->hits.size();  // least hits -> most collimated maximum
-                                     }
-                                     return m1->sector == road.seed->hough->m_descriptor.sector;
-                                   }
-                                   return m1->max > m2->max; 
-                                 };
-        
-    std::stable_sort(road.phiMaxima.begin(),road.phiMaxima.end(), maximaSortingLambda);
-    
-    ATH_MSG_VERBOSE("Merging phi maxima " << road.phiMaxima.size() );
-    std::set<MuonHough::MuonPhiLayerHough::Maximum*> associatedPhiMaxima;
-    for( auto pit = road.phiMaxima.begin();pit!=road.phiMaxima.end();++pit ){  // loop over phi maxima
-      if( associatedPhiMaxima.count(*pit) ) continue; //check if maximum is already in associatedPhiMaxima
-      associatedPhiMaxima.insert(*pit);
-      MuonHough::MuonPhiLayerHough::Maximum phiMaximum = **pit;
-      ATH_MSG_VERBOSE("  phi maxima " << phiMaximum.pos << " val " << phiMaximum.max );
-
-      bool wasExtended = false;
-      for( auto pit1 = pit+1;pit1!=road.phiMaxima.end();++pit1 ){
-        if( (*pit1)->binposmax >= phiMaximum.binposmin && (*pit1)->binposmin <= phiMaximum.binposmax ){
-          ATH_MSG_VERBOSE("    merging maxima " << phiMaximum.pos << " val " << phiMaximum.max << " " << (*pit1)->pos << " val " << (*pit1)->max );
-          phiMaximum.hits.insert(phiMaximum.hits.end(),(*pit1)->hits.begin(),(*pit1)->hits.end());
-          associatedPhiMaxima.insert(*pit1);
-          wasExtended = true;
-        }
-      }
-
-      if( wasExtended ) {
-        // refind maximum
-        MuonHough::MuonPhiLayerHough localHough(60, -M_PI, M_PI, ( (*pit)->hough ? (*pit)->hough->m_region : MuonStationIndex::DetectorRegionUnknown ) );
-        std::vector<MuonHough::PhiHit*> hits = phiMaximum.hits;
-        /* too ambiguous producing irreproducibilities because of sorting by pointer value
-        std::stable_sort(hits.begin(),hits.end(),[]( const MuonHough::PhiHit* h1,
-                                                     const MuonHough::PhiHit* h2 ){ return h1->layer < h2->layer; } );
-        */
-
-        std::stable_sort(hits.begin(),hits.end(),[]( const MuonHough::PhiHit* h1,
-                                                     const MuonHough::PhiHit* h2 ){
-                                                      if( h1->layer == h2->layer ) {
-                                                        if( h1->w == h2->w ) {
-                                                          if( h1->r == h2->r ) {
-                                                            if( std::abs(h1->phimax - h1->phimin) == std::abs(h2->phimax - h2->phimin) ){
-                                                              if( h1->phimin == h2->phimin ) return h1->phimax < h2->phimax;
-                                                              return h1->phimin < h2->phimin;
-                                                            }
-                                                            return std::abs(h1->phimax - h1->phimin) < std::abs(h2->phimax - h2->phimin);
-                                                          }
-                                                          return h1->r < h2->r;
-                                                        }
-                                                        return h1->w > h2->w;
-                                                      }
-                                                      return h1->layer < h2->layer;
-                                                     } );
-
-        ATH_MSG_VERBOSE("  updating phi maximum " << phiMaximum.pos  << " bin " << phiMaximum.binpos 
-                        << " val " << phiMaximum.max << " number of hits " << hits.size() );
-        if( msgLvl(MSG::VERBOSE) ) localHough.setDebug(true);
-        localHough.fillLayer2(hits);
-        localHough.findMaximum(phiMaximum,0.9);
-        localHough.associateHitsToMaximum(phiMaximum,hits);
-        ATH_MSG_VERBOSE("  updated phi maxima " << phiMaximum.pos << " bin " << phiMaximum.binpos 
-                        << " val " << phiMaximum.max << " number of hits " << phiMaximum.hits.size() );
-        phiMaximum.hough = (*pit)->hough; // set back pointer to transform
-      }
-      road.mergedPhiMaxima.push_back(phiMaximum);
-    }
-  }
-
-  // maximum in middle layer
-  // says look in other layers
-  // if yes, combine them
-  // gets on road
-  // roads are combinations of maxima
-  
-  
-  void MuonLayerHoughTool::extendSeed(MuonHough::MuonDetectorHough& detectorHoughTransforms, 
-      std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits, 
-      MuonLayerHoughTool::Road& road, MuonLayerHoughTool::HoughDataPerSector& sectorData ) const { //const {
-    if( !road.seed ) return;
-    
-    RegionMaximumVec& maxVec = sectorData.maxVec;
-
-    // gather locality information on seed
-    MuonHough::MuonLayerHough::Maximum&   seed = *road.seed;
-    MuonStationIndex::LayerIndex          seedLayer   = Muon::MuonStationIndex::toLayerIndex(seed.hough->m_descriptor.chIndex);
-    MuonStationIndex::DetectorRegionIndex region  = seed.hough->m_descriptor.region;
-
-    // loop over layers in the same region as the seed ( inner, middle, outer)
-    for( int lay=0;lay<Muon::MuonStationIndex::LayerIndexMax;++lay ){
-      MuonStationIndex::LayerIndex layer   = static_cast<MuonStationIndex::LayerIndex>(lay);
-      if( layer == seedLayer && seed.hough->m_descriptor.sector == sectorData.sector ) continue; 
-      
-      // untrue -> look in neighboring layer
-      // true -> look only in this layer
-      double distanceCut = layer == seedLayer ? 500. : (double)m_extrapolationDistance;
-
-      unsigned int layerHash = MuonStationIndex::sectorLayerHash(region,layer);
-      
-      // fetching vector of maxima for given region and layer
-      const MaximumVec& maxima = maxVec[layerHash];
-      if( maxima.empty() ) continue;
-
-      ATH_MSG_DEBUG("Associating maxima in " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer)
-                    << " size " << maxima.size() ); 
-      // loop over maxima in layer
-      for( auto mit = maxima.begin();mit!=maxima.end();++mit ){
-        MuonHough::MuonLayerHough::Maximum* candMaximum = *mit;
-        // extrapolate seed to layer assuming a pointing straight line or parabolic
-        // add maximum to road if close enough
-        float yloc_diff =  MuonHough::extrapolate(seed, *candMaximum, m_doParabolicExtrapolation);
-        if( std::abs( MuonHough::extrapolate(seed, *candMaximum, m_doParabolicExtrapolation) ) < distanceCut ) {
-          ATH_MSG_VERBOSE(" Adding maximum position " << candMaximum->pos << " intersect diff" << yloc_diff );
-          road.add(candMaximum);
-        }else{
-          ATH_MSG_VERBOSE(" Maximum position: y " << candMaximum->pos 
-                                        <<  " x " << candMaximum->hough->m_descriptor.referencePosition 
-                                    << " seed y " << seed.hough->m_descriptor.referencePosition 
-                                         << " x " << seed.pos << " intersect diff " << yloc_diff );
+            if (wasExtended) {
+                // refind maximum
+                MuonHough::MuonPhiLayerHough localHough(
+                    60, -M_PI, M_PI, ((*pit)->hough ? (*pit)->hough->m_region : MuonStationIndex::DetectorRegionUnknown));
+                std::vector<MuonHough::PhiHit*> hits = phiMaximum.hits;
+                /* too ambiguous producing irreproducibilities because of sorting by pointer value
+                std::stable_sort(hits.begin(),hits.end(),[]( const MuonHough::PhiHit* h1,
+                                                             const MuonHough::PhiHit* h2 ){ return h1->layer < h2->layer; } );
+                */
+
+                std::stable_sort(hits.begin(), hits.end(), [](const MuonHough::PhiHit* h1, const MuonHough::PhiHit* h2) {
+                    if (h1->layer == h2->layer) {
+                        if (h1->w == h2->w) {
+                            if (h1->r == h2->r) {
+                                if (std::abs(h1->phimax - h1->phimin) == std::abs(h2->phimax - h2->phimin)) {
+                                    if (h1->phimin == h2->phimin) return h1->phimax < h2->phimax;
+                                    return h1->phimin < h2->phimin;
+                                }
+                                return std::abs(h1->phimax - h1->phimin) < std::abs(h2->phimax - h2->phimin);
+                            }
+                            return h1->r < h2->r;
+                        }
+                        return h1->w > h2->w;
+                    }
+                    return h1->layer < h2->layer;
+                });
+
+                ATH_MSG_VERBOSE("  updating phi maximum " << phiMaximum.pos << " bin " << phiMaximum.binpos << " val " << phiMaximum.max
+                                                          << " number of hits " << hits.size());
+                if (msgLvl(MSG::VERBOSE)) localHough.setDebug(true);
+                localHough.fillLayer2(hits);
+                localHough.findMaximum(phiMaximum, 0.9);
+                localHough.associateHitsToMaximum(phiMaximum, hits);
+                ATH_MSG_VERBOSE("  updated phi maxima " << phiMaximum.pos << " bin " << phiMaximum.binpos << " val " << phiMaximum.max
+                                                        << " number of hits " << phiMaximum.hits.size());
+                phiMaximum.hough = (*pit)->hough;  // set back pointer to transform
+            }
+            road.mergedPhiMaxima.push_back(phiMaximum);
         }
-      }
     }
 
-    // check if the maximum is close to the detector boundary, if yes look for maxima in the neighbouring region, skip BarrelExtended
-    if( seedLayer == MuonStationIndex::BarrelExtended ) return;
-
-    ATH_MSG_DEBUG("Checking Barrel/Endcap overlaps: min dist edge " << seed.pos-seed.hough->m_descriptor.yMinRange 
-                                               << " max dist edge " << seed.pos-seed.hough->m_descriptor.yMaxRange
-                                                         << " pos " << seed.pos 
-                                                       << " range " << seed.hough->m_descriptor.yMinRange << " " << seed.hough->m_descriptor.yMaxRange );
-
-    if( std::abs(seed.pos-seed.hough->m_descriptor.yMinRange) < 4000. || std::abs(seed.pos-seed.hough->m_descriptor.yMaxRange) < 4000. ){
-
-      // asumes region is barrel and looks in adjacent regions (clever logic TM here)
-      MuonStationIndex::DetectorRegionIndex neighbourRegion = MuonStationIndex::Barrel;
-      if( region == MuonStationIndex::Barrel ){
-        if( seed.pos < 0 ) neighbourRegion = MuonStationIndex::EndcapC;
-        else               neighbourRegion = MuonStationIndex::EndcapA;
-      } // in all other cases the neigbourRegion is definitely barrel
-      
-      // looping over all layers in neigbouring region
-      for( int lay=0;lay<Muon::MuonStationIndex::LayerIndexMax;++lay ){
-        MuonStationIndex::LayerIndex layer   = static_cast<MuonStationIndex::LayerIndex>(lay);
-        
-        // skip barrel combinations with BEE
-        if( region == MuonStationIndex::Barrel && layer == MuonStationIndex::BarrelExtended ) continue;
-
-        double distanceCut = 1000.;
-
-        // get maxima from neigboring region
-        unsigned int layerHash = MuonStationIndex::sectorLayerHash(neighbourRegion,layer);
-        const MaximumVec& maxima = maxVec[layerHash];
-        if( maxima.empty() ) continue;
-        ATH_MSG_DEBUG("Associating maxima in neighbouring region " << MuonStationIndex::regionName(neighbourRegion) 
-                                                            << " " << MuonStationIndex::layerName(layer) 
-                                                       << " hash " << layerHash 
-                                                       << " size " << maxima.size() ); 
-  
-        // loop over maxima per layer
-        for( auto mit = maxima.begin();mit!=maxima.end();++mit ){
-          MuonHough::MuonLayerHough::Maximum* candMaximum = *mit;
-          // extrapolate seed to layer assuming a pointing straight line, swap coordinates
-          float yloc_diff =  MuonHough::extrapolate(seed, *candMaximum, m_doParabolicExtrapolation);
-          ATH_MSG_VERBOSE(" Maximum position: y " << candMaximum->pos 
-                                         << " x " << candMaximum->hough->m_descriptor.referencePosition 
-                                    << " seed y " << seed.hough->m_descriptor.referencePosition 
-                                         << " x " << seed.pos 
-                                 << " intersect diff " << yloc_diff );
-
-          if( std::abs(yloc_diff) < distanceCut ) {
-            road.add(candMaximum);
-            road.neighbouringRegion = neighbourRegion;
-          }
-        }      
-      }
-    }    
-
-    // search for phiMaxima using the etaMaximum of the road in the current sector
-    std::set<const TgcClusterObj3D*> tgcClusters;
-    std::set<Identifier> triggerLayers;
-    const MaximumVec& maxima = road.maxima;
-    for( auto mit = maxima.begin();mit!=maxima.end();++mit ){
-      MuonHough::MuonLayerHough::Maximum* maximum = *mit;
-      if (maximum->hough->m_descriptor.sector != sectorData.sector) continue; // skip cases where a maximum on the road does not belong to the currently examined sector
-
-      // gather tgcClusters associated to the hits of the maxima
-      for( auto ehit = maximum->hits.begin();ehit!=maximum->hits.end();++ehit ){
-        const MuonHough::Hit& etaHit = **ehit;
-        if (etaHit.tgc){
-          if (!etaHit.tgc->phiCluster.hitList.empty()) tgcClusters.insert(etaHit.tgc);
-        }
-        else if( etaHit.prd ){
-          triggerLayers.insert(m_idHelperSvc->gasGapId(etaHit.prd->identify()));
+    // maximum in middle layer
+    // says look in other layers
+    // if yes, combine them
+    // gets on road
+    // roads are combinations of maxima
+
+    void MuonLayerHoughTool::extendSeed(MuonHough::MuonDetectorHough& detectorHoughTransforms, std::set<Identifier>& truthHits,
+                                        std::set<Identifier>& foundTruthHits, MuonLayerHoughTool::Road& road,
+                                        MuonLayerHoughTool::HoughDataPerSector& sectorData) const {  // const {
+        if (!road.seed) return;
+
+        RegionMaximumVec& maxVec = sectorData.maxVec;
+
+        // gather locality information on seed
+        MuonHough::MuonLayerHough::Maximum& seed = *road.seed;
+        MuonStationIndex::LayerIndex seedLayer = Muon::MuonStationIndex::toLayerIndex(seed.hough->m_descriptor.chIndex);
+        MuonStationIndex::DetectorRegionIndex region = seed.hough->m_descriptor.region;
+
+        // loop over layers in the same region as the seed ( inner, middle, outer)
+        for (int lay = 0; lay < Muon::MuonStationIndex::LayerIndexMax; ++lay) {
+            MuonStationIndex::LayerIndex layer = static_cast<MuonStationIndex::LayerIndex>(lay);
+            if (layer == seedLayer && seed.hough->m_descriptor.sector == sectorData.sector) continue;
+
+            // untrue -> look in neighboring layer
+            // true -> look only in this layer
+            double distanceCut = layer == seedLayer ? 500. : (double)m_extrapolationDistance;
+
+            unsigned int layerHash = MuonStationIndex::sectorLayerHash(region, layer);
+
+            // fetching vector of maxima for given region and layer
+            const MaximumVec& maxima = maxVec[layerHash];
+            if (maxima.empty()) continue;
+
+            ATH_MSG_DEBUG("Associating maxima in " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer)
+                                                   << " size " << maxima.size());
+            // loop over maxima in layer
+            for (auto mit = maxima.begin(); mit != maxima.end(); ++mit) {
+                MuonHough::MuonLayerHough::Maximum* candMaximum = *mit;
+                // extrapolate seed to layer assuming a pointing straight line or parabolic
+                // add maximum to road if close enough
+                float yloc_diff = MuonHough::extrapolate(seed, *candMaximum, m_doParabolicExtrapolation);
+                if (std::abs(MuonHough::extrapolate(seed, *candMaximum, m_doParabolicExtrapolation)) < distanceCut) {
+                    ATH_MSG_VERBOSE(" Adding maximum position " << candMaximum->pos << " intersect diff" << yloc_diff);
+                    road.add(candMaximum);
+                } else {
+                    ATH_MSG_VERBOSE(" Maximum position: y "
+                                    << candMaximum->pos << " x " << candMaximum->hough->m_descriptor.referencePosition << " seed y "
+                                    << seed.hough->m_descriptor.referencePosition << " x " << seed.pos << " intersect diff " << yloc_diff);
+                }
+            }
         }
-      }
-    }
-      
-    MuonHough::MuonPhiLayerHough& phiHough = detectorHoughTransforms.phiHough( region ); // get phi transform in the same region as the seed
-            
-    // gather phiHits in sector that match the etaHits of the maximum
-    PhiHitVec phiHitsInMaximum;
-    PhiHitVec& phiHits = sectorData.phiHitVec[region];      
-    for( PhiHitVec::iterator phit = phiHits.begin(); phit != phiHits.end();++phit ){
-      MuonHough::PhiHit *phiHit = *phit;
-      if (phiHit->tgc){
-        if (tgcClusters.find((*phit)->tgc) != tgcClusters.end()) phiHitsInMaximum.push_back(phiHit);
-      }
-      else if (phiHit->prd){
-        if (triggerLayers.find(m_idHelperSvc->gasGapId(phiHit->prd->identify())) != triggerLayers.end()) phiHitsInMaximum.push_back(phiHit);
-      }
-    }
-    
-    // fill phi hits 
-    ATH_MSG_DEBUG("extendSeed: Filling s"  << sectorData.sector
-                               <<  " "  << MuonStationIndex::regionName(region)
-                               << " phiHitsInMaxima " << phiHitsInMaximum.size()
-                               << " phi hits:  "      << phiHits.size() );
-
-    if( !findMaxima(truthHits, foundTruthHits, phiHough,phiHitsInMaximum,
-        sectorData.phiMaxVec[region], sectorData.sector) || sectorData.phiMaxVec[region].empty() ) {
-      ATH_MSG_DEBUG("extendSeed: No phi maxima found in  s" << sectorData.sector << " " << MuonStationIndex::regionName(region) );
-      return;
-    }
 
-    ++sectorData.nphilayersWithMaxima[region];
-    sectorData.nphimaxHitsInRegion[region] += sectorData.phiMaxVec[region].front()->max;
-
-    ATH_MSG_DEBUG("extendSeed: Sector phiMaxima Summary:  s" << sectorData.sector <<  " " << MuonStationIndex::regionName(region) <<   " " << sectorData.nphilayersWithMaxima[region] 
-                                                             <<  " -> nPhiMaxima: " << sectorData.phiMaxVec[region].size()
-                                                             <<  " max sum: "    << sectorData.nphimaxHitsInRegion[region] );
-
-
-  }
-  
-  // phi hits are not separated into inner middle outer
-  // maxima found in road
-  void MuonLayerHoughTool::associatePhiMaxima( MuonLayerHoughTool::Road& road, MuonLayerHoughTool::PhiMaximumVec& phiMaxima ) const {
-    ATH_MSG_DEBUG("associateMaximaToPhiMaxima: phi maxima " << phiMaxima.size() );
-    if( !road.seed ) return;
-
-    // loop over phi maxima
-    for( auto pit = phiMaxima.begin();pit!=phiMaxima.end();++pit ){
-      
-      // reference to phi maximum
-      MuonHough::MuonPhiLayerHough::Maximum& pmaximum = **pit;
-      
-      ATH_MSG_DEBUG(" new phi maximum " << pmaximum.max << " hits " << pmaximum.hits.size() );
-
-      // precalculate the layers + TGC clusters and add them to a set for easy access
-      std::map<Identifier, std::pair<double,double> > triggerLayersPhiMinMax;
-      std::map<MuonStationIndex::StIndex,std::set<const TgcClusterObj3D*> > tgcClusters;
-
-      // loop over hits
-      PhiHitVec::const_iterator phit = pmaximum.hits.begin();
-      PhiHitVec::const_iterator phit_end = pmaximum.hits.end();
-      for( ;phit!=phit_end;++phit ){
-        const MuonHough::PhiHit& phiHit = **phit; 
-        // two cases 
-        // case 1: phiHit measured in TGC -> get phiHits from phiCluster
-        // case 2: phiHit is prepared raw data -> use phiHit to extend the triggerLayersPhinMinMax map
-        if( phiHit.tgc ){
-          if(  phiHit.tgc->phiCluster.hitList.empty() ) ATH_MSG_WARNING(" TGC 3D cluster without phi hits ");
-          else tgcClusters[m_idHelperSvc->stationIndex( phiHit.tgc->phiCluster.hitList.front()->identify() )].insert(phiHit.tgc);
+        // check if the maximum is close to the detector boundary, if yes look for maxima in the neighbouring region, skip BarrelExtended
+        if (seedLayer == MuonStationIndex::BarrelExtended) return;
+
+        ATH_MSG_DEBUG("Checking Barrel/Endcap overlaps: min dist edge "
+                      << seed.pos - seed.hough->m_descriptor.yMinRange << " max dist edge " << seed.pos - seed.hough->m_descriptor.yMaxRange
+                      << " pos " << seed.pos << " range " << seed.hough->m_descriptor.yMinRange << " "
+                      << seed.hough->m_descriptor.yMaxRange);
+
+        if (std::abs(seed.pos - seed.hough->m_descriptor.yMinRange) < 4000. ||
+            std::abs(seed.pos - seed.hough->m_descriptor.yMaxRange) < 4000.) {
+            // asumes region is barrel and looks in adjacent regions (clever logic TM here)
+            MuonStationIndex::DetectorRegionIndex neighbourRegion = MuonStationIndex::Barrel;
+            if (region == MuonStationIndex::Barrel) {
+                if (seed.pos < 0)
+                    neighbourRegion = MuonStationIndex::EndcapC;
+                else
+                    neighbourRegion = MuonStationIndex::EndcapA;
+            }  // in all other cases the neigbourRegion is definitely barrel
+
+            // looping over all layers in neigbouring region
+            for (int lay = 0; lay < Muon::MuonStationIndex::LayerIndexMax; ++lay) {
+                MuonStationIndex::LayerIndex layer = static_cast<MuonStationIndex::LayerIndex>(lay);
+
+                // skip barrel combinations with BEE
+                if (region == MuonStationIndex::Barrel && layer == MuonStationIndex::BarrelExtended) continue;
+
+                double distanceCut = 1000.;
+
+                // get maxima from neigboring region
+                unsigned int layerHash = MuonStationIndex::sectorLayerHash(neighbourRegion, layer);
+                const MaximumVec& maxima = maxVec[layerHash];
+                if (maxima.empty()) continue;
+                ATH_MSG_DEBUG("Associating maxima in neighbouring region " << MuonStationIndex::regionName(neighbourRegion) << " "
+                                                                           << MuonStationIndex::layerName(layer) << " hash " << layerHash
+                                                                           << " size " << maxima.size());
+
+                // loop over maxima per layer
+                for (auto mit = maxima.begin(); mit != maxima.end(); ++mit) {
+                    MuonHough::MuonLayerHough::Maximum* candMaximum = *mit;
+                    // extrapolate seed to layer assuming a pointing straight line, swap coordinates
+                    float yloc_diff = MuonHough::extrapolate(seed, *candMaximum, m_doParabolicExtrapolation);
+                    ATH_MSG_VERBOSE(" Maximum position: y "
+                                    << candMaximum->pos << " x " << candMaximum->hough->m_descriptor.referencePosition << " seed y "
+                                    << seed.hough->m_descriptor.referencePosition << " x " << seed.pos << " intersect diff " << yloc_diff);
+
+                    if (std::abs(yloc_diff) < distanceCut) {
+                        road.add(candMaximum);
+                        road.neighbouringRegion = neighbourRegion;
+                    }
+                }
+            }
         }
-        else if( phiHit.prd ){
-          Identifier gpId = m_idHelperSvc->gasGapId(phiHit.prd->identify());
-          auto mit = triggerLayersPhiMinMax.find(gpId);
-          if( mit == triggerLayersPhiMinMax.end() ) triggerLayersPhiMinMax[gpId] = std::make_pair(phiHit.phimin,phiHit.phimax);
-          else{
-            if( phiHit.phimin < mit->second.first  ) mit->second.first  = phiHit.phimin;
-            if( phiHit.phimax > mit->second.second ) mit->second.second = phiHit.phimax;
-          }
+
+        // search for phiMaxima using the etaMaximum of the road in the current sector
+        std::set<const TgcClusterObj3D*> tgcClusters;
+        std::set<Identifier> triggerLayers;
+        const MaximumVec& maxima = road.maxima;
+        for (auto mit = maxima.begin(); mit != maxima.end(); ++mit) {
+            MuonHough::MuonLayerHough::Maximum* maximum = *mit;
+            if (maximum->hough->m_descriptor.sector != sectorData.sector)
+                continue;  // skip cases where a maximum on the road does not belong to the currently examined sector
+
+            // gather tgcClusters associated to the hits of the maxima
+            for (auto ehit = maximum->hits.begin(); ehit != maximum->hits.end(); ++ehit) {
+                const MuonHough::Hit& etaHit = **ehit;
+                if (etaHit.tgc) {
+                    if (!etaHit.tgc->phiCluster.hitList.empty()) tgcClusters.insert(etaHit.tgc);
+                } else if (etaHit.prd) {
+                    triggerLayers.insert(m_idHelperSvc->gasGapId(etaHit.prd->identify()));
+                }
+            }
         }
-      }
-      // print out information on the triggerLayersPhiMinMax
-      if( false ){
-        ATH_MSG_DEBUG("Trigger layers " << triggerLayersPhiMinMax.size() << " tgc layers " << tgcClusters.size() );
-        for( auto tgcit = triggerLayersPhiMinMax.begin() ;tgcit!=triggerLayersPhiMinMax.end();++tgcit ){
-          ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString(tgcit->first) );
+
+        MuonHough::MuonPhiLayerHough& phiHough =
+            detectorHoughTransforms.phiHough(region);  // get phi transform in the same region as the seed
+
+        // gather phiHits in sector that match the etaHits of the maximum
+        PhiHitVec phiHitsInMaximum;
+        PhiHitVec& phiHits = sectorData.phiHitVec[region];
+        for (PhiHitVec::iterator phit = phiHits.begin(); phit != phiHits.end(); ++phit) {
+            MuonHough::PhiHit* phiHit = *phit;
+            if (phiHit->tgc) {
+                if (tgcClusters.find((*phit)->tgc) != tgcClusters.end()) phiHitsInMaximum.push_back(phiHit);
+            } else if (phiHit->prd) {
+                if (triggerLayers.find(m_idHelperSvc->gasGapId(phiHit->prd->identify())) != triggerLayers.end())
+                    phiHitsInMaximum.push_back(phiHit);
+            }
         }
-        
-        // loop over the stations and the contained tgcClusters found in the previous step, print out information
-        std::map<MuonStationIndex::StIndex,std::set<const TgcClusterObj3D*> >::const_iterator stit = tgcClusters.begin();
-        std::map<MuonStationIndex::StIndex,std::set<const TgcClusterObj3D*> >::const_iterator stit_end = tgcClusters.end();
-        for( ;stit != stit_end; ++stit ){
-          std::set<const TgcClusterObj3D*>::const_iterator ttit = stit->second.begin();
-          std::set<const TgcClusterObj3D*>::const_iterator ttit_end = stit->second.end();
-          for( ;ttit!=ttit_end;++ttit ){
-            ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString( (*ttit)->phiCluster.hitList.front()->identify() ) << "  nhits " <<  (*ttit)->phiCluster.hitList.size() );
-          }
+
+        // fill phi hits
+        ATH_MSG_DEBUG("extendSeed: Filling s" << sectorData.sector << " " << MuonStationIndex::regionName(region) << " phiHitsInMaxima "
+                                              << phiHitsInMaximum.size() << " phi hits:  " << phiHits.size());
+
+        if (!findMaxima(truthHits, foundTruthHits, phiHough, phiHitsInMaximum, sectorData.phiMaxVec[region], sectorData.sector) ||
+            sectorData.phiMaxVec[region].empty()) {
+            ATH_MSG_DEBUG("extendSeed: No phi maxima found in  s" << sectorData.sector << " " << MuonStationIndex::regionName(region));
+            return;
         }
-      }
-
-      // check if there are matching maxima in neighbouring sectors, add maximum values if confirmation is found
-      // overlap counters
-      int noverlaps = 0;
-      int nNoOverlaps = 0;
-      double phimin =  10;
-      double phimax = -10;
-      
-      // loop over all maxima found on road
-      for( auto *max : road.maxima ){
-
-        // get station information for maximum on road
-        const MuonHough::MuonLayerHough::Maximum& maximum = *max;
-        MuonStationIndex::StIndex stIndex = MuonStationIndex::toStationIndex(maximum.hough->m_descriptor.chIndex);
-
-        // loop over eta hits
-        for( auto ehit = maximum.hits.begin();ehit!=maximum.hits.end();++ehit ){
-          const MuonHough::Hit& etaHit = **ehit; 
-          if( etaHit.tgc ) {
-            if( etaHit.tgc->etaCluster.hitList.empty() ) ATH_MSG_WARNING(" TGC 3D cluster without eta hits " );
-            else{
-              if( tgcClusters[stIndex].count(etaHit.tgc) ){
-                // now loop over phi maximum and find phi hit
-                for( auto phit = pmaximum.hits.begin(); phit!=pmaximum.hits.end();++phit ){
-                  const MuonHough::PhiHit& phiHit = **phit; 
-                  if( phiHit.tgc == etaHit.tgc ){
-                    if( phiHit.phimin < phimin ) phimin = phiHit.phimin;
-                    if( phiHit.phimin > phimax ) phimax = phiHit.phimax;
-                    break;
-                  }
+
+        ++sectorData.nphilayersWithMaxima[region];
+        sectorData.nphimaxHitsInRegion[region] += sectorData.phiMaxVec[region].front()->max;
+
+        ATH_MSG_DEBUG("extendSeed: Sector phiMaxima Summary:  s" << sectorData.sector << " " << MuonStationIndex::regionName(region) << " "
+                                                                 << sectorData.nphilayersWithMaxima[region]
+                                                                 << " -> nPhiMaxima: " << sectorData.phiMaxVec[region].size()
+                                                                 << " max sum: " << sectorData.nphimaxHitsInRegion[region]);
+    }
+
+    // phi hits are not separated into inner middle outer
+    // maxima found in road
+    void MuonLayerHoughTool::associatePhiMaxima(MuonLayerHoughTool::Road& road, MuonLayerHoughTool::PhiMaximumVec& phiMaxima) const {
+        ATH_MSG_DEBUG("associateMaximaToPhiMaxima: phi maxima " << phiMaxima.size());
+        if (!road.seed) return;
+
+        // loop over phi maxima
+        for (auto pit = phiMaxima.begin(); pit != phiMaxima.end(); ++pit) {
+            // reference to phi maximum
+            MuonHough::MuonPhiLayerHough::Maximum& pmaximum = **pit;
+
+            ATH_MSG_DEBUG(" new phi maximum " << pmaximum.max << " hits " << pmaximum.hits.size());
+
+            // precalculate the layers + TGC clusters and add them to a set for easy access
+            std::map<Identifier, std::pair<double, double>> triggerLayersPhiMinMax;
+            std::map<MuonStationIndex::StIndex, std::set<const TgcClusterObj3D*>> tgcClusters;
+
+            // loop over hits
+            PhiHitVec::const_iterator phit = pmaximum.hits.begin();
+            PhiHitVec::const_iterator phit_end = pmaximum.hits.end();
+            for (; phit != phit_end; ++phit) {
+                const MuonHough::PhiHit& phiHit = **phit;
+                // two cases
+                // case 1: phiHit measured in TGC -> get phiHits from phiCluster
+                // case 2: phiHit is prepared raw data -> use phiHit to extend the triggerLayersPhinMinMax map
+                if (phiHit.tgc) {
+                    if (phiHit.tgc->phiCluster.hitList.empty())
+                        ATH_MSG_WARNING(" TGC 3D cluster without phi hits ");
+                    else
+                        tgcClusters[m_idHelperSvc->stationIndex(phiHit.tgc->phiCluster.hitList.front()->identify())].insert(phiHit.tgc);
+                } else if (phiHit.prd) {
+                    Identifier gpId = m_idHelperSvc->gasGapId(phiHit.prd->identify());
+                    auto mit = triggerLayersPhiMinMax.find(gpId);
+                    if (mit == triggerLayersPhiMinMax.end())
+                        triggerLayersPhiMinMax[gpId] = std::make_pair(phiHit.phimin, phiHit.phimax);
+                    else {
+                        if (phiHit.phimin < mit->second.first) mit->second.first = phiHit.phimin;
+                        if (phiHit.phimax > mit->second.second) mit->second.second = phiHit.phimax;
+                    }
                 }
-                ++noverlaps;
-              }
-              else{
-                ++nNoOverlaps;
-              }
             }
-          }else if( etaHit.prd ){
-            if( !m_idHelperSvc->isRpc(etaHit.prd->identify()) && !m_idHelperSvc->issTgc(etaHit.prd->identify())) continue;
-            Identifier gpId = m_idHelperSvc->gasGapId( etaHit.prd->identify() );
-            auto mit = triggerLayersPhiMinMax.find(gpId);
-            if( mit == triggerLayersPhiMinMax.end() )  ++nNoOverlaps;
-            else{
-              if( mit->second.first  < phimin ) phimin = mit->second.first;
-              if( mit->second.second > phimax ) phimax = mit->second.second;
-              ++noverlaps;
+            // print out information on the triggerLayersPhiMinMax
+            if (false) {
+                ATH_MSG_DEBUG("Trigger layers " << triggerLayersPhiMinMax.size() << " tgc layers " << tgcClusters.size());
+                for (auto tgcit = triggerLayersPhiMinMax.begin(); tgcit != triggerLayersPhiMinMax.end(); ++tgcit) {
+                    ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString(tgcit->first));
+                }
+
+                // loop over the stations and the contained tgcClusters found in the previous step, print out information
+                std::map<MuonStationIndex::StIndex, std::set<const TgcClusterObj3D*>>::const_iterator stit = tgcClusters.begin();
+                std::map<MuonStationIndex::StIndex, std::set<const TgcClusterObj3D*>>::const_iterator stit_end = tgcClusters.end();
+                for (; stit != stit_end; ++stit) {
+                    std::set<const TgcClusterObj3D*>::const_iterator ttit = stit->second.begin();
+                    std::set<const TgcClusterObj3D*>::const_iterator ttit_end = stit->second.end();
+                    for (; ttit != ttit_end; ++ttit) {
+                        ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString((*ttit)->phiCluster.hitList.front()->identify()) << "  nhits "
+                                             << (*ttit)->phiCluster.hitList.size());
+                    }
+                }
             }
-          }
-        } // loop over hits in maximum
-      } // loop over maxima in road
-      
-      // if overlaps are found, add the phi maximum in question to the road
-      if( noverlaps > 0 ) {
-        road.add(&pmaximum);
-        // check if we are close to a sector boundary
-        std::vector<int> sectors;
-        m_sectorMapping.getSectors(phimin,sectors);
-        if( sectors.size() > 1 ){
-          for( auto sec : sectors ){
-            if( sec != road.seed->hough->m_descriptor.sector ) road.neighbouringSector = sec;
-          }
-        }else{
-          std::vector<int> sectors;
-          m_sectorMapping.getSectors(phimax,sectors);
-          if( sectors.size() > 1 ){
-            for( auto sec : sectors ){
-              if( sec != road.seed->hough->m_descriptor.sector ) road.neighbouringSector = sec;
+
+            // check if there are matching maxima in neighbouring sectors, add maximum values if confirmation is found
+            // overlap counters
+            int noverlaps = 0;
+            int nNoOverlaps = 0;
+            double phimin = 10;
+            double phimax = -10;
+
+            // loop over all maxima found on road
+            for (auto* max : road.maxima) {
+                // get station information for maximum on road
+                const MuonHough::MuonLayerHough::Maximum& maximum = *max;
+                MuonStationIndex::StIndex stIndex = MuonStationIndex::toStationIndex(maximum.hough->m_descriptor.chIndex);
+
+                // loop over eta hits
+                for (auto ehit = maximum.hits.begin(); ehit != maximum.hits.end(); ++ehit) {
+                    const MuonHough::Hit& etaHit = **ehit;
+                    if (etaHit.tgc) {
+                        if (etaHit.tgc->etaCluster.hitList.empty())
+                            ATH_MSG_WARNING(" TGC 3D cluster without eta hits ");
+                        else {
+                            if (tgcClusters[stIndex].count(etaHit.tgc)) {
+                                // now loop over phi maximum and find phi hit
+                                for (auto phit = pmaximum.hits.begin(); phit != pmaximum.hits.end(); ++phit) {
+                                    const MuonHough::PhiHit& phiHit = **phit;
+                                    if (phiHit.tgc == etaHit.tgc) {
+                                        if (phiHit.phimin < phimin) phimin = phiHit.phimin;
+                                        if (phiHit.phimin > phimax) phimax = phiHit.phimax;
+                                        break;
+                                    }
+                                }
+                                ++noverlaps;
+                            } else {
+                                ++nNoOverlaps;
+                            }
+                        }
+                    } else if (etaHit.prd) {
+                        if (!m_idHelperSvc->isRpc(etaHit.prd->identify()) && !m_idHelperSvc->issTgc(etaHit.prd->identify())) continue;
+                        Identifier gpId = m_idHelperSvc->gasGapId(etaHit.prd->identify());
+                        auto mit = triggerLayersPhiMinMax.find(gpId);
+                        if (mit == triggerLayersPhiMinMax.end())
+                            ++nNoOverlaps;
+                        else {
+                            if (mit->second.first < phimin) phimin = mit->second.first;
+                            if (mit->second.second > phimax) phimax = mit->second.second;
+                            ++noverlaps;
+                        }
+                    }
+                }  // loop over hits in maximum
+            }      // loop over maxima in road
+
+            // if overlaps are found, add the phi maximum in question to the road
+            if (noverlaps > 0) {
+                road.add(&pmaximum);
+                // check if we are close to a sector boundary
+                std::vector<int> sectors;
+                m_sectorMapping.getSectors(phimin, sectors);
+                if (sectors.size() > 1) {
+                    for (auto sec : sectors) {
+                        if (sec != road.seed->hough->m_descriptor.sector) road.neighbouringSector = sec;
+                    }
+                } else {
+                    std::vector<int> sectors;
+                    m_sectorMapping.getSectors(phimax, sectors);
+                    if (sectors.size() > 1) {
+                        for (auto sec : sectors) {
+                            if (sec != road.seed->hough->m_descriptor.sector) road.neighbouringSector = sec;
+                        }
+                    }
+                }
             }
-          }
+            ATH_MSG_DEBUG(" Overlap with Phi maximum: overlap " << noverlaps << " no overlap " << nNoOverlaps << " phimin " << phimin
+                                                                << " phimax " << phimax << " neighbouring sector "
+                                                                << road.neighbouringSector);
         }
-      }
-      ATH_MSG_DEBUG(" Overlap with Phi maximum: overlap " << noverlaps << " no overlap " << nNoOverlaps 
-                    << " phimin " << phimin << " phimax " << phimax << " neighbouring sector " << road.neighbouringSector );  
-
     }
-  }
-
-  // takes the maxima from a given sector and tries to associate it with the maxima of the adjacent sectors
-  void MuonLayerHoughTool::associateMaximaInNeighbouringSectors( MuonLayerHoughTool::HoughDataPerSector& houghData, std::vector<MuonLayerHoughTool::HoughDataPerSector>& houghDataPerSectorVec ) const {
-    
-    ATH_MSG_DEBUG(" looping over eta maxima");
-
-    // now loop over eta maxima per layer
-    for( unsigned int regLay=0;regLay<houghData.maxVec.size();++regLay ){
-  
-      MaximumVec& maxima = houghData.maxVec[regLay];
-      int sector = houghData.sector;
-
-      // loop over two neighbouring sectors
-      for( int i=0;i<2;++i ){
-  
-        // calculate neighbouring sector index
-        int sectorN = (i == 0) ? sector - 1 : sector + 1;
-        if( i == 0 && sector == 1 ) sectorN = 16;
-        if( i == 1 && sector == 16 ) sectorN = 1;
-        
-        MuonLayerHoughTool::HoughDataPerSector& houghDataN = houghDataPerSectorVec[sectorN-1];
-        
-        MaximumVec& maximaN = houghDataN.maxVec[regLay];
-        
-        // loop over maxima in layer
-        MaximumVec::iterator mit     = maxima.begin();
-        MaximumVec::iterator mit_end = maxima.end();
-        for( ;mit!=mit_end;++mit ){
-        
-          // reference to maximum
-          MuonHough::MuonLayerHough::Maximum& maximum = **mit;
-          
-          if( !maximum.hough ){
-            ATH_MSG_WARNING("Maximum without associated hough transform! " );
-            continue;
-          }
-        
-          // loop over maxima per layer in neighbouring sector
-          MaximumVec::iterator nmit = maximaN.begin();
-          MaximumVec::iterator nmit_end = maximaN.end();
-          for( ;nmit!=nmit_end;++nmit ){
-        
-            // reference to maximum
-            MuonHough::MuonLayerHough::Maximum& maximumN = **nmit;
-            if( !maximumN.hough ){
-              ATH_MSG_WARNING("Maximum without associated hough transform! " );
-              continue;
-            }
-            
-            // calculate the position of the first maximum in the reference frame of the other sector
-            double rcor = maximumN.hough->m_descriptor.referencePosition*m_sectorMapping.transformRToNeighboringSector( maximum.pos,sector,sectorN)/maximum.hough->m_descriptor.referencePosition;
-            double dist = rcor - maximumN.pos;
-            ATH_MSG_DEBUG(" maximumN.hough " << maximumN.hough->m_descriptor.referencePosition << " maximum.hough " << maximum.hough->m_descriptor.referencePosition << " maximumN.pos " << maximumN.pos << " maximum.pos " << maximum.pos << rcor << " distance " << dist );
-            if( std::abs(dist) > 100 ) continue;
-            houghData.maxAssociationMap[&maximum].push_back(&maximumN);
-            houghDataN.associatedToOtherSector.insert(&maximumN);
-        
-            ATH_MSG_DEBUG(" Found maximum in neighbouring sector: max " << maximum.max
-              << " pos " << rcor << " maxN " <<  maximumN.max << " pos " << maximumN.pos 
-              << " distance " << dist   );
-            
-            // loop over first and second maximum
-            for( int nn = 0; nn < 2; ++nn ){
-        
-              // setting info for the debug-info objects of the hits
-              MuonHough::MuonLayerHough::Maximum& maxi = nn == 0 ? maximum : maximumN;
-              MuonHough::MuonLayerHough::Maximum& maxi2 = nn == 0 ? maximumN : maximum;
-              ATH_MSG_VERBOSE(" Maximum " << nn << " hits " << maxi.hits.size() );
-              HitVec::const_iterator ehit = maxi.hits.begin();
-              HitVec::const_iterator ehit_end = maxi.hits.end();
-              for( ;ehit!=ehit_end;++ehit ){
-                MuonHough::Hit& hit = **ehit; 
-                if( hit.debugInfo() ) {
-                  hit.debugInfo()->phn = maxi2.max;
-                  Identifier id = hit.tgc ? hit.tgc->etaCluster.hitList.front()->identify() : hit.prd->identify();
-                  ATH_MSG_VERBOSE(" " << m_idHelperSvc->toString(id) << " setphn " << hit.debugInfo()->phn);
+
+    // takes the maxima from a given sector and tries to associate it with the maxima of the adjacent sectors
+    void MuonLayerHoughTool::associateMaximaInNeighbouringSectors(
+        MuonLayerHoughTool::HoughDataPerSector& houghData,
+        std::vector<MuonLayerHoughTool::HoughDataPerSector>& houghDataPerSectorVec) const {
+        ATH_MSG_DEBUG(" looping over eta maxima");
+
+        // now loop over eta maxima per layer
+        for (unsigned int regLay = 0; regLay < houghData.maxVec.size(); ++regLay) {
+            MaximumVec& maxima = houghData.maxVec[regLay];
+            int sector = houghData.sector;
+
+            // loop over two neighbouring sectors
+            for (int i = 0; i < 2; ++i) {
+                // calculate neighbouring sector index
+                int sectorN = (i == 0) ? sector - 1 : sector + 1;
+                if (i == 0 && sector == 1) sectorN = 16;
+                if (i == 1 && sector == 16) sectorN = 1;
+
+                MuonLayerHoughTool::HoughDataPerSector& houghDataN = houghDataPerSectorVec[sectorN - 1];
+
+                MaximumVec& maximaN = houghDataN.maxVec[regLay];
+
+                // loop over maxima in layer
+                MaximumVec::iterator mit = maxima.begin();
+                MaximumVec::iterator mit_end = maxima.end();
+                for (; mit != mit_end; ++mit) {
+                    // reference to maximum
+                    MuonHough::MuonLayerHough::Maximum& maximum = **mit;
+
+                    if (!maximum.hough) {
+                        ATH_MSG_WARNING("Maximum without associated hough transform! ");
+                        continue;
+                    }
+
+                    // loop over maxima per layer in neighbouring sector
+                    MaximumVec::iterator nmit = maximaN.begin();
+                    MaximumVec::iterator nmit_end = maximaN.end();
+                    for (; nmit != nmit_end; ++nmit) {
+                        // reference to maximum
+                        MuonHough::MuonLayerHough::Maximum& maximumN = **nmit;
+                        if (!maximumN.hough) {
+                            ATH_MSG_WARNING("Maximum without associated hough transform! ");
+                            continue;
+                        }
+
+                        // calculate the position of the first maximum in the reference frame of the other sector
+                        double rcor = maximumN.hough->m_descriptor.referencePosition *
+                                      m_sectorMapping.transformRToNeighboringSector(maximum.pos, sector, sectorN) /
+                                      maximum.hough->m_descriptor.referencePosition;
+                        double dist = rcor - maximumN.pos;
+                        ATH_MSG_DEBUG(" maximumN.hough " << maximumN.hough->m_descriptor.referencePosition << " maximum.hough "
+                                                         << maximum.hough->m_descriptor.referencePosition << " maximumN.pos "
+                                                         << maximumN.pos << " maximum.pos " << maximum.pos << rcor << " distance " << dist);
+                        if (std::abs(dist) > 100) continue;
+                        houghData.maxAssociationMap[&maximum].push_back(&maximumN);
+                        houghDataN.associatedToOtherSector.insert(&maximumN);
+
+                        ATH_MSG_DEBUG(" Found maximum in neighbouring sector: max " << maximum.max << " pos " << rcor << " maxN "
+                                                                                    << maximumN.max << " pos " << maximumN.pos
+                                                                                    << " distance " << dist);
+
+                        // loop over first and second maximum
+                        for (int nn = 0; nn < 2; ++nn) {
+                            // setting info for the debug-info objects of the hits
+                            MuonHough::MuonLayerHough::Maximum& maxi = nn == 0 ? maximum : maximumN;
+                            MuonHough::MuonLayerHough::Maximum& maxi2 = nn == 0 ? maximumN : maximum;
+                            ATH_MSG_VERBOSE(" Maximum " << nn << " hits " << maxi.hits.size());
+                            HitVec::const_iterator ehit = maxi.hits.begin();
+                            HitVec::const_iterator ehit_end = maxi.hits.end();
+                            for (; ehit != ehit_end; ++ehit) {
+                                MuonHough::Hit& hit = **ehit;
+                                if (hit.debugInfo()) {
+                                    hit.debugInfo()->phn = maxi2.max;
+                                    Identifier id = hit.tgc ? hit.tgc->etaCluster.hitList.front()->identify() : hit.prd->identify();
+                                    ATH_MSG_VERBOSE(" " << m_idHelperSvc->toString(id) << " setphn " << hit.debugInfo()->phn);
+                                }
+                            }
+                        }
+                    }
                 }
-              }
             }
-          }
         }
-      } 
     }
-  }
-
-
-  void MuonLayerHoughTool::associateMaximaToPhiMaxima( MuonStationIndex::DetectorRegionIndex region, MuonLayerHoughTool::HoughDataPerSector& houghData,
-         std::map< MuonHough::MuonPhiLayerHough::Maximum*, MuonLayerHoughTool::MaximumVec >& phiEtaAssociations,
-         MuonLayerHoughTool::RegionMaximumVec& unassEtaMaxima) const
-  {
-         
-    std::set<MuonHough::MuonLayerHough::Maximum*> associatedMaxima;
-
-    PhiMaximumVec& phiMaxima = houghData.phiMaxVec[region];
-
-    ATH_MSG_DEBUG("associateMaximaToPhiMaxima in sector " << houghData.sector << ": phi maxima " << phiMaxima.size() ); // !!!!
-    // loop over phi maxima
-    PhiMaximumVec::iterator pit = phiMaxima.begin(); 
-    PhiMaximumVec::iterator pit_end = phiMaxima.end(); 
-    for( ;pit!=pit_end;++pit ){
-      
-      // reference to phi maximum
-      MuonHough::MuonPhiLayerHough::Maximum& phiMaximum = **pit;
-      
-      ATH_MSG_DEBUG(" Considering phi maximum " << phiMaximum.max << " hits " << phiMaximum.hits.size() ); // !!!!
-
-      // store associated maxima
-      MaximumVec associatedMaximaVec; // !!!!
-
-      // precalculate the layers + TGC clusters and add them to a set for easy access
-      // std::map< Identifier,std::pair<double,double> > triggerLayersP;
-      std::set<Identifier> triggerLayers;
-      std::map<MuonStationIndex::StIndex,std::set<const TgcClusterObj3D*> > tgcClusters;
-      
-      // loop over hits
-      PhiHitVec::const_iterator phit = phiMaximum.hits.begin();
-      PhiHitVec::const_iterator phit_end = phiMaximum.hits.end();
-      for( ;phit!=phit_end;++phit ){
-        const MuonHough::PhiHit& phiHit = **phit;
-              // double rmin = 0.;
-              // double rmax = 0.;
-        
-        if( phiHit.tgc ){
-          if(  phiHit.tgc->phiCluster.hitList.empty() ) ATH_MSG_WARNING(" TGC 3D cluster without phi hits ");
-          else tgcClusters[m_idHelperSvc->stationIndex( phiHit.tgc->phiCluster.hitList.front()->identify() )].insert(phiHit.tgc);
-        }
-        else if( phiHit.prd ){
-          Identifier colId = phiHit.prd->identify();
-          Identifier layId = m_idHelperSvc->gasGapId( colId );
-          triggerLayers.insert(layId);
-        }
+
+    void MuonLayerHoughTool::associateMaximaToPhiMaxima(
+        MuonStationIndex::DetectorRegionIndex region, MuonLayerHoughTool::HoughDataPerSector& houghData,
+        std::map<MuonHough::MuonPhiLayerHough::Maximum*, MuonLayerHoughTool::MaximumVec>& phiEtaAssociations,
+        MuonLayerHoughTool::RegionMaximumVec& unassEtaMaxima) const {
+        std::set<MuonHough::MuonLayerHough::Maximum*> associatedMaxima;
+
+        PhiMaximumVec& phiMaxima = houghData.phiMaxVec[region];
+
+        ATH_MSG_DEBUG("associateMaximaToPhiMaxima in sector " << houghData.sector << ": phi maxima " << phiMaxima.size());  // !!!!
+        // loop over phi maxima
+        PhiMaximumVec::iterator pit = phiMaxima.begin();
+        PhiMaximumVec::iterator pit_end = phiMaxima.end();
+        for (; pit != pit_end; ++pit) {
+            // reference to phi maximum
+            MuonHough::MuonPhiLayerHough::Maximum& phiMaximum = **pit;
+
+            ATH_MSG_DEBUG(" Considering phi maximum " << phiMaximum.max << " hits " << phiMaximum.hits.size());  // !!!!
+
+            // store associated maxima
+            MaximumVec associatedMaximaVec;  // !!!!
+
+            // precalculate the layers + TGC clusters and add them to a set for easy access
+            // std::map< Identifier,std::pair<double,double> > triggerLayersP;
+            std::set<Identifier> triggerLayers;
+            std::map<MuonStationIndex::StIndex, std::set<const TgcClusterObj3D*>> tgcClusters;
+
+            // loop over hits
+            PhiHitVec::const_iterator phit = phiMaximum.hits.begin();
+            PhiHitVec::const_iterator phit_end = phiMaximum.hits.end();
+            for (; phit != phit_end; ++phit) {
+                const MuonHough::PhiHit& phiHit = **phit;
+                // double rmin = 0.;
+                // double rmax = 0.;
+
+                if (phiHit.tgc) {
+                    if (phiHit.tgc->phiCluster.hitList.empty())
+                        ATH_MSG_WARNING(" TGC 3D cluster without phi hits ");
+                    else
+                        tgcClusters[m_idHelperSvc->stationIndex(phiHit.tgc->phiCluster.hitList.front()->identify())].insert(phiHit.tgc);
+                } else if (phiHit.prd) {
+                    Identifier colId = phiHit.prd->identify();
+                    Identifier layId = m_idHelperSvc->gasGapId(colId);
+                    triggerLayers.insert(layId);
+                }
             }
-            if( msgLvl(MSG::DEBUG) ){
-              ATH_MSG_DEBUG("Trigger layers " << triggerLayers.size() << " tgc layers " << tgcClusters.size() );
-              auto tgcit = triggerLayers.begin();
-              auto tgcit_end = triggerLayers.end();
-              for( ;tgcit!=tgcit_end;++tgcit ){
-                ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString(*tgcit) );
-              }
-              
-              std::map<MuonStationIndex::StIndex,std::set<const TgcClusterObj3D*> >::const_iterator stit = tgcClusters.begin();
-              std::map<MuonStationIndex::StIndex,std::set<const TgcClusterObj3D*> >::const_iterator stit_end = tgcClusters.end();
-              for( ;stit != stit_end; ++stit ){
-                std::set<const TgcClusterObj3D*>::const_iterator ttit = stit->second.begin();
-                std::set<const TgcClusterObj3D*>::const_iterator ttit_end = stit->second.end();
-                for( ;ttit!=ttit_end;++ttit ){
-                  ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString( (*ttit)->phiCluster.hitList.front()->identify() ) << "  nhits " <<  (*ttit)->phiCluster.hitList.size() );
+            if (msgLvl(MSG::DEBUG)) {
+                ATH_MSG_DEBUG("Trigger layers " << triggerLayers.size() << " tgc layers " << tgcClusters.size());
+                auto tgcit = triggerLayers.begin();
+                auto tgcit_end = triggerLayers.end();
+                for (; tgcit != tgcit_end; ++tgcit) { ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString(*tgcit)); }
+
+                std::map<MuonStationIndex::StIndex, std::set<const TgcClusterObj3D*>>::const_iterator stit = tgcClusters.begin();
+                std::map<MuonStationIndex::StIndex, std::set<const TgcClusterObj3D*>>::const_iterator stit_end = tgcClusters.end();
+                for (; stit != stit_end; ++stit) {
+                    std::set<const TgcClusterObj3D*>::const_iterator ttit = stit->second.begin();
+                    std::set<const TgcClusterObj3D*>::const_iterator ttit_end = stit->second.end();
+                    for (; ttit != ttit_end; ++ttit) {
+                        ATH_MSG_VERBOSE("  " << m_idHelperSvc->toString((*ttit)->phiCluster.hitList.front()->identify()) << "  nhits "
+                                             << (*ttit)->phiCluster.hitList.size());
+                    }
                 }
-              }
             }
-        
+
             ATH_MSG_DEBUG(" looping over eta maxima");
-        
+
             // now loop over eta maxima per layer
-        for( unsigned int lay=0;lay<MuonStationIndex::LayerIndexMax;++lay ){
-          MuonStationIndex::LayerIndex layer = static_cast<MuonStationIndex::LayerIndex>(lay);
-          unsigned int layerHash = MuonStationIndex::sectorLayerHash(region,layer);
-          MaximumVec& maxima = houghData.maxVec[layerHash];
-          if( maxima.empty() ) continue;
-          MuonStationIndex::StIndex stIndex = MuonStationIndex::toStationIndex(region,layer);
-        
-        // loop over maxima per layer
-        MaximumVec::iterator mit = maxima.begin();
-        MaximumVec::iterator mit_end = maxima.end();
-        for( ;mit!=mit_end;++mit ){
-        
-          // skip maxima that were already associated to a neighbouring sector
-          if( houghData.associatedToOtherSector.count(*mit) ) continue;
-        
-          // reference to maximum
-          MuonHough::MuonLayerHough::Maximum& maximum = **mit;
-          
-          // check if there are matching maxima in neighbouring sectors, add maximum values if confirmation is found
-          int totmax = 0;
-          int ntrigconfirm = 0;
-          MaximumAssociationMap::iterator pos = houghData.maxAssociationMap.find(&maximum);
-          if( pos != houghData.maxAssociationMap.end() ){
-            for( MaximumVec::iterator amit = pos->second.begin();amit !=pos->second.end();++amit ){
-              if( (*amit)->max > totmax ) totmax = (*amit)->max;
-              ntrigconfirm += (*amit)->triggerConfirmed;
-            }
-          }
-          totmax += maximum.max;
-          ntrigconfirm += maximum.triggerConfirmed;
-        
-          ATH_MSG_DEBUG("   new eta maximum " << MuonStationIndex::stName(stIndex) << " val " << maximum.max 
-            << " neightbour confirmed value " << totmax << " trigger confirmations " << ntrigconfirm );
-          
-          
-          // overlap counters
-          int nmmHits = 0;
-          int ntgcOverlaps = 0;
-          int nrpcOverlaps = 0;
-          int nstgcOverlaps = 0;
-          int ntgcNoOverlaps = 0;
-          int nrpcNoOverlaps = 0;
-          int nstgcNoOverlaps = 0;
-        
-          // loop over hits
-          HitVec::const_iterator ehit = maximum.hits.begin();
-          HitVec::const_iterator ehit_end = maximum.hits.end();
-          for( ;ehit!=ehit_end;++ehit ){
-            const MuonHough::Hit& etaHit = **ehit; 
-            if( etaHit.tgc ) {
-              if( etaHit.tgc->etaCluster.hitList.empty() ) ATH_MSG_WARNING(" TGC 3D cluster without eta hits " );
-              else{
-                if( tgcClusters[stIndex].count(etaHit.tgc) ) ++ntgcOverlaps;
-                else                                         ++ntgcNoOverlaps;
-              }
+            for (unsigned int lay = 0; lay < MuonStationIndex::LayerIndexMax; ++lay) {
+                MuonStationIndex::LayerIndex layer = static_cast<MuonStationIndex::LayerIndex>(lay);
+                unsigned int layerHash = MuonStationIndex::sectorLayerHash(region, layer);
+                MaximumVec& maxima = houghData.maxVec[layerHash];
+                if (maxima.empty()) continue;
+                MuonStationIndex::StIndex stIndex = MuonStationIndex::toStationIndex(region, layer);
+
+                // loop over maxima per layer
+                MaximumVec::iterator mit = maxima.begin();
+                MaximumVec::iterator mit_end = maxima.end();
+                for (; mit != mit_end; ++mit) {
+                    // skip maxima that were already associated to a neighbouring sector
+                    if (houghData.associatedToOtherSector.count(*mit)) continue;
+
+                    // reference to maximum
+                    MuonHough::MuonLayerHough::Maximum& maximum = **mit;
+
+                    // check if there are matching maxima in neighbouring sectors, add maximum values if confirmation is found
+                    int totmax = 0;
+                    int ntrigconfirm = 0;
+                    MaximumAssociationMap::iterator pos = houghData.maxAssociationMap.find(&maximum);
+                    if (pos != houghData.maxAssociationMap.end()) {
+                        for (MaximumVec::iterator amit = pos->second.begin(); amit != pos->second.end(); ++amit) {
+                            if ((*amit)->max > totmax) totmax = (*amit)->max;
+                            ntrigconfirm += (*amit)->triggerConfirmed;
+                        }
+                    }
+                    totmax += maximum.max;
+                    ntrigconfirm += maximum.triggerConfirmed;
+
+                    ATH_MSG_DEBUG("   new eta maximum " << MuonStationIndex::stName(stIndex) << " val " << maximum.max
+                                                        << " neightbour confirmed value " << totmax << " trigger confirmations "
+                                                        << ntrigconfirm);
+
+                    // overlap counters
+                    int nmmHits = 0;
+                    int ntgcOverlaps = 0;
+                    int nrpcOverlaps = 0;
+                    int nstgcOverlaps = 0;
+                    int ntgcNoOverlaps = 0;
+                    int nrpcNoOverlaps = 0;
+                    int nstgcNoOverlaps = 0;
+
+                    // loop over hits
+                    HitVec::const_iterator ehit = maximum.hits.begin();
+                    HitVec::const_iterator ehit_end = maximum.hits.end();
+                    for (; ehit != ehit_end; ++ehit) {
+                        const MuonHough::Hit& etaHit = **ehit;
+                        if (etaHit.tgc) {
+                            if (etaHit.tgc->etaCluster.hitList.empty())
+                                ATH_MSG_WARNING(" TGC 3D cluster without eta hits ");
+                            else {
+                                if (tgcClusters[stIndex].count(etaHit.tgc))
+                                    ++ntgcOverlaps;
+                                else
+                                    ++ntgcNoOverlaps;
+                            }
+                        } else if (etaHit.prd) {
+                            Identifier layId = m_idHelperSvc->gasGapId(etaHit.prd->identify());
+                            ATH_MSG_VERBOSE(" eta layer hit " << m_idHelperSvc->toString(layId));
+                            if (m_idHelperSvc->isMM(layId)) ++nmmHits;
+                            if (triggerLayers.count(layId)) {
+                                if (m_idHelperSvc->isRpc(layId))
+                                    ++nrpcOverlaps;
+                                else if (m_idHelperSvc->issTgc(layId))
+                                    ++nstgcOverlaps;
+                            } else {
+                                if (m_idHelperSvc->isRpc(layId))
+                                    ++nrpcNoOverlaps;
+                                else if (m_idHelperSvc->issTgc(layId))
+                                    ++nstgcNoOverlaps;
+                            }
+                        }
+                    }
+
+                    // cuts on NSW endcap only for now
+                    if (nmmHits + nstgcNoOverlaps + nstgcOverlaps > 0) {
+                        // select
+                        if (maximum.pos < 1200.) {
+                            if (totmax < 8) {
+                                ATH_MSG_DEBUG("  maximum failed cut " << totmax << " cut 8, position " << maximum.pos);
+                                continue;
+                            }
+                        } else if (maximum.pos > 4300.) {
+                            if (totmax < 8) {
+                                ATH_MSG_DEBUG("  maximum failed cut " << totmax << " cut 8, position " << maximum.pos);
+                                continue;
+                            }
+                        } else {
+                            if (totmax < 12) {
+                                ATH_MSG_DEBUG("  maximum failed cut " << totmax << " cut 12, position " << maximum.pos);
+                                continue;
+                            }
+                        }
+                    }
+
+                    if (m_ntuple) { m_ntuple->fill(nstgcOverlaps, nstgcNoOverlaps); }
+
+                    ATH_MSG_DEBUG(" Overlap with Phi maximum: tgc " << ntgcOverlaps << " stgc " << nstgcOverlaps << " rpc " << nrpcOverlaps
+                                                                    << " nphiTgc " << tgcClusters[stIndex].size() << " trigLay "
+                                                                    << triggerLayers.size());
+                    if (stIndex == MuonStationIndex::EM && !tgcClusters[stIndex].empty() && ntgcOverlaps == 0) {
+                        ATH_MSG_VERBOSE(" No association in StationLayer " << MuonStationIndex::stName(stIndex) << " tgcs overlaps "
+                                                                           << ntgcOverlaps << " on phi maximum "
+                                                                           << tgcClusters[stIndex].size());
+                        continue;
+                    }
+                    if (stIndex == MuonStationIndex::EI && !tgcClusters[stIndex].empty() && ntgcOverlaps == 0) {
+                        ATH_MSG_VERBOSE(" No association in StationLayer " << MuonStationIndex::stName(stIndex) << " tgcs overlaps "
+                                                                           << ntgcOverlaps << " on phi maximum "
+                                                                           << tgcClusters[stIndex].size());
+                        continue;
+                    }
+                    if (stIndex == MuonStationIndex::EI && nstgcOverlaps == 0 && nstgcNoOverlaps != 0) {
+                        ATH_MSG_VERBOSE(" No association in StationLayer " << MuonStationIndex::stName(stIndex)
+                                                                           << " stgcs without overlaps " << nstgcNoOverlaps);
+                        continue;
+                    }
+                    // require STGC confirmation
+                    if (m_requireTriggerConfirmationNSW && nmmHits > 0 && ntrigconfirm == 0) continue;
+
+                    associatedMaxima.insert(&maximum);
+                    associatedMaximaVec.push_back(&maximum);
+
+                    // check if there are matching maxima in neighbouring sectors
+                    if (pos != houghData.maxAssociationMap.end()) {
+                        associatedMaxima.insert(pos->second.begin(), pos->second.end());
+                        associatedMaximaVec.insert(associatedMaximaVec.end(), pos->second.begin(), pos->second.end());
+                    }
+                }
             }
-            else if( etaHit.prd ){
-              Identifier layId = m_idHelperSvc->gasGapId( etaHit.prd->identify() );
-              ATH_MSG_VERBOSE(" eta layer hit " << m_idHelperSvc->toString(layId) );
-              if( m_idHelperSvc->isMM(layId) ) ++nmmHits;
-              if( triggerLayers.count(layId) ){
-                if( m_idHelperSvc->isRpc(layId) )       ++nrpcOverlaps;
-                else if( m_idHelperSvc->issTgc(layId) ) ++nstgcOverlaps;
+
+            if (associatedMaximaVec.empty()) continue;
+            ATH_MSG_DEBUG(" processed phi maximum, associated eta maxima " << associatedMaximaVec.size());
+            phiEtaAssociations[*pit] = associatedMaximaVec;
+        }
+
+        // finally idenitify all unassociated maxima and add them to the unassociated maxima list
+        // now loop over eta maxima per layer
+        for (unsigned int lay = 0; lay < MuonStationIndex::LayerIndexMax; ++lay) {
+            MuonStationIndex::LayerIndex layer = static_cast<MuonStationIndex::LayerIndex>(lay);
+            unsigned int layerHash = MuonStationIndex::sectorLayerHash(region, layer);
+
+            if (layer >= (int)unassEtaMaxima.size()) {
+                ATH_MSG_WARNING(" size of unassEtaMaxima too small for region " << unassEtaMaxima.size() << " region "
+                                                                                << MuonStationIndex::regionName(region));
+                break;
             }
-            else{
-              if( m_idHelperSvc->isRpc(layId) )       ++nrpcNoOverlaps;
-              else if( m_idHelperSvc->issTgc(layId) ) ++nstgcNoOverlaps;
+            MaximumVec& maxima = houghData.maxVec[layerHash];
+
+            // loop over maxima per layer
+            MaximumVec::iterator mit = maxima.begin();
+            MaximumVec::iterator mit_end = maxima.end();
+            for (; mit != mit_end; ++mit) {
+                if (associatedMaxima.count(*mit)) continue;
+                unassEtaMaxima[layer].push_back(*mit);
+                ATH_MSG_DEBUG(" unassociated maximum in layer " << MuonStationIndex::layerName(layer) << " max-val " << (*mit)->max);
             }
-          }
-        }
-    
-      // cuts on NSW endcap only for now
-      if( nmmHits + nstgcNoOverlaps + nstgcOverlaps > 0 ) {
-      // select 
-      if( maximum.pos < 1200. ){
-        if( totmax < 8 )  {
-          ATH_MSG_DEBUG("  maximum failed cut " << totmax  << " cut 8, position " << maximum.pos );
-          continue;
-        }
-      }
-      else if( maximum.pos > 4300. ){
-        if( totmax < 8 )  {
-          ATH_MSG_DEBUG("  maximum failed cut " << totmax  << " cut 8, position " << maximum.pos );
-          continue;
         }
-      }
-      else{
-        if( totmax < 12 ) {
-          ATH_MSG_DEBUG("  maximum failed cut " << totmax  << " cut 12, position " << maximum.pos );
-          continue;
-        }
-      }
-    }
-     
-    if( m_ntuple ) {
-      m_ntuple->fill(nstgcOverlaps,nstgcNoOverlaps);
     }
 
-    
-    ATH_MSG_DEBUG(" Overlap with Phi maximum: tgc " << ntgcOverlaps << " stgc " << nstgcOverlaps << " rpc " << nrpcOverlaps
-      << " nphiTgc " << tgcClusters[stIndex].size() << " trigLay " << triggerLayers.size() );  
-    if( stIndex == MuonStationIndex::EM && !tgcClusters[stIndex].empty() && ntgcOverlaps == 0 ) {
-      ATH_MSG_VERBOSE(" No association in StationLayer " << MuonStationIndex::stName(stIndex) << " tgcs overlaps " << ntgcOverlaps 
-          << " on phi maximum " << tgcClusters[stIndex].size() );  
-      continue;
-    }
-    if( stIndex == MuonStationIndex::EI && !tgcClusters[stIndex].empty() && ntgcOverlaps == 0 ) {
-      ATH_MSG_VERBOSE(" No association in StationLayer " << MuonStationIndex::stName(stIndex) << " tgcs overlaps " << ntgcOverlaps 
-          << " on phi maximum " << tgcClusters[stIndex].size() );  
-      continue;
-    }
-    if( stIndex == MuonStationIndex::EI && nstgcOverlaps == 0 && nstgcNoOverlaps != 0 ) {
-      ATH_MSG_VERBOSE(" No association in StationLayer " << MuonStationIndex::stName(stIndex) << " stgcs without overlaps " << nstgcNoOverlaps );  
-      continue;
-    }
-    // require STGC confirmation 
-    if( m_requireTriggerConfirmationNSW && nmmHits > 0 && ntrigconfirm == 0 ) continue;
-    
-    associatedMaxima.insert(&maximum);
-    associatedMaximaVec.push_back(&maximum);
-
-    // check if there are matching maxima in neighbouring sectors
-    if( pos != houghData.maxAssociationMap.end() ){
-      associatedMaxima.insert(pos->second.begin(),pos->second.end());
-      associatedMaximaVec.insert(associatedMaximaVec.end(),pos->second.begin(),pos->second.end());
-    }
-  }
-      }
-      
-      if( associatedMaximaVec.empty() ) continue;
-      ATH_MSG_DEBUG(" processed phi maximum, associated eta maxima " << associatedMaximaVec.size() ); 
-      phiEtaAssociations[*pit] = associatedMaximaVec;
-      
-    }
-    
-    // finally idenitify all unassociated maxima and add them to the unassociated maxima list
-    // now loop over eta maxima per layer
-    for( unsigned int lay=0;lay<MuonStationIndex::LayerIndexMax;++lay ){
-      MuonStationIndex::LayerIndex layer = static_cast<MuonStationIndex::LayerIndex>(lay);
-      unsigned int layerHash = MuonStationIndex::sectorLayerHash(region,layer);
-
-      if( layer >= (int)unassEtaMaxima.size() ){
-        ATH_MSG_WARNING(" size of unassEtaMaxima too small for region " << unassEtaMaxima.size() << " region " << MuonStationIndex::regionName(region) );
-        break;
-      }
-      MaximumVec& maxima = houghData.maxVec[layerHash];
- 
-      // loop over maxima per layer
-      MaximumVec::iterator mit = maxima.begin();
-      MaximumVec::iterator mit_end = maxima.end();
-      for( ;mit!=mit_end;++mit ){
-        if( associatedMaxima.count(*mit) ) continue;
-        unassEtaMaxima[layer].push_back(*mit);
-        ATH_MSG_DEBUG(" unassociated maximum in layer " << MuonStationIndex::layerName(layer) << " max-val " << (*mit)->max );
-      }
-    }
-  }
-
-
-
-  void MuonLayerHoughTool::createPatternCombinations( MuonLayerHoughTool::RegionMaximumVec& maxima,
-                  MuonPatternCombinationCollection& patternCombis )  const {
-    
-    ATH_MSG_DEBUG("Creating pattern combinations for eta patterns ");
-
-    std::vector<MuonPatternChamberIntersect> chamberData;
-
-    // bool isEndcap = maxima.size() == 5;
-
-    // loop over layers
-    RegionMaximumVec::iterator lit = maxima.begin();
-    RegionMaximumVec::iterator lit_end = maxima.end();
-    for( ;lit!=lit_end;++lit ){
-
-      // create vector for prds per chamber
-      std::map< Identifier, std::set< const Trk::PrepRawData* > > prdsPerChamber;
-
-      // loop over maxima per layer
-      MaximumVec::iterator mit = lit->begin();
-      MaximumVec::iterator mit_end = lit->end();
-      for( ;mit!=mit_end;++mit ){
-  
-  MuonHough::MuonLayerHough::Maximum& max = **mit;
-  ATH_MSG_DEBUG("  new maximum  " << max.max << " hits " << max.hits.size() );
-
-  // sanity check
-  if( max.hits.empty() ) {
-    ATH_MSG_WARNING(" Maximum without hits  ");
-    continue;
-  }
-  ATH_MSG_DEBUG("  adding hits " << max.hits.size());
-
-  
-  // loop over hits in maximum and add them to the hit list
-  HitVec::const_iterator hit = max.hits.begin();
-  HitVec::const_iterator hit_end = max.hits.end();
-  for( ;hit!=hit_end;++hit ) {
-    Identifier chId;
-    if( (*hit)->tgc ){
-      chId = m_idHelperSvc->chamberId( (*hit)->tgc->etaCluster.hitList.front()->identify() );
-      prdsPerChamber[chId].insert((*hit)->tgc->etaCluster.hitList.begin(),(*hit)->tgc->etaCluster.hitList.end());
-    }
-    else if( (*hit)->prd ){
-      chId = m_idHelperSvc->chamberId( (*hit)->prd->identify() );
-      prdsPerChamber[chId].insert((*hit)->prd);
-    }
-  }
-      }
-
-      auto sortPrdIds = [](const Trk::PrepRawData* prd1,const Trk::PrepRawData* prd2 ) { return prd1->identify() < prd2->identify(); };
-      std::map< Identifier, std::set< const Trk::PrepRawData* > >::iterator chit = prdsPerChamber.begin();
-      std::map< Identifier, std::set< const Trk::PrepRawData* > >::iterator chit_end = prdsPerChamber.end();
-      for( ;chit!=chit_end;++chit ){
-  ATH_MSG_DEBUG("Adding chamber " << m_idHelperSvc->toStringChamber(chit->first) << " hits " << chit->second.size() );
-  std::vector<const Trk::PrepRawData*> prds;
-  prds.insert(prds.end(),chit->second.begin(),chit->second.end());
-        std::stable_sort(prds.begin(),prds.end(),sortPrdIds);
-  const Trk::PrepRawData& prd = **prds.begin();
-  Amg::Vector3D gpos = prd.detectorElement()->surface(prd.identify()).center();
-  // create intersection and add it to combination
-        ATH_MSG_DEBUG("Adding chamber with intersect phi direction " << gpos.phi() << " theta " << gpos.theta() ); 
-  MuonPatternChamberIntersect intersect(gpos,gpos.unit(),prds);
-  chamberData.push_back(intersect);
-      }
-    }
-    if( chamberData.empty() ) return;
-
-    MuonPatternCombination* combi = new MuonPatternCombination(nullptr,chamberData);
-
-    ATH_MSG_DEBUG(" creating new unassociated " << m_printer->print( *combi ) );
-    patternCombis.push_back(combi);
-  }
-
-  void MuonLayerHoughTool::createPatternCombinations(std::set<Identifier>& truthHits, std::set<Identifier>& outputTruthHits, 
-                  std::map< MuonHough::MuonPhiLayerHough::Maximum*, MuonLayerHoughTool::MaximumVec >& phiEtaAssociations,
-                  MuonPatternCombinationCollection& patternCombis ) const {
-    
-    ATH_MSG_DEBUG("Creating pattern combinations from eta/phi combinations " << phiEtaAssociations.size() );
-
-    // loop over the phi maxima
-    std::map< MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec >::const_iterator pit = phiEtaAssociations.begin();
-    std::map< MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec >::const_iterator pit_end = phiEtaAssociations.end();
-    for( ;pit!=pit_end; ++pit ){
-
-      if( pit->second.empty() ) continue;
-
-      // collect phi hits per chamber
-      std::map<Identifier,std::set<const Trk::PrepRawData*> > phiHitsPerChamber;
-      
-      // loop over hits
-      PhiHitVec::const_iterator phit = pit->first->hits.begin();
-      PhiHitVec::const_iterator phit_end = pit->first->hits.end();
-      for( ;phit!=phit_end;++phit ){
-  const MuonHough::PhiHit& hit = **phit; 
-  if( hit.tgc ){
-    Identifier chId = m_idHelperSvc->chamberId( hit.tgc->phiCluster.hitList.front()->identify() );
-    phiHitsPerChamber[chId].insert(hit.tgc->phiCluster.hitList.begin(),hit.tgc->phiCluster.hitList.end());
-  }
-  else if( hit.prd ){
-    Identifier chId = m_idHelperSvc->chamberId( hit.prd->identify() );
-    phiHitsPerChamber[chId].insert(hit.prd);
-  }
-      }
-
-      // create chamber intersections
-      std::vector<MuonPatternChamberIntersect> chamberData;
-      std::set<Identifier> addedPhiHits;
-
-      // create vector for prds per chamber
-      std::map< Identifier, std::set< const Trk::PrepRawData* > >      prdsPerChamber;
-
-      // store position and direction of the first maximum in the chamber layer
-      std::map< MuonStationIndex::ChIndex, std::pair<Amg::Vector3D,Amg::Vector3D> > directionsPerChamberLayer;
-
-      // loop over eta maxima
-      MaximumVec::const_iterator mit = pit->second.begin();
-      MaximumVec::const_iterator mit_end = pit->second.end();
-      for( ;mit!=mit_end;++mit ){
-  
-
-  const MuonHough::MuonLayerHough::Maximum& max = **mit;
-  ATH_MSG_DEBUG("  new maximum  " << max.max << " hits " << max.hits.size() );
-
-  if( !max.hough ){
-    ATH_MSG_WARNING("Maximum without associated Hough Transform");
-  }
-
-  // sanity check
-  if( max.hits.empty() ) {
-    ATH_MSG_WARNING(" Maximum without hits  ");
-    continue;
-  }
-  ATH_MSG_DEBUG("  adding hits " << max.hits.size());
-
-  // loop over hits in maximum and add them to the hit list
-  HitVec::const_iterator hit = max.hits.begin();
-  HitVec::const_iterator hit_end = max.hits.end();
-  for( ;hit!=hit_end;++hit ) {
-    Identifier chId;
-    if( (*hit)->tgc ){
-      chId = m_idHelperSvc->chamberId( (*hit)->tgc->etaCluster.hitList.front()->identify() );
-      prdsPerChamber[chId].insert((*hit)->tgc->etaCluster.hitList.begin(),(*hit)->tgc->etaCluster.hitList.end());
-    }
-    else if( (*hit)->prd ){
-      chId = m_idHelperSvc->chamberId( (*hit)->prd->identify() );
-      prdsPerChamber[chId].insert((*hit)->prd);
-    }else{
-      ATH_MSG_WARNING("Hit without associated PRDs");
-      continue;
-    }
-    // the first time we have a maximun in this layer store the position and direction 
-    MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
-    if( !directionsPerChamberLayer.count(chIndex) ) {
-      // eta maximum has z(r) and theta parameters but these are local
-      double maxpos = max.pos;
-      double refPlane = 0.;
-      bool isBarrel = !m_idHelperSvc->isEndcap(chId) || chIndex == MuonStationIndex::BEE;
-      if( max.hough ) refPlane = max.hough->m_descriptor.referencePosition;
-      else{
-        if( (*hit)->tgc ) refPlane = (*hit)->tgc->p11.z();
-        else{
-    if( isBarrel )  refPlane = (*hit)->prd->detectorElement()->surface((*hit)->prd->identify()).center().perp();
-    else            refPlane = (*hit)->prd->detectorElement()->surface((*hit)->prd->identify()).center().z();
-        }              
-      }
-      double r = isBarrel ? refPlane : maxpos;
-      double z = isBarrel ? maxpos   : refPlane;
-      double theta  = max.theta;
-
-      // go to global
-      double sign = 1.;
-      if(isBarrel) {
-        theta += M_PI_2;
-        sign = -1.;
-      }
-
-      // phi maximum has one phi from position assume global Phi definition
-      double phi = pit->first->pos;//phiCor(pit->first->pos,pit->first->sector,false);
-      
-      CxxUtils::sincos scphi(phi);
-      double sinphi = scphi.sn; 
-      double cosphi = scphi.cs;
-
-      CxxUtils::sincos sctheta(theta);
-      double sintheta = sctheta.sn; 
-      double costheta = sctheta.cs;
-
-      std::pair<Amg::Vector3D,Amg::Vector3D>& posDir = directionsPerChamberLayer[chIndex];
-      posDir.first  = Amg::Vector3D(r*cosphi,r*sinphi,z);
-      posDir.second = Amg::Vector3D(sign*cosphi*costheta,sign*sinphi*costheta,sintheta);
-      ATH_MSG_DEBUG( MuonStationIndex::chName(chIndex) 
-        << " setting position: perp " << posDir.first.perp() << " z " << posDir.first.z() << " phi pos " << posDir.first.phi()
-        << " direction phi  " << posDir.second.phi() << " theta pos " << posDir.first.theta()  << " direction theta " << posDir.second.theta() 
-        << " ref perp " << r << " z " << z << " phi " << phi << " theta " << theta);
-      if( posDir.first.dot(posDir.second) < 0. ) {
-        ATH_MSG_WARNING(" direction not pointing to IP " << posDir.first.unit().dot(posDir.second));
-      } 
-    }
+    void MuonLayerHoughTool::createPatternCombinations(MuonLayerHoughTool::RegionMaximumVec& maxima,
+                                                       MuonPatternCombinationCollection& patternCombis) const {
+        ATH_MSG_DEBUG("Creating pattern combinations for eta patterns ");
 
-    std::map<Identifier,std::set<const Trk::PrepRawData*> >::iterator pos = phiHitsPerChamber.find(chId);
-    if( pos != phiHitsPerChamber.end() ){
-      std::pair<std::set<Identifier>::iterator,bool> ipos = addedPhiHits.insert(chId);
-      if( ipos.second ){
-        prdsPerChamber[chId].insert(pos->second.begin(),pos->second.end());
-      }
-    }
-  }
-      }
-
-      auto sortPrdIds = [](const Trk::PrepRawData* prd1,const Trk::PrepRawData* prd2 ) { return prd1->identify() < prd2->identify(); };
-      std::map< Identifier, std::set< const Trk::PrepRawData* > >::iterator chit = prdsPerChamber.begin();
-      std::map< Identifier, std::set< const Trk::PrepRawData* > >::iterator chit_end = prdsPerChamber.end();
-      for( ;chit!=chit_end;++chit ){
-  ATH_MSG_DEBUG("Adding chamber " << m_idHelperSvc->toStringChamber(chit->first) << " hits " << chit->second.size() );
-  std::vector<const Trk::PrepRawData*> prds;
-  prds.insert(prds.end(),chit->second.begin(),chit->second.end());
-        std::stable_sort(prds.begin(),prds.end(),sortPrdIds);
-  const Trk::PrepRawData& prd = **prds.begin();
-
-  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(prd.identify());
-  std::map< MuonStationIndex::ChIndex, std::pair<Amg::Vector3D,Amg::Vector3D> >::const_iterator pos = directionsPerChamberLayer.find(chIndex);
-  Amg::Vector3D  gpos;
-  Amg::Vector3D  gdir;
-  if( pos != directionsPerChamberLayer.end() ) {
-    gpos = pos->second.first;
-    gdir = pos->second.second;
-  }else{    
-    ATH_MSG_WARNING("No global position and direction found, calculating from surface");
-    gpos = prd.detectorElement()->surface(prd.identify()).center();
-    gdir = -1*gpos.unit();
-  }
-
-  ATH_MSG_DEBUG( "Creating intersection " <<  MuonStationIndex::chName(chIndex) 
-           << " setting position: perp " << gpos.perp() << " z " << gpos.z() << " phi pos " << gpos.phi()
-           << " direction phi " << gdir.phi() << " theta pos " << gpos.theta() << " theta " << gdir.theta() << " hits " << prds.size() );
-
-  // create intersection and add it to combination
-  MuonPatternChamberIntersect intersect(gpos,gdir,prds);
-  chamberData.push_back(intersect);
-  
-  if( m_doTruth ){
-    for( std::vector<const Trk::PrepRawData*>::iterator it=prds.begin();it!=prds.end();++it ){
-      if( truthHits.count((*it)->identify()) ) outputTruthHits.insert((*it)->identify());
-    }
-  }
-      }
-      if( chamberData.empty() ) continue;
-      if( addedPhiHits.empty() ){
-  ATH_MSG_DEBUG("No phi hits selected, skipping combi ");
-  continue;
-      }
-      MuonPatternCombination* combi = new MuonPatternCombination(nullptr,chamberData);
-      ATH_MSG_DEBUG("adding pattern combination with chambers " << chamberData.size() << " phi layers " << addedPhiHits.size()
-        << std::endl << m_printer->print(*combi) );
-      patternCombis.push_back(combi);
-    }
-  }
-
-  bool MuonLayerHoughTool::findMaxima( std::set<Identifier>& truthHits,
-                                       std::set<Identifier>& foundTruthHits,
-                                       MaximumVec& seedMaxima,
-                                       MuonHough::MuonLayerHough& hough,
-                                       MuonLayerHoughTool::HitVec& hits, 
-                                       MuonLayerHoughTool::MaximumVec& maxima ) const {
-    if( hits.empty() ) return false;
-
-    if( hough.m_descriptor.chIndex < 0 || hough.m_descriptor.chIndex >= Muon::MuonStationIndex::ChIndexMax ){
-      Identifier id = hits.front()->tgc ? hits.front()->tgc->etaCluster.hitList.front()->identify() : hits.front()->prd->identify();
-      ATH_MSG_WARNING("Bad ChIndex " << m_idHelperSvc->toString(id) << "  " << hough.m_descriptor.chIndex );
-      return false;
-    }
+        std::vector<MuonPatternChamberIntersect> chamberData;
 
-    // populate hough transform with hits
-    std::stable_sort(hits.begin(),hits.end(),MuonHough::SortHitsPerLayer());
-    if( m_debugHough ) hough.setDebug(true);
-    hough.fillLayer2(hits);
-      
-    if( m_ntuple ) {
-      updateHits(hits,hough);
-    }
+        // bool isEndcap = maxima.size() == 5;
 
-    Identifier id_hit = hits.front()->tgc ? hits.front()->tgc->etaCluster.hitList.front()->identify() : hits.front()->prd->identify();
-    MuonHough::MuonLayerHoughSelector selectorLoose;
-    MuonHough::MuonLayerHoughSelector selector;
+        // loop over layers
+        RegionMaximumVec::iterator lit = maxima.begin();
+        RegionMaximumVec::iterator lit_end = maxima.end();
+        for (; lit != lit_end; ++lit) {
+            // create vector for prds per chamber
+            std::map<Identifier, std::set<const Trk::PrepRawData*>> prdsPerChamber;
 
-    if ( m_idHelperSvc->issTgc(id_hit) || m_idHelperSvc->isMM(id_hit) ) {
-      selectorLoose = MuonHough::MuonLayerHoughSelector({std::make_pair(0,3.9)}); 
-      selector      = MuonHough::MuonLayerHoughSelector({std::make_pair(0,7.9)}); 
+            // loop over maxima per layer
+            MaximumVec::iterator mit = lit->begin();
+            MaximumVec::iterator mit_end = lit->end();
+            for (; mit != mit_end; ++mit) {
+                MuonHough::MuonLayerHough::Maximum& max = **mit;
+                ATH_MSG_DEBUG("  new maximum  " << max.max << " hits " << max.hits.size());
+
+                // sanity check
+                if (max.hits.empty()) {
+                    ATH_MSG_WARNING(" Maximum without hits  ");
+                    continue;
+                }
+                ATH_MSG_DEBUG("  adding hits " << max.hits.size());
+
+                // loop over hits in maximum and add them to the hit list
+                HitVec::const_iterator hit = max.hits.begin();
+                HitVec::const_iterator hit_end = max.hits.end();
+                for (; hit != hit_end; ++hit) {
+                    Identifier chId;
+                    if ((*hit)->tgc) {
+                        chId = m_idHelperSvc->chamberId((*hit)->tgc->etaCluster.hitList.front()->identify());
+                        prdsPerChamber[chId].insert((*hit)->tgc->etaCluster.hitList.begin(), (*hit)->tgc->etaCluster.hitList.end());
+                    } else if ((*hit)->prd) {
+                        chId = m_idHelperSvc->chamberId((*hit)->prd->identify());
+                        prdsPerChamber[chId].insert((*hit)->prd);
+                    }
+                }
+            }
+
+            auto sortPrdIds = [](const Trk::PrepRawData* prd1, const Trk::PrepRawData* prd2) {
+                return prd1->identify() < prd2->identify();
+            };
+            std::map<Identifier, std::set<const Trk::PrepRawData*>>::iterator chit = prdsPerChamber.begin();
+            std::map<Identifier, std::set<const Trk::PrepRawData*>>::iterator chit_end = prdsPerChamber.end();
+            for (; chit != chit_end; ++chit) {
+                ATH_MSG_DEBUG("Adding chamber " << m_idHelperSvc->toStringChamber(chit->first) << " hits " << chit->second.size());
+                std::vector<const Trk::PrepRawData*> prds;
+                prds.insert(prds.end(), chit->second.begin(), chit->second.end());
+                std::stable_sort(prds.begin(), prds.end(), sortPrdIds);
+                const Trk::PrepRawData& prd = **prds.begin();
+                Amg::Vector3D gpos = prd.detectorElement()->surface(prd.identify()).center();
+                // create intersection and add it to combination
+                ATH_MSG_DEBUG("Adding chamber with intersect phi direction " << gpos.phi() << " theta " << gpos.theta());
+                MuonPatternChamberIntersect intersect(gpos, gpos.unit(), prds);
+                chamberData.push_back(intersect);
+            }
+        }
+        if (chamberData.empty()) return;
+
+        MuonPatternCombination* combi = new MuonPatternCombination(nullptr, chamberData);
+
+        ATH_MSG_DEBUG(" creating new unassociated " << m_printer->print(*combi));
+        patternCombis.push_back(combi);
     }
-    else {
-      selectorLoose = m_selectorsLoose[hough.m_descriptor.chIndex];
-      selector      = m_selectors[hough.m_descriptor.chIndex];
+
+    void MuonLayerHoughTool::createPatternCombinations(
+        std::set<Identifier>& truthHits, std::set<Identifier>& outputTruthHits,
+        std::map<MuonHough::MuonPhiLayerHough::Maximum*, MuonLayerHoughTool::MaximumVec>& phiEtaAssociations,
+        MuonPatternCombinationCollection& patternCombis) const {
+        ATH_MSG_DEBUG("Creating pattern combinations from eta/phi combinations " << phiEtaAssociations.size());
+
+        // loop over the phi maxima
+        std::map<MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec>::const_iterator pit = phiEtaAssociations.begin();
+        std::map<MuonHough::MuonPhiLayerHough::Maximum*, MaximumVec>::const_iterator pit_end = phiEtaAssociations.end();
+        for (; pit != pit_end; ++pit) {
+            if (pit->second.empty()) continue;
+
+            // collect phi hits per chamber
+            std::map<Identifier, std::set<const Trk::PrepRawData*>> phiHitsPerChamber;
+
+            // loop over hits
+            PhiHitVec::const_iterator phit = pit->first->hits.begin();
+            PhiHitVec::const_iterator phit_end = pit->first->hits.end();
+            for (; phit != phit_end; ++phit) {
+                const MuonHough::PhiHit& hit = **phit;
+                if (hit.tgc) {
+                    Identifier chId = m_idHelperSvc->chamberId(hit.tgc->phiCluster.hitList.front()->identify());
+                    phiHitsPerChamber[chId].insert(hit.tgc->phiCluster.hitList.begin(), hit.tgc->phiCluster.hitList.end());
+                } else if (hit.prd) {
+                    Identifier chId = m_idHelperSvc->chamberId(hit.prd->identify());
+                    phiHitsPerChamber[chId].insert(hit.prd);
+                }
+            }
+
+            // create chamber intersections
+            std::vector<MuonPatternChamberIntersect> chamberData;
+            std::set<Identifier> addedPhiHits;
+
+            // create vector for prds per chamber
+            std::map<Identifier, std::set<const Trk::PrepRawData*>> prdsPerChamber;
+
+            // store position and direction of the first maximum in the chamber layer
+            std::map<MuonStationIndex::ChIndex, std::pair<Amg::Vector3D, Amg::Vector3D>> directionsPerChamberLayer;
+
+            // loop over eta maxima
+            MaximumVec::const_iterator mit = pit->second.begin();
+            MaximumVec::const_iterator mit_end = pit->second.end();
+            for (; mit != mit_end; ++mit) {
+                const MuonHough::MuonLayerHough::Maximum& max = **mit;
+                ATH_MSG_DEBUG("  new maximum  " << max.max << " hits " << max.hits.size());
+
+                if (!max.hough) { ATH_MSG_WARNING("Maximum without associated Hough Transform"); }
+
+                // sanity check
+                if (max.hits.empty()) {
+                    ATH_MSG_WARNING(" Maximum without hits  ");
+                    continue;
+                }
+                ATH_MSG_DEBUG("  adding hits " << max.hits.size());
+
+                // loop over hits in maximum and add them to the hit list
+                HitVec::const_iterator hit = max.hits.begin();
+                HitVec::const_iterator hit_end = max.hits.end();
+                for (; hit != hit_end; ++hit) {
+                    Identifier chId;
+                    if ((*hit)->tgc) {
+                        chId = m_idHelperSvc->chamberId((*hit)->tgc->etaCluster.hitList.front()->identify());
+                        prdsPerChamber[chId].insert((*hit)->tgc->etaCluster.hitList.begin(), (*hit)->tgc->etaCluster.hitList.end());
+                    } else if ((*hit)->prd) {
+                        chId = m_idHelperSvc->chamberId((*hit)->prd->identify());
+                        prdsPerChamber[chId].insert((*hit)->prd);
+                    } else {
+                        ATH_MSG_WARNING("Hit without associated PRDs");
+                        continue;
+                    }
+                    // the first time we have a maximun in this layer store the position and direction
+                    MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
+                    if (!directionsPerChamberLayer.count(chIndex)) {
+                        // eta maximum has z(r) and theta parameters but these are local
+                        double maxpos = max.pos;
+                        double refPlane = 0.;
+                        bool isBarrel = !m_idHelperSvc->isEndcap(chId) || chIndex == MuonStationIndex::BEE;
+                        if (max.hough)
+                            refPlane = max.hough->m_descriptor.referencePosition;
+                        else {
+                            if ((*hit)->tgc)
+                                refPlane = (*hit)->tgc->p11.z();
+                            else {
+                                if (isBarrel)
+                                    refPlane = (*hit)->prd->detectorElement()->surface((*hit)->prd->identify()).center().perp();
+                                else
+                                    refPlane = (*hit)->prd->detectorElement()->surface((*hit)->prd->identify()).center().z();
+                            }
+                        }
+                        double r = isBarrel ? refPlane : maxpos;
+                        double z = isBarrel ? maxpos : refPlane;
+                        double theta = max.theta;
+
+                        // go to global
+                        double sign = 1.;
+                        if (isBarrel) {
+                            theta += M_PI_2;
+                            sign = -1.;
+                        }
+
+                        // phi maximum has one phi from position assume global Phi definition
+                        double phi = pit->first->pos;  // phiCor(pit->first->pos,pit->first->sector,false);
+
+                        CxxUtils::sincos scphi(phi);
+                        double sinphi = scphi.sn;
+                        double cosphi = scphi.cs;
+
+                        CxxUtils::sincos sctheta(theta);
+                        double sintheta = sctheta.sn;
+                        double costheta = sctheta.cs;
+
+                        std::pair<Amg::Vector3D, Amg::Vector3D>& posDir = directionsPerChamberLayer[chIndex];
+                        posDir.first = Amg::Vector3D(r * cosphi, r * sinphi, z);
+                        posDir.second = Amg::Vector3D(sign * cosphi * costheta, sign * sinphi * costheta, sintheta);
+                        ATH_MSG_DEBUG(MuonStationIndex::chName(chIndex)
+                                      << " setting position: perp " << posDir.first.perp() << " z " << posDir.first.z() << " phi pos "
+                                      << posDir.first.phi() << " direction phi  " << posDir.second.phi() << " theta pos "
+                                      << posDir.first.theta() << " direction theta " << posDir.second.theta() << " ref perp " << r << " z "
+                                      << z << " phi " << phi << " theta " << theta);
+                        if (posDir.first.dot(posDir.second) < 0.) {
+                            ATH_MSG_WARNING(" direction not pointing to IP " << posDir.first.unit().dot(posDir.second));
+                        }
+                    }
+
+                    std::map<Identifier, std::set<const Trk::PrepRawData*>>::iterator pos = phiHitsPerChamber.find(chId);
+                    if (pos != phiHitsPerChamber.end()) {
+                        std::pair<std::set<Identifier>::iterator, bool> ipos = addedPhiHits.insert(chId);
+                        if (ipos.second) { prdsPerChamber[chId].insert(pos->second.begin(), pos->second.end()); }
+                    }
+                }
+            }
+
+            auto sortPrdIds = [](const Trk::PrepRawData* prd1, const Trk::PrepRawData* prd2) {
+                return prd1->identify() < prd2->identify();
+            };
+            std::map<Identifier, std::set<const Trk::PrepRawData*>>::iterator chit = prdsPerChamber.begin();
+            std::map<Identifier, std::set<const Trk::PrepRawData*>>::iterator chit_end = prdsPerChamber.end();
+            for (; chit != chit_end; ++chit) {
+                ATH_MSG_DEBUG("Adding chamber " << m_idHelperSvc->toStringChamber(chit->first) << " hits " << chit->second.size());
+                std::vector<const Trk::PrepRawData*> prds;
+                prds.insert(prds.end(), chit->second.begin(), chit->second.end());
+                std::stable_sort(prds.begin(), prds.end(), sortPrdIds);
+                const Trk::PrepRawData& prd = **prds.begin();
+
+                MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(prd.identify());
+                std::map<MuonStationIndex::ChIndex, std::pair<Amg::Vector3D, Amg::Vector3D>>::const_iterator pos =
+                    directionsPerChamberLayer.find(chIndex);
+                Amg::Vector3D gpos;
+                Amg::Vector3D gdir;
+                if (pos != directionsPerChamberLayer.end()) {
+                    gpos = pos->second.first;
+                    gdir = pos->second.second;
+                } else {
+                    ATH_MSG_WARNING("No global position and direction found, calculating from surface");
+                    gpos = prd.detectorElement()->surface(prd.identify()).center();
+                    gdir = -1 * gpos.unit();
+                }
+
+                ATH_MSG_DEBUG("Creating intersection " << MuonStationIndex::chName(chIndex) << " setting position: perp " << gpos.perp()
+                                                       << " z " << gpos.z() << " phi pos " << gpos.phi() << " direction phi " << gdir.phi()
+                                                       << " theta pos " << gpos.theta() << " theta " << gdir.theta() << " hits "
+                                                       << prds.size());
+
+                // create intersection and add it to combination
+                MuonPatternChamberIntersect intersect(gpos, gdir, prds);
+                chamberData.push_back(intersect);
+
+                if (m_doTruth) {
+                    for (std::vector<const Trk::PrepRawData*>::iterator it = prds.begin(); it != prds.end(); ++it) {
+                        if (truthHits.count((*it)->identify())) outputTruthHits.insert((*it)->identify());
+                    }
+                }
+            }
+            if (chamberData.empty()) continue;
+            if (addedPhiHits.empty()) {
+                ATH_MSG_DEBUG("No phi hits selected, skipping combi ");
+                continue;
+            }
+            MuonPatternCombination* combi = new MuonPatternCombination(nullptr, chamberData);
+            ATH_MSG_DEBUG("adding pattern combination with chambers " << chamberData.size() << " phi layers " << addedPhiHits.size()
+                                                                      << std::endl
+                                                                      << m_printer->print(*combi));
+            patternCombis.push_back(combi);
+        }
     }
-    
-//    Muon::MuonStationIndex::StIndex stIndex = Muon::MuonStationIndex::toStationIndex(hough.m_descriptor.chIndex);
-    unsigned int nmaxima = 0;
-    while( nmaxima < 5 ){
-      MuonHough::MuonLayerHough::Maximum maximum;
-      if( hough.findMaximum( maximum, selectorLoose ) ) {
-        hough.associateHitsToMaximum(maximum,hits);
-        ATH_MSG_DEBUG("findMaxima: Found Eta Maximum " << nmaxima 
-                        <<     "  "          << maximum.max 
-                        << " trigConfirmed " << maximum.triggerConfirmed 
-                        << " pos "           << maximum.pos 
-                        << " theta "         << maximum.theta
-                        << " binPos "        << maximum.binpos 
-                        << " binRange "      << maximum.binposmin << " -- " << maximum.binposmax
-                        << " binTheta "      << maximum.bintheta 
-                        << " nHits "         << maximum.hits.size() );
-
-        int nmdt = 0;
-        int nmm = 0;
-        int ntgc = 0;
-        int nstgc = 0;
-
-        const unsigned int nHitsInMaximum = maximum.hits.size();
-        for( unsigned int i = 0; i < nHitsInMaximum; ++i){
-          MuonHough::Hit& hit = *(maximum.hits[i]);
-          Identifier id = hit.tgc ? hit.tgc->etaCluster.hitList.front()->identify() : hit.prd->identify();
-          int nhits = hit.tgc ? hit.tgc->etaCluster.hitList.size() : 1;
-
-          if( m_idHelperSvc->isMdt(id) ) ++nmdt;
-          else if( m_idHelperSvc->isTgc(id) ) ++ntgc;
-          else if( m_idHelperSvc->issTgc(id) ) ++nstgc;
-          else if( m_idHelperSvc->isMM(id) ) ++nmm;
-
-          if( m_doTruth ){
-            if( truthHits.count(id) )       foundTruthHits.insert(id);
-          }
-
-          ATH_MSG_VERBOSE("findMaxima: hit " << hit.layer << "  " << m_idHelperSvc->toString(id) << " hits " << nhits );
+
+    bool MuonLayerHoughTool::findMaxima(std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits, MaximumVec& seedMaxima,
+                                        MuonHough::MuonLayerHough& hough, MuonLayerHoughTool::HitVec& hits,
+                                        MuonLayerHoughTool::MaximumVec& maxima) const {
+        if (hits.empty()) return false;
+
+        if (hough.m_descriptor.chIndex < 0 || hough.m_descriptor.chIndex >= Muon::MuonStationIndex::ChIndexMax) {
+            Identifier id = hits.front()->tgc ? hits.front()->tgc->etaCluster.hitList.front()->identify() : hits.front()->prd->identify();
+            ATH_MSG_WARNING("Bad ChIndex " << m_idHelperSvc->toString(id) << "  " << hough.m_descriptor.chIndex);
+            return false;
         }
 
-        // only store maxima that have MDT hits        
-        if( nmdt > 0 || (nmm + nstgc) > 0) {
-          maxima.push_back( new MuonHough::MuonLayerHough::Maximum(maximum) );
-          // add to seed list if 
-          if( maximum.max > selector.getCutValue(maximum.pos) ) seedMaxima.push_back(maxima.back());        
-          ++nmaxima;
+        // populate hough transform with hits
+        std::stable_sort(hits.begin(), hits.end(), MuonHough::SortHitsPerLayer());
+        if (m_debugHough) hough.setDebug(true);
+        hough.fillLayer2(hits);
+
+        if (m_ntuple) { updateHits(hits, hough); }
+
+        Identifier id_hit = hits.front()->tgc ? hits.front()->tgc->etaCluster.hitList.front()->identify() : hits.front()->prd->identify();
+        MuonHough::MuonLayerHoughSelector selectorLoose;
+        MuonHough::MuonLayerHoughSelector selector;
+
+        if (m_idHelperSvc->issTgc(id_hit) || m_idHelperSvc->isMM(id_hit)) {
+            selectorLoose = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 3.9)});
+            selector = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 7.9)});
+        } else {
+            selectorLoose = m_selectorsLoose[hough.m_descriptor.chIndex];
+            selector = m_selectors[hough.m_descriptor.chIndex];
         }
-        hough.fillLayer2(maximum.hits,true);
-      }
-      else{
-        if( nmaxima > 0 ) {
-          ATH_MSG_VERBOSE("findMaxima: No more maxima found " << nmaxima );
+
+        //    Muon::MuonStationIndex::StIndex stIndex = Muon::MuonStationIndex::toStationIndex(hough.m_descriptor.chIndex);
+        unsigned int nmaxima = 0;
+        while (nmaxima < 5) {
+            MuonHough::MuonLayerHough::Maximum maximum;
+            if (hough.findMaximum(maximum, selectorLoose)) {
+                hough.associateHitsToMaximum(maximum, hits);
+                ATH_MSG_DEBUG("findMaxima: Found Eta Maximum "
+                              << nmaxima << "  " << maximum.max << " trigConfirmed " << maximum.triggerConfirmed << " pos " << maximum.pos
+                              << " theta " << maximum.theta << " binPos " << maximum.binpos << " binRange " << maximum.binposmin << " -- "
+                              << maximum.binposmax << " binTheta " << maximum.bintheta << " nHits " << maximum.hits.size());
+
+                int nmdt = 0;
+                int nmm = 0;
+                int ntgc = 0;
+                int nstgc = 0;
+
+                const unsigned int nHitsInMaximum = maximum.hits.size();
+                for (unsigned int i = 0; i < nHitsInMaximum; ++i) {
+                    MuonHough::Hit& hit = *(maximum.hits[i]);
+                    Identifier id = hit.tgc ? hit.tgc->etaCluster.hitList.front()->identify() : hit.prd->identify();
+                    int nhits = hit.tgc ? hit.tgc->etaCluster.hitList.size() : 1;
+
+                    if (m_idHelperSvc->isMdt(id))
+                        ++nmdt;
+                    else if (m_idHelperSvc->isTgc(id))
+                        ++ntgc;
+                    else if (m_idHelperSvc->issTgc(id))
+                        ++nstgc;
+                    else if (m_idHelperSvc->isMM(id))
+                        ++nmm;
+
+                    if (m_doTruth) {
+                        if (truthHits.count(id)) foundTruthHits.insert(id);
+                    }
+
+                    ATH_MSG_VERBOSE("findMaxima: hit " << hit.layer << "  " << m_idHelperSvc->toString(id) << " hits " << nhits);
+                }
+
+                // only store maxima that have MDT hits
+                if (nmdt > 0 || (nmm + nstgc) > 0) {
+                    maxima.push_back(new MuonHough::MuonLayerHough::Maximum(maximum));
+                    // add to seed list if
+                    if (maximum.max > selector.getCutValue(maximum.pos)) seedMaxima.push_back(maxima.back());
+                    ++nmaxima;
+                }
+                hough.fillLayer2(maximum.hits, true);
+            } else {
+                if (nmaxima > 0) { ATH_MSG_VERBOSE("findMaxima: No more maxima found " << nmaxima); }
+                // ?!? if nmaximo == 0 here the function should return false, I think
+                break;
+            }
         }
-        // ?!? if nmaximo == 0 here the function should return false, I think
-        break;      
-      }
+        return true;
     }
-    return true;
-  }
-
-  bool MuonLayerHoughTool::findMaxima( std::set<Identifier>& truthHits,
-                                       std::set<Identifier>& foundTruthHits,
-                                       MuonHough::MuonPhiLayerHough& hough,
-                                       MuonLayerHoughTool::PhiHitVec& hits, 
-                                       MuonLayerHoughTool::PhiMaximumVec& maxima,
-                                       int sector ) const{
-    if( hits.empty() ) return false;
-
-    std::stable_sort(hits.begin(),hits.end(),MuonHough::SortHitsPerLayer());
-    if( m_debugHough ) hough.setDebug(true);
-    hough.fillLayer2(hits);
-    
-    if( m_ntuple ) {
-      updateHits(hits,hough);
-    }
-    
-    unsigned int nmaxima = 0;
-    while( nmaxima < 5 ){
-      MuonHough::MuonPhiLayerHough::Maximum maximum;
-      if( hough.findMaximum( maximum, 1.9 ) ) {
-        hough.associateHitsToMaximum(maximum,hits);
-
-        ATH_MSG_DEBUG("findMaxima(Phi): Found Phi maximum " << nmaxima 
-                                  << " height "             << maximum.max 
-                                  << " pos "                << maximum.pos
-                                  << " bin pos "            << maximum.binpos 
-                                  << " binRange "           << maximum.binposmin << " -- " << maximum.binposmax
-                                  << " nHits "              << maximum.hits.size());
-
-        const unsigned int nHitsInMaximum = maximum.hits.size();
-        for( unsigned int i = 0;i < nHitsInMaximum; ++i){
-          MuonHough::PhiHit& hit = *(maximum.hits[i]);
-          Identifier id = hit.tgc ? hit.tgc->phiCluster.hitList.front()->identify() : hit.prd->identify();
-        
-          if( m_doTruth ){
-            if( truthHits.count(id) )       foundTruthHits.insert(id);
-          }
-          
-          int nhits = hit.tgc ? hit.tgc->phiCluster.hitList.size() : 1;
-          ATH_MSG_VERBOSE("findMaxima(Phi) phiHit " << m_idHelperSvc->toString(id) << " hits " << nhits );
-        }
-        
-        maximum.sector = sector; // very fragile passing on of sector
-        
-        //check if the maximum is already filled, if so, don't add it again
-        bool maximum_matched = false;
-        for( auto pit = maxima.begin();pit!=maxima.end();++pit ){
-          // reference to phi maximum
-          MuonHough::MuonPhiLayerHough::Maximum& pmaximum = **pit;
-          if (pmaximum.sector == maximum.sector && pmaximum.max == maximum.max && pmaximum.pos == maximum.pos && 
-            pmaximum.hits.size() == maximum.hits.size() && pmaximum.binpos == maximum.binpos && 
-            pmaximum.binposmin == maximum.binposmin && pmaximum.binposmax == maximum.binposmax){
-            ATH_MSG_DEBUG("extendSeed: sector has already been added! Skip. ");
-            bool maximum_hitmatched = true;//  check if there is a hit that is not the same
-            for ( unsigned int k=0; k < maximum.hits.size(); ++k){
-              if (maximum.hits[k] != pmaximum.hits[k]){// directly compare pointer address
-                maximum_hitmatched = false;
+
+    bool MuonLayerHoughTool::findMaxima(std::set<Identifier>& truthHits, std::set<Identifier>& foundTruthHits,
+                                        MuonHough::MuonPhiLayerHough& hough, MuonLayerHoughTool::PhiHitVec& hits,
+                                        MuonLayerHoughTool::PhiMaximumVec& maxima, int sector) const {
+        if (hits.empty()) return false;
+
+        std::stable_sort(hits.begin(), hits.end(), MuonHough::SortHitsPerLayer());
+        if (m_debugHough) hough.setDebug(true);
+        hough.fillLayer2(hits);
+
+        if (m_ntuple) { updateHits(hits, hough); }
+
+        unsigned int nmaxima = 0;
+        while (nmaxima < 5) {
+            MuonHough::MuonPhiLayerHough::Maximum maximum;
+            if (hough.findMaximum(maximum, 1.9)) {
+                hough.associateHitsToMaximum(maximum, hits);
+
+                ATH_MSG_DEBUG("findMaxima(Phi): Found Phi maximum " << nmaxima << " height " << maximum.max << " pos " << maximum.pos
+                                                                    << " bin pos " << maximum.binpos << " binRange " << maximum.binposmin
+                                                                    << " -- " << maximum.binposmax << " nHits " << maximum.hits.size());
+
+                const unsigned int nHitsInMaximum = maximum.hits.size();
+                for (unsigned int i = 0; i < nHitsInMaximum; ++i) {
+                    MuonHough::PhiHit& hit = *(maximum.hits[i]);
+                    Identifier id = hit.tgc ? hit.tgc->phiCluster.hitList.front()->identify() : hit.prd->identify();
+
+                    if (m_doTruth) {
+                        if (truthHits.count(id)) foundTruthHits.insert(id);
+                    }
+
+                    int nhits = hit.tgc ? hit.tgc->phiCluster.hitList.size() : 1;
+                    ATH_MSG_VERBOSE("findMaxima(Phi) phiHit " << m_idHelperSvc->toString(id) << " hits " << nhits);
+                }
+
+                maximum.sector = sector;  // very fragile passing on of sector
+
+                // check if the maximum is already filled, if so, don't add it again
+                bool maximum_matched = false;
+                for (auto pit = maxima.begin(); pit != maxima.end(); ++pit) {
+                    // reference to phi maximum
+                    MuonHough::MuonPhiLayerHough::Maximum& pmaximum = **pit;
+                    if (pmaximum.sector == maximum.sector && pmaximum.max == maximum.max && pmaximum.pos == maximum.pos &&
+                        pmaximum.hits.size() == maximum.hits.size() && pmaximum.binpos == maximum.binpos &&
+                        pmaximum.binposmin == maximum.binposmin && pmaximum.binposmax == maximum.binposmax) {
+                        ATH_MSG_DEBUG("extendSeed: sector has already been added! Skip. ");
+                        bool maximum_hitmatched = true;  //  check if there is a hit that is not the same
+                        for (unsigned int k = 0; k < maximum.hits.size(); ++k) {
+                            if (maximum.hits[k] != pmaximum.hits[k]) {  // directly compare pointer address
+                                maximum_hitmatched = false;
+                                break;
+                            }
+                        }
+                        if (maximum_hitmatched) {
+                            maximum_matched = true;
+                            break;
+                        }
+                    }
+                }
+                // remove the hits from hough
+                hough.fillLayer2(maximum.hits, true);
+                if (maximum_matched) {
+                    //++nmaxima;
+                    continue;
+                } else {
+                    maxima.push_back(new MuonHough::MuonPhiLayerHough::Maximum(maximum));
+                    ++nmaxima;
+                }
+            } else {
+                if (nmaxima > 0) { ATH_MSG_VERBOSE("findMaxima(Phi): No more maxima found " << nmaxima); }
+                // ?!? same here, the function should return false if nothing was found, right?
                 break;
-              }
-            }
-            if (maximum_hitmatched){
-              maximum_matched = true;
-              break;
             }
-          }
         }
-        //remove the hits from hough
-        hough.fillLayer2(maximum.hits,true);
-        if (maximum_matched){
-          //++nmaxima;
-          continue;
-        }
-        else{
-          maxima.push_back( new MuonHough::MuonPhiLayerHough::Maximum(maximum) );
-          ++nmaxima;
-        }
-      }
-      else{
-        if( nmaxima > 0 ) {
-          ATH_MSG_VERBOSE("findMaxima(Phi): No more maxima found " << nmaxima );
-        }
-        // ?!? same here, the function should return false if nothing was found, right?
-        break;     
-      }
+        hough.reset();
+        return true;
     }
-    hough.reset();
-    return true;
-  }
 
-  void MuonLayerHoughTool::fillHitsPerSector(  std::set<Identifier>& truthHits,
+    void MuonLayerHoughTool::fillHitsPerSector(std::set<Identifier>& truthHits,
                                                std::vector<std::unique_ptr<TgcHitClusteringObj>>& tgcClusteringObjs,
                                                const MuonLayerHoughTool::CollectionsPerSector& collectionsPerSector,
-                                               const MdtPrepDataContainer*  mdtCont,  
-                                               const CscPrepDataContainer*  /*cscCont*/,  
-                                               const TgcPrepDataContainer*  tgcCont,  
-                                               const RpcPrepDataContainer*  rpcCont,
-                                               const sTgcPrepDataContainer* stgcCont,  
-                                               const MMPrepDataContainer*   mmCont,
-                                               MuonLayerHoughTool::HoughDataPerSector& houghData ) const {
-    // loop over all possible station layers in the sector
-    for( unsigned int tech=0;tech<m_ntechnologies;++tech ){
-      for( unsigned int layerHash=0;layerHash<MuonStationIndex::sectorLayerHashMax();++layerHash ){
-        const HashVec& hashes = collectionsPerSector.technologyRegionHashVecs[tech][layerHash];
-        if( hashes.empty() ) continue;
-        auto regionLayer = MuonStationIndex::decomposeSectorLayerHash( layerHash );
-        
-        HashVec::const_iterator iit = hashes.begin();
-        HashVec::const_iterator iit_end = hashes.end();
-        for( ;iit!=iit_end;++iit ){
-          // !?! else if made by Felix
-          if( mdtCont && mdtCont->size()>0 && tech == MuonStationIndex::MDT ) {
-            const auto *pos = mdtCont->indexFindPtr(*iit);
-            if( pos != nullptr ) fill(truthHits,*pos,houghData.hitVec[layerHash]);
-          }
-          else if( rpcCont && rpcCont->size()>0 && tech == MuonStationIndex::RPC ) {
-            const auto *pos = rpcCont->indexFindPtr(*iit);
-            if( pos != nullptr ) fill(truthHits,*pos,houghData.hitVec[layerHash],houghData.phiHitVec[regionLayer.first]);
-          }
-          else if( tgcCont && tgcCont->size()>0 && tech == MuonStationIndex::TGC ) {
-            const auto *pos = tgcCont->indexFindPtr(*iit);
-            if( pos != nullptr ) fill(truthHits, tgcClusteringObjs, *pos,houghData.hitVec[layerHash],houghData.phiHitVec[regionLayer.first],collectionsPerSector.sector);
-          }
-          else if( stgcCont && stgcCont->size()>0 && tech == MuonStationIndex::STGC ) {
-            const auto *pos = stgcCont->indexFindPtr(*iit);
-            if( pos != nullptr ) fill(truthHits,*pos,houghData.hitVec[layerHash],houghData.phiHitVec[regionLayer.first],collectionsPerSector.sector);
-          }
-          else if( mmCont && mmCont->size()>0 && tech == MuonStationIndex::MM ) {
-            const auto *pos = mmCont->indexFindPtr(*iit);
-            if( pos != nullptr ) fill(truthHits,*pos,houghData.hitVec[layerHash]);
-          }
+                                               const MdtPrepDataContainer* mdtCont, const CscPrepDataContainer* /*cscCont*/,
+                                               const TgcPrepDataContainer* tgcCont, const RpcPrepDataContainer* rpcCont,
+                                               const sTgcPrepDataContainer* stgcCont, const MMPrepDataContainer* mmCont,
+                                               MuonLayerHoughTool::HoughDataPerSector& houghData) const {
+        // loop over all possible station layers in the sector
+        for (unsigned int tech = 0; tech < m_ntechnologies; ++tech) {
+            for (unsigned int layerHash = 0; layerHash < MuonStationIndex::sectorLayerHashMax(); ++layerHash) {
+                const HashVec& hashes = collectionsPerSector.technologyRegionHashVecs[tech][layerHash];
+                if (hashes.empty()) continue;
+                auto regionLayer = MuonStationIndex::decomposeSectorLayerHash(layerHash);
+
+                HashVec::const_iterator iit = hashes.begin();
+                HashVec::const_iterator iit_end = hashes.end();
+                for (; iit != iit_end; ++iit) {
+                    // !?! else if made by Felix
+                    if (mdtCont && mdtCont->size() > 0 && tech == MuonStationIndex::MDT) {
+                        const auto* pos = mdtCont->indexFindPtr(*iit);
+                        if (pos != nullptr) fill(truthHits, *pos, houghData.hitVec[layerHash]);
+                    } else if (rpcCont && rpcCont->size() > 0 && tech == MuonStationIndex::RPC) {
+                        const auto* pos = rpcCont->indexFindPtr(*iit);
+                        if (pos != nullptr) fill(truthHits, *pos, houghData.hitVec[layerHash], houghData.phiHitVec[regionLayer.first]);
+                    } else if (tgcCont && tgcCont->size() > 0 && tech == MuonStationIndex::TGC) {
+                        const auto* pos = tgcCont->indexFindPtr(*iit);
+                        if (pos != nullptr)
+                            fill(truthHits, tgcClusteringObjs, *pos, houghData.hitVec[layerHash], houghData.phiHitVec[regionLayer.first],
+                                 collectionsPerSector.sector);
+                    } else if (stgcCont && stgcCont->size() > 0 && tech == MuonStationIndex::STGC) {
+                        const auto* pos = stgcCont->indexFindPtr(*iit);
+                        if (pos != nullptr)
+                            fill(truthHits, *pos, houghData.hitVec[layerHash], houghData.phiHitVec[regionLayer.first],
+                                 collectionsPerSector.sector);
+                    } else if (mmCont && mmCont->size() > 0 && tech == MuonStationIndex::MM) {
+                        const auto* pos = mmCont->indexFindPtr(*iit);
+                        if (pos != nullptr) fill(truthHits, *pos, houghData.hitVec[layerHash]);
+                    }
+                }
+            }
         }
-      }
     }
-  }
-
-  void MuonLayerHoughTool::updateHits( MuonLayerHoughTool::PhiHitVec& hits, MuonHough::MuonPhiLayerHough& hough ) const {
-    PhiHitVec::iterator hit = hits.begin();
-    PhiHitVec::iterator hit_end = hits.end();
-    for( ;hit!=hit_end;++hit ){
-      if( (*hit)->debugInfo() ){
-        float max = hough.maximum( (*hit)->r, (*hit)->phimin, (*hit)->phimax, (*hit)->debugInfo()->binpos );
-        if( max > 100 ) ATH_MSG_WARNING(" Maximum value too large" << max );
-        (*hit)->debugInfo()->ph = max;
-        (*hit)->debugInfo()->rot = -99999.;
-      }
-      else{
-        ATH_MSG_DEBUG("Failed to update hit: " << (*hit)->r << " " << (*hit)->phimin << " lay " << (*hit)->layer << " no debugInfo ");
-      }
-    }
-  }
-
-  void MuonLayerHoughTool::updateHits( MuonLayerHoughTool::HitVec& hits, MuonHough::MuonLayerHough& hough ) const {
-    HitVec::iterator hit = hits.begin();
-    HitVec::iterator hit_end = hits.end();
-    for( ;hit!=hit_end;++hit ){
-      if( (*hit)->debugInfo() ){
-        std::pair<float,float> max = hough.maximum( (*hit)->x, (*hit)->ymin, (*hit)->debugInfo()->binpos, (*hit)->debugInfo()->bintheta );
-        (*hit)->debugInfo()->ph = max.first;
-        (*hit)->debugInfo()->rot = max.second;
-      }
-      else{
-        ATH_MSG_DEBUG("Failed to update hit: " << (*hit)->x << " " << (*hit)->ymin << " lay " << (*hit)->layer << " no debugInfo ");
-      }
+
+    void MuonLayerHoughTool::updateHits(MuonLayerHoughTool::PhiHitVec& hits, MuonHough::MuonPhiLayerHough& hough) const {
+        PhiHitVec::iterator hit = hits.begin();
+        PhiHitVec::iterator hit_end = hits.end();
+        for (; hit != hit_end; ++hit) {
+            if ((*hit)->debugInfo()) {
+                float max = hough.maximum((*hit)->r, (*hit)->phimin, (*hit)->phimax, (*hit)->debugInfo()->binpos);
+                if (max > 100) ATH_MSG_WARNING(" Maximum value too large" << max);
+                (*hit)->debugInfo()->ph = max;
+                (*hit)->debugInfo()->rot = -99999.;
+            } else {
+                ATH_MSG_DEBUG("Failed to update hit: " << (*hit)->r << " " << (*hit)->phimin << " lay " << (*hit)->layer
+                                                       << " no debugInfo ");
+            }
+        }
     }
-  }
-
-  void MuonLayerHoughTool::matchTruth(std::set<Identifier>& truthHits, const PRD_MultiTruthCollection& truthCol, const Identifier& id, MuonHough::HitDebugInfo& debug ) const {
-    typedef PRD_MultiTruthCollection::const_iterator iprdt;
-    std::pair<iprdt, iprdt> range = truthCol.equal_range(id);
-    // Loop over particles contributing to this cluster
-    for(iprdt i = range.first; i != range.second; i++) {
-      if(!i->second.isValid()) {
-        ATH_MSG_WARNING("Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
-      } else {
-        const HepMcParticleLink& link = i->second;
-        if( link.cptr() && abs(link.cptr()->pdg_id()) == 13 ){
-          debug.barcode = link.barcode();
-          debug.pdgId = link.cptr()->pdg_id();
-          truthHits.insert(id);
+
+    void MuonLayerHoughTool::updateHits(MuonLayerHoughTool::HitVec& hits, MuonHough::MuonLayerHough& hough) const {
+        HitVec::iterator hit = hits.begin();
+        HitVec::iterator hit_end = hits.end();
+        for (; hit != hit_end; ++hit) {
+            if ((*hit)->debugInfo()) {
+                std::pair<float, float> max =
+                    hough.maximum((*hit)->x, (*hit)->ymin, (*hit)->debugInfo()->binpos, (*hit)->debugInfo()->bintheta);
+                (*hit)->debugInfo()->ph = max.first;
+                (*hit)->debugInfo()->rot = max.second;
+            } else {
+                ATH_MSG_DEBUG("Failed to update hit: " << (*hit)->x << " " << (*hit)->ymin << " lay " << (*hit)->layer << " no debugInfo ");
+            }
         }
-      }
     }
-  }
 
-    void MuonLayerHoughTool::fill(std::set<Identifier> &truthHits, const MdtPrepDataCollection &mdts, MuonLayerHoughTool::HitVec &hits) const {
+    void MuonLayerHoughTool::matchTruth(std::set<Identifier>& truthHits, const PRD_MultiTruthCollection& truthCol, const Identifier& id,
+                                        MuonHough::HitDebugInfo& debug) const {
+        typedef PRD_MultiTruthCollection::const_iterator iprdt;
+        std::pair<iprdt, iprdt> range = truthCol.equal_range(id);
+        // Loop over particles contributing to this cluster
+        for (iprdt i = range.first; i != range.second; i++) {
+            if (!i->second.isValid()) {
+                ATH_MSG_WARNING("Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
+            } else {
+                const HepMcParticleLink& link = i->second;
+                if (link.cptr() && abs(link.cptr()->pdg_id()) == 13) {
+                    debug.barcode = link.barcode();
+                    debug.pdgId = link.cptr()->pdg_id();
+                    truthHits.insert(id);
+                }
+            }
+        }
+    }
 
+    void MuonLayerHoughTool::fill(std::set<Identifier>& truthHits, const MdtPrepDataCollection& mdts,
+                                  MuonLayerHoughTool::HitVec& hits) const {
         if (mdts.empty()) return;
         auto truthCollections = m_truthNames.makeHandles();
         Identifier chid = mdts.identify();
@@ -1782,13 +1798,13 @@ namespace Muon {
         MdtPrepDataCollection::const_iterator mit = mdts.begin();
         MdtPrepDataCollection::const_iterator mit_end = mdts.end();
         for (; mit != mit_end; ++mit) {
-            const MdtPrepData &prd = **mit;
+            const MdtPrepData& prd = **mit;
             if (prd.adc() < 50 || prd.status() != Muon::MdtStatusDriftTime) {
                 ++nmdtsBad;
                 continue;
             }
             ++nmdts;
-            const Identifier &id = prd.identify();
+            const Identifier& id = prd.identify();
 
             float r = rCor(prd);
             float x = barrelLike ? r : prd.globalPosition().z();
@@ -1797,24 +1813,24 @@ namespace Muon {
 
             float ymin = y - prd.localPosition()[Trk::locR];
             float ymax = y + prd.localPosition()[Trk::locR];
-            MuonHough::HitDebugInfo *debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
+            MuonHough::HitDebugInfo* debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
             debug->time = prd.tdc();
             debug->r = prd.localPosition()[Trk::locR];
 
             std::map<unsigned int, unsigned int>::const_iterator pos = m_techToTruthNameIdx.find(technology);
-            if (pos != m_techToTruthNameIdx.end()) {
-                matchTruth(truthHits, *truthCollections[pos->second], id, *debug);
-            }
-            MuonHough::Hit *hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 1., debug, *mit);
+            if (pos != m_techToTruthNameIdx.end()) { matchTruth(truthHits, *truthCollections[pos->second], id, *debug); }
+            MuonHough::Hit* hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 1., debug, *mit);
             hits.push_back(hit);
         }
 
-        ATH_MSG_DEBUG("fillMDT: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> hits: " << nmdts << " bad " << nmdtsBad << " isSmallChamber " << m_idHelperSvc->isSmallChamber(chid));
-
+        ATH_MSG_DEBUG("fillMDT: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " "
+                                          << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer)
+                                          << " -> hits: " << nmdts << " bad " << nmdtsBad << " isSmallChamber "
+                                          << m_idHelperSvc->isSmallChamber(chid));
     }
 
-    void MuonLayerHoughTool::fill(std::set<Identifier> &truthHits, const RpcPrepDataCollection &rpcs, MuonLayerHoughTool::HitVec &hits, MuonLayerHoughTool::PhiHitVec &phiHits) const {
-
+    void MuonLayerHoughTool::fill(std::set<Identifier>& truthHits, const RpcPrepDataCollection& rpcs, MuonLayerHoughTool::HitVec& hits,
+                                  MuonLayerHoughTool::PhiHitVec& phiHits) const {
         if (rpcs.empty()) return;
         auto truthCollections = m_truthNames.makeHandles();
         Identifier chid = rpcs.identify();
@@ -1829,31 +1845,33 @@ namespace Muon {
         RpcPrepDataCollection::const_iterator mit = rpcs.begin();
         RpcPrepDataCollection::const_iterator mit_end = rpcs.end();
         for (; mit != mit_end; ++mit) {
-            if (m_idHelperSvc->rpcIdHelper().measuresPhi((*mit)->identify())) ++nphi;
-            else ++neta;
+            if (m_idHelperSvc->rpcIdHelper().measuresPhi((*mit)->identify()))
+                ++nphi;
+            else
+                ++neta;
         }
-        ATH_MSG_DEBUG("fillRPC: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> eta hits " << neta << " phi hits " << nphi);
+        ATH_MSG_DEBUG("fillRPC: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " "
+                                          << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer)
+                                          << " -> eta hits " << neta << " phi hits " << nphi);
 
         mit = rpcs.begin();
         for (; mit != mit_end; ++mit) {
-            const RpcPrepData &prd = **mit;
-            const Identifier &id = prd.identify();
+            const RpcPrepData& prd = **mit;
+            const Identifier& id = prd.identify();
             int sublayer = sublay(id);
-            MuonHough::HitDebugInfo *debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
+            MuonHough::HitDebugInfo* debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
             debug->isEtaPhi = (neta && nphi);
             debug->trigConfirm = 1;
             debug->time = prd.time();
             std::map<unsigned int, unsigned int>::const_iterator pos = m_techToTruthNameIdx.find(technology);
-            if (pos != m_techToTruthNameIdx.end()) {
-                matchTruth(truthHits, *truthCollections[pos->second], id, *debug);
-            }
+            if (pos != m_techToTruthNameIdx.end()) { matchTruth(truthHits, *truthCollections[pos->second], id, *debug); }
             float weight = (neta && nphi) ? 2 : 1;
             if (m_idHelperSvc->rpcIdHelper().measuresPhi(id)) {
                 const float r = rCor(prd);
                 const float phi = prd.globalPosition().phi();
-                const double phi1 = phi; //phiCor(phi,sector);
+                const double phi1 = phi;  // phiCor(phi,sector);
                 debug->r = -99999;
-                MuonHough::PhiHit *hit = new MuonHough::PhiHit(sublayer, r, phi1, phi1, weight, debug, &prd);
+                MuonHough::PhiHit* hit = new MuonHough::PhiHit(sublayer, r, phi1, phi1, weight, debug, &prd);
                 phiHits.push_back(hit);
             } else {
                 const float x = rCor(prd);
@@ -1862,14 +1880,14 @@ namespace Muon {
                 const float ymin = y - stripCor;
                 const float ymax = y + stripCor;
                 debug->r = stripCor;
-                MuonHough::Hit *hit = new MuonHough::Hit(sublayer, x, ymin, ymax, weight, debug, *mit);
+                MuonHough::Hit* hit = new MuonHough::Hit(sublayer, x, ymin, ymax, weight, debug, *mit);
                 hits.push_back(hit);
             }
         }
     }
 
-    void MuonLayerHoughTool::fill(std::set<Identifier> &truthHits, const MMPrepDataCollection &mms, MuonLayerHoughTool::HitVec &hits) const {
-
+    void MuonLayerHoughTool::fill(std::set<Identifier>& truthHits, const MMPrepDataCollection& mms,
+                                  MuonLayerHoughTool::HitVec& hits) const {
         if (mms.empty()) return;
         auto truthCollections = m_truthNames.makeHandles();
         Identifier chid = mms.identify();
@@ -1877,33 +1895,33 @@ namespace Muon {
         MuonStationIndex::LayerIndex layer = m_idHelperSvc->layerIndex(chid);
         int sector = m_idHelperSvc->sector(chid);
         unsigned int technology = m_idHelperSvc->technologyIndex(chid);
-        ATH_MSG_DEBUG("fillMM: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> hits " << mms.size());
+        ATH_MSG_DEBUG("fillMM: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " "
+                                         << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> hits "
+                                         << mms.size());
 
         MMPrepDataCollection::const_iterator mit = mms.begin();
         MMPrepDataCollection::const_iterator mit_end = mms.end();
         for (; mit != mit_end; ++mit) {
-            const MMPrepData &prd = **mit;
-            const Identifier &id = prd.identify();
+            const MMPrepData& prd = **mit;
+            const Identifier& id = prd.identify();
 
             float x = prd.globalPosition().z();
             float y = rCor(prd);
             int sublayer = sublay(id);
-            float stripCor = 0.45; // get from det el
+            float stripCor = 0.45;  // get from det el
             float ymin = y - stripCor;
             float ymax = y + stripCor;
-            MuonHough::HitDebugInfo *debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
+            MuonHough::HitDebugInfo* debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
             debug->r = stripCor;
             std::map<unsigned int, unsigned int>::const_iterator pos = m_techToTruthNameIdx.find(technology);
-            if (pos != m_techToTruthNameIdx.end()) {
-                matchTruth(truthHits, *truthCollections[pos->second], id, *debug);
-            }
-            MuonHough::Hit *hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 1., debug, *mit);
+            if (pos != m_techToTruthNameIdx.end()) { matchTruth(truthHits, *truthCollections[pos->second], id, *debug); }
+            MuonHough::Hit* hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 1., debug, *mit);
             hits.push_back(hit);
         }
     }
 
-    void MuonLayerHoughTool::fill(std::set<Identifier> &truthHits, const sTgcPrepDataCollection &stgcs, MuonLayerHoughTool::HitVec &hits, MuonLayerHoughTool::PhiHitVec &phiHits, int selectedSector) const {
-
+    void MuonLayerHoughTool::fill(std::set<Identifier>& truthHits, const sTgcPrepDataCollection& stgcs, MuonLayerHoughTool::HitVec& hits,
+                                  MuonLayerHoughTool::PhiHitVec& phiHits, int selectedSector) const {
         if (stgcs.empty()) return;
         auto truthCollections = m_truthNames.makeHandles();
         Identifier chid = stgcs.identify();
@@ -1912,13 +1930,15 @@ namespace Muon {
         int sector = m_idHelperSvc->sector(chid);
         bool isNeighbouringSector = sector != selectedSector;
         unsigned int technology = m_idHelperSvc->technologyIndex(chid);
-        ATH_MSG_DEBUG("fillsTGC: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> hits: " << stgcs.size());
+        ATH_MSG_DEBUG("fillsTGC: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " "
+                                           << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer)
+                                           << " -> hits: " << stgcs.size());
 
         sTgcPrepDataCollection::const_iterator mit = stgcs.begin();
         sTgcPrepDataCollection::const_iterator mit_end = stgcs.end();
         for (; mit != mit_end; ++mit) {
-            const sTgcPrepData &prd = **mit;
-            const Identifier &id = prd.identify();
+            const sTgcPrepData& prd = **mit;
+            const Identifier& id = prd.identify();
             int channelType = m_idHelperSvc->stgcIdHelper().channelType(id);
 
             // only pick up phi hits in neighbouring sectors
@@ -1926,21 +1946,19 @@ namespace Muon {
             if (m_onlyUseCurrentBunch && (prd.getBcBitMap() & sTgcPrepData::BCBIT_CURRENT) != sTgcPrepData::BCBIT_CURRENT) continue;
             int sublayer = sublay(id);
 
-            MuonHough::HitDebugInfo *debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
+            MuonHough::HitDebugInfo* debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
             debug->isEtaPhi = 1;
             debug->trigConfirm = (prd.getBcBitMap() & sTgcPrepData::BCBIT_CURRENT) == sTgcPrepData::BCBIT_CURRENT;
             debug->time = prd.getBcBitMap();
 
             std::map<unsigned int, unsigned int>::const_iterator pos = m_techToTruthNameIdx.find(technology);
-            if (pos != m_techToTruthNameIdx.end()) {
-                matchTruth(truthHits, *truthCollections[pos->second], id, *debug);
-            }
+            if (pos != m_techToTruthNameIdx.end()) { matchTruth(truthHits, *truthCollections[pos->second], id, *debug); }
             if (m_idHelperSvc->stgcIdHelper().channelType(id) == 1) {
                 // eta strips
                 float x = prd.globalPosition().z();
                 float y = rCor(prd);
-                float stripCor = 1.5; // get from det el
-                const MuonGM::MuonChannelDesign *design = prd.detectorElement()->getDesign(id);
+                float stripCor = 1.5;  // get from det el
+                const MuonGM::MuonChannelDesign* design = prd.detectorElement()->getDesign(id);
                 if (design) {
                     double stripWidth = design->inputWidth;
                     double stripLength = design->channelLength(m_idHelperSvc->stgcIdHelper().channel(id));
@@ -1950,14 +1968,13 @@ namespace Muon {
                 debug->r = stripCor;
                 float ymin = y - stripCor;
                 float ymax = y + stripCor;
-                MuonHough::Hit *hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 1., debug, *mit);
+                MuonHough::Hit* hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 1., debug, *mit);
                 hits.push_back(hit);
             } else {
                 double chWidth = 0;
                 if (m_idHelperSvc->stgcIdHelper().channelType(id) == 0) {
-
                     // pads
-                    const MuonGM::MuonPadDesign *design = prd.detectorElement()->getPadDesign(id);
+                    const MuonGM::MuonPadDesign* design = prd.detectorElement()->getPadDesign(id);
                     if (!design) {
                         ATH_MSG_WARNING("No design found for " << m_idHelperSvc->toString(id));
                         delete debug;
@@ -1966,11 +1983,13 @@ namespace Muon {
                     // get the pad width from the detector design
                     double chWidth = 0.5 * design->channelWidth(prd.localPosition(), true);
 
-                    if (m_debugHough) ATH_MSG_DEBUG(" sPadWidth " << design->sPadWidth << " lPadWidth " << design->lPadWidth << " inputRowWidth " << design->inputRowWidth);
+                    if (m_debugHough)
+                        ATH_MSG_DEBUG(" sPadWidth " << design->sPadWidth << " lPadWidth " << design->lPadWidth << " inputRowWidth "
+                                                    << design->inputRowWidth);
 
                     if (m_debugHough) ATH_MSG_DEBUG(" Pad chWidth " << chWidth << " phi global " << prd.globalPosition().phi());
                 } else if (m_idHelperSvc->stgcIdHelper().channelType(id) == 2) {
-                    const MuonGM::MuonChannelDesign *design = prd.detectorElement()->getDesign(id);
+                    const MuonGM::MuonChannelDesign* design = prd.detectorElement()->getDesign(id);
                     if (!design) {
                         ATH_MSG_WARNING("No design found for " << m_idHelperSvc->toString(id));
                         delete debug;
@@ -1991,30 +2010,41 @@ namespace Muon {
 
                 double phi1 = gp1.phi();
                 double phi2 = gp2.phi();
-                double phi1c = phi1; //phiCor(phi1,selectedSector);
-                double phi2c = phi2; //phiCor(phi2,selectedSector);
-		double phi_check = std::abs(phi1c-phi2c) < TMath::Pi() ? std::abs(phi1c-phi2c) : 2.*TMath::Pi()-std::abs(phi1c-phi2c);
-                if ( phi_check > 0.3) {
-                    ATH_MSG_WARNING("bad local phi: in " << phi1 << ", " << phi2 << " sector phi " << m_sectorMapping.sectorPhi(selectedSector) << " phicor " << phi1c << ", " << phi2c);
+                double phi1c = phi1;  // phiCor(phi1,selectedSector);
+                double phi2c = phi2;  // phiCor(phi2,selectedSector);
+                double phi_check =
+                    std::abs(phi1c - phi2c) < TMath::Pi() ? std::abs(phi1c - phi2c) : 2. * TMath::Pi() - std::abs(phi1c - phi2c);
+                if (phi_check > 0.3) {
+                    ATH_MSG_WARNING("bad local phi: in " << phi1 << ", " << phi2 << " sector phi "
+                                                         << m_sectorMapping.sectorPhi(selectedSector) << " phicor " << phi1c << ", "
+                                                         << phi2c);
                 }
-                if (isNeighbouringSector && !(m_sectorMapping.insideSector(selectedSector, phi1) || m_sectorMapping.insideSector(selectedSector, phi2))) {
-                    ATH_MSG_DEBUG("Dropping phi hit in neighbouring sector " << m_idHelperSvc->toString(id) << " phi min " << std::min(phi1c, phi2c) << " max " << std::max(phi1c, phi2c) << " global phi: in " << phi1 << ", " << phi2 << " sector phi " << m_sectorMapping.sectorPhi(selectedSector));
+                if (isNeighbouringSector &&
+                    !(m_sectorMapping.insideSector(selectedSector, phi1) || m_sectorMapping.insideSector(selectedSector, phi2))) {
+                    ATH_MSG_DEBUG("Dropping phi hit in neighbouring sector " << m_idHelperSvc->toString(id) << " phi min "
+                                                                             << std::min(phi1c, phi2c) << " max " << std::max(phi1c, phi2c)
+                                                                             << " global phi: in " << phi1 << ", " << phi2 << " sector phi "
+                                                                             << m_sectorMapping.sectorPhi(selectedSector));
                     delete debug;
                     continue;
                 }
                 float r = rCor(prd);
-                MuonHough::PhiHit *phiHit = new MuonHough::PhiHit(sublayer, r, std::min(phi1c, phi2c), std::max(phi1c, phi2c), 1, debug, &prd);
-                ATH_MSG_VERBOSE("Phi hit " << m_idHelperSvc->toString(id) << " r " << r << " phi min " << phiHit->phimin << " phi max " << phiHit->phimax << " bc " << debug->barcode << " chw " << chWidth << " trigC " << debug->trigConfirm << " g phi " << phi1 << " " << phi2);
+                MuonHough::PhiHit* phiHit =
+                    new MuonHough::PhiHit(sublayer, r, std::min(phi1c, phi2c), std::max(phi1c, phi2c), 1, debug, &prd);
+                ATH_MSG_VERBOSE("Phi hit " << m_idHelperSvc->toString(id) << " r " << r << " phi min " << phiHit->phimin << " phi max "
+                                           << phiHit->phimax << " bc " << debug->barcode << " chw " << chWidth << " trigC "
+                                           << debug->trigConfirm << " g phi " << phi1 << " " << phi2);
                 phiHits.push_back(phiHit);
             }
         }
     }
 
-    void MuonLayerHoughTool::fill(std::set<Identifier> &truthHits, std::vector<std::unique_ptr<TgcHitClusteringObj>> &tgcClusteringObjs, const TgcPrepDataCollection &tgcs, MuonLayerHoughTool::HitVec &hits, MuonLayerHoughTool::PhiHitVec &phiHits, int sector) const {
-
+    void MuonLayerHoughTool::fill(std::set<Identifier>& truthHits, std::vector<std::unique_ptr<TgcHitClusteringObj>>& tgcClusteringObjs,
+                                  const TgcPrepDataCollection& tgcs, MuonLayerHoughTool::HitVec& hits,
+                                  MuonLayerHoughTool::PhiHitVec& phiHits, int sector) const {
         if (tgcs.empty()) return;
         tgcClusteringObjs.push_back(std::make_unique<TgcHitClusteringObj>(&m_idHelperSvc->tgcIdHelper()));
-        TgcHitClusteringObj &clustering = *tgcClusteringObjs.back();
+        TgcHitClusteringObj& clustering = *tgcClusteringObjs.back();
         std::vector<const TgcPrepData*> prds;
         prds.insert(prds.begin(), tgcs.begin(), tgcs.end());
         clustering.cluster(prds);
@@ -2052,12 +2082,12 @@ namespace Muon {
             std::vector<TgcClusterObj3D>::const_iterator cl_it_end = clustering.clusters3D.end();
 
             for (; cl_it != cl_it_end; ++cl_it) {
-                const TgcClusterObj3D &cl = *cl_it;
+                const TgcClusterObj3D& cl = *cl_it;
                 if (cl.etaCluster.hitList.empty()) {
                     ATH_MSG_WARNING("Incomplete TgcClusterObj3D in chamber " << m_idHelperSvc->toString(chid));
                     continue;
                 }
-                const Identifier &id = cl.etaCluster.hitList.front()->identify();
+                const Identifier& id = cl.etaCluster.hitList.front()->identify();
 
                 double x = cl.p11.z();
                 double y11 = rCor(cl, 1, sector);
@@ -2072,200 +2102,202 @@ namespace Muon {
                 double ymax = std::max(std::max(y11, y12), std::max(y21, y22));
                 double phimin = std::min(std::min(phi11, phi12), std::min(phi21, phi22));
                 double phimax = std::max(std::max(phi11, phi12), std::max(phi21, phi22));
-                double phi1 = phimin; //phiCor(phimin,sector);
-                double phi2 = phimax; //phiCor(phimax,sector);
+                double phi1 = phimin;  // phiCor(phimin,sector);
+                double phi2 = phimax;  // phiCor(phimax,sector);
                 int sublayer = sublay(id, x);
 
-                MuonHough::HitDebugInfo *debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
+                MuonHough::HitDebugInfo* debug = new MuonHough::HitDebugInfo(technology, sector, region, layer, sublayer);
                 debug->clusterSize = cl.etaCluster.hitList.size();
                 debug->clusterLayers = cl.etaCluster.layers();
                 debug->isEtaPhi = cl.phiCluster.layers();
                 debug->time = cl.etaCluster.hitList.front()->getBcBitMap();
                 std::map<unsigned int, unsigned int>::const_iterator pos = m_techToTruthNameIdx.find(technology);
-                if (pos != m_techToTruthNameIdx.end()) {
-                    matchTruth(truthHits, *truthCollections[pos->second], id, *debug);
-                }
+                if (pos != m_techToTruthNameIdx.end()) { matchTruth(truthHits, *truthCollections[pos->second], id, *debug); }
 
-                MuonHough::HitDebugInfo *phiDebug = new MuonHough::HitDebugInfo(*debug);
+                MuonHough::HitDebugInfo* phiDebug = new MuonHough::HitDebugInfo(*debug);
                 phiDebug->clusterSize = cl.phiCluster.hitList.size();
                 phiDebug->clusterLayers = cl.phiCluster.layers();
                 phiDebug->isEtaPhi = cl.etaCluster.layers();
 
-                MuonHough::Hit *hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 2 * cl.etaCluster.layers(), debug, nullptr, &cl);
-                MuonHough::PhiHit *phiHit = new MuonHough::PhiHit(sublayer, y11, phi1, phi2, 2 * cl.phiCluster.layers(), phiDebug, nullptr, &cl);
+                MuonHough::Hit* hit = new MuonHough::Hit(sublayer, x, ymin, ymax, 2 * cl.etaCluster.layers(), debug, nullptr, &cl);
+                MuonHough::PhiHit* phiHit =
+                    new MuonHough::PhiHit(sublayer, y11, phi1, phi2, 2 * cl.phiCluster.layers(), phiDebug, nullptr, &cl);
                 hits.push_back(hit);
                 phiHits.push_back(phiHit);
             }
         }
-        ATH_MSG_DEBUG("fillTGC: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " " << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer) << " -> etaHits: " << hits.size() << " phiHits: " << phiHits.size() << " sectors: " << sectors.size());
-    }
- 
-  void MuonLayerHoughTool::insertHash( const IdentifierHash& hash, const Identifier& id ) {
-    insertHash(m_idHelperSvc->sector(id),hash,id);
-  }
-
-  void MuonLayerHoughTool::insertHash( int sector, const IdentifierHash& hash, const Identifier& id ) {
-    MuonStationIndex::TechnologyIndex techIndex = m_idHelperSvc->technologyIndex(id);
-    int sectorLayerHash = MuonStationIndex::sectorLayerHash(m_idHelperSvc->regionIndex(id),m_idHelperSvc->layerIndex(id));
-    m_collectionsPerSector[sector-1].technologyRegionHashVecs[techIndex][sectorLayerHash].push_back(hash);
-  }
-
-  // all chambers are mapped onto a layer and sector map
-  void MuonLayerHoughTool::initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr) {
-    m_collectionsPerSector.resize(MuonStationIndex::numberOfSectors());
-    // set sector numbers
-    unsigned int nsectorHashMax = MuonStationIndex::sectorLayerHashMax();
-    for( unsigned int i=0;i<m_collectionsPerSector.size();++i ) {
-      m_collectionsPerSector[i].sector=i+1;
-      m_collectionsPerSector[i].technologyRegionHashVecs.resize(m_ntechnologies);
-      for( auto it = m_collectionsPerSector[i].technologyRegionHashVecs.begin();it!=m_collectionsPerSector[i].technologyRegionHashVecs.end(); ++it ) {
-        it->resize(nsectorHashMax);
-      }
-    }
-    ATH_MSG_DEBUG("Initializing hashes: number of sectors " << MuonStationIndex::numberOfSectors() 
-                  << " technologies " << m_ntechnologies << " sectorLayers " << MuonStationIndex::sectorLayerHashMax() );
-    // loop over all available MDT collection identifiers and order them per sector
-    MuonIdHelper::const_id_iterator it = m_idHelperSvc->mdtIdHelper().module_begin();
-    MuonIdHelper::const_id_iterator it_end = m_idHelperSvc->mdtIdHelper().module_end();
-    for( ;it!=it_end; ++it ){
-      IdentifierHash hash;
-      m_idHelperSvc->mdtIdHelper().get_module_hash(*it,hash);
-      insertHash(hash,*it);
+        ATH_MSG_DEBUG("fillTGC: Filling " << m_idHelperSvc->toStringChamber(chid) << ": loc s" << sector << " "
+                                          << MuonStationIndex::regionName(region) << " " << MuonStationIndex::layerName(layer)
+                                          << " -> etaHits: " << hits.size() << " phiHits: " << phiHits.size()
+                                          << " sectors: " << sectors.size());
     }
 
-    // loop over all available RPC collection identifiers and order them per sector
-    it = m_idHelperSvc->rpcIdHelper().module_begin();
-    it_end = m_idHelperSvc->rpcIdHelper().module_end();
-    for( ;it!=it_end; ++it ){
-      IdentifierHash hash;
-      m_idHelperSvc->rpcIdHelper().get_module_hash(*it,hash);
-      insertHash(hash,*it);
+    void MuonLayerHoughTool::insertHash(const IdentifierHash& hash, const Identifier& id) {
+        insertHash(m_idHelperSvc->sector(id), hash, id);
     }
 
-    // loop over all available CSC collection identifiers and order them per sector
-    if (m_idHelperSvc->hasCSC()) {
-      it = m_idHelperSvc->cscIdHelper().module_begin();
-      it_end = m_idHelperSvc->cscIdHelper().module_end();
-      for( ;it!=it_end; ++it ){
-        IdentifierHash hash;
-        m_idHelperSvc->cscIdHelper().get_module_hash(*it,hash);
-        insertHash(hash,*it);
-      }
+    void MuonLayerHoughTool::insertHash(int sector, const IdentifierHash& hash, const Identifier& id) {
+        MuonStationIndex::TechnologyIndex techIndex = m_idHelperSvc->technologyIndex(id);
+        int sectorLayerHash = MuonStationIndex::sectorLayerHash(m_idHelperSvc->regionIndex(id), m_idHelperSvc->layerIndex(id));
+        m_collectionsPerSector[sector - 1].technologyRegionHashVecs[techIndex][sectorLayerHash].push_back(hash);
     }
 
-    // loop over all available MM collection identifiers and order them per sector
-    if (m_idHelperSvc->hasMM()) {
-      it = m_idHelperSvc->mmIdHelper().detectorElement_begin();
-      it_end = m_idHelperSvc->mmIdHelper().detectorElement_end();
-      for( ;it!=it_end; ++it ){
-        IdentifierHash hash;
-        m_idHelperSvc->mmIdHelper().get_module_hash(*it,hash);
-        insertHash(hash,*it);
-      }
-    }
+    // all chambers are mapped onto a layer and sector map
+    void MuonLayerHoughTool::initializeSectorMapping(const MuonGM::MuonDetectorManager* detMgr) {
+        m_collectionsPerSector.resize(MuonStationIndex::numberOfSectors());
+        // set sector numbers
+        unsigned int nsectorHashMax = MuonStationIndex::sectorLayerHashMax();
+        for (unsigned int i = 0; i < m_collectionsPerSector.size(); ++i) {
+            m_collectionsPerSector[i].sector = i + 1;
+            m_collectionsPerSector[i].technologyRegionHashVecs.resize(m_ntechnologies);
+            for (auto it = m_collectionsPerSector[i].technologyRegionHashVecs.begin();
+                 it != m_collectionsPerSector[i].technologyRegionHashVecs.end(); ++it) {
+                it->resize(nsectorHashMax);
+            }
+        }
+        ATH_MSG_DEBUG("Initializing hashes: number of sectors " << MuonStationIndex::numberOfSectors() << " technologies "
+                                                                << m_ntechnologies << " sectorLayers "
+                                                                << MuonStationIndex::sectorLayerHashMax());
+        // loop over all available MDT collection identifiers and order them per sector
+        MuonIdHelper::const_id_iterator it = m_idHelperSvc->mdtIdHelper().module_begin();
+        MuonIdHelper::const_id_iterator it_end = m_idHelperSvc->mdtIdHelper().module_end();
+        for (; it != it_end; ++it) {
+            IdentifierHash hash;
+            m_idHelperSvc->mdtIdHelper().get_module_hash(*it, hash);
+            insertHash(hash, *it);
+        }
 
-    // loop over all available STGC collection identifiers and order them per sector
-    if (m_idHelperSvc->hasSTgc()) {
-      it = m_idHelperSvc->stgcIdHelper().detectorElement_begin();
-      it_end = m_idHelperSvc->stgcIdHelper().detectorElement_end();
-      for( ;it!=it_end; ++it ){
-        IdentifierHash hash;
-        m_idHelperSvc->stgcIdHelper().get_module_hash(*it,hash);
-        int sector = m_idHelperSvc->sector(*it);
-        insertHash(sector,hash,*it);
-        int sectorU = sector != 1 ? sector-1 : 16;
-        int sectorD = sector != 16 ? sector+1 : 1;
-        insertHash(sectorU,hash,*it);
-        insertHash(sectorD,hash,*it);
-      }
-    }
+        // loop over all available RPC collection identifiers and order them per sector
+        it = m_idHelperSvc->rpcIdHelper().module_begin();
+        it_end = m_idHelperSvc->rpcIdHelper().module_end();
+        for (; it != it_end; ++it) {
+            IdentifierHash hash;
+            m_idHelperSvc->rpcIdHelper().get_module_hash(*it, hash);
+            insertHash(hash, *it);
+        }
 
-    // loop over all available TGC collection identifiers and order them per sector
-    it = m_idHelperSvc->tgcIdHelper().module_begin();
-    it_end = m_idHelperSvc->tgcIdHelper().module_end();
-    for( ;it!=it_end; ++it ){
-      const MuonGM::TgcReadoutElement* detEl = detMgr->getTgcReadoutElement(*it);
-      if( !detEl ) {
-        ATH_MSG_DEBUG(" No detector element found for " << m_idHelperSvc->toString(*it) );
-        continue;
-      }
-      IdentifierHash hash;
-      m_idHelperSvc->tgcIdHelper().get_module_hash(*it,hash);
-      int nstrips = detEl->getNStrips(1);
-      Amg::Vector3D p1 = detEl->channelPos(1,1,1);
-      Amg::Vector3D p2 = detEl->channelPos(1,1,nstrips);
-      std::vector<int> sectors1;
-      getSectors(p1,sectors1);
-      std::set<int> added;
-      std::vector<int>::iterator sit = sectors1.begin();
-      std::vector<int>::iterator sit_end = sectors1.end();
-      for( ;sit!=sit_end; ++sit ){
-        insertHash(*sit,hash,*it);
-        added.insert(*sit);
-      }
-
-      std::vector<int> sectors2;
-      getSectors(p2,sectors2);
-      sit = sectors2.begin();
-      sit_end = sectors2.end();
-      for( ;sit!=sit_end; ++sit ){
-        if( added.count(*sit) ) continue;
-        added.insert(*sit);
-        insertHash(*sit,hash,*it);
-      }
+        // loop over all available CSC collection identifiers and order them per sector
+        if (m_idHelperSvc->hasCSC()) {
+            it = m_idHelperSvc->cscIdHelper().module_begin();
+            it_end = m_idHelperSvc->cscIdHelper().module_end();
+            for (; it != it_end; ++it) {
+                IdentifierHash hash;
+                m_idHelperSvc->cscIdHelper().get_module_hash(*it, hash);
+                insertHash(hash, *it);
+            }
+        }
 
-    }
+        // loop over all available MM collection identifiers and order them per sector
+        if (m_idHelperSvc->hasMM()) {
+            it = m_idHelperSvc->mmIdHelper().detectorElement_begin();
+            it_end = m_idHelperSvc->mmIdHelper().detectorElement_end();
+            for (; it != it_end; ++it) {
+                IdentifierHash hash;
+                m_idHelperSvc->mmIdHelper().get_module_hash(*it, hash);
+                insertHash(hash, *it);
+            }
+        }
 
-    if( msgLvl(MSG::DEBUG) ) ATH_MSG_DEBUG(" Printing collections per sector, number of technologies " << m_ntechnologies);
-    for( int sector = 1; sector<=16; ++sector ){
-      MuonStationIndex::DetectorRegionIndex currentRegion = MuonStationIndex::DetectorRegionUnknown;
-      if( msgLvl(MSG::DEBUG) ) ATH_MSG_DEBUG(" sector " << sector);
-      TechnologyRegionHashVec& vec = m_collectionsPerSector[sector-1].technologyRegionHashVecs;
-      for( unsigned int hash = 0; hash < nsectorHashMax; ++hash ){
-        std::pair<MuonStationIndex::DetectorRegionIndex,MuonStationIndex::LayerIndex> regionLayer = MuonStationIndex::decomposeSectorLayerHash(hash);
-        if( msgLvl(MSG::DEBUG) ) if( regionLayer.first != currentRegion ) ATH_MSG_DEBUG("  " << MuonStationIndex::regionName(regionLayer.first));
-        bool first = true;
-        currentRegion = regionLayer.first;
-        for( unsigned int tech=0; tech<m_ntechnologies;++tech ){
-          std::stable_sort(vec[tech][hash].begin(),vec[tech][hash].end());
-          if( !vec[tech][hash].empty() ) {
-            if( msgLvl(MSG::DEBUG) ) {
-              if( first ) {
-                ATH_MSG_DEBUG("  " << std::setw(7) << MuonStationIndex::layerName(regionLayer.second));
-                first = false;
-              }
-              ATH_MSG_DEBUG(" " << std::setw(4) << MuonStationIndex::technologyName(static_cast<MuonStationIndex::TechnologyIndex>(tech)) 
-                              << " " << std::setw(4) << vec[tech][hash].size()); 
+        // loop over all available STGC collection identifiers and order them per sector
+        if (m_idHelperSvc->hasSTgc()) {
+            it = m_idHelperSvc->stgcIdHelper().detectorElement_begin();
+            it_end = m_idHelperSvc->stgcIdHelper().detectorElement_end();
+            for (; it != it_end; ++it) {
+                IdentifierHash hash;
+                m_idHelperSvc->stgcIdHelper().get_module_hash(*it, hash);
+                int sector = m_idHelperSvc->sector(*it);
+                insertHash(sector, hash, *it);
+                int sectorU = sector != 1 ? sector - 1 : 16;
+                int sectorD = sector != 16 ? sector + 1 : 1;
+                insertHash(sectorU, hash, *it);
+                insertHash(sectorD, hash, *it);
             }
-          }
         }
-      }
-    }
-  }
 
-  void MuonLayerHoughTool::printTruthSummary( std::set<Identifier>& truth, std::set<Identifier>& found ) const {
-    if( truth.size() == found.size() ){
-      ATH_MSG_DEBUG(" All hits found: truth " << truth.size() << " found " << found.size() );
+        // loop over all available TGC collection identifiers and order them per sector
+        it = m_idHelperSvc->tgcIdHelper().module_begin();
+        it_end = m_idHelperSvc->tgcIdHelper().module_end();
+        for (; it != it_end; ++it) {
+            const MuonGM::TgcReadoutElement* detEl = detMgr->getTgcReadoutElement(*it);
+            if (!detEl) {
+                ATH_MSG_DEBUG(" No detector element found for " << m_idHelperSvc->toString(*it));
+                continue;
+            }
+            IdentifierHash hash;
+            m_idHelperSvc->tgcIdHelper().get_module_hash(*it, hash);
+            int nstrips = detEl->getNStrips(1);
+            Amg::Vector3D p1 = detEl->channelPos(1, 1, 1);
+            Amg::Vector3D p2 = detEl->channelPos(1, 1, nstrips);
+            std::vector<int> sectors1;
+            getSectors(p1, sectors1);
+            std::set<int> added;
+            std::vector<int>::iterator sit = sectors1.begin();
+            std::vector<int>::iterator sit_end = sectors1.end();
+            for (; sit != sit_end; ++sit) {
+                insertHash(*sit, hash, *it);
+                added.insert(*sit);
+            }
+
+            std::vector<int> sectors2;
+            getSectors(p2, sectors2);
+            sit = sectors2.begin();
+            sit_end = sectors2.end();
+            for (; sit != sit_end; ++sit) {
+                if (added.count(*sit)) continue;
+                added.insert(*sit);
+                insertHash(*sit, hash, *it);
+            }
+        }
+
+        if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(" Printing collections per sector, number of technologies " << m_ntechnologies);
+        for (int sector = 1; sector <= 16; ++sector) {
+            MuonStationIndex::DetectorRegionIndex currentRegion = MuonStationIndex::DetectorRegionUnknown;
+            if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(" sector " << sector);
+            TechnologyRegionHashVec& vec = m_collectionsPerSector[sector - 1].technologyRegionHashVecs;
+            for (unsigned int hash = 0; hash < nsectorHashMax; ++hash) {
+                std::pair<MuonStationIndex::DetectorRegionIndex, MuonStationIndex::LayerIndex> regionLayer =
+                    MuonStationIndex::decomposeSectorLayerHash(hash);
+                if (msgLvl(MSG::DEBUG))
+                    if (regionLayer.first != currentRegion) ATH_MSG_DEBUG("  " << MuonStationIndex::regionName(regionLayer.first));
+                bool first = true;
+                currentRegion = regionLayer.first;
+                for (unsigned int tech = 0; tech < m_ntechnologies; ++tech) {
+                    std::stable_sort(vec[tech][hash].begin(), vec[tech][hash].end());
+                    if (!vec[tech][hash].empty()) {
+                        if (msgLvl(MSG::DEBUG)) {
+                            if (first) {
+                                ATH_MSG_DEBUG("  " << std::setw(7) << MuonStationIndex::layerName(regionLayer.second));
+                                first = false;
+                            }
+                            ATH_MSG_DEBUG(" " << std::setw(4)
+                                              << MuonStationIndex::technologyName(static_cast<MuonStationIndex::TechnologyIndex>(tech))
+                                              << " " << std::setw(4) << vec[tech][hash].size());
+                        }
+                    }
+                }
+            }
+        }
     }
-    else{
-      ATH_MSG_DEBUG(" Some truth hits not found: truth " << truth.size() << " found " << found.size() );
-      std::vector<Identifier> result(truth.size()-found.size());
-      std::vector<Identifier>::iterator pos = std::set_difference(truth.begin(),truth.end(),found.begin(),found.end(),result.begin());
-      result.resize(pos-result.begin());
-      for( std::vector<Identifier>::iterator it=result.begin();it!=result.end();++it ){
-        ATH_MSG_DEBUG("  " << m_idHelperSvc->toString(*it) );
-      }
+
+    void MuonLayerHoughTool::printTruthSummary(std::set<Identifier>& truth, std::set<Identifier>& found) const {
+        if (truth.size() == found.size()) {
+            ATH_MSG_DEBUG(" All hits found: truth " << truth.size() << " found " << found.size());
+        } else {
+            ATH_MSG_DEBUG(" Some truth hits not found: truth " << truth.size() << " found " << found.size());
+            std::vector<Identifier> result(truth.size() - found.size());
+            std::vector<Identifier>::iterator pos =
+                std::set_difference(truth.begin(), truth.end(), found.begin(), found.end(), result.begin());
+            result.resize(pos - result.begin());
+            for (std::vector<Identifier>::iterator it = result.begin(); it != result.end(); ++it) {
+                ATH_MSG_DEBUG("  " << m_idHelperSvc->toString(*it));
+            }
+        }
     }
-  }
-
-  void MuonLayerHoughTool::fillNtuple( MuonLayerHoughTool::HoughDataPerSectorVec& houghDataPerSectorVec ) const {
-    for( const auto& it : houghDataPerSectorVec.vec ){
-      for( const auto& rit : it.hitVec ) {
-        m_ntuple->fill(rit);
-      }
-      for( const auto& rit : it.phiHitVec ) {
-        m_ntuple->fill(rit);
-      } 
+
+    void MuonLayerHoughTool::fillNtuple(MuonLayerHoughTool::HoughDataPerSectorVec& houghDataPerSectorVec) const {
+        for (const auto& it : houghDataPerSectorVec.vec) {
+            for (const auto& rit : it.hitVec) { m_ntuple->fill(rit); }
+            for (const auto& rit : it.phiHitVec) { m_ntuple->fill(rit); }
+        }
     }
-  }
-}
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/components/MuonHoughPatternTool_entries.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/components/MuonHoughPatternTool_entries.cxx
index bfd50aee6b81b1f411de42a099daccf4e1d807b3..cc2e9731131a3f50f9ae1681e5b97e8dc41a18f5 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/components/MuonHoughPatternTool_entries.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/components/MuonHoughPatternTool_entries.cxx
@@ -1,12 +1,11 @@
-#include "MuonHoughPatternTools/MuonHoughPatternTool.h"
+#include "../MuonLayerHoughAlg.h"
 #include "MuonHoughPatternTools/MuonHoughPatternFinderTool.h"
+#include "MuonHoughPatternTools/MuonHoughPatternTool.h"
 #include "MuonHoughPatternTools/MuonLayerHoughTool.h"
-#include "../MuonLayerHoughAlg.h"
 
 using namespace Muon;
 
-DECLARE_COMPONENT( MuonHoughPatternTool )
-DECLARE_COMPONENT( MuonHoughPatternFinderTool )
-DECLARE_COMPONENT( MuonLayerHoughTool )
-DECLARE_COMPONENT( MuonLayerHoughAlg )
-
+DECLARE_COMPONENT(MuonHoughPatternTool)
+DECLARE_COMPONENT(MuonHoughPatternFinderTool)
+DECLARE_COMPONENT(MuonLayerHoughTool)
+DECLARE_COMPONENT(MuonLayerHoughAlg)
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2D.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2D.h
index 84839083a395d8554b9cb125eec6cbad967fb214..226ccede43edb1e49000d3b3f196d35b82dfbcc1 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2D.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2D.h
@@ -5,231 +5,230 @@
 #ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2D_H
 #define MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2D_H
 
-#include <vector>
-#include <functional>
-#include <set>
-#include <cmath>
+#include <memory.h>
+
 #include <algorithm>
+#include <cmath>
+#include <functional>
 #include <iostream>
-#include <memory.h>
+#include <set>
+#include <vector>
 class TH2F;
 
-/** Histogram class, similar to Root's TH2D. 
+/** Histogram class, similar to Root's TH2D.
     Binnumbering is similar to Root's numbering. Starting in left corner to right upper corner
     Remind the over/under flow bins */
-class MuonHoughHisto2D
-{
-
- public:
-  /** destructor */
-  ~MuonHoughHisto2D();
-  /** constructor */
-  MuonHoughHisto2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int number_of_maxima=1);
-
-  /** fill 2d histogram with point (x,y) with weight w, return binnumber filled */
-  int fill(double x,double y,double weight=1.);
-
-  /** fill bin with weight w */
-  void fill(int binnumber,double weight=1.);
-  
-  /** returns number of bins x coordinate */
-  int getNbinsX()const;
-  /** returns number of bins y coordinate */
-  int getNbinsY()const;
-
-  /** returns min x axis */
-  double getXmin()const;
-  /** returns max x axis */
-  double getXmax()const;
-
-  /** return binwidth x axis */
-  double getBinWidthX()const;
-
-  /** return binwidth y axis */
-  double getBinWidthY()const;
-
-  /** returns x axis */
-  double getBinContent(int binnumber)const;
-  
-  /** clears histogram and bins_above_threshold */
-  void reset(); 
-  
-  /** find maxima in histogram */
-  void findMaxima(int printlevel=0, bool which_segment=0);
-
-  /** returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold) */
-  std::pair<int,double> getMax()const;
-  /** returns binnumber and maximum of maximum number maximum_number*/
-  std::pair<int,double> getMaximumBin(unsigned int maximum_number=0,bool which_segment=0, int printlevel = 0); 
-  /** returns coords of maximum number maximum_number*/
-  std::pair <double, double> getCoordsMaximum(unsigned int maximum_number=0, bool which_segment=0, int printlevel=0);
-
-  /** check when searching for several maxima if binnumber is close to an earlier found maximum */
-  bool checkIfMaximumAlreadyUsed(int binnumber)const;
-  /** check if binnumber is a maximum */
-  bool checkIfMaximum(int binnumber,double& maximum,int& maxbin,bool which_segment=0,int printlevel=0)const;
-
-  /** calculates the distance in binwidths between two binnumbers ("Manhattan metric") */
-  int distanceBins(int binnumber1, int binnumber2)const;
-  
-  /** return value of maximum bin */
-  double getMaximum(unsigned int maximum_number=0,bool which_segment=0, int printlevel = 0);  
-  /** return maximum binnumber */
-  int getMaxBin(unsigned int maximum_number=0,bool which_segment=0, int printlevel = 0); 
-
-  /** return the total content of binarea (default: content of bin) */
-  double content_Bin_Area(int binnumber)const;
-  
-  //histogram functions:
-
-  /** gives coordinates for certain binnumber */
-  std::pair <double,double>  binnumberToCoords(int binnumber,int printlevel=0)const; // <x-point, y-point>
-  /** gives x-coordinate for certain binnumber */
-  double binnumberToXCoord(int binnumber)const;
-  /** gives y-coordinate for certain binnumber */
-  double binnumberToYCoord(int binnumber)const;
-  
-  /** converts coordinates to a binnumber */
-  int coordToBinnumber(double x, double y)const;
-  /** converts x-coordinates to binx */  
-  int coordToBinx(double x)const;
-  /** converts y-coordinates to biny */
-  int coordToBiny(double y)const;
-
-  /** checks if bin is in histogram or if it is an under/overflow bin (unused)
-   * 0 is in histo
-   * 1 x underflow 
-   * 2 x overflow 
-   * 3 y underflow 
-   * 4 y overflow */
-  int binInHistogram(unsigned int bin)const; 
-  
-  /** set threshold for maxima in histogram */
-  void setThreshold(double threshold);
-  /** returns threshold for maxima in histogram */
-  double getThreshold()const;
-  
-  /** intialises a root histogram of MuonHoughHisto2D and fill it, used for debugging purposes */
-  TH2F* bookAndFillRootHistogram(const std::string& hname) const;
-  
-  void setMaximumIsValid(bool flag ) { m_maximumIsValid = flag; }
-
- private:
-
-  /** initialises private members, called in constructor */
-  void init();
-
-  /** resets histogram */
-  void resetHisto();
-
-  /** actual storage of bin values */
-  unsigned int* m_histBuffer{};
-  /** size of array */
-  unsigned int m_size;
-
-  /** number of x bins */
-  unsigned int m_nbinsx;
-  /** number of x bins + 2 , used for cpu speedup*/
-  unsigned int m_nbinsx_plus2;
-  /** minimum x coordinate */
-  double m_xmin;
-  /** maximum x coordinate */
-  double m_xmax;
-  /** number of y bins */
-  unsigned int m_nbinsy;
-  /** number of y bins + 2 , used for cpu speedup*/
-  unsigned int m_nbinsy_plus2;
-  /** minimum y coordinate */
-  double m_ymin;
-  /** maximum y coordinate */
-  double m_ymax;
-
-  /** binwidth x axis */
-  double m_binwidthx;
-  /** binwidth y axis */
-  double m_binwidthy;
-
-  /** inv binwidth x axis used for cpu speedup */
-  double m_invbinwidthx;
-  /** inv binwidth y axis used for cpu speedup */
-  double m_invbinwidthy;
-
-  /** set of bins that are above threshold
-   * used for speeding up searching for maxima */
-  std::set<int> m_bins_above_threshold;
-  
-  /** binnumbers found as maxima */
-  std::vector<int> m_maximumbins; 
-
-  /** number of maxima to be searched for */
-  const int m_number_of_maxima;
-
-  /** threshold for minimum content for a maximum */
-  unsigned int m_scale; // conversion from double -> unsigned int 
-  unsigned int m_threshold; 
-  
-  /** minimum distance for a maximum to be away from another maximum */
-  const int m_distance_to_next_maximum; 
-
-  /** check if search for maxima already performed */
-  bool m_maxima_found; 
-
-  /** maximum */
-  int    m_maximumBin;
-  unsigned int m_maximum;
-  bool   m_maximumIsValid; // flag whether the maximum can be trusted
-  /** set bin content of binnumber */
-  void setBinContent(int binnumber,double value);
-  /** set bin content of binnumber corresponding to coordinates */
-  void setBinContent(int binx, int biny,double value);
-
-  MuonHoughHisto2D & operator=(const MuonHoughHisto2D &right);
-  MuonHoughHisto2D(const MuonHoughHisto2D&);
-
+class MuonHoughHisto2D {
+public:
+    /** destructor */
+    ~MuonHoughHisto2D();
+    /** constructor */
+    MuonHoughHisto2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int number_of_maxima = 1);
+
+    /** fill 2d histogram with point (x,y) with weight w, return binnumber filled */
+    int fill(double x, double y, double weight = 1.);
+
+    /** fill bin with weight w */
+    void fill(int binnumber, double weight = 1.);
+
+    /** returns number of bins x coordinate */
+    int getNbinsX() const;
+    /** returns number of bins y coordinate */
+    int getNbinsY() const;
+
+    /** returns min x axis */
+    double getXmin() const;
+    /** returns max x axis */
+    double getXmax() const;
+
+    /** return binwidth x axis */
+    double getBinWidthX() const;
+
+    /** return binwidth y axis */
+    double getBinWidthY() const;
+
+    /** returns x axis */
+    double getBinContent(int binnumber) const;
+
+    /** clears histogram and bins_above_threshold */
+    void reset();
+
+    /** find maxima in histogram */
+    void findMaxima(int printlevel = 0, bool which_segment = 0);
+
+    /** returns binnumber and maximum of histogram (doesn't use m_bins_above_threshold) */
+    std::pair<int, double> getMax() const;
+    /** returns binnumber and maximum of maximum number maximum_number*/
+    std::pair<int, double> getMaximumBin(unsigned int maximum_number = 0, bool which_segment = 0, int printlevel = 0);
+    /** returns coords of maximum number maximum_number*/
+    std::pair<double, double> getCoordsMaximum(unsigned int maximum_number = 0, bool which_segment = 0, int printlevel = 0);
+
+    /** check when searching for several maxima if binnumber is close to an earlier found maximum */
+    bool checkIfMaximumAlreadyUsed(int binnumber) const;
+    /** check if binnumber is a maximum */
+    bool checkIfMaximum(int binnumber, double& maximum, int& maxbin, bool which_segment = 0, int printlevel = 0) const;
+
+    /** calculates the distance in binwidths between two binnumbers ("Manhattan metric") */
+    int distanceBins(int binnumber1, int binnumber2) const;
+
+    /** return value of maximum bin */
+    double getMaximum(unsigned int maximum_number = 0, bool which_segment = 0, int printlevel = 0);
+    /** return maximum binnumber */
+    int getMaxBin(unsigned int maximum_number = 0, bool which_segment = 0, int printlevel = 0);
+
+    /** return the total content of binarea (default: content of bin) */
+    double content_Bin_Area(int binnumber) const;
+
+    // histogram functions:
+
+    /** gives coordinates for certain binnumber */
+    std::pair<double, double> binnumberToCoords(int binnumber, int printlevel = 0) const;  // <x-point, y-point>
+    /** gives x-coordinate for certain binnumber */
+    double binnumberToXCoord(int binnumber) const;
+    /** gives y-coordinate for certain binnumber */
+    double binnumberToYCoord(int binnumber) const;
+
+    /** converts coordinates to a binnumber */
+    int coordToBinnumber(double x, double y) const;
+    /** converts x-coordinates to binx */
+    int coordToBinx(double x) const;
+    /** converts y-coordinates to biny */
+    int coordToBiny(double y) const;
+
+    /** checks if bin is in histogram or if it is an under/overflow bin (unused)
+     * 0 is in histo
+     * 1 x underflow
+     * 2 x overflow
+     * 3 y underflow
+     * 4 y overflow */
+    int binInHistogram(unsigned int bin) const;
+
+    /** set threshold for maxima in histogram */
+    void setThreshold(double threshold);
+    /** returns threshold for maxima in histogram */
+    double getThreshold() const;
+
+    /** intialises a root histogram of MuonHoughHisto2D and fill it, used for debugging purposes */
+    TH2F* bookAndFillRootHistogram(const std::string& hname) const;
+
+    void setMaximumIsValid(bool flag) { m_maximumIsValid = flag; }
+
+private:
+    /** initialises private members, called in constructor */
+    void init();
+
+    /** resets histogram */
+    void resetHisto();
+
+    /** actual storage of bin values */
+    unsigned int* m_histBuffer{};
+    /** size of array */
+    unsigned int m_size;
+
+    /** number of x bins */
+    unsigned int m_nbinsx;
+    /** number of x bins + 2 , used for cpu speedup*/
+    unsigned int m_nbinsx_plus2;
+    /** minimum x coordinate */
+    double m_xmin;
+    /** maximum x coordinate */
+    double m_xmax;
+    /** number of y bins */
+    unsigned int m_nbinsy;
+    /** number of y bins + 2 , used for cpu speedup*/
+    unsigned int m_nbinsy_plus2;
+    /** minimum y coordinate */
+    double m_ymin;
+    /** maximum y coordinate */
+    double m_ymax;
+
+    /** binwidth x axis */
+    double m_binwidthx;
+    /** binwidth y axis */
+    double m_binwidthy;
+
+    /** inv binwidth x axis used for cpu speedup */
+    double m_invbinwidthx;
+    /** inv binwidth y axis used for cpu speedup */
+    double m_invbinwidthy;
+
+    /** set of bins that are above threshold
+     * used for speeding up searching for maxima */
+    std::set<int> m_bins_above_threshold;
+
+    /** binnumbers found as maxima */
+    std::vector<int> m_maximumbins;
+
+    /** number of maxima to be searched for */
+    const int m_number_of_maxima;
+
+    /** threshold for minimum content for a maximum */
+    unsigned int m_scale;  // conversion from double -> unsigned int
+    unsigned int m_threshold;
+
+    /** minimum distance for a maximum to be away from another maximum */
+    const int m_distance_to_next_maximum;
+
+    /** check if search for maxima already performed */
+    bool m_maxima_found;
+
+    /** maximum */
+    int m_maximumBin;
+    unsigned int m_maximum;
+    bool m_maximumIsValid;  // flag whether the maximum can be trusted
+    /** set bin content of binnumber */
+    void setBinContent(int binnumber, double value);
+    /** set bin content of binnumber corresponding to coordinates */
+    void setBinContent(int binx, int biny, double value);
+
+    MuonHoughHisto2D& operator=(const MuonHoughHisto2D& right);
+    MuonHoughHisto2D(const MuonHoughHisto2D&);
 };
 
-inline int MuonHoughHisto2D::fill(double x,double y, double w){
-  int binnumber = coordToBinnumber(x,y);
-  fill(binnumber,w);
-  return binnumber;
+inline int MuonHoughHisto2D::fill(double x, double y, double w) {
+    int binnumber = coordToBinnumber(x, y);
+    fill(binnumber, w);
+    return binnumber;
 }
 
-inline void MuonHoughHisto2D::fill(int binnumber, double weight){
-  unsigned int& binval = m_histBuffer[binnumber];
-  binval +=m_scale*weight;
-  if( binval > m_maximum ){
-    m_maximum = binval;
-    m_maximumBin = binnumber;
-  }
+inline void MuonHoughHisto2D::fill(int binnumber, double weight) {
+    unsigned int& binval = m_histBuffer[binnumber];
+    binval += m_scale * weight;
+    if (binval > m_maximum) {
+        m_maximum = binval;
+        m_maximumBin = binnumber;
+    }
+}
+inline void MuonHoughHisto2D::setBinContent(int binnumber, double value) { m_histBuffer[binnumber] = m_scale * value; }
+inline double MuonHoughHisto2D::getBinContent(int binnumber) const { return m_histBuffer[binnumber] / m_scale; }
+inline double MuonHoughHisto2D::content_Bin_Area(int binnumber) const { return getBinContent(binnumber); }
+inline int MuonHoughHisto2D::getNbinsX() const { return m_nbinsx; }
+inline int MuonHoughHisto2D::getNbinsY() const { return m_nbinsy; }
+inline double MuonHoughHisto2D::getXmin() const { return m_xmin; }
+inline double MuonHoughHisto2D::getXmax() const { return m_xmax; }
+inline double MuonHoughHisto2D::getBinWidthX() const { return m_binwidthx; }
+inline double MuonHoughHisto2D::getBinWidthY() const { return m_binwidthy; }
+inline void MuonHoughHisto2D::setThreshold(double threshold) { m_threshold = m_scale * threshold; }
+inline double MuonHoughHisto2D::getThreshold() const { return m_threshold; }
+inline double MuonHoughHisto2D::getMaximum(unsigned int maximum_number, bool which_segment, int printlevel) {
+    return getMaximumBin(maximum_number, which_segment, printlevel).second;
 }
-inline void MuonHoughHisto2D::setBinContent(int binnumber,double value){m_histBuffer[binnumber]=m_scale*value;}
-inline double MuonHoughHisto2D::getBinContent(int binnumber)const{return m_histBuffer[binnumber]/m_scale;}
-inline double MuonHoughHisto2D::content_Bin_Area(int binnumber)const{return getBinContent(binnumber);}
-inline int MuonHoughHisto2D::getNbinsX()const{return m_nbinsx;}
-inline int MuonHoughHisto2D::getNbinsY()const{return m_nbinsy;}
-inline double MuonHoughHisto2D::getXmin()const{return m_xmin;}
-inline double MuonHoughHisto2D::getXmax()const{return m_xmax;}
-inline double MuonHoughHisto2D::getBinWidthX()const{return m_binwidthx;}
-inline double MuonHoughHisto2D::getBinWidthY()const{return m_binwidthy;}
-inline void MuonHoughHisto2D::setThreshold(double threshold){m_threshold=m_scale*threshold;}
-inline double MuonHoughHisto2D::getThreshold()const{return m_threshold;}
-inline double MuonHoughHisto2D::getMaximum(unsigned int maximum_number, bool which_segment, int printlevel){return getMaximumBin(maximum_number,which_segment,printlevel).second;}
-inline int MuonHoughHisto2D::getMaxBin(unsigned int maximum_number,bool which_segment, int printlevel){return getMaximumBin(maximum_number,which_segment,printlevel).first;}
-inline int MuonHoughHisto2D::coordToBinx(double x)const{
-  return static_cast<int> ((x-m_xmin)*m_invbinwidthx)+1;
+inline int MuonHoughHisto2D::getMaxBin(unsigned int maximum_number, bool which_segment, int printlevel) {
+    return getMaximumBin(maximum_number, which_segment, printlevel).first;
 }
-inline int MuonHoughHisto2D::coordToBiny(double y)const{
-  return static_cast<int> ((y-m_ymin)*m_invbinwidthy)+1;
+inline int MuonHoughHisto2D::coordToBinx(double x) const { return static_cast<int>((x - m_xmin) * m_invbinwidthx) + 1; }
+inline int MuonHoughHisto2D::coordToBiny(double y) const { return static_cast<int>((y - m_ymin) * m_invbinwidthy) + 1; }
+inline int MuonHoughHisto2D::coordToBinnumber(double x, double y) const {
+    int biny = coordToBiny(y);
+    int binx = coordToBinx(x);
+    return binx + biny * m_nbinsx_plus2;
 }
-inline int MuonHoughHisto2D::coordToBinnumber(double x, double y)const{
-  int biny = coordToBiny(y);
-  int binx = coordToBinx(x);
-  return binx+biny*m_nbinsx_plus2;
+inline double MuonHoughHisto2D::binnumberToXCoord(int binnumber) const {
+    return m_xmin + m_binwidthx * (-0.5 + (binnumber) % m_nbinsx_plus2);
 }
-inline double MuonHoughHisto2D::binnumberToXCoord(int binnumber)const{return m_xmin + m_binwidthx * (-0.5 + (binnumber)%m_nbinsx_plus2);}
-inline double MuonHoughHisto2D::binnumberToYCoord(int binnumber)const{return m_ymin + m_binwidthy * (-0.5 + (binnumber)/m_nbinsx_plus2);}
-inline void MuonHoughHisto2D::resetHisto(){
-  memset( m_histBuffer, 0, sizeof(unsigned int)*m_size );  
+inline double MuonHoughHisto2D::binnumberToYCoord(int binnumber) const {
+    return m_ymin + m_binwidthy * (-0.5 + (binnumber) / m_nbinsx_plus2);
 }
- 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2D_H
+inline void MuonHoughHisto2D::resetHisto() { memset(m_histBuffer, 0, sizeof(unsigned int) * m_size); }
+
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2D_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2DContainer.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2DContainer.h
index 401c9260010128cb77219b917c6a13133bfb3024..32572dc8a2c8201b7584ef06b1e234f18333ae5a 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2DContainer.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHisto2DContainer.h
@@ -7,38 +7,37 @@
 
 #include "MuonHoughPatternEvent/MuonHoughHisto2D.h"
 
-class MuonHoughHisto2DContainer
-{
-
- public:
-  /** constructor */
-  MuonHoughHisto2DContainer();
-  /** destructor */
-  virtual ~MuonHoughHisto2DContainer() = default;
-
-  /** return histogram at place id */
-  MuonHoughHisto2D* getHisto(int id)const;
-
-  /** return maximum of container
-   * gives first id histogram (sector) and then maximumbin */
-  std::pair<int,int> getMaximumBinnumber(unsigned int maximum_number,bool which_segment,int printlevel=0)const; 
-
-  /** resets histograms */
-  void reset() const;
-  /** returns size of container */
-  int size()const;
-  /** reserve a certain size (memory) for m_histos */
-  void reserve(int);
-  /** push_back a histogram */
-  void push_back(MuonHoughHisto2D*);
- private:
-  /** vector of MuonHoughHisto2D* */
-  std::vector <MuonHoughHisto2D*> m_histos;
+class MuonHoughHisto2DContainer {
+public:
+    /** constructor */
+    MuonHoughHisto2DContainer();
+    /** destructor */
+    virtual ~MuonHoughHisto2DContainer() = default;
+
+    /** return histogram at place id */
+    MuonHoughHisto2D* getHisto(int id) const;
+
+    /** return maximum of container
+     * gives first id histogram (sector) and then maximumbin */
+    std::pair<int, int> getMaximumBinnumber(unsigned int maximum_number, bool which_segment, int printlevel = 0) const;
+
+    /** resets histograms */
+    void reset() const;
+    /** returns size of container */
+    int size() const;
+    /** reserve a certain size (memory) for m_histos */
+    void reserve(int);
+    /** push_back a histogram */
+    void push_back(MuonHoughHisto2D*);
+
+private:
+    /** vector of MuonHoughHisto2D* */
+    std::vector<MuonHoughHisto2D*> m_histos;
 };
 
-inline int MuonHoughHisto2DContainer::size()const{return m_histos.size();}
-inline MuonHoughHisto2D* MuonHoughHisto2DContainer::getHisto(int id)const{return m_histos[id];}
-inline void MuonHoughHisto2DContainer::reserve(int size){m_histos.reserve(size);}
-inline void MuonHoughHisto2DContainer::push_back(MuonHoughHisto2D* histo){m_histos.push_back(histo);}
+inline int MuonHoughHisto2DContainer::size() const { return m_histos.size(); }
+inline MuonHoughHisto2D* MuonHoughHisto2DContainer::getHisto(int id) const { return m_histos[id]; }
+inline void MuonHoughHisto2DContainer::reserve(int size) { m_histos.reserve(size); }
+inline void MuonHoughHisto2DContainer::push_back(MuonHoughHisto2D* histo) { m_histos.push_back(histo); }
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2DCONTAINER_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHHISTO2DCONTAINER_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHit.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHit.h
index 835225ace9cd628264f9fddd744caa79af59a3f1..547e5837030bee484f5d0daecf1776341e0dca5d 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHit.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHit.h
@@ -5,181 +5,181 @@
 #ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
 #define MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
 
-#include <string>
 #include <cmath>
 #include <iostream>
+#include <string>
 #include <vector>
 
-namespace MuonHough
-{
-  /** enum to identify the muondetectortechnology */
-  enum DetectorTechnology { MDT, CSC, RPC, TGC };
-  /** number of phi sectors */
-  const int phisectors = 16;
-  /** angle of half a sector in rad */
-  const double half_phisector = M_PI/phisectors;
+namespace MuonHough {
+    /** enum to identify the muondetectortechnology */
+    enum DetectorTechnology { MDT, CSC, RPC, TGC };
+    /** number of phi sectors */
+    const int phisectors = 16;
+    /** angle of half a sector in rad */
+    const double half_phisector = M_PI / phisectors;
+}  // namespace MuonHough
+
+namespace Trk {
+    class PrepRawData;
 }
 
-namespace Trk{class PrepRawData;}
-
-class MuonHoughHit
-{
- public:
-  /** default constructor (should not be used) */
-  //  MuonHoughHit();
-  /** constructor per preprawdata (not used) */
-  MuonHoughHit(const Trk::PrepRawData* prd);
-  /** constructor */
-  MuonHoughHit(double x,double y,double z,bool measures_phi,MuonHough::DetectorTechnology detector_id, double prob = 1, double weight = 1., const Trk::PrepRawData* prd = 0, int id = -1);
-  /** destructor */
-  virtual ~MuonHoughHit() = default;
-
-  /** return DetectorTechnology */
-  MuonHough::DetectorTechnology getDetectorId() const;
-  /** return DetectorTechnology in string */
-  std::string getWhichDetector()const;
-
-  /** return (x,y,z) vector */
-  std::vector <double> getPosition()const;
-  /** returns id */
-  int getId()const;
-  /** returns x position */
-  double getHitx()const;
-  /** returns y position */
-  double getHity()const;
-  /** returns z position */
-  double getHitz()const;
-  /** returns weight in histogram after rescaling */
-  double getWeight()const;
-  /** returns original weight */
-  double getOrigWeight()const;
-  /** returns probability that hit is part of pattern (true muon) */
-  double getProbability()const;
-
-  /** returns radius */
-  double getRadius()const;
-  /** returns radius */
-  double getAbs()const;
-  /** returns theta */
-  double getTheta()const;
-  /** returns phi */
-  double getPhi()const;
-
-  /** hit is barrel or endcap (for curved track model) */
-  bool isBarrel()const;
-  /** phi sector of hit */
-  int phiSector()const;
-  /** ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model) */
-  double getMagneticTrackRatio()const;
-
-  /** hit measures phi? */
-  bool getMeasuresPhi()const;
-
-  /** return if hit already associated to pattern */
-  bool getAssociated()const;
-
-  /** set id */
-  void setId(int id);
-
-  /** set weight */
-  void setWeight(double weight);
-
-  /** set probability */
-  void setProbability(double prob);
-
-  /** set associated */
-  void setAssociated(bool associated);
-
-  /** return preprawdata */
-  const Trk::PrepRawData* getPrd()const;
-
- protected:
- 
-  /** Pointer to preprawdata */
-  const Trk::PrepRawData* m_prd;
-
-  /** unique id */
-  int m_id;
-  /** x-position of hit */
-  double m_hitx;
-  /** y-position of hit */
-  double m_hity;
-  /** z-position of hit */
-  double m_hitz;
-  /** radius of hit*/
-  double m_radius;
-  /** absolute value of hit */
-  double m_abs;
-  /** phi of hit */
-  double m_phi;
-  /** theta of hit */
-  double m_theta;
-  /** hit is barrel / endcap */
-  bool m_barrel;
-  /** phi sector (0,15), Atlas Convention */
-  int m_phi_sector;
-  /** ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model) */
-  double m_magnetic_trackratio;
-  /** weight of hit in histogram, after rescaling*/
-  double m_weight;
-  /** original weight */
-  const double m_orig_weight; 
-  /** probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (used for mdts)) */
-  double m_probability; 
-
-  /** detector technology of hit */
-  MuonHough::DetectorTechnology m_detector_id;
-
-  /** hit measures phi? */
-  bool m_measures_phi;
-
-  /** hit associated to pattern */
-  bool m_associated;
-
- private:
-  /** method that calculates phi sector of hit */
-  int calcPhiSector()const;
-  /** method that calculates 'magnetic track ratio' (for curved track model) */
-  double calcMagneticTrackRatio()const;
+class MuonHoughHit {
+public:
+    /** default constructor (should not be used) */
+    //  MuonHoughHit();
+    /** constructor per preprawdata (not used) */
+    MuonHoughHit(const Trk::PrepRawData* prd);
+    /** constructor */
+    MuonHoughHit(double x, double y, double z, bool measures_phi, MuonHough::DetectorTechnology detector_id, double prob = 1,
+                 double weight = 1., const Trk::PrepRawData* prd = 0, int id = -1);
+    /** destructor */
+    virtual ~MuonHoughHit() = default;
+
+    /** return DetectorTechnology */
+    MuonHough::DetectorTechnology getDetectorId() const;
+    /** return DetectorTechnology in string */
+    std::string getWhichDetector() const;
+
+    /** return (x,y,z) vector */
+    std::vector<double> getPosition() const;
+    /** returns id */
+    int getId() const;
+    /** returns x position */
+    double getHitx() const;
+    /** returns y position */
+    double getHity() const;
+    /** returns z position */
+    double getHitz() const;
+    /** returns weight in histogram after rescaling */
+    double getWeight() const;
+    /** returns original weight */
+    double getOrigWeight() const;
+    /** returns probability that hit is part of pattern (true muon) */
+    double getProbability() const;
+
+    /** returns radius */
+    double getRadius() const;
+    /** returns radius */
+    double getAbs() const;
+    /** returns theta */
+    double getTheta() const;
+    /** returns phi */
+    double getPhi() const;
+
+    /** hit is barrel or endcap (for curved track model) */
+    bool isBarrel() const;
+    /** phi sector of hit */
+    int phiSector() const;
+    /** ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model)
+     */
+    double getMagneticTrackRatio() const;
+
+    /** hit measures phi? */
+    bool getMeasuresPhi() const;
+
+    /** return if hit already associated to pattern */
+    bool getAssociated() const;
+
+    /** set id */
+    void setId(int id);
+
+    /** set weight */
+    void setWeight(double weight);
+
+    /** set probability */
+    void setProbability(double prob);
+
+    /** set associated */
+    void setAssociated(bool associated);
+
+    /** return preprawdata */
+    const Trk::PrepRawData* getPrd() const;
+
+protected:
+    /** Pointer to preprawdata */
+    const Trk::PrepRawData* m_prd;
+
+    /** unique id */
+    int m_id;
+    /** x-position of hit */
+    double m_hitx;
+    /** y-position of hit */
+    double m_hity;
+    /** z-position of hit */
+    double m_hitz;
+    /** radius of hit*/
+    double m_radius;
+    /** absolute value of hit */
+    double m_abs;
+    /** phi of hit */
+    double m_phi;
+    /** theta of hit */
+    double m_theta;
+    /** hit is barrel / endcap */
+    bool m_barrel;
+    /** phi sector (0,15), Atlas Convention */
+    int m_phi_sector;
+    /** ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model)
+     */
+    double m_magnetic_trackratio;
+    /** weight of hit in histogram, after rescaling*/
+    double m_weight;
+    /** original weight */
+    const double m_orig_weight;
+    /** probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (used for mdts)) */
+    double m_probability;
+
+    /** detector technology of hit */
+    MuonHough::DetectorTechnology m_detector_id;
+
+    /** hit measures phi? */
+    bool m_measures_phi;
+
+    /** hit associated to pattern */
+    bool m_associated;
+
+private:
+    /** method that calculates phi sector of hit */
+    int calcPhiSector() const;
+    /** method that calculates 'magnetic track ratio' (for curved track model) */
+    double calcMagneticTrackRatio() const;
 };
 
-inline bool operator==(MuonHoughHit hit1, MuonHoughHit hit2)
-{
-  bool equal_to = 0;
+inline bool operator==(MuonHoughHit hit1, MuonHoughHit hit2) {
+    bool equal_to = 0;
 
-  if (hit1.getHitx()==hit2.getHitx() && hit1.getHity()==hit2.getHity() && hit1.getHitz()==hit2.getHitz())
-    {equal_to=1;}
+    if (hit1.getHitx() == hit2.getHitx() && hit1.getHity() == hit2.getHity() && hit1.getHitz() == hit2.getHitz()) { equal_to = 1; }
 
-  return equal_to;
+    return equal_to;
 }
 
-inline MuonHough::DetectorTechnology MuonHoughHit::getDetectorId() const {return m_detector_id;}
+inline MuonHough::DetectorTechnology MuonHoughHit::getDetectorId() const { return m_detector_id; }
 
-inline int MuonHoughHit::getId()const{return m_id;}
-inline double MuonHoughHit::getHitx()const{return m_hitx;}
-inline double MuonHoughHit::getHity()const{return m_hity;}
-inline double MuonHoughHit::getHitz()const{return m_hitz;}  
-inline double MuonHoughHit::getWeight()const{return m_weight;}
-inline double MuonHoughHit::getOrigWeight()const{return m_orig_weight;}
-inline double MuonHoughHit::getProbability()const{return m_probability;}
+inline int MuonHoughHit::getId() const { return m_id; }
+inline double MuonHoughHit::getHitx() const { return m_hitx; }
+inline double MuonHoughHit::getHity() const { return m_hity; }
+inline double MuonHoughHit::getHitz() const { return m_hitz; }
+inline double MuonHoughHit::getWeight() const { return m_weight; }
+inline double MuonHoughHit::getOrigWeight() const { return m_orig_weight; }
+inline double MuonHoughHit::getProbability() const { return m_probability; }
 
-inline double MuonHoughHit::getRadius()const{return m_radius;}
-inline double MuonHoughHit::getAbs()const{return m_abs;}
-inline double MuonHoughHit::getTheta()const{return m_theta;} 
-inline double MuonHoughHit::getPhi()const{return m_phi;}
+inline double MuonHoughHit::getRadius() const { return m_radius; }
+inline double MuonHoughHit::getAbs() const { return m_abs; }
+inline double MuonHoughHit::getTheta() const { return m_theta; }
+inline double MuonHoughHit::getPhi() const { return m_phi; }
 
-inline bool MuonHoughHit::isBarrel()const{return m_barrel;}
-inline int MuonHoughHit::phiSector()const{return m_phi_sector;}
-inline double MuonHoughHit::getMagneticTrackRatio()const{return m_magnetic_trackratio;}
+inline bool MuonHoughHit::isBarrel() const { return m_barrel; }
+inline int MuonHoughHit::phiSector() const { return m_phi_sector; }
+inline double MuonHoughHit::getMagneticTrackRatio() const { return m_magnetic_trackratio; }
 
-inline bool MuonHoughHit::getMeasuresPhi()const{return m_measures_phi;}
-inline bool MuonHoughHit::getAssociated()const{return m_associated;}
+inline bool MuonHoughHit::getMeasuresPhi() const { return m_measures_phi; }
+inline bool MuonHoughHit::getAssociated() const { return m_associated; }
 
-inline void MuonHoughHit::setId(int id){m_id=id;}
-inline void MuonHoughHit::setWeight(double weight){m_weight = weight;}
-inline void MuonHoughHit::setProbability(double prob){m_probability = prob;}
-inline void MuonHoughHit::setAssociated(bool associated){m_associated = associated;}
+inline void MuonHoughHit::setId(int id) { m_id = id; }
+inline void MuonHoughHit::setWeight(double weight) { m_weight = weight; }
+inline void MuonHoughHit::setProbability(double prob) { m_probability = prob; }
+inline void MuonHoughHit::setAssociated(bool associated) { m_associated = associated; }
 
-inline const Trk::PrepRawData* MuonHoughHit::getPrd()const{return m_prd;}
+inline const Trk::PrepRawData* MuonHoughHit::getPrd() const { return m_prd; }
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHitContainer.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHitContainer.h
index 520a9b9b64e03a758eeeb5ab0ca4a7ee56b8774e..3bbe0b4e00fb69b795a95c0b6a4ce0434ba10ef1 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHitContainer.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughHitContainer.h
@@ -7,106 +7,106 @@
 
 #include "MuonHoughPatternEvent/MuonHoughHit.h"
 
-namespace Trk{class PrepRawData;}
-
-class MuonHoughHitContainer
-{
-  /** MuonHoughHitContainer does own its hits all added hits should be 'newed',
-      except when m_ownhits==false */
-
- public:
-
-  /** constructor, flag for deleting hits at destructor */
-  MuonHoughHitContainer(bool ownhits=true);
-
-  /** destructor */
-  ~MuonHoughHitContainer();
-
-  /** returns Hit at position hitno */
-  MuonHoughHit* getHit(int hitno)const;
-  /** returns hit vector */
-  std::vector <MuonHoughHit*> getHits()const;
-  
-  /** add hit to container */
-  void addHit(MuonHoughHit* hit);
-
-  /** remove hit from container */
-  void removeHit(int hitno);
-
-  /** returns hitid of hit hitno */
-  int getHitId(int hitno) const;
-  /** returns x position of hit hitno*/
-  double getHitx (int hitno)const;
-  /** returns y position of hit hitno*/
-  double getHity (int hitno)const;
-  /** returns z position of hit hitno*/
-  double getHitz (int hitno)const;
-
-  /** returns radius of hit hitno*/
-  double getRadius(int hitno)const;
-  /** returns theta of hit hitno*/
-  double getTheta(int hitno)const;
-  /** returns phi of hit hitno*/
-  double getPhi(int hitno)const;
-  /** returns weight of hit hitno*/
-  double getWeight(int hitno)const;  
-  /** returns the orignal weight of hit hitno*/
-  double getOrigWeight(int hitno)const;  
-
-  /** returns if hit hitno measures phi*/
-  bool getMeasuresPhi(int hitno)const;
-  /** returns preprawdata pointer of hit hitno*/
-  const Trk::PrepRawData* getPrd(int hitno)const;
-
-  /** returns detectortechnology in string of hit hitno*/
-  std::string getWhichDetector(int hitno)const;
-  /** returns detectortechnology of hit hitno*/
-  MuonHough::DetectorTechnology getDetectorId(int hitno)const;
-  /** returns size of hitcontainer */
-  unsigned int size()const;
-  /** returns if hitcontainer is empty */
-  bool empty()const;
-  /** allocates memory for hitvector*/
-  void reserve(int size);
-
-  /** returns number of rpc hits in container */
-  int getRPChitno()const;
-  /** returns number of rpc eta hits in container */
-  int getRPCetahitno()const;
-  /** returns number of mdt hits in container */
-  int getMDThitno()const;
-  /** returns number of csc hits in container */
-  int getCSChitno()const;
-  /** returns number of tgc hits in container */
-  int getTGChitno()const;
-
- protected:
-  /** vector of hits in container */
-  std::vector<MuonHoughHit*> m_hit; 
-
-  /** delete hits in destructor and create hits when added */
-  const bool m_ownhits;
+namespace Trk {
+    class PrepRawData;
+}
+
+class MuonHoughHitContainer {
+    /** MuonHoughHitContainer does own its hits all added hits should be 'newed',
+        except when m_ownhits==false */
+
+public:
+    /** constructor, flag for deleting hits at destructor */
+    MuonHoughHitContainer(bool ownhits = true);
+
+    /** destructor */
+    ~MuonHoughHitContainer();
+
+    /** returns Hit at position hitno */
+    MuonHoughHit* getHit(int hitno) const;
+    /** returns hit vector */
+    std::vector<MuonHoughHit*> getHits() const;
+
+    /** add hit to container */
+    void addHit(MuonHoughHit* hit);
+
+    /** remove hit from container */
+    void removeHit(int hitno);
+
+    /** returns hitid of hit hitno */
+    int getHitId(int hitno) const;
+    /** returns x position of hit hitno*/
+    double getHitx(int hitno) const;
+    /** returns y position of hit hitno*/
+    double getHity(int hitno) const;
+    /** returns z position of hit hitno*/
+    double getHitz(int hitno) const;
+
+    /** returns radius of hit hitno*/
+    double getRadius(int hitno) const;
+    /** returns theta of hit hitno*/
+    double getTheta(int hitno) const;
+    /** returns phi of hit hitno*/
+    double getPhi(int hitno) const;
+    /** returns weight of hit hitno*/
+    double getWeight(int hitno) const;
+    /** returns the orignal weight of hit hitno*/
+    double getOrigWeight(int hitno) const;
+
+    /** returns if hit hitno measures phi*/
+    bool getMeasuresPhi(int hitno) const;
+    /** returns preprawdata pointer of hit hitno*/
+    const Trk::PrepRawData* getPrd(int hitno) const;
+
+    /** returns detectortechnology in string of hit hitno*/
+    std::string getWhichDetector(int hitno) const;
+    /** returns detectortechnology of hit hitno*/
+    MuonHough::DetectorTechnology getDetectorId(int hitno) const;
+    /** returns size of hitcontainer */
+    unsigned int size() const;
+    /** returns if hitcontainer is empty */
+    bool empty() const;
+    /** allocates memory for hitvector*/
+    void reserve(int size);
+
+    /** returns number of rpc hits in container */
+    int getRPChitno() const;
+    /** returns number of rpc eta hits in container */
+    int getRPCetahitno() const;
+    /** returns number of mdt hits in container */
+    int getMDThitno() const;
+    /** returns number of csc hits in container */
+    int getCSChitno() const;
+    /** returns number of tgc hits in container */
+    int getTGChitno() const;
+
+protected:
+    /** vector of hits in container */
+    std::vector<MuonHoughHit*> m_hit;
+
+    /** delete hits in destructor and create hits when added */
+    const bool m_ownhits;
 };
 
-inline MuonHoughHit* MuonHoughHitContainer::getHit(int hitno)const{return m_hit[hitno];}
-inline std::vector <MuonHoughHit*> MuonHoughHitContainer::getHits()const{return m_hit;}
-inline int MuonHoughHitContainer::getHitId(int hitno) const {return m_hit[hitno]->getId();}
-inline double MuonHoughHitContainer::getHitx (int hitno)const{return m_hit[hitno]->getHitx();} 
-inline double MuonHoughHitContainer::getHity (int hitno)const{return m_hit[hitno]->getHity();} 
-inline double MuonHoughHitContainer::getHitz (int hitno)const{return m_hit[hitno]->getHitz();} 
-inline double MuonHoughHitContainer::getRadius(int hitno)const{return m_hit[hitno]->getRadius();}
-
-inline double MuonHoughHitContainer::getTheta(int hitno)const{return m_hit[hitno]->getTheta();}
-inline double MuonHoughHitContainer::getPhi(int hitno)const{return m_hit[hitno]->getPhi();}
-inline double MuonHoughHitContainer::getWeight(int hitno)const{return m_hit[hitno]->getWeight();}
-inline double MuonHoughHitContainer::getOrigWeight(int hitno)const{return m_hit[hitno]->getOrigWeight();}
-
-inline unsigned int MuonHoughHitContainer::size()const{return m_hit.size();}
-inline bool MuonHoughHitContainer::empty()const{return m_hit.empty();}
-inline void MuonHoughHitContainer::reserve(int size){m_hit.reserve(size);}
-inline MuonHough::DetectorTechnology MuonHoughHitContainer::getDetectorId(int hitno)const{return m_hit[hitno]->getDetectorId();}
-inline std::string MuonHoughHitContainer::getWhichDetector(int hitno)const {return m_hit[hitno]->getWhichDetector();}
-inline bool MuonHoughHitContainer::getMeasuresPhi(int hitno)const{return m_hit[hitno]->getMeasuresPhi();}
-inline const Trk::PrepRawData* MuonHoughHitContainer::getPrd(int hitno)const{return m_hit[hitno]->getPrd();}
-
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHHITCONTAINER_H
+inline MuonHoughHit* MuonHoughHitContainer::getHit(int hitno) const { return m_hit[hitno]; }
+inline std::vector<MuonHoughHit*> MuonHoughHitContainer::getHits() const { return m_hit; }
+inline int MuonHoughHitContainer::getHitId(int hitno) const { return m_hit[hitno]->getId(); }
+inline double MuonHoughHitContainer::getHitx(int hitno) const { return m_hit[hitno]->getHitx(); }
+inline double MuonHoughHitContainer::getHity(int hitno) const { return m_hit[hitno]->getHity(); }
+inline double MuonHoughHitContainer::getHitz(int hitno) const { return m_hit[hitno]->getHitz(); }
+inline double MuonHoughHitContainer::getRadius(int hitno) const { return m_hit[hitno]->getRadius(); }
+
+inline double MuonHoughHitContainer::getTheta(int hitno) const { return m_hit[hitno]->getTheta(); }
+inline double MuonHoughHitContainer::getPhi(int hitno) const { return m_hit[hitno]->getPhi(); }
+inline double MuonHoughHitContainer::getWeight(int hitno) const { return m_hit[hitno]->getWeight(); }
+inline double MuonHoughHitContainer::getOrigWeight(int hitno) const { return m_hit[hitno]->getOrigWeight(); }
+
+inline unsigned int MuonHoughHitContainer::size() const { return m_hit.size(); }
+inline bool MuonHoughHitContainer::empty() const { return m_hit.empty(); }
+inline void MuonHoughHitContainer::reserve(int size) { m_hit.reserve(size); }
+inline MuonHough::DetectorTechnology MuonHoughHitContainer::getDetectorId(int hitno) const { return m_hit[hitno]->getDetectorId(); }
+inline std::string MuonHoughHitContainer::getWhichDetector(int hitno) const { return m_hit[hitno]->getWhichDetector(); }
+inline bool MuonHoughHitContainer::getMeasuresPhi(int hitno) const { return m_hit[hitno]->getMeasuresPhi(); }
+inline const Trk::PrepRawData* MuonHoughHitContainer::getPrd(int hitno) const { return m_hit[hitno]->getPrd(); }
+
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHHITCONTAINER_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughMathUtils.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughMathUtils.h
index 313c79e85a60bfad092a2bda8be5cad8c75f902d..f531d50871c2954f8e46796cc38604188f32e652 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughMathUtils.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughMathUtils.h
@@ -5,123 +5,123 @@
 #ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHMATHUTILS_H
 #define MUONHOUGHPATTERNEVENT_MUONHOUGHMATHUTILS_H
 
-#include <vector>
-#include <string>
 #include <cmath>
+#include <string>
+#include <vector>
 
-#include "MuonHoughPatternEvent/MuonHoughHit.h"
 #include "GeoPrimitives/GeoPrimitives.h"
+#include "MuonHoughPatternEvent/MuonHoughHit.h"
 
-
-namespace MuonHough
-{
-  const double two_Pi = 2*M_PI;
-  const double degree_rad_conversion_factor = M_PI/180.;
-  const double rad_degree_conversion_factor = 180./M_PI;
-
-  // Geometry for curved Hough extrapolation 
-  /** relation for transition between endcap and barrel 11.43 m (r) / 14m (z) */ 
-  const double tan_barrel = 11430./14000.;
-  /** radius of cylinder */
-  const double radius_cylinder = 4000.;
-  /** length of cylinder */ 
-  const double z_cylinder = 6000.;
-  /** z value whereafter no magnetic field / curvature */
-  const double z_end = 15000.;
-  /** range where hit is curved in endcap region */
-  const double z_magnetic_range = z_end - z_cylinder;
-  /** range where hit is curved in endcap region ('squared') */
-  const double z_magnetic_range_squared  = z_end*z_end - z_cylinder*z_cylinder;
-}
-
-class MuonHoughMathUtils
-{
- public:
-  
-  /** default constructor */
-  MuonHoughMathUtils();
-  /** destructor */
-  virtual ~MuonHoughMathUtils() = default;
-
-  /** sign (-1 or 1) of a double */
-  static int sgn(double d);
-  /** step function at place x0 */
-  static int step (double d,double x0=0);
-
-  /** distance from (x0,y0) to the line (r0,phi), phi in rad */
-  static double signedDistanceToLine(double x0, double y0, double r0, double phi); 
-  /** distance from (x0,y0) to the line (r0,phi), phi in rad */
-  static double distanceToLine(double x0, double y0, double r0, double phi); 
-  /** increments x with inc till above x */
-  static double incrementTillAbove0 (double x, double inc,double zero=0); 
-  /** computes angle in degrees between 0 and 360 */ 
-  static double angleFrom0To360(double angle); 
-  /** computes angle in degrees between 0 and 180 */ 
-  static double angleFrom0To180(double angle); 
-  /** computes angle in rad between 0 and Pi */ 
-  static double angleFrom0ToPi(double angle); 
-  /** computes angle in rad between -Pi and Pi */ 
-  static double angleFromMinusPiToPi(double angle); 
-  /** converts angle in rad to degrees */ 
-  double angleFromRadialToGrad (double angle)const; 
-  /** converts angle in degrees to rad */ 
-  double angleFromGradToRadial (double angle)const; 
-
-  /** converts integer to string */
-  static std::string intToString(int i);
-  /** converts string to char* */
-  static const char* stringToChar(std::string& s);
-  /** converts integer to char* */
-  static const char* intToChar(int i);
-
-  /** distance from (x0,y0) to line (r,phi) */
-  double distanceToLine2D(double x0, double y0, double r, double phi)const; 
-  /** distance from (x0,y0,z0) to line (x,y,z,phi,theta) */
-  static double distanceToLine3D(double x0,double y0,double z0, double x, double y, double z, double phi, double theta); 
-
-  /** distance of line y = ax + b to origin */
-  static double distanceOfLineToOrigin2D(double a, double b);
-  /** signed distance of line with point (x,y) and angle phi to origin */
-  static double signedDistanceOfLineToOrigin2D(double x, double y, double phi);
-
-  /** calculates theta at (x,y,z) for curved track model */
-  static double thetaForCurvedHit(double invcurvature, MuonHoughHit* hit) ;
-  /** calculates theta at (x,y,z) for curved track model, for positive and negative curvature */
-  static void thetasForCurvedHit(double ratio,MuonHoughHit* hit, double& theta1, double& theta2) ;
-  /** calculates distance of point (x,y,z) to curved track with z0, theta and invcurvature for curved track model */
-  static double signedDistanceCurvedToHit(double z0, double theta, double invcurvature, double hitx, double hity , double hitz ) ;
-
-  /** 
-   * @brief extrapolates road to global position 
-   * @param[in] roadpos The position of the combined pattern (should be perigee position)
-   * @param[in] roadmom The momentum of the combined pattern (should be perigee momentum)
-   * @param[in] pos The global position to extrapolate to
-   * @param[out] roadpose The nearest to pos, estimated road position
-   * @param[out] roadpose The nearest to pos, estimated road direction
-   */
-
-  static void extrapolateCurvedRoad(const Amg::Vector3D& roadpos, const Amg::Vector3D& roadmom,  const Amg::Vector3D& pos, Amg::Vector3D& roadpose , Amg::Vector3D& roaddire);
-
-  /** calculates the 3d-point closest to origin in xy-plane */
-  static std::vector <double> shortestPointOfLineToOrigin3D(double x, double y, double z, double phi, double theta); 
-
-  /** calculates the 3d-point closest to origin */
-  static std::vector<double> shortestPointOfLineToOrigin(double x, double y, double z, double phi, double theta);
-
-  /** calculates if line (x,y,z,phi,theta) crosses cylinder (r_0,z_0) around origin */
-  static bool lineThroughCylinder(double x, double y, double z, double phi, double theta, double r_0, double z_0);
-
-  /** cross product between 2 3-vectors */
-  static std::vector<double> crossProduct(std::vector <double> x, std::vector<double> y); 
-  /** dot product between 2 3-vectors */
-  static double dotProduct(std::vector <double> x, std::vector<double> y);
-  /** absolute value of 3-vector */
-  double abs(std::vector <double> p)const; 
-
+namespace MuonHough {
+    const double two_Pi = 2 * M_PI;
+    const double degree_rad_conversion_factor = M_PI / 180.;
+    const double rad_degree_conversion_factor = 180. / M_PI;
+
+    // Geometry for curved Hough extrapolation
+    /** relation for transition between endcap and barrel 11.43 m (r) / 14m (z) */
+    const double tan_barrel = 11430. / 14000.;
+    /** radius of cylinder */
+    const double radius_cylinder = 4000.;
+    /** length of cylinder */
+    const double z_cylinder = 6000.;
+    /** z value whereafter no magnetic field / curvature */
+    const double z_end = 15000.;
+    /** range where hit is curved in endcap region */
+    const double z_magnetic_range = z_end - z_cylinder;
+    /** range where hit is curved in endcap region ('squared') */
+    const double z_magnetic_range_squared = z_end * z_end - z_cylinder * z_cylinder;
+}  // namespace MuonHough
+
+class MuonHoughMathUtils {
+public:
+    /** default constructor */
+    MuonHoughMathUtils();
+    /** destructor */
+    virtual ~MuonHoughMathUtils() = default;
+
+    /** sign (-1 or 1) of a double */
+    static int sgn(double d);
+    /** step function at place x0 */
+    static int step(double d, double x0 = 0);
+
+    /** distance from (x0,y0) to the line (r0,phi), phi in rad */
+    static double signedDistanceToLine(double x0, double y0, double r0, double phi);
+    /** distance from (x0,y0) to the line (r0,phi), phi in rad */
+    static double distanceToLine(double x0, double y0, double r0, double phi);
+    /** increments x with inc till above x */
+    static double incrementTillAbove0(double x, double inc, double zero = 0);
+    /** computes angle in degrees between 0 and 360 */
+    static double angleFrom0To360(double angle);
+    /** computes angle in degrees between 0 and 180 */
+    static double angleFrom0To180(double angle);
+    /** computes angle in rad between 0 and Pi */
+    static double angleFrom0ToPi(double angle);
+    /** computes angle in rad between -Pi and Pi */
+    static double angleFromMinusPiToPi(double angle);
+    /** converts angle in rad to degrees */
+    double angleFromRadialToGrad(double angle) const;
+    /** converts angle in degrees to rad */
+    double angleFromGradToRadial(double angle) const;
+
+    /** converts integer to string */
+    static std::string intToString(int i);
+    /** converts string to char* */
+    static const char* stringToChar(std::string& s);
+    /** converts integer to char* */
+    static const char* intToChar(int i);
+
+    /** distance from (x0,y0) to line (r,phi) */
+    double distanceToLine2D(double x0, double y0, double r, double phi) const;
+    /** distance from (x0,y0,z0) to line (x,y,z,phi,theta) */
+    static double distanceToLine3D(double x0, double y0, double z0, double x, double y, double z, double phi, double theta);
+
+    /** distance of line y = ax + b to origin */
+    static double distanceOfLineToOrigin2D(double a, double b);
+    /** signed distance of line with point (x,y) and angle phi to origin */
+    static double signedDistanceOfLineToOrigin2D(double x, double y, double phi);
+
+    /** calculates theta at (x,y,z) for curved track model */
+    static double thetaForCurvedHit(double invcurvature, MuonHoughHit* hit);
+    /** calculates theta at (x,y,z) for curved track model, for positive and negative curvature */
+    static void thetasForCurvedHit(double ratio, MuonHoughHit* hit, double& theta1, double& theta2);
+    /** calculates distance of point (x,y,z) to curved track with z0, theta and invcurvature for curved track model */
+    static double signedDistanceCurvedToHit(double z0, double theta, double invcurvature, double hitx, double hity, double hitz);
+
+    /**
+     * @brief extrapolates road to global position
+     * @param[in] roadpos The position of the combined pattern (should be perigee position)
+     * @param[in] roadmom The momentum of the combined pattern (should be perigee momentum)
+     * @param[in] pos The global position to extrapolate to
+     * @param[out] roadpose The nearest to pos, estimated road position
+     * @param[out] roadpose The nearest to pos, estimated road direction
+     */
+
+    static void extrapolateCurvedRoad(const Amg::Vector3D& roadpos, const Amg::Vector3D& roadmom, const Amg::Vector3D& pos,
+                                      Amg::Vector3D& roadpose, Amg::Vector3D& roaddire);
+
+    /** calculates the 3d-point closest to origin in xy-plane */
+    static std::vector<double> shortestPointOfLineToOrigin3D(double x, double y, double z, double phi, double theta);
+
+    /** calculates the 3d-point closest to origin */
+    static std::vector<double> shortestPointOfLineToOrigin(double x, double y, double z, double phi, double theta);
+
+    /** calculates if line (x,y,z,phi,theta) crosses cylinder (r_0,z_0) around origin */
+    static bool lineThroughCylinder(double x, double y, double z, double phi, double theta, double r_0, double z_0);
+
+    /** cross product between 2 3-vectors */
+    static std::vector<double> crossProduct(std::vector<double> x, std::vector<double> y);
+    /** dot product between 2 3-vectors */
+    static double dotProduct(std::vector<double> x, std::vector<double> y);
+    /** absolute value of 3-vector */
+    double abs(std::vector<double> p) const;
 };
 
-inline double MuonHoughMathUtils::angleFromRadialToGrad (double angle)const{return (angle/MuonHough::degree_rad_conversion_factor);} // angle in radial
-inline double MuonHoughMathUtils::angleFromGradToRadial (double angle)const{return (angle*MuonHough::degree_rad_conversion_factor);} // angle in grad
-inline double MuonHoughMathUtils::abs(std::vector <double> p)const{return std::sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);}
+inline double MuonHoughMathUtils::angleFromRadialToGrad(double angle) const {
+    return (angle / MuonHough::degree_rad_conversion_factor);
+}  // angle in radial
+inline double MuonHoughMathUtils::angleFromGradToRadial(double angle) const {
+    return (angle * MuonHough::degree_rad_conversion_factor);
+}  // angle in grad
+inline double MuonHoughMathUtils::abs(std::vector<double> p) const { return std::sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]); }
 
-#endif //MUONHOUGHPATTERNEVENT_MUONHOUGHMATHUTILS_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHMATHUTILS_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPattern.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPattern.h
index 12e4ec93dccafc501b2411c320b9a4ab7fa2b11f..94308a37907d1b4a323addb88c0d4f156524da12 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPattern.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPattern.h
@@ -5,132 +5,130 @@
 #ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHPATTERN_H
 #define MUONHOUGHPATTERNEVENT_MUONHOUGHPATTERN_H
 
+#include "AthContainers/DataVector.h"
 #include "MuonHoughPatternEvent/MuonHoughHitContainer.h"
 #include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
-#include "AthContainers/DataVector.h"
 
-namespace MuonHough{
-  /** enum to identify the different houghtransformers */
-  enum MuonHoughTransformers {hough_xy,hough_rzcosmics,hough_curved_at_a_cylinder,hough_rz,hough_rz_mdt,hough_rz_rpc,hough_yz};
-}
-
-class MuonHoughPattern : public MuonHoughHitContainer
-{
-  /** MuonHoughPattern does not own its hits (contrary to the default) MuonHoughHitContainer! */
-
- public:
-  /** constructor */
-  MuonHoughPattern(int id_number, bool ownhits = false);
-
-  /** destructor */
-  virtual ~MuonHoughPattern() = default;
-
-  /** clear pattern */
-  void resetTracksegment();
-  
-  /** returns if hit is in pattern */
-  bool hitInHoughPattern(MuonHoughHit* hit)const;
-
-  /** calculate estimated z-position of pattern */
-  double calculateEZ()const;
-  /** returns distance between first and last hit */
-  double patternLength()const;
-  
-  /** prints out info about hough pattern */
-  void printHoughPattern()const;
-  
-  /** returns id number of hough transform used to generate pattern */
-  int getIdNumber() const;
-
-  /** returns phi of pattern */
-  double getEPhi()const;
-  /** returns r0/d0 of pattern */
-  double getERPhi()const;
-  /** returns theta of pattern */
-  double getETheta()const;
-  /** returns z0 of pattern */
-  double getERTheta()const;
-  /** returns curvature of pattern */
-  double getECurvature()const;
-  /** returns maximum of histogram used to generate pattern */
-  double getMaximumHistogram()const;
-
-  /** set phi of pattern */
-  void setEPhi(double ephi);
-  /** set r0 of pattern */
-  void setERPhi(double erphi);
-  /** set theta of pattern */
-  void setETheta(double etheta);
-  /** set z0 of pattern */
-  void setERTheta(double ertheta);
-  /** set curvature of pattern */
-  void setECurvature(double curvature);
-  /** set maximum of histogram used to generate pattern */
-  void setMaximumHistogram(double maximumhistogram);
-
-  /** returns angle in precision plane in rad */ 
-  double getEAngle()const;
-  /** returns radius in precision plane in mm */ 
-  double getER()const;
-  /** set angle in precision plane in rad */ 
-  void setEAngle(double eangle);
-  /** set radius in precision plane in mm */ 
-  void setER(double er);
-
-  /** set which segment pattern is in, not in use */
-  void setWhichSegment (bool which_segment);
-
-  /** calulates 3d point closest to ip */
-  std::vector<double> getEPos()const;
-  /** calculates direction at point closest to ip */
-  std::vector<double> getEDir()const;
-
-  /** update parameters in rphi plane based on weighted fit*/
-  void updateParametersRPhi(bool cosmics=false);
-
-  typedef DataVector <MuonHoughPattern> MuonHoughPatternCollection;
-
- private:
-
-  /** id number of hough transform used to generate pattern */
-  int m_id_number;  
-  
-  /** which segment is pattern created in, not relevant if split search is off 
-   * 0 lower segment, 1 uppersegment */
-  bool m_whichsegment; 
-
-  /** phi in rad */
-  double m_ephi; 
-  /** r0 in mm */
-  double m_erphi;
-  /** theta in rad */
-  double m_etheta; 
-  /** z0 in mm */
-  double m_ertheta;
-  /** curvature of pattern in rz plane in mm */
-  double m_ecurvature; 
-  /** maximum of histogram */
-  double m_maximumhistogram;
-  
-  /** object for use of mathematical formulas for trackmodels */
-  MuonHoughMathUtils m_muonhoughmathutils;
+namespace MuonHough {
+    /** enum to identify the different houghtransformers */
+    enum MuonHoughTransformers { hough_xy, hough_rzcosmics, hough_curved_at_a_cylinder, hough_rz, hough_rz_mdt, hough_rz_rpc, hough_yz };
+}  // namespace MuonHough
+
+class MuonHoughPattern : public MuonHoughHitContainer {
+    /** MuonHoughPattern does not own its hits (contrary to the default) MuonHoughHitContainer! */
+
+public:
+    /** constructor */
+    MuonHoughPattern(int id_number, bool ownhits = false);
+
+    /** destructor */
+    virtual ~MuonHoughPattern() = default;
+
+    /** clear pattern */
+    void resetTracksegment();
+
+    /** returns if hit is in pattern */
+    bool hitInHoughPattern(MuonHoughHit* hit) const;
+
+    /** calculate estimated z-position of pattern */
+    double calculateEZ() const;
+    /** returns distance between first and last hit */
+    double patternLength() const;
+
+    /** prints out info about hough pattern */
+    void printHoughPattern() const;
+
+    /** returns id number of hough transform used to generate pattern */
+    int getIdNumber() const;
+
+    /** returns phi of pattern */
+    double getEPhi() const;
+    /** returns r0/d0 of pattern */
+    double getERPhi() const;
+    /** returns theta of pattern */
+    double getETheta() const;
+    /** returns z0 of pattern */
+    double getERTheta() const;
+    /** returns curvature of pattern */
+    double getECurvature() const;
+    /** returns maximum of histogram used to generate pattern */
+    double getMaximumHistogram() const;
+
+    /** set phi of pattern */
+    void setEPhi(double ephi);
+    /** set r0 of pattern */
+    void setERPhi(double erphi);
+    /** set theta of pattern */
+    void setETheta(double etheta);
+    /** set z0 of pattern */
+    void setERTheta(double ertheta);
+    /** set curvature of pattern */
+    void setECurvature(double curvature);
+    /** set maximum of histogram used to generate pattern */
+    void setMaximumHistogram(double maximumhistogram);
+
+    /** returns angle in precision plane in rad */
+    double getEAngle() const;
+    /** returns radius in precision plane in mm */
+    double getER() const;
+    /** set angle in precision plane in rad */
+    void setEAngle(double eangle);
+    /** set radius in precision plane in mm */
+    void setER(double er);
+
+    /** set which segment pattern is in, not in use */
+    void setWhichSegment(bool which_segment);
+
+    /** calulates 3d point closest to ip */
+    std::vector<double> getEPos() const;
+    /** calculates direction at point closest to ip */
+    std::vector<double> getEDir() const;
+
+    /** update parameters in rphi plane based on weighted fit*/
+    void updateParametersRPhi(bool cosmics = false);
+
+    typedef DataVector<MuonHoughPattern> MuonHoughPatternCollection;
+
+private:
+    /** id number of hough transform used to generate pattern */
+    int m_id_number;
+
+    /** which segment is pattern created in, not relevant if split search is off
+     * 0 lower segment, 1 uppersegment */
+    bool m_whichsegment;
+
+    /** phi in rad */
+    double m_ephi;
+    /** r0 in mm */
+    double m_erphi;
+    /** theta in rad */
+    double m_etheta;
+    /** z0 in mm */
+    double m_ertheta;
+    /** curvature of pattern in rz plane in mm */
+    double m_ecurvature;
+    /** maximum of histogram */
+    double m_maximumhistogram;
+
+    /** object for use of mathematical formulas for trackmodels */
+    MuonHoughMathUtils m_muonhoughmathutils;
 };
 
-inline int MuonHoughPattern::getIdNumber() const {return m_id_number;}
+inline int MuonHoughPattern::getIdNumber() const { return m_id_number; }
 
-inline double MuonHoughPattern::getEPhi()const{return m_ephi;}
-inline double MuonHoughPattern::getERPhi()const{return m_erphi;}
-inline double MuonHoughPattern::getETheta()const{return m_etheta;}
-inline double MuonHoughPattern::getERTheta()const{return m_ertheta;}
-inline double MuonHoughPattern::getECurvature()const{return m_ecurvature;}
-inline double MuonHoughPattern::getMaximumHistogram()const{return m_maximumhistogram;}
+inline double MuonHoughPattern::getEPhi() const { return m_ephi; }
+inline double MuonHoughPattern::getERPhi() const { return m_erphi; }
+inline double MuonHoughPattern::getETheta() const { return m_etheta; }
+inline double MuonHoughPattern::getERTheta() const { return m_ertheta; }
+inline double MuonHoughPattern::getECurvature() const { return m_ecurvature; }
+inline double MuonHoughPattern::getMaximumHistogram() const { return m_maximumhistogram; }
 
-inline void MuonHoughPattern::setEPhi(double ephi){m_ephi=ephi;}
-inline void MuonHoughPattern::setERPhi(double erphi){m_erphi=erphi;}
-inline void MuonHoughPattern::setETheta(double etheta){m_etheta=etheta;}
-inline void MuonHoughPattern::setERTheta(double ertheta){m_ertheta=ertheta;}
-inline void MuonHoughPattern::setECurvature(double ecurvature){m_ecurvature=ecurvature;}
-inline void MuonHoughPattern::setMaximumHistogram(double maximumhistogram){m_maximumhistogram=maximumhistogram;}
+inline void MuonHoughPattern::setEPhi(double ephi) { m_ephi = ephi; }
+inline void MuonHoughPattern::setERPhi(double erphi) { m_erphi = erphi; }
+inline void MuonHoughPattern::setETheta(double etheta) { m_etheta = etheta; }
+inline void MuonHoughPattern::setERTheta(double ertheta) { m_ertheta = ertheta; }
+inline void MuonHoughPattern::setECurvature(double ecurvature) { m_ecurvature = ecurvature; }
+inline void MuonHoughPattern::setMaximumHistogram(double maximumhistogram) { m_maximumhistogram = maximumhistogram; }
 
-inline void MuonHoughPattern::setWhichSegment (bool which_segment){m_whichsegment=which_segment;}
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHPATTERN_H
+inline void MuonHoughPattern::setWhichSegment(bool which_segment) { m_whichsegment = which_segment; }
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHPATTERN_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPatternCollection.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPatternCollection.h
index 6ab0010cfd85e6e79bb94fec0b201953ecb393a0..cb38d69ae792c2e1ec0d05a2d1dc9b4b1d202b6b 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPatternCollection.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughPatternCollection.h
@@ -8,12 +8,12 @@
 #include "MuonHoughPatternEvent/MuonHoughPattern.h"
 
 /**
-This typedef represents a collection and container of MuonHoughPattern objects. 
+This typedef represents a collection and container of MuonHoughPattern objects.
 */
 typedef std::vector<MuonHoughPattern*> MuonHoughPatternCollection;
 
-typedef std::vector <MuonHoughPatternCollection> MuonHoughPatternContainer;
+typedef std::vector<MuonHoughPatternCollection> MuonHoughPatternContainer;
 
-typedef std::vector <MuonHoughPatternContainer> MuonHoughPatternContainerShip;
+typedef std::vector<MuonHoughPatternContainer> MuonHoughPatternContainerShip;
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHPATTERNCOLLECTION_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHPATTERNCOLLECTION_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformSteering.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformSteering.h
index cbeafcc0c33050e90033ff70fcae61a4b76572db..199878d27867f1a5c1b1a36a8997273a26292abd 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformSteering.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformSteering.h
@@ -1,66 +1,63 @@
 /*
-  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 MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMSTEERING_H
 #define MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMSTEERING_H
 
 #include "MuonHoughPatternEvent/MuonHoughPatternCollection.h"
+#include "MuonHoughPatternEvent/MuonHoughHisto2DContainer.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 
 class MuonHoughPattern;
-class MuonHoughTransformer;
 
-
-class MuonHoughTransformSteering
-{
-  /** Class is build as Strategy, Context pattern */
-
- public:
-  /** constructor */
-  MuonHoughTransformSteering(MuonHoughTransformer*);
-  /** destructor */
-  ~MuonHoughTransformSteering();
-
-  /** construct hough patterns 
-   * @param[in] event Hitcontainer
-   * @param[in] residu_mm maximum residu for hit to be associated to pattern 
-   * @param[in] residu_grad maximum residu for hit to be associated to pattern
-   * @param[in] max_patterns maximum number of patterns to be built
-   * @param[in] which_segment upper (1) or lower (0) segment, this option is off by default
-   * @param[in] printlevel outputlevel between 0-10
-   * @param[out] HoughPatternCollection
-   */
-  MuonHoughPatternCollection constructHoughPatterns(const MuonHoughHitContainer* event, double residu_mm, double residu_grad, int max_patterns=1, bool which_segment=0, int printlevel=0)const;
-  /** construct hough pattern on a certain maxima number of histogram */   
-  MuonHoughPattern* constructHoughPattern(const MuonHoughHitContainer* event, double residu_mm, double residu_grad, int maximum_number=0, bool which_segment=0, int printlevel=0)const;
-  /** construct hough pattern at a certain coordinate (maximum) in certain sector*/   
-  MuonHoughPattern* constructHoughPattern(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double residu_mm,double residu_grad, int sector=0, bool which_segment=0, int printlevel=0)const;
-  /** construct hough pattern at a certain binnumber (maximum) in certain sector*/   
-  MuonHoughPattern* constructHoughPattern(const MuonHoughHitContainer* event,int binnumber, double residu_mm,double residu_grad, int sector=0, bool which_segment=0, int printlevel=0)const;
-
-  /** fill histograms */
-  void fill(const MuonHoughHitContainer* event, bool subtract = false );
-
-  /** reset histograms */
-  void resetHisto();
-
-  /** access to histograms */
-  const MuonHoughHisto2DContainer& histos() const {
-    return m_houghtransformer->histos();
-  }
-
-  
-  const MuonHoughTransformer* transformer() const {
-    return m_houghtransformer;
-  }
-
- private:
-
-  /** the actual houghtransform */
-  MuonHoughTransformer* m_houghtransformer;
-
-  /** maximum residu for hit to be associated to pattern */
-  bool m_maximum_residu_mm;
+class MuonHoughTransformSteering {
+    /** Class is build as Strategy, Context pattern */
+
+public:
+    /** constructor */
+    MuonHoughTransformSteering(MuonHoughTransformer*);
+    /** destructor */
+    ~MuonHoughTransformSteering();
+
+    /** construct hough patterns
+     * @param[in] event Hitcontainer
+     * @param[in] residu_mm maximum residu for hit to be associated to pattern
+     * @param[in] residu_grad maximum residu for hit to be associated to pattern
+     * @param[in] max_patterns maximum number of patterns to be built
+     * @param[in] which_segment upper (1) or lower (0) segment, this option is off by default
+     * @param[in] printlevel outputlevel between 0-10
+     * @param[out] HoughPatternCollection
+     */
+    MuonHoughPatternCollection constructHoughPatterns(const MuonHoughHitContainer* event, double residu_mm, double residu_grad,
+                                                      int max_patterns = 1, bool which_segment = 0, int printlevel = 0) const;
+    /** construct hough pattern on a certain maxima number of histogram */
+    MuonHoughPattern* constructHoughPattern(const MuonHoughHitContainer* event, double residu_mm, double residu_grad,
+                                            int maximum_number = 0, bool which_segment = 0, int printlevel = 0) const;
+    /** construct hough pattern at a certain coordinate (maximum) in certain sector*/
+    MuonHoughPattern* constructHoughPattern(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum, double residu_mm,
+                                            double residu_grad, int sector = 0, bool which_segment = 0, int printlevel = 0) const;
+    /** construct hough pattern at a certain binnumber (maximum) in certain sector*/
+    MuonHoughPattern* constructHoughPattern(const MuonHoughHitContainer* event, int binnumber, double residu_mm, double residu_grad,
+                                            int sector = 0, bool which_segment = 0, int printlevel = 0) const;
+
+    /** fill histograms */
+    void fill(const MuonHoughHitContainer* event, bool subtract = false);
+
+    /** reset histograms */
+    void resetHisto();
+
+    /** access to histograms */
+    const MuonHoughHisto2DContainer& histos() const { return m_houghtransformer->histos(); }
+
+    const MuonHoughTransformer* transformer() const { return m_houghtransformer; }
+
+private:
+    /** the actual houghtransform */
+    MuonHoughTransformer* m_houghtransformer;
+
+    /** maximum residu for hit to be associated to pattern */
+    bool m_maximum_residu_mm;
 };
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMSTEERING_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMSTEERING_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer.h
index d706f465bdda4a22f27ce1fe68fe11ff51a1b67a..0b057a0b701341785fe9cb81ef6dc52018caf8ef 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer.h
@@ -5,148 +5,152 @@
 #ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
 #define MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
 
-#include "MuonHoughPatternEvent/MuonHoughPattern.h"
-#include "MuonHoughPatternEvent/MuonHoughHisto2DContainer.h"
-#include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
-#include "MuonHoughPatternEvent/MuonHoughHit.h"
-
 #include <cmath>
 #include <map>
 
+#include "MuonHoughPatternEvent/MuonHoughHisto2DContainer.h"
+#include "MuonHoughPatternEvent/MuonHoughHit.h"
+#include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
+#include "MuonHoughPatternEvent/MuonHoughPattern.h"
+
 class MuonHoughHitContainer;
 
 /** Abstract base class, Strategy pattern */
 /** from this class, algorithms inherit and do the houghtransformation and searches for a houghpattern */
 
-class MuonHoughTransformer
-{
-
- public:
-  /** destructor */
-  virtual ~MuonHoughTransformer();
-
-  /** weight houghtransform, give more importance to houghtransforms close to origin */
-  virtual float weightHoughTransform (double r0) const=0;
-  /** fill histograms with hitcontainer */
-  virtual void fill(const MuonHoughHitContainer* event, bool subtract = false);
-  /** fill histograms with hit */
-  virtual void fillHit(MuonHoughHit* hit, double weight=1.)=0;
-  /** fill histogram with certain coordinate */
-  virtual int fillHisto(double coord1, double coord2, double weight=1., int sector=0)=0;
-
-  /** associate hits to certain maximum number of histograms */
-  MuonHoughPattern* associateHitsToMaximum(const MuonHoughHitContainer* event, double residu_mm, double residu_grad, int maximum_number, bool which_segment=0, int printlevel=0)const;
-
-  /** associate hits to certain coordinates and sector */
-  MuonHoughPattern* associateHitsToCoords(const MuonHoughHitContainer* event,std::pair <double,double> coords, double residu_mm,double residu_angle, int sector=0, bool which_segment=0, int printlevel = 0)const; //residu_mm for id=0,1,2 ; residu_angle for id=3,4 
-
-  /** associate hits to certain binnumber and sector */
-  MuonHoughPattern* associateHitsToBinnumber(const MuonHoughHitContainer* event,int binnumber,double maximum_residu_mm, double maximum_residu_angle, int sector=0, bool which_segment=0, int printlevel=0)const;
-
-  /** reset histograms */
-  void resetHisto();
-  /** use negative weights */
-  void useNegativeWeights(bool use_negative_weights);
-
-  /** return the first certain number of maxima of histograms */
-  std::vector <std::pair <int,int> > getMaxima(int max_patterns)const;
-
-  /** set m_ip_setting (e.g. to not split patterns) */
-  void setIP(bool ip_setting);
-
-  /** access to histograms */
-  const MuonHoughHisto2DContainer& histos() const { return m_histos; }
- protected:
-
-  /** constructor, input values are those of histograms */
-  MuonHoughTransformer(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,int number_of_sectors=1);
-
-  /** pure virtual method for derived class implementation of associateHitsToMaximum method */
-  virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double residu_mm,double residu_angle, int sector=0, bool which_segment=0, int printlevel =0)const=0;
-
-  /** returns begin and end value of the filling loop */
-  std::pair <double,double> getEndPointsFillLoop(double radius, double stepsize, int sector=0)const;
-
-  /** returns sector for coords */
-  virtual int sector(MuonHoughHit * hit)const=0;
-
-  /** returns sinus from lookup table */
-  double sinus(double angle)const;
- /** returns cosinus from lookup table */
-  double cosinus(double angle)const;
-
-  /** histogram container */
-  MuonHoughHisto2DContainer m_histos;
-
-  /** threshold of histograms */
-  double m_threshold_histo;
-
-  /** size of event to be filled (can be used for weighting) */
-  unsigned int m_eventsize;
-  /** weightfactor based on eventsize (used in curved hough transform) */
-  double m_eventsize_weightfactor;
-
-  /** use weight of patterns in angle coordinate */
-  bool m_add_weight_angle;
-  /** weight constant of patterns in angle coordinate */
-  double m_weight_constant_angle;
-  /** use weight of patterns in radius coordinate */
-  bool m_add_weight_radius;
-  /** weight constant of patterns in radius coordinate */
-  double m_weight_constant_radius;
-
-  /** use of negative weights */
-  bool m_use_negative_weights;
-
-  /** object for use of mathematical formulas for trackmodels */
-  MuonHoughMathUtils m_muonhoughmathutils;
-
-  /** number of bins in histograms in radius coordinate*/
-  const int m_nbins;
-  /** number of bins in histograms in radius coordinate*/
-  const int m_nbins_plus3;
-  /** number of bins in histograms in angle coordinate*/
-  const int m_nbins_angle;
-  /** range of radius coordinate */
-  const double m_detectorsize;
-  /** range of angle coordinate */
-  const double m_detectorsize_angle;
-  /** x-binwidth of histogram */
-  double m_binwidthx;
-  /** y-binwidth of histogram */
-  double m_binwidthy;
-
-  /** stepsize of transform for radius coordinate */
-  double m_stepsize;
-  /** stepsize of transform for angle coordinate */
-  double m_stepsize_per_angle;
-
-  /** use settings for patterns originating from origin */
-  bool m_ip_setting;
-
-  /** number of histograms (1 for cosmics 16 for rz) */
-  const int m_number_of_sectors; 
-
- private:
-  /** initialize sinus and cosinus tables */
-  void initTables();
-
-  /** lookup table <angle in rad, sinus value> for sin */
-  std::map <double, double> m_sin; 
-  /** lookup table <angle in rad, cosinus value> for con */
-  std::map <double, double> m_cos; 
-
-  class maximaCompare{
-  public:
-    bool operator()(std::pair < std::pair <int,int> , double > lhs, std::pair < std::pair <int,int> , double > rhs)const
-    {
-      return lhs.second > rhs.second;
-    }
-  };
-
+class MuonHoughTransformer {
+public:
+    /** destructor */
+    virtual ~MuonHoughTransformer();
+
+    /** weight houghtransform, give more importance to houghtransforms close to origin */
+    virtual float weightHoughTransform(double r0) const = 0;
+    /** fill histograms with hitcontainer */
+    virtual void fill(const MuonHoughHitContainer* event, bool subtract = false);
+    /** fill histograms with hit */
+    virtual void fillHit(MuonHoughHit* hit, double weight = 1.) = 0;
+    /** fill histogram with certain coordinate */
+    virtual int fillHisto(double coord1, double coord2, double weight = 1., int sector = 0) = 0;
+
+    /** associate hits to certain maximum number of histograms */
+    MuonHoughPattern* associateHitsToMaximum(const MuonHoughHitContainer* event, double residu_mm, double residu_grad, int maximum_number,
+                                             bool which_segment = 0, int printlevel = 0) const;
+
+    /** associate hits to certain coordinates and sector */
+    MuonHoughPattern* associateHitsToCoords(const MuonHoughHitContainer* event, std::pair<double, double> coords, double residu_mm,
+                                            double residu_angle, int sector = 0, bool which_segment = 0,
+                                            int printlevel = 0) const;  // residu_mm for id=0,1,2 ; residu_angle for id=3,4
+
+    /** associate hits to certain binnumber and sector */
+    MuonHoughPattern* associateHitsToBinnumber(const MuonHoughHitContainer* event, int binnumber, double maximum_residu_mm,
+                                               double maximum_residu_angle, int sector = 0, bool which_segment = 0,
+                                               int printlevel = 0) const;
+
+    /** reset histograms */
+    void resetHisto();
+    /** use negative weights */
+    void useNegativeWeights(bool use_negative_weights);
+
+    /** return the first certain number of maxima of histograms */
+    std::vector<std::pair<int, int> > getMaxima(int max_patterns) const;
+
+    /** set m_ip_setting (e.g. to not split patterns) */
+    void setIP(bool ip_setting);
+
+    /** access to histograms */
+    const MuonHoughHisto2DContainer& histos() const { return m_histos; }
+
+protected:
+    /** constructor, input values are those of histograms */
+    MuonHoughTransformer(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
+                         int number_of_sectors = 1);
+
+    /** pure virtual method for derived class implementation of associateHitsToMaximum method */
+    virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum,
+                                                         double residu_mm, double residu_angle, int sector = 0, bool which_segment = 0,
+                                                         int printlevel = 0) const = 0;
+
+    /** returns begin and end value of the filling loop */
+    std::pair<double, double> getEndPointsFillLoop(double radius, double stepsize, int sector = 0) const;
+
+    /** returns sector for coords */
+    virtual int sector(MuonHoughHit* hit) const = 0;
+
+    /** returns sinus from lookup table */
+    double sinus(double angle) const;
+    /** returns cosinus from lookup table */
+    double cosinus(double angle) const;
+
+    /** histogram container */
+    MuonHoughHisto2DContainer m_histos;
+
+    /** threshold of histograms */
+    double m_threshold_histo;
+
+    /** size of event to be filled (can be used for weighting) */
+    unsigned int m_eventsize;
+    /** weightfactor based on eventsize (used in curved hough transform) */
+    double m_eventsize_weightfactor;
+
+    /** use weight of patterns in angle coordinate */
+    bool m_add_weight_angle;
+    /** weight constant of patterns in angle coordinate */
+    double m_weight_constant_angle;
+    /** use weight of patterns in radius coordinate */
+    bool m_add_weight_radius;
+    /** weight constant of patterns in radius coordinate */
+    double m_weight_constant_radius;
+
+    /** use of negative weights */
+    bool m_use_negative_weights;
+
+    /** object for use of mathematical formulas for trackmodels */
+    MuonHoughMathUtils m_muonhoughmathutils;
+
+    /** number of bins in histograms in radius coordinate*/
+    const int m_nbins;
+    /** number of bins in histograms in radius coordinate*/
+    const int m_nbins_plus3;
+    /** number of bins in histograms in angle coordinate*/
+    const int m_nbins_angle;
+    /** range of radius coordinate */
+    const double m_detectorsize;
+    /** range of angle coordinate */
+    const double m_detectorsize_angle;
+    /** x-binwidth of histogram */
+    double m_binwidthx;
+    /** y-binwidth of histogram */
+    double m_binwidthy;
+
+    /** stepsize of transform for radius coordinate */
+    double m_stepsize;
+    /** stepsize of transform for angle coordinate */
+    double m_stepsize_per_angle;
+
+    /** use settings for patterns originating from origin */
+    bool m_ip_setting;
+
+    /** number of histograms (1 for cosmics 16 for rz) */
+    const int m_number_of_sectors;
+
+private:
+    /** initialize sinus and cosinus tables */
+    void initTables();
+
+    /** lookup table <angle in rad, sinus value> for sin */
+    std::map<double, double> m_sin;
+    /** lookup table <angle in rad, cosinus value> for con */
+    std::map<double, double> m_cos;
+
+    class maximaCompare {
+    public:
+        bool operator()(std::pair<std::pair<int, int>, double> lhs, std::pair<std::pair<int, int>, double> rhs) const {
+            return lhs.second > rhs.second;
+        }
+    };
 };
 
-inline void MuonHoughTransformer::setIP(bool ip_setting){m_ip_setting=ip_setting;}
-inline void MuonHoughTransformer::useNegativeWeights(bool use_negative_weights){m_use_negative_weights=use_negative_weights;}
+inline void MuonHoughTransformer::setIP(bool ip_setting) { m_ip_setting = ip_setting; }
+inline void MuonHoughTransformer::useNegativeWeights(bool use_negative_weights) { m_use_negative_weights = use_negative_weights; }
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h
index 94df64697433809d318a6af83fa36bf4a2a73d27..fb78fba2bf5cde412fd1762e9d87fcd9d808ff43 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h
@@ -7,37 +7,38 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 
-class MuonHoughTransformer_CurvedAtACylinder : public MuonHoughTransformer
-{
- public:
-  /** constructor */
-  MuonHoughTransformer_CurvedAtACylinder(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,int number_of_sectors=1);
-  /** destructor */
-  ~MuonHoughTransformer_CurvedAtACylinder();
-
-  /** fill hit in histogram */
-  virtual void fillHit(MuonHoughHit* hit, double weight=1.);
-  /** fill transformed values in histogram */
-  virtual int fillHisto(double xbin, double theta, double weight=1., int sector=0);
-
-  /** associate hits to maximum found */
-  virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double residu_mm,double residu_grad, int sector=0, bool which_segment=0, int printlevel=999)const;
-
-  /** returns the phi sector */
-  virtual int sector(MuonHoughHit* hit)const;
-  /** not implemented for this transform */
-  virtual float weightHoughTransform(double r0)const;
-
- private:
-  /** array that stores the inverse curvatures that are scanned */
-  double* m_invcurvature;
-  double* m_weightcurvature;
-
-  MuonHoughTransformer_CurvedAtACylinder & operator=(const MuonHoughTransformer_CurvedAtACylinder &right);
-  MuonHoughTransformer_CurvedAtACylinder(const MuonHoughTransformer_CurvedAtACylinder&);
-
+class MuonHoughTransformer_CurvedAtACylinder : public MuonHoughTransformer {
+public:
+    /** constructor */
+    MuonHoughTransformer_CurvedAtACylinder(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                           double threshold_histo, int number_of_sectors = 1);
+    /** destructor */
+    ~MuonHoughTransformer_CurvedAtACylinder();
+
+    /** fill hit in histogram */
+    virtual void fillHit(MuonHoughHit* hit, double weight = 1.);
+    /** fill transformed values in histogram */
+    virtual int fillHisto(double xbin, double theta, double weight = 1., int sector = 0);
+
+    /** associate hits to maximum found */
+    virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum,
+                                                         double residu_mm, double residu_grad, int sector = 0, bool which_segment = 0,
+                                                         int printlevel = 999) const;
+
+    /** returns the phi sector */
+    virtual int sector(MuonHoughHit* hit) const;
+    /** not implemented for this transform */
+    virtual float weightHoughTransform(double r0) const;
+
+private:
+    /** array that stores the inverse curvatures that are scanned */
+    double* m_invcurvature;
+    double* m_weightcurvature;
+
+    MuonHoughTransformer_CurvedAtACylinder& operator=(const MuonHoughTransformer_CurvedAtACylinder& right);
+    MuonHoughTransformer_CurvedAtACylinder(const MuonHoughTransformer_CurvedAtACylinder&);
 };
 
-inline int MuonHoughTransformer_CurvedAtACylinder::sector(MuonHoughHit* hit)const{return hit->phiSector();}
+inline int MuonHoughTransformer_CurvedAtACylinder::sector(MuonHoughHit* hit) const { return hit->phiSector(); }
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_CURVEDATACYLINDER_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_CURVEDATACYLINDER_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rz.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rz.h
index e44ca4785fdff653c7b04f6399db800150baea69..809ccf2ef1cff9a58036020834bdd566c0a58974 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rz.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rz.h
@@ -7,31 +7,30 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 
-class MuonHoughTransformer_rz: public MuonHoughTransformer 
-{
+class MuonHoughTransformer_rz : public MuonHoughTransformer {
+public:
+    MuonHoughTransformer_rz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
+                            int number_of_sectors = 1);
+    virtual ~MuonHoughTransformer_rz() = default;
 
- public:
+    virtual void fillHit(MuonHoughHit* hit, double weight = 1.);
+    virtual int fillHisto(double rz0, double theta, double weight = 1., int sector = 0);
 
-  MuonHoughTransformer_rz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,int number_of_sectors=1);
-  virtual ~MuonHoughTransformer_rz() = default;
+    static double calculateAngle(double hitx, double hity, double hitz, double z0);  // in rad
 
-  virtual void fillHit(MuonHoughHit* hit, double weight=1.);
-  virtual int fillHisto(double rz0, double theta, double weight=1., int sector=0);
+    virtual float weightHoughTransform(double r0) const;
+    float weightHoughTransform(double r0, double angle) const;
 
-  static double calculateAngle(double hitx, double hity, double hitz, double z0); // in rad
+    virtual int sector(MuonHoughHit* hit) const;  // 0..15 same as atlas sector 1..16 // returns 0 if number_of_sectors == 0
 
-  virtual float weightHoughTransform (double r0) const;
-  float weightHoughTransform (double r0,double angle) const;
-
-  virtual int sector(MuonHoughHit* hit)const; // 0..15 same as atlas sector 1..16 // returns 0 if number_of_sectors == 0
-
- protected:
-  virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double residu_mm,double residu_grad, int sector=0, bool which_segment=0, int printlevel=999)const;
-
-  const bool m_use_residu_grad; //0 is advisable //only used for rz
+protected:
+    virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum,
+                                                         double residu_mm, double residu_grad, int sector = 0, bool which_segment = 0,
+                                                         int printlevel = 999) const;
 
+    const bool m_use_residu_grad;  // 0 is advisable //only used for rz
 };
 
-inline int MuonHoughTransformer_rz::sector(MuonHoughHit* hit)const{return hit->phiSector();}
+inline int MuonHoughTransformer_rz::sector(MuonHoughHit* hit) const { return hit->phiSector(); }
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_RZ_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_RZ_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h
index 2cf0e4a0767231fad84c44d4eaaad0de57a48002..3f6f5b145c7a92559affb303018863c5c3e38c6b 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h
@@ -7,41 +7,40 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 
-class MuonHoughTransformer_rzcosmics: public MuonHoughTransformer 
-{
-
- public:
-
-  MuonHoughTransformer_rzcosmics(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,int number_of_sectors=1);
-  ~MuonHoughTransformer_rzcosmics();
-
-  virtual void fillHit(MuonHoughHit* hit, double weight=1.);
-  virtual int fillHisto(double rz0, double theta, double weight=1., int sector=0);
-
-  virtual float weightHoughTransform (double r0) const;
-
-  virtual int sector(MuonHoughHit* hit)const; // 0..15 same as atlas sector 1..16 // returns 0 if number_of_sectors == 0
- protected:
-  virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double residu_mm,double residu_grad, int sector=0, bool which_segment=0, int printlevel=999)const;
-
- private:
-  /** recalculate trackparameters of pattern */
-  static void updateParameters(MuonHoughPattern*);
-
-  /** weight in transform, dotprod is the phi angle between the normal and the phisector */
-  float weightHoughTransform (double r0,double sintheta, double sinphi, double dotprod) const;
-
-  /** arrays that store values of transform */
-  double* m_phisec;
-  double* m_sinphisec;
-  double* m_cosphisec;
-  double* m_theta_in_grad;
-  double* m_sintheta;
-  double* m_costheta;
-
-  MuonHoughTransformer_rzcosmics & operator=(const MuonHoughTransformer_rzcosmics &right);
-  MuonHoughTransformer_rzcosmics(const MuonHoughTransformer_rzcosmics&);
-
+class MuonHoughTransformer_rzcosmics : public MuonHoughTransformer {
+public:
+    MuonHoughTransformer_rzcosmics(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
+                                   int number_of_sectors = 1);
+    ~MuonHoughTransformer_rzcosmics();
+
+    virtual void fillHit(MuonHoughHit* hit, double weight = 1.);
+    virtual int fillHisto(double rz0, double theta, double weight = 1., int sector = 0);
+
+    virtual float weightHoughTransform(double r0) const;
+
+    virtual int sector(MuonHoughHit* hit) const;  // 0..15 same as atlas sector 1..16 // returns 0 if number_of_sectors == 0
+protected:
+    virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum,
+                                                         double residu_mm, double residu_grad, int sector = 0, bool which_segment = 0,
+                                                         int printlevel = 999) const;
+
+private:
+    /** recalculate trackparameters of pattern */
+    static void updateParameters(MuonHoughPattern*);
+
+    /** weight in transform, dotprod is the phi angle between the normal and the phisector */
+    float weightHoughTransform(double r0, double sintheta, double sinphi, double dotprod) const;
+
+    /** arrays that store values of transform */
+    double* m_phisec;
+    double* m_sinphisec;
+    double* m_cosphisec;
+    double* m_theta_in_grad;
+    double* m_sintheta;
+    double* m_costheta;
+
+    MuonHoughTransformer_rzcosmics& operator=(const MuonHoughTransformer_rzcosmics& right);
+    MuonHoughTransformer_rzcosmics(const MuonHoughTransformer_rzcosmics&);
 };
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_RZCOSMICS_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_RZCOSMICS_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xy.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xy.h
index 85030c23179f926e6303eef2edb5bad5afce51ec..153634702b707b0da46b71517783ae254e54bd68 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xy.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xy.h
@@ -7,20 +7,20 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_xyz.h"
 
-class MuonHoughTransformer_xy : public MuonHoughTransformer_xyz
-{
- public:
-  /** constructor */
-  MuonHoughTransformer_xy(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,int number_of_sectors=1);
-  /** destructor */
-  virtual ~MuonHoughTransformer_xy() = default;
+class MuonHoughTransformer_xy : public MuonHoughTransformer_xyz {
+public:
+    /** constructor */
+    MuonHoughTransformer_xy(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
+                            int number_of_sectors = 1);
+    /** destructor */
+    virtual ~MuonHoughTransformer_xy() = default;
 
-  /** returns the hit position in xy frame */
-  virtual std::pair <double,double> getHitPos(const MuonHoughHitContainer* event, int hitid)const; 
-  /** build new houghpattern */
-  virtual MuonHoughPattern* initialiseHoughPattern()const;
-  /** put weight on houghtransform dependent on r0 */
-  virtual float weightHoughTransform(double r0)const;
+    /** returns the hit position in xy frame */
+    virtual std::pair<double, double> getHitPos(const MuonHoughHitContainer* event, int hitid) const;
+    /** build new houghpattern */
+    virtual MuonHoughPattern* initialiseHoughPattern() const;
+    /** put weight on houghtransform dependent on r0 */
+    virtual float weightHoughTransform(double r0) const;
 };
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_XY_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_XY_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xyz.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xyz.h
index 6e10a2ee48cf3393a701c814ff32692161ef1554..4633db02d7614340cb07a9c036566aec49010871 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xyz.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_xyz.h
@@ -8,38 +8,39 @@
 #include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 
 /** abstract base class for hough transform with carthesian coordinates */
-class MuonHoughTransformer_xyz : public MuonHoughTransformer 
-{
- protected:
-  /** constructor */
-  MuonHoughTransformer_xyz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors=1);
-
-  /** associate hits to maximum found */
-  virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double residu_mm,double residu_grad, int sector=0, bool which_segment=0, int printlevel = 999)const;
-
- public:
-  /** destructor */
-  virtual ~MuonHoughTransformer_xyz() = default;
-
-  /** fill hit in histogram */
-  virtual void fillHit(MuonHoughHit* hit, double weight=1.); 
-  /** fill transformed values in histogram */
-  virtual int fillHisto(double r0, double phi, double weight=1., int sector=0);
-
-  /** returns the rz sector */
-  virtual int sector(MuonHoughHit* hit)const; 
-
-  /** calcalates the phi angle for a given hit and r0 */
-  static double calculateAngle(double hitx, double hity, double r0); 
-
-  /** build new houghpattern */
-  virtual MuonHoughPattern* initialiseHoughPattern()const=0;
-  /** put weight on houghtransform dependent on r0 */
-  virtual float weightHoughTransform(double r0)const;
-
-  /** returns the relevant 2d hit position */
-  virtual std::pair <double,double> getHitPos(const MuonHoughHitContainer* event, int hitid)const=0;
-  
+class MuonHoughTransformer_xyz : public MuonHoughTransformer {
+protected:
+    /** constructor */
+    MuonHoughTransformer_xyz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
+                             int number_of_sectors = 1);
+
+    /** associate hits to maximum found */
+    virtual MuonHoughPattern* hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum,
+                                                         double residu_mm, double residu_grad, int sector = 0, bool which_segment = 0,
+                                                         int printlevel = 999) const;
+
+public:
+    /** destructor */
+    virtual ~MuonHoughTransformer_xyz() = default;
+
+    /** fill hit in histogram */
+    virtual void fillHit(MuonHoughHit* hit, double weight = 1.);
+    /** fill transformed values in histogram */
+    virtual int fillHisto(double r0, double phi, double weight = 1., int sector = 0);
+
+    /** returns the rz sector */
+    virtual int sector(MuonHoughHit* hit) const;
+
+    /** calcalates the phi angle for a given hit and r0 */
+    static double calculateAngle(double hitx, double hity, double r0);
+
+    /** build new houghpattern */
+    virtual MuonHoughPattern* initialiseHoughPattern() const = 0;
+    /** put weight on houghtransform dependent on r0 */
+    virtual float weightHoughTransform(double r0) const;
+
+    /** returns the relevant 2d hit position */
+    virtual std::pair<double, double> getHitPos(const MuonHoughHitContainer* event, int hitid) const = 0;
 };
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_XYZ_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_XYZ_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_yz.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_yz.h
index 3a997682d3f7d2041bfaafc06c35a5a7ffbeb8fc..d94c4bf6b1df2d7f904a24f7644e9f4e0613cec8 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_yz.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/MuonHoughPatternEvent/MuonHoughTransformer_yz.h
@@ -7,20 +7,21 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_xyz.h"
 
-class MuonHoughTransformer_yz : public MuonHoughTransformer_xyz
-{
- public:
-  /** constructor */
-  MuonHoughTransformer_yz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors=1);
-  /** destructor */
-  virtual ~MuonHoughTransformer_yz() = default;
+class MuonHoughTransformer_yz : public MuonHoughTransformer_xyz {
+public:
+    /** constructor */
+    MuonHoughTransformer_yz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo,
+                            int number_of_sectors = 1);
+    /** destructor */
+    virtual ~MuonHoughTransformer_yz() = default;
 
-  /** returns the hit position in yz frame */
-  virtual std::pair <double,double> getHitPos(const MuonHoughHitContainer* event, int hitid)const; //returns the relevant position of the hit (xy-RPC in case of id==id_xy_rpc etc.)
-  /** build new houghpattern */
-  virtual MuonHoughPattern* initialiseHoughPattern()const;
-  /** put weight on houghtransform dependent on r0 */
-  virtual float weightHoughTransform(double r0)const;
+    /** returns the hit position in yz frame */
+    virtual std::pair<double, double> getHitPos(const MuonHoughHitContainer* event, int hitid)
+        const;  // returns the relevant position of the hit (xy-RPC in case of id==id_xy_rpc etc.)
+    /** build new houghpattern */
+    virtual MuonHoughPattern* initialiseHoughPattern() const;
+    /** put weight on houghtransform dependent on r0 */
+    virtual float weightHoughTransform(double r0) const;
 };
 
-#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_YZ_H
+#endif  // MUONHOUGHPATTERNEVENT_MUONHOUGHTRANSFORMER_YZ_H
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/doc/packagedoc.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/doc/packagedoc.h
index 0d9f5b572ccddb581ca5f488ac87e2bc6c07f30e..5cd934b7ce036df7a8f312383c1b09cd913ccc37 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/doc/packagedoc.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/doc/packagedoc.h
@@ -8,7 +8,8 @@
 
 @section MuonHoughPatternEvent_MuonHoughPatternEventIntro Introduction
 
-This package contains the different HoughTransforms used in the HoughPatternTool and also the internal EDM. Every houghtransformer does both the histogram filling and the association step.
+This package contains the different HoughTransforms used in the HoughPatternTool and also the internal EDM. Every houghtransformer does both
+the histogram filling and the association step.
 
 @section MuonHoughPatternEvent_MuonHoughPatternEventOverview Class Overview
   The MuonHoughPatternEvent package contains of following classes:
@@ -22,7 +23,8 @@ This package contains the different HoughTransforms used in the HoughPatternTool
   - MuonHoughPatternCollection: Container class of MuonHoughPattern
   - MuonHoughTransformSteering: class that steers the initialization of HoughTransformers
   - MuonHoughTransformer: abstract base class
-  - MuonHoughTransformer_CurvedAtACylinder: HoughTransformer in rz plane with curved track model (Atlas magnets bend charged particles in rz plane). Assumes muons from interaction point
+  - MuonHoughTransformer_CurvedAtACylinder: HoughTransformer in rz plane with curved track model (Atlas magnets bend charged particles in rz
+plane). Assumes muons from interaction point
   - MuonHoughTransformer_rz: HoughTransformer in rz plance with straight track model, used for cosmics
   - MuonHoughTransformer_xy: HoughTransformer in xy plane with straight track model
   - MuonHoughTransformer_xyz: base class for HoughTransformers in carthesian coordinates, straight track model
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2D.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2D.cxx
index 0319010ca2f6f021e57b17cac5bcc4489edb822e..4fe2cc820ad916f4427fe5c46d0577878aac2276 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2D.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2D.cxx
@@ -3,285 +3,262 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughHisto2D.h"
-#include "TH2F.h"
-#include "TFile.h"
-#include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
-
-MuonHoughHisto2D::~MuonHoughHisto2D()
-{
-  delete[] m_histBuffer;
-}
-
-MuonHoughHisto2D::MuonHoughHisto2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax,int number_of_maxima):m_nbinsx(nbinsx), m_xmin(xmin), m_xmax(xmax), m_nbinsy(nbinsy), m_ymin(ymin), m_ymax(ymax), m_number_of_maxima(number_of_maxima), m_scale(10000),m_threshold(2.1*m_scale), m_distance_to_next_maximum(100)
-{
-  m_nbinsx_plus2 = nbinsx + 2;
-  m_nbinsy_plus2 = nbinsy + 2;
-  m_size = m_nbinsx_plus2*m_nbinsy_plus2;
-
-  m_binwidthx = (m_xmax-m_xmin)/(m_nbinsx+0.);
-  m_binwidthy = (m_ymax-m_ymin)/(m_nbinsy+0.);
-
-  m_invbinwidthx = 1./m_binwidthx;
-  m_invbinwidthy = 1./m_binwidthy;
 
+#include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
+#include "TFile.h"
+#include "TH2F.h"
 
-  m_maxima_found=0;
-  m_maximumBin = -1;
-  m_maximum = 0;
-  m_maximumIsValid = true;
-  init();
+MuonHoughHisto2D::~MuonHoughHisto2D() { delete[] m_histBuffer; }
+
+MuonHoughHisto2D::MuonHoughHisto2D(int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int number_of_maxima) :
+    m_nbinsx(nbinsx),
+    m_xmin(xmin),
+    m_xmax(xmax),
+    m_nbinsy(nbinsy),
+    m_ymin(ymin),
+    m_ymax(ymax),
+    m_number_of_maxima(number_of_maxima),
+    m_scale(10000),
+    m_threshold(2.1 * m_scale),
+    m_distance_to_next_maximum(100) {
+    m_nbinsx_plus2 = nbinsx + 2;
+    m_nbinsy_plus2 = nbinsy + 2;
+    m_size = m_nbinsx_plus2 * m_nbinsy_plus2;
+
+    m_binwidthx = (m_xmax - m_xmin) / (m_nbinsx + 0.);
+    m_binwidthy = (m_ymax - m_ymin) / (m_nbinsy + 0.);
+
+    m_invbinwidthx = 1. / m_binwidthx;
+    m_invbinwidthy = 1. / m_binwidthy;
+
+    m_maxima_found = 0;
+    m_maximumBin = -1;
+    m_maximum = 0;
+    m_maximumIsValid = true;
+    init();
 }
 
-void MuonHoughHisto2D::init()
-{
-  m_histBuffer = new unsigned int[m_size];
-}
+void MuonHoughHisto2D::init() { m_histBuffer = new unsigned int[m_size]; }
 
-void MuonHoughHisto2D::reset()
-{
-  resetHisto();
+void MuonHoughHisto2D::reset() {
+    resetHisto();
 
-  m_bins_above_threshold.clear();
-  m_maximumbins.clear(); // obsolete?
-  m_maxima_found=0;
-  m_maximumBin = -1;
-  m_maximum = 0;
-  m_maximumIsValid = true;
+    m_bins_above_threshold.clear();
+    m_maximumbins.clear();  // obsolete?
+    m_maxima_found = 0;
+    m_maximumBin = -1;
+    m_maximum = 0;
+    m_maximumIsValid = true;
 }
 
-void MuonHoughHisto2D::findMaxima(int printlevel, bool which_segment)
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughHisto2D::findMaxima");
-  m_maximumbins.clear(); // clear old m_maxima_vector and start searching again
-
-  int maximum_number=0;
-  
-  while (maximum_number<m_number_of_maxima)
-    {
-      double maximum=-1.;
-      int maxbin=-1;
-      
-      if (printlevel>=3 || log.level()<=MSG::DEBUG){log << MSG::DEBUG << "MuonHoughHisto2D::size bins above threshold: " << m_bins_above_threshold.size() <<endmsg;}
-      
-      std::set<int>::iterator it = m_bins_above_threshold.begin();
-      std::set<int>::iterator it_end = m_bins_above_threshold.end();
-      for (; it!=it_end; ++it)
-	{
-	  if ( !checkIfMaximumAlreadyUsed(*it)){
-	    checkIfMaximum(*it,maximum,maxbin,which_segment,printlevel); // call by ref
-	  }
-	}
-      
-      if (maximum < m_threshold)
-	{
-	  if (printlevel>=2 || log.level()<=MSG::INFO)
-	    {
-	      log << MSG::INFO << "MuonHoughHisto2D:: no maximum found" << endmsg; 
-	    }
-	  break;
-	}
-      else 
-	{
-	  if (printlevel>=2 || log.level()<=MSG::INFO)
-	    {
-	      std::pair <double,double> coords;
-	      coords = binnumberToCoords(maxbin);
-	      log << MSG::INFO << "MuonHoughHisto2D:: Maximum found: " << maximum <<  " binnumber: "<< maxbin <<  " R (z) " << coords.first << " angle " << coords.second << endmsg;
-	    }
-	  m_maximumbins.push_back(maxbin);
-	} // maxbin <> m_threshold
-
-      if (printlevel>=10 || log.level()<=MSG::VERBOSE)
-	{   
-	  if (maximum==-1.)
-	    {
-	      log << MSG::VERBOSE  << "MuonHoughHisto2D::No Bins Above Threshold" << endmsg;
-	    }
-	  else
-	    {
-	      std::pair <double,double> coords;
-	      coords = binnumberToCoords(maxbin);
-	      log << MSG::VERBOSE  << "MuonHoughHisto2D::Maximum Number: " << maximum_number << " Maximum: " << maximum << " binnumber: " << maxbin << " x: " << coords.first << " y: " << coords.second <<endmsg;
-	    }
-	} // printlevel 
-
-      maximum_number++;
-    }//number_of_maxima
-  
-  m_maxima_found=1;
+void MuonHoughHisto2D::findMaxima(int printlevel, bool which_segment) {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughHisto2D::findMaxima");
+    m_maximumbins.clear();  // clear old m_maxima_vector and start searching again
+
+    int maximum_number = 0;
+
+    while (maximum_number < m_number_of_maxima) {
+        double maximum = -1.;
+        int maxbin = -1;
+
+        if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+            log << MSG::DEBUG << "MuonHoughHisto2D::size bins above threshold: " << m_bins_above_threshold.size() << endmsg;
+        }
+
+        std::set<int>::iterator it = m_bins_above_threshold.begin();
+        std::set<int>::iterator it_end = m_bins_above_threshold.end();
+        for (; it != it_end; ++it) {
+            if (!checkIfMaximumAlreadyUsed(*it)) {
+                checkIfMaximum(*it, maximum, maxbin, which_segment, printlevel);  // call by ref
+            }
+        }
+
+        if (maximum < m_threshold) {
+            if (printlevel >= 2 || log.level() <= MSG::INFO) { log << MSG::INFO << "MuonHoughHisto2D:: no maximum found" << endmsg; }
+            break;
+        } else {
+            if (printlevel >= 2 || log.level() <= MSG::INFO) {
+                std::pair<double, double> coords;
+                coords = binnumberToCoords(maxbin);
+                log << MSG::INFO << "MuonHoughHisto2D:: Maximum found: " << maximum << " binnumber: " << maxbin << " R (z) " << coords.first
+                    << " angle " << coords.second << endmsg;
+            }
+            m_maximumbins.push_back(maxbin);
+        }  // maxbin <> m_threshold
+
+        if (printlevel >= 10 || log.level() <= MSG::VERBOSE) {
+            if (maximum == -1.) {
+                log << MSG::VERBOSE << "MuonHoughHisto2D::No Bins Above Threshold" << endmsg;
+            } else {
+                std::pair<double, double> coords;
+                coords = binnumberToCoords(maxbin);
+                log << MSG::VERBOSE << "MuonHoughHisto2D::Maximum Number: " << maximum_number << " Maximum: " << maximum
+                    << " binnumber: " << maxbin << " x: " << coords.first << " y: " << coords.second << endmsg;
+            }
+        }  // printlevel
+
+        maximum_number++;
+    }  // number_of_maxima
+
+    m_maxima_found = 1;
 }
 
-std::pair <int,double> MuonHoughHisto2D::getMax()const
-{
-  std::pair<int,double> maxpair;
-  int maxbin = -1; // convention! for no bin above threshold
-  unsigned int maximum = m_threshold;
-
-  if( m_maximumIsValid ){
-    if( m_maximum > m_threshold){
-      maxbin = m_maximumBin;
-      maximum = m_maximum;
+std::pair<int, double> MuonHoughHisto2D::getMax() const {
+    std::pair<int, double> maxpair;
+    int maxbin = -1;  // convention! for no bin above threshold
+    unsigned int maximum = m_threshold;
+
+    if (m_maximumIsValid) {
+        if (m_maximum > m_threshold) {
+            maxbin = m_maximumBin;
+            maximum = m_maximum;
+        }
+    } else {
+        for (unsigned int i = 0; i < m_size; i++) {
+            if (m_histBuffer[i] > maximum) {
+                maximum = m_histBuffer[i];
+                maxbin = i;
+            }
+        }
     }
-  }else{
-    for (unsigned int i=0; i<m_size; i++) {
-      if (m_histBuffer[i]>maximum) {
-	maximum = m_histBuffer[i];
-	maxbin = i;
-      }
-    }
-  }
-  maxpair.first = maxbin;
-  maxpair.second = maximum;
+    maxpair.first = maxbin;
+    maxpair.second = maximum;
 
-  return maxpair;
+    return maxpair;
 }
 
-std::pair <int,double> MuonHoughHisto2D::getMaximumBin(unsigned int maximum_number,bool which_segment, int printlevel)
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughHisto2D::getMaximumBin");  
-  if (m_maxima_found==0)
-    {
-      findMaxima(printlevel,which_segment); // fills m_maximumbins
+std::pair<int, double> MuonHoughHisto2D::getMaximumBin(unsigned int maximum_number, bool which_segment, int printlevel) {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughHisto2D::getMaximumBin");
+    if (m_maxima_found == 0) {
+        findMaxima(printlevel, which_segment);  // fills m_maximumbins
     }
 
-  int maxbin = -1;
-  double maximum= -1.;
+    int maxbin = -1;
+    double maximum = -1.;
 
-  if (printlevel>=3 || log.level()<=MSG::DEBUG)
-    {
-      log << MSG::VERBOSE << "MuonHoughHisto2D:: m_maximumbins.size: " << m_maximumbins.size() << endmsg;
+    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+        log << MSG::VERBOSE << "MuonHoughHisto2D:: m_maximumbins.size: " << m_maximumbins.size() << endmsg;
     }
 
-  if (m_maximumbins.size() > maximum_number)
-    {
-      maxbin = m_maximumbins[maximum_number];
-      maximum = content_Bin_Area(maxbin);
+    if (m_maximumbins.size() > maximum_number) {
+        maxbin = m_maximumbins[maximum_number];
+        maximum = content_Bin_Area(maxbin);
     }
 
-  std::pair <int ,double> maximumbin (maxbin,maximum); 
+    std::pair<int, double> maximumbin(maxbin, maximum);
 
-  return maximumbin;
+    return maximumbin;
 
-} //getMaximumBin 
+}  // getMaximumBin
 
-std::pair <double, double> MuonHoughHisto2D::getCoordsMaximum(unsigned int maximum_number, bool which_segment, int printlevel)
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughHisto2D::getCoordsMaximum");  
-  std::pair <double,double> coordsmaximum; 
-  int binnumber = getMaxBin(maximum_number,which_segment,printlevel);
-  
-  if (binnumber != -1)
-    {
-      coordsmaximum = binnumberToCoords(binnumber);
-    }
-  else 
-    {
-      if (log.level()<=MSG::WARNING)log << MSG::WARNING << "HoughTransform::No Maximum Found" << endmsg;
-      coordsmaximum.first = 99999.;
-      coordsmaximum.second = 99999.;
+std::pair<double, double> MuonHoughHisto2D::getCoordsMaximum(unsigned int maximum_number, bool which_segment, int printlevel) {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughHisto2D::getCoordsMaximum");
+    std::pair<double, double> coordsmaximum;
+    int binnumber = getMaxBin(maximum_number, which_segment, printlevel);
+
+    if (binnumber != -1) {
+        coordsmaximum = binnumberToCoords(binnumber);
+    } else {
+        if (log.level() <= MSG::WARNING) log << MSG::WARNING << "HoughTransform::No Maximum Found" << endmsg;
+        coordsmaximum.first = 99999.;
+        coordsmaximum.second = 99999.;
     }
-  return coordsmaximum;
+    return coordsmaximum;
 }
 
-bool MuonHoughHisto2D::checkIfMaximumAlreadyUsed(int binnumber)const
-{
-  bool check=false;
-  
-  for (unsigned int i=0; i<m_maximumbins.size(); i++)
-    {
-      if (distanceBins(binnumber,m_maximumbins[i]) < m_distance_to_next_maximum)
-	{
-	  check = true;
-	  return check;
-	}
+bool MuonHoughHisto2D::checkIfMaximumAlreadyUsed(int binnumber) const {
+    bool check = false;
+
+    for (unsigned int i = 0; i < m_maximumbins.size(); i++) {
+        if (distanceBins(binnumber, m_maximumbins[i]) < m_distance_to_next_maximum) {
+            check = true;
+            return check;
+        }
     }
-  
-  return check;
+
+    return check;
 }
 
-bool MuonHoughHisto2D::checkIfMaximum(int binnumber,double &maximum,int &maxbin,bool which_segment,int printlevel)const
-{
-  bool check=false;
-  printlevel+=0;
-  which_segment+=0;
-
-  double content_bin_area=content_Bin_Area(binnumber); // now no area anymore == getBinContent
-  
-  // when using negative weights the following can happen:
-  if (content_bin_area < m_threshold ) return check;
- 
-  if (content_bin_area==maximum)
-    {
-      if (getBinContent(maxbin) > getBinContent(binnumber)) //give preference to maximum with peak ( _U_ ) 
-	{
-	  check=true;
-	  maximum=content_bin_area;
-	  maxbin=binnumber;
-	}
+bool MuonHoughHisto2D::checkIfMaximum(int binnumber, double& maximum, int& maxbin, bool which_segment, int printlevel) const {
+    bool check = false;
+    printlevel += 0;
+    which_segment += 0;
+
+    double content_bin_area = content_Bin_Area(binnumber);  // now no area anymore == getBinContent
+
+    // when using negative weights the following can happen:
+    if (content_bin_area < m_threshold) return check;
+
+    if (content_bin_area == maximum) {
+        if (getBinContent(maxbin) > getBinContent(binnumber))  // give preference to maximum with peak ( _U_ )
+        {
+            check = true;
+            maximum = content_bin_area;
+            maxbin = binnumber;
+        }
+    } else if (content_bin_area > maximum) {
+        check = true;
+        maximum = content_bin_area;
+        maxbin = binnumber;
     }
-  else if (content_bin_area>maximum)
-    {
-      check = true;
-      maximum=content_bin_area;
-      maxbin=binnumber;
-    }
-  return check;
-} //checkIfMaximum
+    return check;
+}  // checkIfMaximum
 
-int MuonHoughHisto2D::distanceBins(int binnumber1,int binnumber2)const
-{
-  int binnumberdistance = std::abs (binnumber1-binnumber2);
+int MuonHoughHisto2D::distanceBins(int binnumber1, int binnumber2) const {
+    int binnumberdistance = std::abs(binnumber1 - binnumber2);
 
-  // Manhattan metric:
-  int distance = (binnumberdistance%m_nbinsx_plus2)+(binnumberdistance/m_nbinsx_plus2);
+    // Manhattan metric:
+    int distance = (binnumberdistance % m_nbinsx_plus2) + (binnumberdistance / m_nbinsx_plus2);
 
-  return distance;
+    return distance;
 }
 
-std::pair <double,double> MuonHoughHisto2D::binnumberToCoords(int binnumber, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughHisto2D::binnumberToCoords");  
-  std::pair <double,double> coordsbin;
-  if (binnumber < 0) 
-    {
-      if (log.level()<=MSG::WARNING)log << MSG::WARNING << "MuonHoughHisto2D::ERROR: negativebinnumber: " << binnumber  << endmsg;   
-      coordsbin.first=99999.;
-      coordsbin.second=99999.;
-      return coordsbin;
+std::pair<double, double> MuonHoughHisto2D::binnumberToCoords(int binnumber, int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughHisto2D::binnumberToCoords");
+    std::pair<double, double> coordsbin;
+    if (binnumber < 0) {
+        if (log.level() <= MSG::WARNING) log << MSG::WARNING << "MuonHoughHisto2D::ERROR: negativebinnumber: " << binnumber << endmsg;
+        coordsbin.first = 99999.;
+        coordsbin.second = 99999.;
+        return coordsbin;
     }
-  
-  double xcoord = binnumberToXCoord(binnumber);
-  double ycoord = binnumberToYCoord(binnumber);
-  
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE){log << MSG::VERBOSE << "MuonHoughHisto2D::Maximum: " << getBinContent(binnumber) << " binnumber: " << binnumber << " x: " << xcoord << " y: " << ycoord <<endmsg;}
-
-  coordsbin.first = xcoord;
-  coordsbin.second = ycoord;
-  return coordsbin;
-}
 
-int MuonHoughHisto2D::binInHistogram(unsigned int binnumber)const
-{
-  int bininhisto=0;
+    double xcoord = binnumberToXCoord(binnumber);
+    double ycoord = binnumberToYCoord(binnumber);
 
-  if ((binnumber)%m_nbinsx_plus2==0) {bininhisto=1;}
-  else if ((binnumber+1)%m_nbinsx_plus2==0) {bininhisto=2;}
-  else if (binnumber <= m_nbinsx_plus2){bininhisto=3;}
-  else if (binnumber>=m_nbinsx_plus2*(getNbinsY()+1)){bininhisto=4;}
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "MuonHoughHisto2D::Maximum: " << getBinContent(binnumber) << " binnumber: " << binnumber << " x: " << xcoord
+            << " y: " << ycoord << endmsg;
+    }
 
-  return bininhisto;
+    coordsbin.first = xcoord;
+    coordsbin.second = ycoord;
+    return coordsbin;
 }
 
-TH2F* MuonHoughHisto2D::bookAndFillRootHistogram(const std::string& hname)const
-{
-  TH2F* histogram =  new TH2F(hname.c_str(),hname.c_str(),m_nbinsx,m_xmin,m_xmax,m_nbinsy,m_ymin,m_ymax);
-  for (unsigned int i=0; i<m_size; i++)
-    {      
-      int ix = i%m_nbinsx_plus2;
-      int iy = i/m_nbinsx_plus2;
-      histogram->SetBinContent(ix,iy,m_histBuffer[i]/(double)m_scale);
+int MuonHoughHisto2D::binInHistogram(unsigned int binnumber) const {
+    int bininhisto = 0;
+
+    if ((binnumber) % m_nbinsx_plus2 == 0) {
+        bininhisto = 1;
+    } else if ((binnumber + 1) % m_nbinsx_plus2 == 0) {
+        bininhisto = 2;
+    } else if (binnumber <= m_nbinsx_plus2) {
+        bininhisto = 3;
+    } else if (binnumber >= m_nbinsx_plus2 * (getNbinsY() + 1)) {
+        bininhisto = 4;
     }
-  return histogram;
+
+    return bininhisto;
 }
 
+TH2F* MuonHoughHisto2D::bookAndFillRootHistogram(const std::string& hname) const {
+    TH2F* histogram = new TH2F(hname.c_str(), hname.c_str(), m_nbinsx, m_xmin, m_xmax, m_nbinsy, m_ymin, m_ymax);
+    for (unsigned int i = 0; i < m_size; i++) {
+        int ix = i % m_nbinsx_plus2;
+        int iy = i / m_nbinsx_plus2;
+        histogram->SetBinContent(ix, iy, m_histBuffer[i] / (double)m_scale);
+    }
+    return histogram;
+}
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2DContainer.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2DContainer.cxx
index 21e85fb2e8876a3cbfa65f0336a35444f944bb27..0c6a7a698c07d2c1977bb7f6629047d2d4f56480 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2DContainer.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHisto2DContainer.cxx
@@ -3,44 +3,40 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughHisto2DContainer.h"
-#include "GaudiKernel/MsgStream.h"
+
 #include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
 
-MuonHoughHisto2DContainer::MuonHoughHisto2DContainer()
-{
-}
+MuonHoughHisto2DContainer::MuonHoughHisto2DContainer() {}
 
-std::pair <int,int> MuonHoughHisto2DContainer::getMaximumBinnumber(unsigned int maximum_number,bool which_segment,int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughHisto2DContainer::getMaximumBinnumber");
-  // does only work for maximum_number==0!
-  if (maximum_number!=0)
-    {
-      if(log.level()<=MSG::WARNING)log << MSG::WARNING << "WARNING: possibly maximum taken which is not " << maximum_number+1 << "rd maximum" << endmsg; 
+std::pair<int, int> MuonHoughHisto2DContainer::getMaximumBinnumber(unsigned int maximum_number, bool which_segment, int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughHisto2DContainer::getMaximumBinnumber");
+    // does only work for maximum_number==0!
+    if (maximum_number != 0) {
+        if (log.level() <= MSG::WARNING)
+            log << MSG::WARNING << "WARNING: possibly maximum taken which is not " << maximum_number + 1 << "rd maximum" << endmsg;
     }
 
-  double maximum = 0.;
-  int maxid = -1;
-  int maxbin = -1;
+    double maximum = 0.;
+    int maxid = -1;
+    int maxbin = -1;
 
-  for (int histoid=0; histoid<size(); histoid++)
-    {
-      std::pair <int, double> histomax = getHisto(histoid)->getMaximumBin(0,which_segment,printlevel); // binnumber and value of the area of the bin
+    for (int histoid = 0; histoid < size(); histoid++) {
+        std::pair<int, double> histomax =
+            getHisto(histoid)->getMaximumBin(0, which_segment, printlevel);  // binnumber and value of the area of the bin
 
-      if (histomax.second > maximum) { maximum = histomax.second; maxid = histoid; maxbin = histomax.first;}
-      
+        if (histomax.second > maximum) {
+            maximum = histomax.second;
+            maxid = histoid;
+            maxbin = histomax.first;
+        }
     }
 
-  std::pair <int,int> coordsmaximum (maxid, maxbin);
+    std::pair<int, int> coordsmaximum(maxid, maxbin);
 
-  return coordsmaximum;
-  
+    return coordsmaximum;
 }
 
-void MuonHoughHisto2DContainer::reset() const
-{
-  for (int histoid=0; histoid<size(); histoid++)
-    {
-      getHisto(histoid)->reset();
-    }
+void MuonHoughHisto2DContainer::reset() const {
+    for (int histoid = 0; histoid < size(); histoid++) { getHisto(histoid)->reset(); }
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHit.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHit.cxx
index 27407c1548eefe263350228f4c879111807959ea..cd8b07fd473493f153d5354a440fa37dfe297129 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHit.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHit.cxx
@@ -3,145 +3,130 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughHit.h"
+
+#include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
 #include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
+#include "TrkDetElementBase/TrkDetElementBase.h"
 #include "TrkPrepRawData/PrepRawData.h"
-
-#include "TrkDetElementBase/TrkDetElementBase.h"  
 #include "TrkSurfaces/Surface.h"
-#include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
 
-MuonHoughHit::MuonHoughHit(const Trk::PrepRawData* prd):m_orig_weight(1.)
-{
-  const Trk::TrkDetElementBase* element = prd->detectorElement();
-  const Identifier identifier  = prd->identify();
+MuonHoughHit::MuonHoughHit(const Trk::PrepRawData* prd) : m_orig_weight(1.) {
+    const Trk::TrkDetElementBase* element = prd->detectorElement();
+    const Identifier identifier = prd->identify();
+
+    const Amg::Vector3D globalpos = element->surface(identifier).Trk::Surface::localToGlobal(prd->localPosition());
 
-  const Amg::Vector3D globalpos = element->surface(identifier).Trk::Surface::localToGlobal(prd->localPosition());
-  
-  m_hitx = globalpos.x(); // does this what i expect?
-  m_hity = globalpos.y();
-  m_hitz = globalpos.z();
+    m_hitx = globalpos.x();  // does this what i expect?
+    m_hity = globalpos.y();
+    m_hitz = globalpos.z();
 
+    double hitr2 = m_hitx * m_hitx + m_hity * m_hity;
+    m_radius = std::sqrt(hitr2);
+    m_abs = std::sqrt(hitr2 + m_hitz * m_hitz);
+    m_theta = std::atan2(m_radius, m_hitz);
+    m_phi = std::atan2(m_hity, m_hitx);
+    m_barrel = (std::abs(m_radius / m_hitz) < MuonHough::tan_barrel) ? 0 : 1;
 
-  double hitr2 = m_hitx*m_hitx+m_hity*m_hity;
-  m_radius = std::sqrt(hitr2);
-  m_abs = std::sqrt(hitr2+m_hitz*m_hitz);
-  m_theta = std::atan2(m_radius,m_hitz); 
-  m_phi = std::atan2(m_hity,m_hitx);
-  m_barrel = (std::abs(m_radius/m_hitz)<MuonHough::tan_barrel) ? 0 : 1;
-  
-  m_phi_sector = calcPhiSector();
-  m_magnetic_trackratio = calcMagneticTrackRatio();
-  
-  m_prd = prd;
+    m_phi_sector = calcPhiSector();
+    m_magnetic_trackratio = calcMagneticTrackRatio();
 
-  m_weight = 1;
-  m_probability = 1;
-  m_associated = false;
-  m_id = -1;
+    m_prd = prd;
 
-  m_detector_id = MuonHough::MDT;
+    m_weight = 1;
+    m_probability = 1;
+    m_associated = false;
+    m_id = -1;
 
-  m_measures_phi = false;
+    m_detector_id = MuonHough::MDT;
 
+    m_measures_phi = false;
 }
 
-MuonHoughHit::MuonHoughHit(double x, double y, double z, bool measures_phi, MuonHough::DetectorTechnology detector_id, double prob, double weight, const Trk::PrepRawData* prd, int id):m_orig_weight(weight)
-{
-  m_detector_id=detector_id;
-  m_measures_phi=measures_phi;
-  m_hitx=x;
-  m_hity=y;
-  m_hitz=z;
-  m_probability = prob;
-  m_weight = weight;
-  m_prd = prd;
-  m_associated = false;
-  m_id = id;
-
-  double hitr2 = m_hitx*m_hitx+m_hity*m_hity;
-  m_radius = std::sqrt(hitr2);
-  m_abs = std::sqrt(hitr2+m_hitz*m_hitz);
-  m_theta = std::atan2(m_radius,m_hitz); 
-  m_phi = std::atan2(m_hity,m_hitx);
-  m_barrel = (std::abs(m_radius/m_hitz)<MuonHough::tan_barrel) ? 0 : 1;
-  m_phi_sector = calcPhiSector();
-  m_magnetic_trackratio = calcMagneticTrackRatio();
+MuonHoughHit::MuonHoughHit(double x, double y, double z, bool measures_phi, MuonHough::DetectorTechnology detector_id, double prob,
+                           double weight, const Trk::PrepRawData* prd, int id) :
+    m_orig_weight(weight) {
+    m_detector_id = detector_id;
+    m_measures_phi = measures_phi;
+    m_hitx = x;
+    m_hity = y;
+    m_hitz = z;
+    m_probability = prob;
+    m_weight = weight;
+    m_prd = prd;
+    m_associated = false;
+    m_id = id;
+
+    double hitr2 = m_hitx * m_hitx + m_hity * m_hity;
+    m_radius = std::sqrt(hitr2);
+    m_abs = std::sqrt(hitr2 + m_hitz * m_hitz);
+    m_theta = std::atan2(m_radius, m_hitz);
+    m_phi = std::atan2(m_hity, m_hitx);
+    m_barrel = (std::abs(m_radius / m_hitz) < MuonHough::tan_barrel) ? 0 : 1;
+    m_phi_sector = calcPhiSector();
+    m_magnetic_trackratio = calcMagneticTrackRatio();
 }
 
-std::string MuonHoughHit::getWhichDetector()const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughHit::getWhichDetector");
-  std::string detector_name;
-  switch (m_detector_id)
-    {
-    case MuonHough::MDT:
-      detector_name="MDT";
-      break;
-    case MuonHough::CSC:
-      detector_name="CSC";
-      break;
-    case MuonHough::RPC:
-      detector_name="RPC";
-      break;
-    case MuonHough::TGC:
-      detector_name="TGC";
-      break;
-    default: if(log.level()<=MSG::WARNING) log << MSG::WARNING << "MuonHoughHit:: no valid detector_id" << endmsg;
+std::string MuonHoughHit::getWhichDetector() const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughHit::getWhichDetector");
+    std::string detector_name;
+    switch (m_detector_id) {
+        case MuonHough::MDT: detector_name = "MDT"; break;
+        case MuonHough::CSC: detector_name = "CSC"; break;
+        case MuonHough::RPC: detector_name = "RPC"; break;
+        case MuonHough::TGC: detector_name = "TGC"; break;
+        default:
+            if (log.level() <= MSG::WARNING) log << MSG::WARNING << "MuonHoughHit:: no valid detector_id" << endmsg;
     }
-  return detector_name;
+    return detector_name;
 }
 
-std::vector <double> MuonHoughHit::getPosition()const
-{
-  std::vector <double> position(3);
-  position[0]=m_hitx;
-  position[1]=m_hity;
-  position[2]=m_hitz;
+std::vector<double> MuonHoughHit::getPosition() const {
+    std::vector<double> position(3);
+    position[0] = m_hitx;
+    position[1] = m_hity;
+    position[2] = m_hitz;
 
-  return position;
+    return position;
 }
 
-int MuonHoughHit::calcPhiSector()const
-{
-  double phi = m_phi; // [-Pi , Pi]
-  phi += MuonHough::half_phisector;
+int MuonHoughHit::calcPhiSector() const {
+    double phi = m_phi;  // [-Pi , Pi]
+    phi += MuonHough::half_phisector;
 
-  if(phi<0) phi += MuonHough::two_Pi;  // [ 0 , 2*Pi ]
-  int sectorhit = static_cast<int> (phi / (2*MuonHough::half_phisector)) ; // 0..15
-  if (sectorhit == MuonHough::phisectors) sectorhit += -1; // could happen in rare cases
-  return sectorhit;
+    if (phi < 0) phi += MuonHough::two_Pi;                                    // [ 0 , 2*Pi ]
+    int sectorhit = static_cast<int>(phi / (2 * MuonHough::half_phisector));  // 0..15
+    if (sectorhit == MuonHough::phisectors) sectorhit += -1;                  // could happen in rare cases
+    return sectorhit;
 }
 
-double MuonHoughHit::calcMagneticTrackRatio()const
-{
-  // for formulas see muonhoughmathutils, only here for cpu improvements
-  double magnetic_trk_ratio = 0.;
+double MuonHoughHit::calcMagneticTrackRatio() const {
+    // for formulas see muonhoughmathutils, only here for cpu improvements
+    double magnetic_trk_ratio = 0.;
 
-  if (m_barrel) {
-    
-    // Barrel hypothesis
+    if (m_barrel) {
+        // Barrel hypothesis
 
-    if ( m_radius >= MuonHough::radius_cylinder) {
-      double diff_b = m_radius-MuonHough::radius_cylinder;
-      magnetic_trk_ratio = diff_b*diff_b/m_abs;
-    }
-  }
-  else {
-    int sign = 1;
-    if (m_hitz < 0) sign = -1;
-    // Endcap hypothesis
-    if (std::abs(m_hitz) < MuonHough::z_cylinder) {magnetic_trk_ratio = 0.;}
-    else if (std::abs(m_hitz) < MuonHough::z_end) {
-      // Inside Toroid
-      double diff_e = m_hitz-sign*MuonHough::z_cylinder; 
-      magnetic_trk_ratio = diff_e*diff_e/m_abs;
-      
+        if (m_radius >= MuonHough::radius_cylinder) {
+            double diff_b = m_radius - MuonHough::radius_cylinder;
+            magnetic_trk_ratio = diff_b * diff_b / m_abs;
+        }
     } else {
-      // Outside Toroid
-      magnetic_trk_ratio = (-MuonHough::z_magnetic_range_squared + sign*2*m_hitz*MuonHough::z_magnetic_range)/m_abs;
+        int sign = 1;
+        if (m_hitz < 0) sign = -1;
+        // Endcap hypothesis
+        if (std::abs(m_hitz) < MuonHough::z_cylinder) {
+            magnetic_trk_ratio = 0.;
+        } else if (std::abs(m_hitz) < MuonHough::z_end) {
+            // Inside Toroid
+            double diff_e = m_hitz - sign * MuonHough::z_cylinder;
+            magnetic_trk_ratio = diff_e * diff_e / m_abs;
+
+        } else {
+            // Outside Toroid
+            magnetic_trk_ratio = (-MuonHough::z_magnetic_range_squared + sign * 2 * m_hitz * MuonHough::z_magnetic_range) / m_abs;
+        }
     }
-  }
-  
-  return magnetic_trk_ratio;
+
+    return magnetic_trk_ratio;
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHitContainer.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHitContainer.cxx
index 93760559ceee338dd51b787a75e1409e9469749e..3aafb2a1c074a7b802163370b26ea4cc28f92d4e 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHitContainer.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughHitContainer.cxx
@@ -4,101 +4,70 @@
 
 #include "MuonHoughPatternEvent/MuonHoughHitContainer.h"
 
-MuonHoughHitContainer::MuonHoughHitContainer(bool ownhits):m_ownhits(ownhits)
-{ 
-  //  std::cout << "Constructor MuonHoughHitContainer" << std::endl;
+MuonHoughHitContainer::MuonHoughHitContainer(bool ownhits) : m_ownhits(ownhits) {
+    //  std::cout << "Constructor MuonHoughHitContainer" << std::endl;
 }
 
-MuonHoughHitContainer::~MuonHoughHitContainer()
-{
-  //  std::cout << "Destructor MuonHoughHitContainer" << std::endl;
+MuonHoughHitContainer::~MuonHoughHitContainer() {
+    //  std::cout << "Destructor MuonHoughHitContainer" << std::endl;
 
-  if (m_ownhits) {
-    for (unsigned int i=0; i<m_hit.size(); i++) {
-      delete m_hit[i];
-      m_hit[i]=nullptr;
+    if (m_ownhits) {
+        for (unsigned int i = 0; i < m_hit.size(); i++) {
+            delete m_hit[i];
+            m_hit[i] = nullptr;
+        }
     }
-  }
-  
-  m_hit.clear();
+
+    m_hit.clear();
 }
 
-void MuonHoughHitContainer::addHit(MuonHoughHit* hit)
-{
-  if (hit->getId() == -1) {hit->setId(size());}
-  m_hit.push_back(hit);
+void MuonHoughHitContainer::addHit(MuonHoughHit* hit) {
+    if (hit->getId() == -1) { hit->setId(size()); }
+    m_hit.push_back(hit);
 }
 
-void MuonHoughHitContainer::removeHit(int hitno)
-{
-  if (hitno<0 || hitno>=(int)m_hit.size()) {throw "MuonHoughHitContainer::range error!";}
-  if (m_ownhits) {
-    delete m_hit[hitno];
-  }
-  m_hit.erase(m_hit.begin()+hitno);
+void MuonHoughHitContainer::removeHit(int hitno) {
+    if (hitno < 0 || hitno >= (int)m_hit.size()) { throw "MuonHoughHitContainer::range error!"; }
+    if (m_ownhits) { delete m_hit[hitno]; }
+    m_hit.erase(m_hit.begin() + hitno);
 }
 
-int MuonHoughHitContainer::getRPChitno()const
-{
-  int rpchitno=0;
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      if (getDetectorId(i)==MuonHough::RPC)
-	{
-	  rpchitno++;
-	}
+int MuonHoughHitContainer::getRPChitno() const {
+    int rpchitno = 0;
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        if (getDetectorId(i) == MuonHough::RPC) { rpchitno++; }
     }
-  return rpchitno;
+    return rpchitno;
 }
 
-int MuonHoughHitContainer::getMDThitno()const
-{
-  int mdthitno=0;
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      if (getDetectorId(i)==MuonHough::MDT)
-	{
-	  mdthitno++;
-	}
+int MuonHoughHitContainer::getMDThitno() const {
+    int mdthitno = 0;
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        if (getDetectorId(i) == MuonHough::MDT) { mdthitno++; }
     }
-  return mdthitno;
+    return mdthitno;
 }
 
-int MuonHoughHitContainer::getRPCetahitno()const
-{
-  int rpchitno=0;
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      if (getDetectorId(i)==MuonHough::RPC && getMeasuresPhi(i)==0)
-	{
-	  rpchitno++;
-	}
+int MuonHoughHitContainer::getRPCetahitno() const {
+    int rpchitno = 0;
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        if (getDetectorId(i) == MuonHough::RPC && getMeasuresPhi(i) == 0) { rpchitno++; }
     }
-  return rpchitno;
+    return rpchitno;
 }
 
-int MuonHoughHitContainer::getCSChitno()const
-{
-  int cschitno=0;
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      if (getDetectorId(i)==MuonHough::CSC)
-	{
-	  cschitno++;
-	}
+int MuonHoughHitContainer::getCSChitno() const {
+    int cschitno = 0;
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        if (getDetectorId(i) == MuonHough::CSC) { cschitno++; }
     }
-  return cschitno;
+    return cschitno;
 }
 
-int MuonHoughHitContainer::getTGChitno()const
-{
-  int tgchitno=0;
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      if (getDetectorId(i)==MuonHough::TGC)
-	{
-	  tgchitno++;
-	}
+int MuonHoughHitContainer::getTGChitno() const {
+    int tgchitno = 0;
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        if (getDetectorId(i) == MuonHough::TGC) { tgchitno++; }
     }
-  return tgchitno;
+    return tgchitno;
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughMathUtils.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughMathUtils.cxx
index 8534e8603ef160fbd3e8ad11074c452fe6e04bba..52eb3a829470e013a1be22f480f6b0d25a0bb450 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughMathUtils.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughMathUtils.cxx
@@ -3,420 +3,404 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughMathUtils.h"
-#include "CxxUtils/sincos.h"
 
-#include <sstream>
-#include <iostream>
 #include <cassert>
-#include "GaudiKernel/MsgStream.h"
+#include <iostream>
+#include <sstream>
+
 #include "AthenaKernel/getMessageSvc.h"
+#include "CxxUtils/sincos.h"
+#include "GaudiKernel/MsgStream.h"
 
-MuonHoughMathUtils::MuonHoughMathUtils()
-{
-}
+MuonHoughMathUtils::MuonHoughMathUtils() {}
 
-int MuonHoughMathUtils::sgn(double d)
-{
-  if (d<0) {return -1;}
-  //  if (d==0) {return 0;} //i know, its the definition, but we dont want it
-  if (d>=0) {return 1;}
-  return 666;
+int MuonHoughMathUtils::sgn(double d) {
+    if (d < 0) { return -1; }
+    //  if (d==0) {return 0;} //i know, its the definition, but we dont want it
+    if (d >= 0) { return 1; }
+    return 666;
 }
 
-int MuonHoughMathUtils::step(double d, double x0)
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughMathUtils::step");
-  if (d==x0) {if (log.level()<=MSG::WARNING) log << MSG::WARNING << "WARNING: Possible mistake in Step function" << endmsg;}
-  if (d<=x0) {return 0;}
-  if (d>x0) {return 1;}
-  return -1;
+int MuonHoughMathUtils::step(double d, double x0) {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughMathUtils::step");
+    if (d == x0) {
+        if (log.level() <= MSG::WARNING) log << MSG::WARNING << "WARNING: Possible mistake in Step function" << endmsg;
+    }
+    if (d <= x0) { return 0; }
+    if (d > x0) { return 1; }
+    return -1;
 }
 
-double MuonHoughMathUtils::signedDistanceToLine(double x0, double y0, double r0, double phi) //distance from (x0,y0) to the line (r0,phi) , phi in [-Pi,Pi] ,different phi than in calculateangle() (==angle(2))
+double MuonHoughMathUtils::signedDistanceToLine(
+    double x0, double y0, double r0,
+    double phi)  // distance from (x0,y0) to the line (r0,phi) , phi in [-Pi,Pi] ,different phi than in calculateangle() (==angle(2))
 {
-  CxxUtils::sincos scphi(phi);
-  double distance = scphi.apply(x0,-y0) - r0;
-  return distance;
+    CxxUtils::sincos scphi(phi);
+    double distance = scphi.apply(x0, -y0) - r0;
+    return distance;
 }
 
-double MuonHoughMathUtils::distanceToLine(double x0,  double y0, double r0, double phi)
-{
-  return std::abs(signedDistanceToLine(x0,y0,r0,phi));
+double MuonHoughMathUtils::distanceToLine(double x0, double y0, double r0, double phi) {
+    return std::abs(signedDistanceToLine(x0, y0, r0, phi));
 }
 
-double MuonHoughMathUtils::incrementTillAbove0(double x, double inc, double zero)
-{
-  while(x > inc + zero ) 
-    {x-=inc;}
-  while(x < zero )
-    {x+=inc;}
-  return x;
+double MuonHoughMathUtils::incrementTillAbove0(double x, double inc, double zero) {
+    while (x > inc + zero) { x -= inc; }
+    while (x < zero) { x += inc; }
+    return x;
 }
 
-double MuonHoughMathUtils::angleFrom0To360(double angle)
-{
-  return incrementTillAbove0(angle,360.);
-}
+double MuonHoughMathUtils::angleFrom0To360(double angle) { return incrementTillAbove0(angle, 360.); }
 
-double MuonHoughMathUtils::angleFrom0To180(double angle)
-{
-  return incrementTillAbove0(angle,180.);
-}
+double MuonHoughMathUtils::angleFrom0To180(double angle) { return incrementTillAbove0(angle, 180.); }
 
-double MuonHoughMathUtils::angleFrom0ToPi(double angle)
-{
-  return incrementTillAbove0(angle,M_PI);
-}
+double MuonHoughMathUtils::angleFrom0ToPi(double angle) { return incrementTillAbove0(angle, M_PI); }
 
-double MuonHoughMathUtils::angleFromMinusPiToPi(double angle)
-{
-  return incrementTillAbove0(angle,2*M_PI,-M_PI);
-}
+double MuonHoughMathUtils::angleFromMinusPiToPi(double angle) { return incrementTillAbove0(angle, 2 * M_PI, -M_PI); }
 
-std::string MuonHoughMathUtils::intToString(int i)
-{
-  std::string s;
-  std::stringstream ss;
-  ss << i;
-  ss >> s;
+std::string MuonHoughMathUtils::intToString(int i) {
+    std::string s;
+    std::stringstream ss;
+    ss << i;
+    ss >> s;
 
-  return s;
+    return s;
 }
 
-const char * MuonHoughMathUtils::stringToChar(std::string& string)
-{
-  const char * constcharstar = string.data();
-  return constcharstar;
+const char* MuonHoughMathUtils::stringToChar(std::string& string) {
+    const char* constcharstar = string.data();
+    return constcharstar;
 }
 
-const char * MuonHoughMathUtils::intToChar(int i)
-{
-  std::string string = intToString(i);
-  const char * constcharstar = stringToChar(string);
-  return constcharstar;
+const char* MuonHoughMathUtils::intToChar(int i) {
+    std::string string = intToString(i);
+    const char* constcharstar = stringToChar(string);
+    return constcharstar;
 }
 
-double MuonHoughMathUtils::distanceToLine2D(double x0, double y0, double r0, double phi)const // distance from (x0,y0) to line (r,phi) // from mathworld.wolfram.com/Point-LineDistance2-Dimensional.html // better to use distancetoline() 
+double MuonHoughMathUtils::distanceToLine2D(double x0, double y0, double r0, double phi)
+    const  // distance from (x0,y0) to line (r,phi) // from mathworld.wolfram.com/Point-LineDistance2-Dimensional.html // better to use
+           // distancetoline()
 {
-  // need two points on line:
-  
-  CxxUtils::sincos scphi(phi);
-
-  double x1 = - r0 * scphi.sn; // point closest to origin
-  double y1 = r0 * scphi.cs;
-
-  std::vector <double> v(3); // (p1 - p0)
-  
-  v[0] = x1-x0;
-  v[1] = y1-y0;
-
-  std::vector <double> r(3); // vector perpendicular to line
-  
-  r[0] = x1; 
-  r[1] = y1;
-
-  double distance = dotProduct(r,v)/abs(r);
-  
-  return distance;
-}
+    // need two points on line:
 
-double MuonHoughMathUtils::distanceToLine3D(double x0,double y0,double z0, double x, double y, double z, double phi, double theta) // from wolfram: http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
-{
-  std::vector <double> x1(3); // x1-x0
-  std::vector <double> x3(3); // x2-x1 = e_r
+    CxxUtils::sincos scphi(phi);
+
+    double x1 = -r0 * scphi.sn;  // point closest to origin
+    double y1 = r0 * scphi.cs;
+
+    std::vector<double> v(3);  // (p1 - p0)
 
-  x1[0]=x-x0;
-  x1[1]=y-y0;
-  x1[2]=z-z0;
+    v[0] = x1 - x0;
+    v[1] = y1 - y0;
 
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
+    std::vector<double> r(3);  // vector perpendicular to line
 
-  x3[0]= scphi.cs*sctheta.sn;
-  x3[1]= scphi.sn*sctheta.sn;
-  x3[2]= sctheta.cs;
+    r[0] = x1;
+    r[1] = y1;
 
-  // sqrt(x3^2) == 1; !
- 
-  double distance;
-  std::vector<double> x4(3);
-  x4 = crossProduct(x3,x1);
+    double distance = dotProduct(r, v) / abs(r);
 
-  distance = std::sqrt(dotProduct(x4,x4))/(std::sqrt(dotProduct(x3,x3)));
-  
-  return distance;
+    return distance;
 }
 
-double MuonHoughMathUtils::distanceOfLineToOrigin2D(double a, double b)
+double MuonHoughMathUtils::distanceToLine3D(
+    double x0, double y0, double z0, double x, double y, double z, double phi,
+    double theta)  // from wolfram: http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
 {
-  return std::abs(b/(std::sqrt(a*a+1)));
+    std::vector<double> x1(3);  // x1-x0
+    std::vector<double> x3(3);  // x2-x1 = e_r
+
+    x1[0] = x - x0;
+    x1[1] = y - y0;
+    x1[2] = z - z0;
+
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
+
+    x3[0] = scphi.cs * sctheta.sn;
+    x3[1] = scphi.sn * sctheta.sn;
+    x3[2] = sctheta.cs;
+
+    // sqrt(x3^2) == 1; !
+
+    double distance;
+    std::vector<double> x4(3);
+    x4 = crossProduct(x3, x1);
+
+    distance = std::sqrt(dotProduct(x4, x4)) / (std::sqrt(dotProduct(x3, x3)));
+
+    return distance;
 }
 
-double MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(double x, double y, double phi)
-{
-  CxxUtils::sincos scphi(phi);
-  return scphi.apply(x,-y);
+double MuonHoughMathUtils::distanceOfLineToOrigin2D(double a, double b) { return std::abs(b / (std::sqrt(a * a + 1))); }
+
+double MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(double x, double y, double phi) {
+    CxxUtils::sincos scphi(phi);
+    return scphi.apply(x, -y);
 }
 
-std::vector<double> MuonHoughMathUtils::shortestPointOfLineToOrigin3D(double x, double y, double z, double phi, double theta) // actually this is the 3d-point closest to origin in xy-plane
+std::vector<double> MuonHoughMathUtils::shortestPointOfLineToOrigin3D(
+    double x, double y, double z, double phi, double theta)  // actually this is the 3d-point closest to origin in xy-plane
 {
-  std::vector <double> p(3);
+    std::vector<double> p(3);
+
+    double r0 = signedDistanceOfLineToOrigin2D(x, y, phi);
 
-  double r0 = signedDistanceOfLineToOrigin2D(x,y,phi);
+    CxxUtils::sincos scphi(phi);
 
-  CxxUtils::sincos scphi(phi);
+    double x0 = r0 * scphi.sn;
+    double y0 = -r0 * scphi.cs;
 
-  double x0 = r0*scphi.sn;
-  double y0 = -r0* scphi.cs;
+    double radius = std::sqrt((x - x0) * (x - x0) + (y - y0) * (y - y0));
 
-  double radius = std::sqrt((x-x0)*(x-x0)+(y-y0)*(y-y0));
-  
-  if ( std::abs((y-y0) - scphi.sn*radius) > std::abs((y-y0) + scphi.cs*radius) ) // also possible for x
+    if (std::abs((y - y0) - scphi.sn * radius) > std::abs((y - y0) + scphi.cs * radius))  // also possible for x
     {
-      radius=-radius;
+        radius = -radius;
     }
 
-  double z0 = z - radius / std::tan(theta);
-  
-  p[0]=x0;
-  p[1]=y0;
-  p[2]=z0;
+    double z0 = z - radius / std::tan(theta);
 
-  return p;
+    p[0] = x0;
+    p[1] = y0;
+    p[2] = z0;
+
+    return p;
 }
 
-std::vector<double> MuonHoughMathUtils::shortestPointOfLineToOrigin(double x, double y, double z, double phi, double theta) // from wolfram: http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
+std::vector<double> MuonHoughMathUtils::shortestPointOfLineToOrigin(
+    double x, double y, double z, double phi,
+    double theta)  // from wolfram: http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
 {
-  // origin: 
-  std::vector <double> x0(3);
-  x0[0]=0;
-  x0[1]=0;
-  x0[2]=0;
+    // origin:
+    std::vector<double> x0(3);
+    x0[0] = 0;
+    x0[1] = 0;
+    x0[2] = 0;
 
-  std::vector <double> x1(3); // x1-x0
-  std::vector <double> x3(3); // x2-x1
+    std::vector<double> x1(3);  // x1-x0
+    std::vector<double> x3(3);  // x2-x1
 
-  x1[0]=x-x0[0];
-  x1[1]=y-x0[1];
-  x1[2]=z-x0[2];
+    x1[0] = x - x0[0];
+    x1[1] = y - x0[1];
+    x1[2] = z - x0[2];
 
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
 
-  x3[0]= scphi.cs*sctheta.sn;
-  x3[1]= scphi.sn*sctheta.sn;
-  x3[2]= sctheta.cs;
+    x3[0] = scphi.cs * sctheta.sn;
+    x3[1] = scphi.sn * sctheta.sn;
+    x3[2] = sctheta.cs;
 
-  double time=0;
-  double x5=0;
-  x5 = dotProduct(x1,x3);
+    double time = 0;
+    double x5 = 0;
+    x5 = dotProduct(x1, x3);
 
-  time = - x5 / (dotProduct(x3,x3));
+    time = -x5 / (dotProduct(x3, x3));
 
-  std::vector <double> p(3);
+    std::vector<double> p(3);
 
-  p[0]=x1[0]+x3[0]*time;
-  p[1]=x1[1]+x3[1]*time;  
-  p[2]=x1[2]+x3[2]*time;
+    p[0] = x1[0] + x3[0] * time;
+    p[1] = x1[1] + x3[1] * time;
+    p[2] = x1[2] + x3[2] * time;
 
-  return p;
+    return p;
 }
 
-bool MuonHoughMathUtils::lineThroughCylinder(double x_0, double y_0, double z_0, double phi, double theta, double r_cyl, double z_cyl)
-{
-   // if there is one, then track will be split
-  assert(r_cyl>=0);
+bool MuonHoughMathUtils::lineThroughCylinder(double x_0, double y_0, double z_0, double phi, double theta, double r_cyl, double z_cyl) {
+    // if there is one, then track will be split
+    assert(r_cyl >= 0);
 
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-  
-  // 1 -- check if there is an intersection at z0=+-c0
-  double p_1 = z_0 - z_cyl;
-  double p_2 = z_0 + z_cyl;
-  double tantheta = sctheta.sn/sctheta.cs;
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
 
-  double x_1 = x_0 - p_1*scphi.cs*tantheta;
-  double y_1 = y_0 - p_1*scphi.sn*tantheta;
-  double r_1 = std::sqrt(x_1*x_1+y_1*y_1);
-  if (r_1<r_cyl) {return true;}
+    // 1 -- check if there is an intersection at z0=+-c0
+    double p_1 = z_0 - z_cyl;
+    double p_2 = z_0 + z_cyl;
+    double tantheta = sctheta.sn / sctheta.cs;
 
-  double x_2 = x_0 - p_2*scphi.cs*tantheta;
-  double y_2 = y_0 - p_2*scphi.sn*tantheta;
-  double r_2 = std::sqrt(x_2*x_2+y_2*y_2);
-  if (r_2<r_cyl) {return true;}
+    double x_1 = x_0 - p_1 * scphi.cs * tantheta;
+    double y_1 = y_0 - p_1 * scphi.sn * tantheta;
+    double r_1 = std::sqrt(x_1 * x_1 + y_1 * y_1);
+    if (r_1 < r_cyl) { return true; }
 
-  // 2 -- check if there is an intersection with the circle x^2 + y^2 = r_cyl^2 and the line y=px+q, p = tan(phi), q = y_0 - x_0 tan(phi) <--> r_cyl^2 = (px+q)^2 + x^2
-  double r_0 = scphi.apply(-x_0,y_0);
+    double x_2 = x_0 - p_2 * scphi.cs * tantheta;
+    double y_2 = y_0 - p_2 * scphi.sn * tantheta;
+    double r_2 = std::sqrt(x_2 * x_2 + y_2 * y_2);
+    if (r_2 < r_cyl) { return true; }
 
-  if (std::abs(r_0) > r_cyl) return false; 
+    // 2 -- check if there is an intersection with the circle x^2 + y^2 = r_cyl^2 and the line y=px+q, p = tan(phi), q = y_0 - x_0 tan(phi)
+    // <--> r_cyl^2 = (px+q)^2 + x^2
+    double r_0 = scphi.apply(-x_0, y_0);
 
-  // 3 -- check if the intersection is cylinder: for -z_cyl<z<z_cyl
-  double s_1 = - scphi.sn * r_0;
-  double s_2 = scphi.cs * std::sqrt(r_cyl*r_cyl-r_0*r_0);
+    if (std::abs(r_0) > r_cyl) return false;
 
-  x_1 = s_1 + s_2;
+    // 3 -- check if the intersection is cylinder: for -z_cyl<z<z_cyl
+    double s_1 = -scphi.sn * r_0;
+    double s_2 = scphi.cs * std::sqrt(r_cyl * r_cyl - r_0 * r_0);
 
-  double inv_angle = 1/(scphi.cs * tantheta);
+    x_1 = s_1 + s_2;
 
-  double z_1 = z_0 + (x_1-x_0) * inv_angle;
+    double inv_angle = 1 / (scphi.cs * tantheta);
 
-  if (std::abs(z_1) < z_cyl) return true; 
+    double z_1 = z_0 + (x_1 - x_0) * inv_angle;
 
-  x_2 = s_1 - s_2;
-  double z_2 = z_0 + (x_2-x_0) * inv_angle;
+    if (std::abs(z_1) < z_cyl) return true;
 
-  return std::abs(z_2) < z_cyl;
+    x_2 = s_1 - s_2;
+    double z_2 = z_0 + (x_2 - x_0) * inv_angle;
 
+    return std::abs(z_2) < z_cyl;
 }
 
-std::vector<double> MuonHoughMathUtils::crossProduct(std::vector <double> x, std::vector<double> y)
-{
-  std::vector<double> z(3);
-  z[0]=y[1]*x[2]-y[2]*x[1];
-  z[1]=y[2]*x[0]-y[0]*x[2];
-  z[2]=y[0]*x[1]-y[1]*x[0];
+std::vector<double> MuonHoughMathUtils::crossProduct(std::vector<double> x, std::vector<double> y) {
+    std::vector<double> z(3);
+    z[0] = y[1] * x[2] - y[2] * x[1];
+    z[1] = y[2] * x[0] - y[0] * x[2];
+    z[2] = y[0] * x[1] - y[1] * x[0];
 
-  return z;
+    return z;
 }
 
-double MuonHoughMathUtils::dotProduct(std::vector <double> x, std::vector<double> y) 
-{
-  double z;
-  z = y[0]*x[0] + y[1]*x[1] + y[2]*x[2];
+double MuonHoughMathUtils::dotProduct(std::vector<double> x, std::vector<double> y) {
+    double z;
+    z = y[0] * x[0] + y[1] * x[1] + y[2] * x[2];
 
-  return z;
+    return z;
 }
-double MuonHoughMathUtils::signedDistanceCurvedToHit(double z0, double theta, double invcurvature, double hitx, double hity , double hitz ) 
-{
-  double hitr = std::sqrt(hitx*hitx+hity*hity);
+double MuonHoughMathUtils::signedDistanceCurvedToHit(double z0, double theta, double invcurvature, double hitx, double hity, double hitz) {
+    double hitr = std::sqrt(hitx * hitx + hity * hity);
 
-  CxxUtils::sincos sctheta(theta);
+    CxxUtils::sincos sctheta(theta);
 
-  double sdistance = 100000000.;
-  // if angle rotation larger than Pi/2 then return large distance (formulas don't work for flip in z!)
-  if (sctheta.apply(hitr,hitz) < 0) return sdistance; //  hitr*sctheta.sn + hitz*sctheta.cs < 0 
+    double sdistance = 100000000.;
+    // if angle rotation larger than Pi/2 then return large distance (formulas don't work for flip in z!)
+    if (sctheta.apply(hitr, hitz) < 0) return sdistance;  //  hitr*sctheta.sn + hitz*sctheta.cs < 0
 
-  int sign = 1;
-  if (hitz < 0) sign = -1;
+    int sign = 1;
+    if (hitz < 0) sign = -1;
 
-  if (std::abs(hitr/hitz)>MuonHough::tan_barrel) {
-    // Barrel Extrapolation
-    if (std::abs(sctheta.sn) > 1e-7) {
-      double diffr = hitr-MuonHough::radius_cylinder;
-      double zext = z0 + (hitr*sctheta.cs + diffr*diffr*invcurvature)/sctheta.sn;
-      sdistance = (zext - hitz);
-    }
+    if (std::abs(hitr / hitz) > MuonHough::tan_barrel) {
+        // Barrel Extrapolation
+        if (std::abs(sctheta.sn) > 1e-7) {
+            double diffr = hitr - MuonHough::radius_cylinder;
+            double zext = z0 + (hitr * sctheta.cs + diffr * diffr * invcurvature) / sctheta.sn;
+            sdistance = (zext - hitz);
+        }
 
-  } else {
-    if (std::abs(sctheta.sn) > 1e-7) {
-      double rext=0.;
-      if ( std::abs(hitz) < MuonHough::z_end) {
-	// Forward in Toroid
-	double diffz = hitz-sign*MuonHough::z_cylinder;
-	rext = ((hitz-z0)*sctheta.sn - diffz*diffz*invcurvature)/sctheta.cs;
-	
-      } else {
-	// Forward OutSide EC Toroid
-	rext = ((hitz-z0)*sctheta.sn + (MuonHough::z_magnetic_range_squared - sign*2*hitz*(MuonHough::z_magnetic_range))*invcurvature)/sctheta.cs;
-      }
-      sdistance = (rext - hitr);
+    } else {
+        if (std::abs(sctheta.sn) > 1e-7) {
+            double rext = 0.;
+            if (std::abs(hitz) < MuonHough::z_end) {
+                // Forward in Toroid
+                double diffz = hitz - sign * MuonHough::z_cylinder;
+                rext = ((hitz - z0) * sctheta.sn - diffz * diffz * invcurvature) / sctheta.cs;
+
+            } else {
+                // Forward OutSide EC Toroid
+                rext = ((hitz - z0) * sctheta.sn +
+                        (MuonHough::z_magnetic_range_squared - sign * 2 * hitz * (MuonHough::z_magnetic_range)) * invcurvature) /
+                       sctheta.cs;
+            }
+            sdistance = (rext - hitr);
+        }
     }
-  }
-  return sdistance;
+    return sdistance;
 }
 
-double MuonHoughMathUtils::thetaForCurvedHit(double invcurvature, MuonHoughHit* hit) 
-{
-  double ratio = hit->getMagneticTrackRatio()*invcurvature;
-  if (std::abs(ratio) < 1.) return hit->getTheta() + std::asin (ratio); 
-  else return -1;
+double MuonHoughMathUtils::thetaForCurvedHit(double invcurvature, MuonHoughHit* hit) {
+    double ratio = hit->getMagneticTrackRatio() * invcurvature;
+    if (std::abs(ratio) < 1.)
+        return hit->getTheta() + std::asin(ratio);
+    else
+        return -1;
 }
 
-void MuonHoughMathUtils::thetasForCurvedHit(double ratio, MuonHoughHit* hit, double& theta1, double& theta2)
-{
-  /** returns angle for positive and negative curvature (positive first) */
+void MuonHoughMathUtils::thetasForCurvedHit(double ratio, MuonHoughHit* hit, double& theta1, double& theta2) {
+    /** returns angle for positive and negative curvature (positive first) */
 
-  if (std::abs(ratio) < 1.) {
-    double asin_ratio = std::asin(ratio);
-    theta1 = hit->getTheta() + asin_ratio;
-    theta2 = hit->getTheta() - asin_ratio;
-  }
+    if (std::abs(ratio) < 1.) {
+        double asin_ratio = std::asin(ratio);
+        theta1 = hit->getTheta() + asin_ratio;
+        theta2 = hit->getTheta() - asin_ratio;
+    }
 }
 
-void MuonHoughMathUtils::extrapolateCurvedRoad(const Amg::Vector3D& roadpos, const Amg::Vector3D& roadmom,  const Amg::Vector3D& pos, Amg::Vector3D& roadpose , Amg::Vector3D& roaddire)
-{
-  /** Extrapolate pattern given by a roadpos and roadmom (should be perigee)
-      to a position in space pos
-      And determine extrapolated position: roadpose 
-      and direction: roaddire 
-      using the curved track model
-  */
-
-  //  m_log<< MSG::VERBOSE << "Extrapolate the road to the segment (hit)" <<endmsg;
-
-  const double theta = roadmom.theta(); 
-  const double phi = roadmom.phi(); 
-
-  CxxUtils::sincos scphi(phi);
-  CxxUtils::sincos sctheta(theta);
-  
-  double tantheta = sctheta.sn/sctheta.cs;
-
-  double r0 = scphi.apply(roadpos.x(),-roadpos.y());
-  double charge = 1.;
-  if ( r0 < 0) charge = -1.;
-  double invcurvature =  charge/roadmom.mag();
-  // No momentum estimate 
-  if (roadmom.mag() < 2 ) invcurvature = 0.;
-
-  double posr = std::sqrt(pos.x()*pos.x()+pos.y()*pos.y());
-  double thetan = theta;
-
-  int sign = 1;
-  if (pos.z() < 0) sign = -1;
-  
-  double xe = pos.x();
-  double ye = pos.y();
-  double ze = pos.z();
-  double rotationangle=0.;
-
-  if (std::abs(posr/pos.z())>MuonHough::tan_barrel) {
-    // Barrel Extrapolation
-    if ( (posr*posr-r0*r0) > 0) {
-      double lenr = std::sqrt(posr*posr-r0*r0);
-      double len = posr - fabs(r0);
-      double diffr = posr-MuonHough::radius_cylinder;
-      rotationangle = diffr*invcurvature/sctheta.sn;
-      xe = roadpos.x() + lenr * scphi.cs;
-      ye = roadpos.y() + lenr * scphi.sn;
-      ze = roadpos.z() + len/tantheta + diffr*rotationangle;
-      thetan = std::atan2(1.,1/tantheta + 2*rotationangle);
+void MuonHoughMathUtils::extrapolateCurvedRoad(const Amg::Vector3D& roadpos, const Amg::Vector3D& roadmom, const Amg::Vector3D& pos,
+                                               Amg::Vector3D& roadpose, Amg::Vector3D& roaddire) {
+    /** Extrapolate pattern given by a roadpos and roadmom (should be perigee)
+        to a position in space pos
+        And determine extrapolated position: roadpose
+        and direction: roaddire
+        using the curved track model
+    */
+
+    //  m_log<< MSG::VERBOSE << "Extrapolate the road to the segment (hit)" <<endmsg;
+
+    const double theta = roadmom.theta();
+    const double phi = roadmom.phi();
+
+    CxxUtils::sincos scphi(phi);
+    CxxUtils::sincos sctheta(theta);
+
+    double tantheta = sctheta.sn / sctheta.cs;
+
+    double r0 = scphi.apply(roadpos.x(), -roadpos.y());
+    double charge = 1.;
+    if (r0 < 0) charge = -1.;
+    double invcurvature = charge / roadmom.mag();
+    // No momentum estimate
+    if (roadmom.mag() < 2) invcurvature = 0.;
+
+    double posr = std::sqrt(pos.x() * pos.x() + pos.y() * pos.y());
+    double thetan = theta;
+
+    int sign = 1;
+    if (pos.z() < 0) sign = -1;
+
+    double xe = pos.x();
+    double ye = pos.y();
+    double ze = pos.z();
+    double rotationangle = 0.;
+
+    if (std::abs(posr / pos.z()) > MuonHough::tan_barrel) {
+        // Barrel Extrapolation
+        if ((posr * posr - r0 * r0) > 0) {
+            double lenr = std::sqrt(posr * posr - r0 * r0);
+            double len = posr - fabs(r0);
+            double diffr = posr - MuonHough::radius_cylinder;
+            rotationangle = diffr * invcurvature / sctheta.sn;
+            xe = roadpos.x() + lenr * scphi.cs;
+            ye = roadpos.y() + lenr * scphi.sn;
+            ze = roadpos.z() + len / tantheta + diffr * rotationangle;
+            thetan = std::atan2(1., 1 / tantheta + 2 * rotationangle);
+        }
+    } else {
+        double lext = 0., rotationangle = 0.;
+        if (std::abs(pos.z()) < MuonHough::z_end) {
+            // Forward in Toroid
+            double diffz = pos.z() - sign * MuonHough::z_cylinder;
+            rotationangle = diffz * invcurvature / sctheta.cs;
+            lext = (pos.z() - roadpos.z()) * tantheta - diffz * rotationangle;
+        } else {
+            // Forward OutSide EC Toroid
+            double effcurv = invcurvature / sctheta.cs;
+            rotationangle = sign * (MuonHough::z_end - MuonHough::z_cylinder) * effcurv;
+            lext = (pos.z() - roadpos.z()) * tantheta +
+                   (MuonHough::z_magnetic_range_squared - 2 * sign * pos.z() * MuonHough::z_magnetic_range) * effcurv;
+        }
+        xe = roadpos.x() + lext * scphi.cs;
+        ye = roadpos.y() + lext * scphi.sn;
+        double dx = tantheta - 2 * rotationangle;
+        if (dx != 0) thetan = std::atan2(1., 1 / dx);
     }
-  } else {
-    double lext=0., rotationangle=0.;
-    if ( std::abs(pos.z()) < MuonHough::z_end) {
-      // Forward in Toroid
-      double diffz = pos.z()-sign*MuonHough::z_cylinder;
-      rotationangle = diffz*invcurvature/sctheta.cs;
-      lext = (pos.z()-roadpos.z())*tantheta - diffz*rotationangle;
+
+    // In case direction theta is rotated for low momenta: flip direction vector
+    CxxUtils::sincos scthetan(thetan);
+    if (sctheta.cs * scthetan.cs + sctheta.sn * scthetan.sn < 0) {
+        roaddire = Amg::Vector3D(scthetan.sn * scphi.cs, scthetan.sn * scphi.sn, -scthetan.cs);
     } else {
-      // Forward OutSide EC Toroid
-      double effcurv = invcurvature/sctheta.cs;
-      rotationangle = sign*(MuonHough::z_end-MuonHough::z_cylinder)*effcurv;
-      lext = (pos.z()-roadpos.z())*tantheta + (MuonHough::z_magnetic_range_squared - 2*sign*pos.z()*MuonHough::z_magnetic_range)*effcurv;
+        roaddire = Amg::Vector3D(scthetan.sn * scphi.cs, scthetan.sn * scphi.sn, scthetan.cs);
     }
-    xe = roadpos.x() + lext * scphi.cs;
-    ye = roadpos.y() + lext * scphi.sn;
-    double dx = tantheta - 2*rotationangle;
-    if (dx !=0)  thetan = std::atan2(1.,1/dx);
-  }
-
-  // In case direction theta is rotated for low momenta: flip direction vector 
-  CxxUtils::sincos scthetan(thetan);
-  if (sctheta.cs*scthetan.cs+sctheta.sn*scthetan.sn < 0) {
-    roaddire = Amg::Vector3D(scthetan.sn*scphi.cs,scthetan.sn*scphi.sn,-scthetan.cs);
-  } else {
-    roaddire = Amg::Vector3D(scthetan.sn*scphi.cs,scthetan.sn*scphi.sn,scthetan.cs);
-  }
-  roadpose = Amg::Vector3D(xe,ye,ze);
+    roadpose = Amg::Vector3D(xe, ye, ze);
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughPattern.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughPattern.cxx
index d02aae34ce85e48bed66fa721ac9deefdb57354b..8f4c337a0528a601eaf15458b70dd7e83ef85fff 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughPattern.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughPattern.cxx
@@ -3,296 +3,270 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughPattern.h"
+
+#include "AthenaKernel/getMessageSvc.h"
 #include "CxxUtils/sincos.h"
 #include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
-
-MuonHoughPattern::MuonHoughPattern(int id_number,bool ownhits):MuonHoughHitContainer(ownhits),m_id_number(id_number),m_whichsegment(false),m_ephi(-M_PI/2.),m_erphi(0.),m_etheta(M_PI/2.), m_ertheta(0.),m_ecurvature(1.),m_maximumhistogram(0.)
-{
-}
 
-void MuonHoughPattern::resetTracksegment()
-{
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      delete m_hit[i];
-      m_hit[i]=nullptr;
+MuonHoughPattern::MuonHoughPattern(int id_number, bool ownhits) :
+    MuonHoughHitContainer(ownhits),
+    m_id_number(id_number),
+    m_whichsegment(false),
+    m_ephi(-M_PI / 2.),
+    m_erphi(0.),
+    m_etheta(M_PI / 2.),
+    m_ertheta(0.),
+    m_ecurvature(1.),
+    m_maximumhistogram(0.) {}
+
+void MuonHoughPattern::resetTracksegment() {
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        delete m_hit[i];
+        m_hit[i] = nullptr;
     }
-  
-  m_hit.clear();
+
+    m_hit.clear();
 }
 
-bool MuonHoughPattern::hitInHoughPattern(MuonHoughHit * hit)const // adviced not to use, slow function
+bool MuonHoughPattern::hitInHoughPattern(MuonHoughHit* hit) const  // adviced not to use, slow function
 {
-  for (unsigned int i = 0; i<size(); i++)
-    {
-      if (m_hit[i]->getId()==hit->getId())
-	{
-	  return true;
-	}
+    for (unsigned int i = 0; i < size(); i++) {
+        if (m_hit[i]->getId() == hit->getId()) { return true; }
     }
 
-  return false;
+    return false;
 }
 
-double MuonHoughPattern::patternLength()const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughPattern::patternLength");
-  // takes the first 2 hits and calculates distance and then takes next hit, and calculates from previous 2 hits which 2 are farthest away, etc..
-  // also possible to calculate point closest to IP and determine if left/ right to pattern, app. just as fast.
-
-  double max_patternlength = 0;
-
-  if (m_hit.size()>=2)
-    {
-      double pattern_length1=0,pattern_length2 = 0;
-      int hitno1 = 0;
-      int hitno2 = 1;
-
-      std::vector <double> diff(3);
-      diff[0] = m_hit[hitno1]->getHitx()-m_hit[hitno2]->getHitx();
-      diff[1] = m_hit[hitno1]->getHity()-m_hit[hitno2]->getHity();
-      diff[2] = m_hit[hitno1]->getHitz()-m_hit[hitno2]->getHitz();
-      max_patternlength = m_muonhoughmathutils.abs(diff);
-      
-      for (unsigned int i=2; i<m_hit.size(); i++)
-	{
-	  diff[0] = m_hit[hitno1]->getHitx()-m_hit[i]->getHitx();
-	  diff[1] = m_hit[hitno1]->getHity()-m_hit[i]->getHity();
-	  diff[2] = m_hit[hitno1]->getHitz()-m_hit[i]->getHitz();
-	  pattern_length1 = m_muonhoughmathutils.abs(diff);
-	  
-	  diff[0] = m_hit[hitno2]->getHitx()-m_hit[i]->getHitx();
-	  diff[1] = m_hit[hitno2]->getHity()-m_hit[i]->getHity();
-	  diff[2] = m_hit[hitno2]->getHitz()-m_hit[i]->getHitz();
-	  pattern_length2 = m_muonhoughmathutils.abs(diff);
-
-	  if (pattern_length1 <= max_patternlength && pattern_length2 <= max_patternlength)
-	    {
-	      // nothing happens..
-	    }
-	  else if (pattern_length1 > max_patternlength && pattern_length1 >= pattern_length2)
-	    {
-	      hitno2 = i;
-	      max_patternlength = pattern_length1;
-	    }
-	  else if (pattern_length2 > max_patternlength && pattern_length2 > pattern_length1)
-	    {
-	      hitno1 = i;
-	      max_patternlength = pattern_length2;
-	    }
-	}
+double MuonHoughPattern::patternLength() const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::patternLength");
+    // takes the first 2 hits and calculates distance and then takes next hit, and calculates from previous 2 hits which 2 are farthest
+    // away, etc.. also possible to calculate point closest to IP and determine if left/ right to pattern, app. just as fast.
+
+    double max_patternlength = 0;
+
+    if (m_hit.size() >= 2) {
+        double pattern_length1 = 0, pattern_length2 = 0;
+        int hitno1 = 0;
+        int hitno2 = 1;
+
+        std::vector<double> diff(3);
+        diff[0] = m_hit[hitno1]->getHitx() - m_hit[hitno2]->getHitx();
+        diff[1] = m_hit[hitno1]->getHity() - m_hit[hitno2]->getHity();
+        diff[2] = m_hit[hitno1]->getHitz() - m_hit[hitno2]->getHitz();
+        max_patternlength = m_muonhoughmathutils.abs(diff);
+
+        for (unsigned int i = 2; i < m_hit.size(); i++) {
+            diff[0] = m_hit[hitno1]->getHitx() - m_hit[i]->getHitx();
+            diff[1] = m_hit[hitno1]->getHity() - m_hit[i]->getHity();
+            diff[2] = m_hit[hitno1]->getHitz() - m_hit[i]->getHitz();
+            pattern_length1 = m_muonhoughmathutils.abs(diff);
+
+            diff[0] = m_hit[hitno2]->getHitx() - m_hit[i]->getHitx();
+            diff[1] = m_hit[hitno2]->getHity() - m_hit[i]->getHity();
+            diff[2] = m_hit[hitno2]->getHitz() - m_hit[i]->getHitz();
+            pattern_length2 = m_muonhoughmathutils.abs(diff);
+
+            if (pattern_length1 <= max_patternlength && pattern_length2 <= max_patternlength) {
+                // nothing happens..
+            } else if (pattern_length1 > max_patternlength && pattern_length1 >= pattern_length2) {
+                hitno2 = i;
+                max_patternlength = pattern_length1;
+            } else if (pattern_length2 > max_patternlength && pattern_length2 > pattern_length1) {
+                hitno1 = i;
+                max_patternlength = pattern_length2;
+            }
+        }
+    } else {
+        if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::pattern_size <2" << endmsg;
     }
-  else {if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << "MuonHoughPattern::pattern_size <2" << endmsg;}
 
-  return max_patternlength;
+    return max_patternlength;
 }
 
-double MuonHoughPattern::calculateEZ()const
-{
-  double ez = 0;
-  double count = 0;
-  //  double r0 = m_erphi;
-  
-  for (unsigned int hitno=0; hitno<m_hit.size(); hitno++)
-    {
-      // for each hit the distance from the hit to x,y line through (0,0) in the xy plane is calcualted and then distance*cos(theta) gives z_hit - z
+double MuonHoughPattern::calculateEZ() const {
+    double ez = 0;
+    double count = 0;
+    //  double r0 = m_erphi;
 
-      double distance = MuonHoughMathUtils::signedDistanceToLine(getHit(hitno)->getHitx(),getHit(hitno)->getHity(),0,m_ephi - M_PI);
-      
-      double z = getHit(hitno)->getHitz() - (distance * std::cos(m_etheta) / std::sin(m_etheta)); // distance * sin (m_etheta) = L  // - sign correct?
-      // hough correction in here?
+    for (unsigned int hitno = 0; hitno < m_hit.size(); hitno++) {
+        // for each hit the distance from the hit to x,y line through (0,0) in the xy plane is calcualted and then distance*cos(theta) gives
+        // z_hit - z
 
-      // straight line fitter?
+        double distance = MuonHoughMathUtils::signedDistanceToLine(getHit(hitno)->getHitx(), getHit(hitno)->getHity(), 0, m_ephi - M_PI);
 
-      ez += z;
-      count++;
+        double z = getHit(hitno)->getHitz() -
+                   (distance * std::cos(m_etheta) / std::sin(m_etheta));  // distance * sin (m_etheta) = L  // - sign correct?
+        // hough correction in here?
 
+        // straight line fitter?
+
+        ez += z;
+        count++;
     }
 
-  ez = ez / count ;
+    ez = ez / count;
 
-  return ez;
+    return ez;
 }
 
-void MuonHoughPattern::printHoughPattern()const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughPattern::printHoughPattern");
-  if (m_hit.empty())
-    {
-      if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE <<"MuonHoughPattern::No pattern_Segment" << endmsg;
+void MuonHoughPattern::printHoughPattern() const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::printHoughPattern");
+    if (m_hit.empty()) {
+        if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::No pattern_Segment" << endmsg;
+    }
+
+    if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::Size of MuonHoughPattern: " << m_hit.size() << endmsg;
+    for (unsigned int i = 0; i < m_hit.size(); i++) {
+        if (log.level() <= MSG::VERBOSE)
+            log << MSG::VERBOSE << m_hit[i]->getHitx() << " " << m_hit[i]->getHity() << " " << m_hit[i]->getHitz() << " "
+                << m_hit[i]->getId() << endmsg;
     }
-  
-  if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << "MuonHoughPattern::Size of MuonHoughPattern: " << m_hit.size() << endmsg;  
-  for (unsigned int i=0; i<m_hit.size(); i++)
-    {
-      if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << m_hit[i]->getHitx() << " " << m_hit[i]->getHity() << " " << m_hit[i]->getHitz() << " " << m_hit[i]->getId() << endmsg;
-    } 
 }
 
-double MuonHoughPattern::getEAngle()const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughPattern::getEAngle");
-  double eangle=0;
-  switch (m_id_number)
-    {
-    case MuonHough::hough_xy:
-      eangle=m_ephi;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      eangle=m_etheta;
-      break;
-    default:
-      if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
+double MuonHoughPattern::getEAngle() const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::getEAngle");
+    double eangle = 0;
+    switch (m_id_number) {
+        case MuonHough::hough_xy: eangle = m_ephi; break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder: eangle = m_etheta; break;
+        default:
+            if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
     }
-  return eangle;
+    return eangle;
 }
-      
-double MuonHoughPattern::getER()const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughPattern::getER");
-  double er=0;
-  switch (m_id_number)
-    {
-    case MuonHough::hough_xy:
-      er=m_erphi;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      er=m_ertheta;
-      break;
-    default:
-      if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
+
+double MuonHoughPattern::getER() const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::getER");
+    double er = 0;
+    switch (m_id_number) {
+        case MuonHough::hough_xy: er = m_erphi; break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder: er = m_ertheta; break;
+        default:
+            if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
     }
-  return er;
+    return er;
 }
 
-void MuonHoughPattern::setEAngle(double eangle)
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughPattern::setEAngle");
-  switch (m_id_number)
-    {
-    case MuonHough::hough_xy:
-      m_ephi=eangle;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      m_etheta=eangle;
-      break;
-    default:
-      if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
+void MuonHoughPattern::setEAngle(double eangle) {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::setEAngle");
+    switch (m_id_number) {
+        case MuonHough::hough_xy: m_ephi = eangle; break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder: m_etheta = eangle; break;
+        default:
+            if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
     }
 }
 
-void MuonHoughPattern::setER(double er)
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughPattern::setER");
-  switch (m_id_number)
-    {
-    case MuonHough::hough_xy:
-      m_erphi=er;
-      break;
-    case MuonHough::hough_rz: case MuonHough::hough_rzcosmics: case MuonHough::hough_rz_rpc: case MuonHough::hough_rz_mdt: case MuonHough::hough_curved_at_a_cylinder:
-      m_ertheta=er;
-      break;
-    default:
-      if(log.level()<=MSG::VERBOSE)log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
+void MuonHoughPattern::setER(double er) {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::setER");
+    switch (m_id_number) {
+        case MuonHough::hough_xy: m_erphi = er; break;
+        case MuonHough::hough_rz:
+        case MuonHough::hough_rzcosmics:
+        case MuonHough::hough_rz_rpc:
+        case MuonHough::hough_rz_mdt:
+        case MuonHough::hough_curved_at_a_cylinder: m_ertheta = er; break;
+        default:
+            if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
     }
 }
 
-std::vector <double> MuonHoughPattern::getEPos()const
-{
-  // similar to StandardAlgs::shortestPointOfLineToOrigin3D
+std::vector<double> MuonHoughPattern::getEPos() const {
+    // similar to StandardAlgs::shortestPointOfLineToOrigin3D
 
-  // should be maybe really shortest point, but
+    // should be maybe really shortest point, but
 
-  // problem is that there is no starting point on the line (well this calc. pos could be available) 
+    // problem is that there is no starting point on the line (well this calc. pos could be available)
 
-  std::vector <double> pos(3);
+    std::vector<double> pos(3);
 
-  pos[0] = m_erphi * std::sin(m_ephi);
-  pos[1] = -m_erphi * std::cos(m_ephi);
+    pos[0] = m_erphi * std::sin(m_ephi);
+    pos[1] = -m_erphi * std::cos(m_ephi);
 
-  if (m_etheta != 0)
-    {
-      pos[2] = m_ertheta / std::sin(m_etheta);
-    }
-  else 
-    {
-      pos[2] = 0;
+    if (m_etheta != 0) {
+        pos[2] = m_ertheta / std::sin(m_etheta);
+    } else {
+        pos[2] = 0;
     }
-  return pos;
+    return pos;
 }
 
-std::vector <double> MuonHoughPattern::getEDir()const
-{
-  std::vector <double> dir(3);
+std::vector<double> MuonHoughPattern::getEDir() const {
+    std::vector<double> dir(3);
 
-  dir[0]= std::cos(m_ephi)*std::sin(m_etheta);
-  dir[1]= std::sin(m_ephi)*std::sin(m_etheta);
-  dir[2]= std::cos(m_etheta);
+    dir[0] = std::cos(m_ephi) * std::sin(m_etheta);
+    dir[1] = std::sin(m_ephi) * std::sin(m_etheta);
+    dir[2] = std::cos(m_etheta);
 
-  return dir;
+    return dir;
 }
 
-void MuonHoughPattern::updateParametersRPhi(bool cosmics)
-{
-  if (empty()) return;
+void MuonHoughPattern::updateParametersRPhi(bool cosmics) {
+    if (empty()) return;
 
-  double sum_x = 0.;
-  double sum_y = 0.;
+    double sum_x = 0.;
+    double sum_y = 0.;
 
-  int hitsno = size();
+    int hitsno = size();
 
-  for (unsigned int i=0; i<size(); i++)
-    {
-      sum_x += getHitx(i); //*getOrigWeight(i);
-      sum_y += getHity(i); //*getOrigWeight(i);
+    for (unsigned int i = 0; i < size(); i++) {
+        sum_x += getHitx(i);  //*getOrigWeight(i);
+        sum_y += getHity(i);  //*getOrigWeight(i);
     }
 
-  // adding interaction point constraint:
-  if (!cosmics || size()==1) hitsno += size();
-  
-  const double av_x = sum_x / (hitsno+0.);
-  const double av_y = sum_y / (hitsno+0.);
-  
-  double sumx = 0.;
-  double sumy = 0.;
-  for (unsigned int i=0; i<size(); i++)
-    {
-      double hitx = getHitx(i);
-      double hity = getHity(i);
-      double x_offset = hitx - av_x;
-      double y_offset = hity - av_y;
-      double weight = (x_offset*x_offset + y_offset*y_offset); //*getOrigWeight(i);
-      int sign = 1;
-      if (!cosmics) {
-	if (x_offset*hitx+y_offset*hity<0) {sign =-1;}
-      }
-      else {
-	if (y_offset<0) {sign =-1;} // assume cosmic muon comes from above
-      }
-      sumx += weight*sign*x_offset;
-      sumy += weight*sign*y_offset;
+    // adding interaction point constraint:
+    if (!cosmics || size() == 1) hitsno += size();
+
+    const double av_x = sum_x / (hitsno + 0.);
+    const double av_y = sum_y / (hitsno + 0.);
+
+    double sumx = 0.;
+    double sumy = 0.;
+    for (unsigned int i = 0; i < size(); i++) {
+        double hitx = getHitx(i);
+        double hity = getHity(i);
+        double x_offset = hitx - av_x;
+        double y_offset = hity - av_y;
+        double weight = (x_offset * x_offset + y_offset * y_offset);  //*getOrigWeight(i);
+        int sign = 1;
+        if (!cosmics) {
+            if (x_offset * hitx + y_offset * hity < 0) { sign = -1; }
+        } else {
+            if (y_offset < 0) { sign = -1; }  // assume cosmic muon comes from above
+        }
+        sumx += weight * sign * x_offset;
+        sumy += weight * sign * y_offset;
     }
-  // adding interaction point (count size)
-  if (!cosmics) {
-    double weight = av_x*av_x + av_y*av_y;
-    sumx += size() * weight * av_x;
-    sumy += size() * weight * av_y;
-  }
-
-  if (std::abs(sumx) < 0.000001 || std::abs(sumy) < 0.000001) {
-    return;
-  }
-
-  double phi = std::atan2(sumy,sumx);
-  if (cosmics) {
-    if (phi > 0) phi -= M_PI; // phi between 0,-Pi for cosmics! 
-  }
-
-  CxxUtils::sincos scphi(phi);
-  
-  const double r0 = scphi.apply(av_x,-av_y);
-
-  setEPhi(phi);
-  setERPhi(r0);
+    // adding interaction point (count size)
+    if (!cosmics) {
+        double weight = av_x * av_x + av_y * av_y;
+        sumx += size() * weight * av_x;
+        sumy += size() * weight * av_y;
+    }
+
+    if (std::abs(sumx) < 0.000001 || std::abs(sumy) < 0.000001) { return; }
+
+    double phi = std::atan2(sumy, sumx);
+    if (cosmics) {
+        if (phi > 0) phi -= M_PI;  // phi between 0,-Pi for cosmics!
+    }
+
+    CxxUtils::sincos scphi(phi);
+
+    const double r0 = scphi.apply(av_x, -av_y);
+
+    setEPhi(phi);
+    setERPhi(r0);
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformSteering.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformSteering.cxx
index 4dba0466a49ae0fc8025dab2c6b39af07087549f..488648fbb2d9d83a27f91a72ff9260ec79fe4e7b 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformSteering.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformSteering.cxx
@@ -2,91 +2,88 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "MuonHoughPatternEvent/MuonHoughPattern.h"
-#include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 #include "MuonHoughPatternEvent/MuonHoughTransformSteering.h"
-#include "GaudiKernel/MsgStream.h"
+
 #include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
+#include "MuonHoughPatternEvent/MuonHoughPattern.h"
+#include "MuonHoughPatternEvent/MuonHoughTransformer.h"
 
-MuonHoughTransformSteering::MuonHoughTransformSteering(MuonHoughTransformer* houghtransformer)
-{
-  m_houghtransformer=houghtransformer;
-  m_maximum_residu_mm = 1.;
+MuonHoughTransformSteering::MuonHoughTransformSteering(MuonHoughTransformer* houghtransformer) {
+    m_houghtransformer = houghtransformer;
+    m_maximum_residu_mm = 1.;
 }
 
-MuonHoughTransformSteering::~MuonHoughTransformSteering()
-{
-  delete m_houghtransformer;
-  m_houghtransformer=nullptr;
+MuonHoughTransformSteering::~MuonHoughTransformSteering() {
+    delete m_houghtransformer;
+    m_houghtransformer = nullptr;
 }
 
-MuonHoughPatternCollection MuonHoughTransformSteering::constructHoughPatterns(const MuonHoughHitContainer* event, double residu_mm, double residu_grad, int max_patterns, bool which_segment, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformSteering::constructHoughPatterns");
-  MuonHoughPatternCollection houghpatterns;
-  houghpatterns.reserve(max_patterns);
-  std::vector <std::pair <int, int> > maxima = m_houghtransformer->getMaxima(max_patterns); // sector,binnumber , sorted vector
-  
-  for (unsigned int maximum_number=0; maximum_number<maxima.size(); maximum_number++)
-    {
-      int binnumber = maxima[maximum_number].second;
-
-      if (binnumber!=-1)
-	{
-	  int sector = maxima[maximum_number].first;
-	  MuonHoughPattern* houghpattern = constructHoughPattern(event,binnumber,residu_mm,residu_grad,sector,which_segment,printlevel);
-	  
-	  houghpatterns.push_back(houghpattern);
-	}
-      else 
-	{
-	  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-	    {
-	      log << MSG::VERBOSE << "binnumber == -1 (no max found), max patterns = " << maximum_number << endmsg;
-	    }
-	  break;
-	}
+MuonHoughPatternCollection MuonHoughTransformSteering::constructHoughPatterns(const MuonHoughHitContainer* event, double residu_mm,
+                                                                              double residu_grad, int max_patterns, bool which_segment,
+                                                                              int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformSteering::constructHoughPatterns");
+    MuonHoughPatternCollection houghpatterns;
+    houghpatterns.reserve(max_patterns);
+    std::vector<std::pair<int, int> > maxima = m_houghtransformer->getMaxima(max_patterns);  // sector,binnumber , sorted vector
+
+    for (unsigned int maximum_number = 0; maximum_number < maxima.size(); maximum_number++) {
+        int binnumber = maxima[maximum_number].second;
+
+        if (binnumber != -1) {
+            int sector = maxima[maximum_number].first;
+            MuonHoughPattern* houghpattern =
+                constructHoughPattern(event, binnumber, residu_mm, residu_grad, sector, which_segment, printlevel);
+
+            houghpatterns.push_back(houghpattern);
+        } else {
+            if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                log << MSG::VERBOSE << "binnumber == -1 (no max found), max patterns = " << maximum_number << endmsg;
+            }
+            break;
+        }
     }
 
-  // subtract all hits that were just added to a pattern
-  //m_houghtransformer->fill(event,true);
+    // subtract all hits that were just added to a pattern
+    // m_houghtransformer->fill(event,true);
 
-  return houghpatterns;
+    return houghpatterns;
 }
 
-MuonHoughPattern* MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer* event, double residu_mm, double residu_grad, int maximum_number, bool which_segment, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformSteering::constructHoughPattern");
-  if (printlevel>=3 || log.level()<=MSG::DEBUG)
-    {log << MSG::DEBUG << "MuonHoughTransformSteering::constructHoughPattern (start) " << endmsg;}
-  
-  MuonHoughPattern* houghpattern = m_houghtransformer->associateHitsToMaximum(event,residu_mm,residu_grad,maximum_number,which_segment,printlevel);
-  
-  if (printlevel>=3 || log.level()<=MSG::DEBUG)
-    {log << MSG::DEBUG << "MuonHoughTransformSteering::constructHoughPattern (end) " << endmsg;}
-  
-  return houghpattern;
-}
+MuonHoughPattern* MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer* event, double residu_mm,
+                                                                    double residu_grad, int maximum_number, bool which_segment,
+                                                                    int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformSteering::constructHoughPattern");
+    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG << "MuonHoughTransformSteering::constructHoughPattern (start) " << endmsg;
+    }
 
-MuonHoughPattern* MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer* event,std::pair <double,double> coords, double residu_mm,double residu_grad, int sector, bool which_segment, int printlevel)const
-{
-  MuonHoughPattern* houghpattern = m_houghtransformer->associateHitsToCoords(event,coords,residu_mm,residu_grad,sector,which_segment,printlevel);
-  return houghpattern;
-}
+    MuonHoughPattern* houghpattern =
+        m_houghtransformer->associateHitsToMaximum(event, residu_mm, residu_grad, maximum_number, which_segment, printlevel);
 
-MuonHoughPattern* MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer* event,int binnumber, double residu_mm,double residu_grad, int sector, bool which_segment, int printlevel)const
-{
-  MuonHoughPattern* houghpattern = m_houghtransformer->associateHitsToBinnumber(event,binnumber,residu_mm,residu_grad,sector,which_segment,printlevel);
-  return houghpattern;
-}
+    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG << "MuonHoughTransformSteering::constructHoughPattern (end) " << endmsg;
+    }
 
+    return houghpattern;
+}
 
-void MuonHoughTransformSteering::fill(const MuonHoughHitContainer* event, bool /**subtract*/)
-{
-  m_houghtransformer->fill(event);
+MuonHoughPattern* MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer* event, std::pair<double, double> coords,
+                                                                    double residu_mm, double residu_grad, int sector, bool which_segment,
+                                                                    int printlevel) const {
+    MuonHoughPattern* houghpattern =
+        m_houghtransformer->associateHitsToCoords(event, coords, residu_mm, residu_grad, sector, which_segment, printlevel);
+    return houghpattern;
 }
 
-void MuonHoughTransformSteering::resetHisto()
-{
-  m_houghtransformer->resetHisto();
+MuonHoughPattern* MuonHoughTransformSteering::constructHoughPattern(const MuonHoughHitContainer* event, int binnumber, double residu_mm,
+                                                                    double residu_grad, int sector, bool which_segment,
+                                                                    int printlevel) const {
+    MuonHoughPattern* houghpattern =
+        m_houghtransformer->associateHitsToBinnumber(event, binnumber, residu_mm, residu_grad, sector, which_segment, printlevel);
+    return houghpattern;
 }
+
+void MuonHoughTransformSteering::fill(const MuonHoughHitContainer* event, bool /**subtract*/) { m_houghtransformer->fill(event); }
+
+void MuonHoughTransformSteering::resetHisto() { m_houghtransformer->resetHisto(); }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer.cxx
index c23f83f93b364c8a1504a033eb9e8e5cdbeaae7f..5f1791a8ed17e3f4101325485402d520c99f5222 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer.cxx
@@ -3,267 +3,240 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer.h"
-#include "MuonHoughPatternEvent/MuonHoughHitContainer.h"
-#include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
-
-MuonHoughTransformer::MuonHoughTransformer(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):
-  m_threshold_histo(threshold_histo), m_eventsize(0), m_eventsize_weightfactor(20.), m_nbins(nbins), m_nbins_plus3(m_nbins + 3), m_nbins_angle(nbins_angle),
-m_detectorsize(detectorsize), m_detectorsize_angle(detectorsize_angle), m_number_of_sectors(number_of_sectors)
-{
-  m_add_weight_angle = false;
-  m_weight_constant_angle = 1.;
-  m_weight_constant_radius = 1.;
-
-  m_use_negative_weights = false;
-  m_ip_setting = true;
 
-  m_stepsize = 2*detectorsize / (nbins+0.);
-  m_stepsize_per_angle = detectorsize_angle / (nbins_angle+0.);
+#include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
+#include "MuonHoughPatternEvent/MuonHoughHitContainer.h"
 
-  m_add_weight_radius = 1.;
-  m_histos.reserve(m_number_of_sectors);
-  for (int i=0; i<m_number_of_sectors; i++)
-    {
-      MuonHoughHisto2D * histo = new MuonHoughHisto2D(nbins, -detectorsize, detectorsize, nbins_angle, 0., detectorsize_angle);
-      histo->setThreshold(m_threshold_histo);
-      m_histos.push_back(histo);
+MuonHoughTransformer::MuonHoughTransformer(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                           double threshold_histo, int number_of_sectors) :
+    m_threshold_histo(threshold_histo),
+    m_eventsize(0),
+    m_eventsize_weightfactor(20.),
+    m_nbins(nbins),
+    m_nbins_plus3(m_nbins + 3),
+    m_nbins_angle(nbins_angle),
+    m_detectorsize(detectorsize),
+    m_detectorsize_angle(detectorsize_angle),
+    m_number_of_sectors(number_of_sectors) {
+    m_add_weight_angle = false;
+    m_weight_constant_angle = 1.;
+    m_weight_constant_radius = 1.;
+
+    m_use_negative_weights = false;
+    m_ip_setting = true;
+
+    m_stepsize = 2 * detectorsize / (nbins + 0.);
+    m_stepsize_per_angle = detectorsize_angle / (nbins_angle + 0.);
+
+    m_add_weight_radius = 1.;
+    m_histos.reserve(m_number_of_sectors);
+    for (int i = 0; i < m_number_of_sectors; i++) {
+        MuonHoughHisto2D* histo = new MuonHoughHisto2D(nbins, -detectorsize, detectorsize, nbins_angle, 0., detectorsize_angle);
+        histo->setThreshold(m_threshold_histo);
+        m_histos.push_back(histo);
     }
 
-  m_binwidthx = m_histos.getHisto(0)->getBinWidthX();
-  m_binwidthy = m_histos.getHisto(0)->getBinWidthY();
+    m_binwidthx = m_histos.getHisto(0)->getBinWidthX();
+    m_binwidthy = m_histos.getHisto(0)->getBinWidthY();
 }
 
-MuonHoughTransformer::~MuonHoughTransformer()
-{
-  for (int i=0; i<m_number_of_sectors; i++)
-    {
-      delete m_histos.getHisto(i);
-    }
+MuonHoughTransformer::~MuonHoughTransformer() {
+    for (int i = 0; i < m_number_of_sectors; i++) { delete m_histos.getHisto(i); }
 }
 
-void MuonHoughTransformer::fill(const MuonHoughHitContainer* event, bool subtract)
-{
-  m_eventsize = event->size();
-  m_eventsize_weightfactor = 20.*std::sqrt(m_eventsize)/std::sqrt(7000.);
-  if( subtract ){
-    // invalidate maxima
-    for( int i=0;i<m_histos.size();++i)
-      m_histos.getHisto(i)->setMaximumIsValid(false);
-  
-    for (unsigned int hitid=0; hitid<m_eventsize; hitid++) {
-      MuonHoughHit* hit = event->getHit(hitid);
-      if( hit->getAssociated() ) fillHit(hit,-1.*hit->getWeight());
+void MuonHoughTransformer::fill(const MuonHoughHitContainer* event, bool subtract) {
+    m_eventsize = event->size();
+    m_eventsize_weightfactor = 20. * std::sqrt(m_eventsize) / std::sqrt(7000.);
+    if (subtract) {
+        // invalidate maxima
+        for (int i = 0; i < m_histos.size(); ++i) m_histos.getHisto(i)->setMaximumIsValid(false);
+
+        for (unsigned int hitid = 0; hitid < m_eventsize; hitid++) {
+            MuonHoughHit* hit = event->getHit(hitid);
+            if (hit->getAssociated()) fillHit(hit, -1. * hit->getWeight());
+        }
+    } else {
+        for (unsigned int hitid = 0; hitid < m_eventsize; hitid++) { fillHit(event->getHit(hitid), event->getHit(hitid)->getWeight()); }
     }
-  }else{ 
-    for (unsigned int hitid=0; hitid<m_eventsize; hitid++) {
-      fillHit(event->getHit(hitid),event->getHit(hitid)->getWeight());
-    }
-  }
 }
 
-
-
-MuonHoughPattern* MuonHoughTransformer::associateHitsToMaximum(const MuonHoughHitContainer* event, double maximum_residu_mm, double maximum_residu_grad, int maximum_number, bool which_segment, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer::associateHitsToMaximum");
-  MuonHoughPattern* houghpattern;
-  std::pair <double,double> coordsmaximum;
-  std::pair <int,int> maximumbin;
-  maximumbin = m_histos.getMaximumBinnumber(maximum_number,which_segment,printlevel);
-  
-  int sector = maximumbin.first;
-
-  if (sector!=-1)
-    {
-      coordsmaximum = m_histos.getHisto(sector)->getCoordsMaximum(maximum_number,which_segment,printlevel);  
-      
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-	{
-	  log << MSG::VERBOSE << "maximum binnumber of histogram: " << maximumbin.second << " value: " << m_histos.getHisto(sector)->getBinContent(maximumbin.second)  << endmsg;
-	  log << MSG::VERBOSE << " coordinates: " << coordsmaximum.first << " second " << coordsmaximum.second << endmsg;
-	
-	  if (m_number_of_sectors!=1)
-	    {log << MSG::VERBOSE << "sector: " << sector << endmsg;}
-	}
-      
-      if (maximumbin.second == -1) // no maximum, no bin above threshold
-	{
-	  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-	    {log << MSG::VERBOSE << "MuonHoughTransformer::No Maximum Found" << endmsg;}
-	  return nullptr;
-	}
-      else 
-	{
-	  houghpattern = hookAssociateHitsToMaximum(event,coordsmaximum,maximum_residu_mm,maximum_residu_grad,sector,which_segment,printlevel);
-	  if (houghpattern)
-	    {houghpattern->setMaximumHistogram(m_histos.getHisto(sector)->getBinContent(maximumbin.second));}
-	}
+MuonHoughPattern* MuonHoughTransformer::associateHitsToMaximum(const MuonHoughHitContainer* event, double maximum_residu_mm,
+                                                               double maximum_residu_grad, int maximum_number, bool which_segment,
+                                                               int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer::associateHitsToMaximum");
+    MuonHoughPattern* houghpattern;
+    std::pair<double, double> coordsmaximum;
+    std::pair<int, int> maximumbin;
+    maximumbin = m_histos.getMaximumBinnumber(maximum_number, which_segment, printlevel);
+
+    int sector = maximumbin.first;
+
+    if (sector != -1) {
+        coordsmaximum = m_histos.getHisto(sector)->getCoordsMaximum(maximum_number, which_segment, printlevel);
+
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE << "maximum binnumber of histogram: " << maximumbin.second
+                << " value: " << m_histos.getHisto(sector)->getBinContent(maximumbin.second) << endmsg;
+            log << MSG::VERBOSE << " coordinates: " << coordsmaximum.first << " second " << coordsmaximum.second << endmsg;
+
+            if (m_number_of_sectors != 1) { log << MSG::VERBOSE << "sector: " << sector << endmsg; }
+        }
+
+        if (maximumbin.second == -1)  // no maximum, no bin above threshold
+        {
+            if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                log << MSG::VERBOSE << "MuonHoughTransformer::No Maximum Found" << endmsg;
+            }
+            return nullptr;
+        } else {
+            houghpattern =
+                hookAssociateHitsToMaximum(event, coordsmaximum, maximum_residu_mm, maximum_residu_grad, sector, which_segment, printlevel);
+            if (houghpattern) { houghpattern->setMaximumHistogram(m_histos.getHisto(sector)->getBinContent(maximumbin.second)); }
+        }
+    } else {
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) { log << MSG::VERBOSE << "MuonHoughTransformer::No Maximum Found" << endmsg; }
+        return nullptr;
     }
-  else
-    {
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-	{log << MSG::VERBOSE << "MuonHoughTransformer::No Maximum Found" << endmsg;}
-      return nullptr;
-    }
-  
-  return houghpattern;
-}
 
-MuonHoughPattern* MuonHoughTransformer::associateHitsToCoords(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum,double maximum_residu_mm, double maximum_residu_angle, int sector, bool which_segment, int printlevel)const
-{
-  MuonHoughPattern* houghpattern = hookAssociateHitsToMaximum(event,coordsmaximum,maximum_residu_mm,maximum_residu_angle,sector,which_segment,printlevel);
-  return houghpattern;
+    return houghpattern;
 }
 
-MuonHoughPattern* MuonHoughTransformer::associateHitsToBinnumber(const MuonHoughHitContainer* event,int binnumber,double maximum_residu_mm, double maximum_residu_angle, int sector, bool which_segment, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer::associateHitsToBinnumber");
-  // this one is currently in use
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE) {
-    log << MSG::VERBOSE << "maximum of histogram: " << m_histos.getHisto(sector)->getBinContent(binnumber) << endmsg; 
+MuonHoughPattern* MuonHoughTransformer::associateHitsToCoords(const MuonHoughHitContainer* event, std::pair<double, double> coordsmaximum,
+                                                              double maximum_residu_mm, double maximum_residu_angle, int sector,
+                                                              bool which_segment, int printlevel) const {
+    MuonHoughPattern* houghpattern =
+        hookAssociateHitsToMaximum(event, coordsmaximum, maximum_residu_mm, maximum_residu_angle, sector, which_segment, printlevel);
+    return houghpattern;
+}
 
-  }
+MuonHoughPattern* MuonHoughTransformer::associateHitsToBinnumber(const MuonHoughHitContainer* event, int binnumber,
+                                                                 double maximum_residu_mm, double maximum_residu_angle, int sector,
+                                                                 bool which_segment, int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer::associateHitsToBinnumber");
+    // this one is currently in use
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "maximum of histogram: " << m_histos.getHisto(sector)->getBinContent(binnumber) << endmsg;
+    }
 
-  std::pair <double,double> coordsmaximum = m_histos.getHisto(sector)->binnumberToCoords(binnumber);
-  MuonHoughPattern* houghpattern = hookAssociateHitsToMaximum(event,coordsmaximum,maximum_residu_mm,maximum_residu_angle,sector,which_segment,printlevel);
-  houghpattern->setMaximumHistogram(m_histos.getHisto(sector)->getBinContent(binnumber));
-  return houghpattern;
+    std::pair<double, double> coordsmaximum = m_histos.getHisto(sector)->binnumberToCoords(binnumber);
+    MuonHoughPattern* houghpattern =
+        hookAssociateHitsToMaximum(event, coordsmaximum, maximum_residu_mm, maximum_residu_angle, sector, which_segment, printlevel);
+    houghpattern->setMaximumHistogram(m_histos.getHisto(sector)->getBinContent(binnumber));
+    return houghpattern;
 }
 
-std::pair <double,double> MuonHoughTransformer::getEndPointsFillLoop(double radius, double stepsize, int sector)const
-{
-  std::pair <double,double> endpoints (-radius+0.00001,radius);   // why +0.00001?
+std::pair<double, double> MuonHoughTransformer::getEndPointsFillLoop(double radius, double stepsize, int sector) const {
+    std::pair<double, double> endpoints(-radius + 0.00001, radius);  // why +0.00001?
 
-  if (-radius < m_histos.getHisto(sector)->getXmin()) // randomizer to avoid binning effects
+    if (-radius < m_histos.getHisto(sector)->getXmin())  // randomizer to avoid binning effects
     {
-      endpoints.first=m_histos.getHisto(sector)->getXmin() + 0.5*stepsize; // no randomizer! no radius constraint
+        endpoints.first = m_histos.getHisto(sector)->getXmin() + 0.5 * stepsize;  // no randomizer! no radius constraint
     }
 
-  if (radius > m_histos.getHisto(sector)->getXmax())
-    {
-      endpoints.second = m_histos.getHisto(sector)->getXmax();
-    }
-  return endpoints;
+    if (radius > m_histos.getHisto(sector)->getXmax()) { endpoints.second = m_histos.getHisto(sector)->getXmax(); }
+    return endpoints;
 }
 
-double MuonHoughTransformer::sinus(double angle)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer::sinus");
-  std::map <double,double>::const_iterator find;
+double MuonHoughTransformer::sinus(double angle) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer::sinus");
+    std::map<double, double>::const_iterator find;
 
-  find = m_sin.find(angle);
+    find = m_sin.find(angle);
 
-  if (find != m_sin.end())
-    {
-      return find->second;
-    }
-  else 
-    {
-      if (log.level()<=MSG::WARNING)
-	log << MSG::WARNING << "MuonHoughTransformer::WARNING: angle: " << angle << " not in map!" << endmsg;
-      return std::sin(angle);
+    if (find != m_sin.end()) {
+        return find->second;
+    } else {
+        if (log.level() <= MSG::WARNING)
+            log << MSG::WARNING << "MuonHoughTransformer::WARNING: angle: " << angle << " not in map!" << endmsg;
+        return std::sin(angle);
     }
 }
 
-double MuonHoughTransformer::cosinus(double angle)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer::cosinus");
-  std::map <double,double>::const_iterator find;
+double MuonHoughTransformer::cosinus(double angle) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer::cosinus");
+    std::map<double, double>::const_iterator find;
 
-  find = m_cos.find(angle);
+    find = m_cos.find(angle);
 
-  if (find != m_cos.end())
-    {
-      return find->second;
-    }
-  else 
-    {
-      if (log.level()<=MSG::WARNING)
-	log << MSG::WARNING << "MuonHoughTransformer::WARNING: angle: " << angle << " not in map!" << endmsg;
-      return std::cos(angle);
+    if (find != m_cos.end()) {
+        return find->second;
+    } else {
+        if (log.level() <= MSG::WARNING)
+            log << MSG::WARNING << "MuonHoughTransformer::WARNING: angle: " << angle << " not in map!" << endmsg;
+        return std::cos(angle);
     }
 }
 
-void MuonHoughTransformer::initTables()
-{
-  m_sin.clear();
-  m_cos.clear();
+void MuonHoughTransformer::initTables() {
+    m_sin.clear();
+    m_cos.clear();
 
-  // better to calculate pi/180 * theta already and loop over angle in rad
-  for (double angle = m_stepsize_per_angle/2.; angle <180.; angle+=m_stepsize_per_angle)
-    {
-      double angle_in_rad = M_PI*angle/180.;
-      m_sin[angle_in_rad] = std::sin(angle_in_rad);
-      m_cos[angle_in_rad] = std::cos(angle_in_rad);
+    // better to calculate pi/180 * theta already and loop over angle in rad
+    for (double angle = m_stepsize_per_angle / 2.; angle < 180.; angle += m_stepsize_per_angle) {
+        double angle_in_rad = M_PI * angle / 180.;
+        m_sin[angle_in_rad] = std::sin(angle_in_rad);
+        m_cos[angle_in_rad] = std::cos(angle_in_rad);
     }
 }
 
-void MuonHoughTransformer::resetHisto()
-{
-  m_histos.reset();
-}
+void MuonHoughTransformer::resetHisto() { m_histos.reset(); }
 
-std::vector <std::pair <int,int> > MuonHoughTransformer::getMaxima(int max_patterns)const
-{
-  std::vector <std::pair <int,int> > maximumbins; // sorted
-  
-  std::vector <std::pair < std::pair <int,int> , double > > maxima;
+std::vector<std::pair<int, int> > MuonHoughTransformer::getMaxima(int max_patterns) const {
+    std::vector<std::pair<int, int> > maximumbins;  // sorted
 
-  for (int sector=0; sector<m_number_of_sectors; sector++) // to be made more general when m_number_of_sectors ==1 e.g.
+    std::vector<std::pair<std::pair<int, int>, double> > maxima;
+
+    for (int sector = 0; sector < m_number_of_sectors; sector++)  // to be made more general when m_number_of_sectors ==1 e.g.
     {
-      std::pair <int,double> maximumbin = m_histos.getHisto(sector)->getMax();
-      std::pair < std::pair <int,int> , double > maximum;
-      maximum.first.first = sector;
-      maximum.first.second = maximumbin.first;
-      maximum.second = maximumbin.second;
-      maxima.push_back(maximum);
+        std::pair<int, double> maximumbin = m_histos.getHisto(sector)->getMax();
+        std::pair<std::pair<int, int>, double> maximum;
+        maximum.first.first = sector;
+        maximum.first.second = maximumbin.first;
+        maximum.second = maximumbin.second;
+        maxima.push_back(maximum);
     }
 
-  sort(maxima.begin(),maxima.end(),maximaCompare());
-  
-  unsigned int count_maxima = 0; // should be iterator
-  int number_of_patterns = 0;
-  std::set <int> sectors; // sectors that are already used
-  const unsigned int size = maxima.size();
-  while (count_maxima!=size && number_of_patterns!=max_patterns)
-    {
-      std::pair <int,int> maximumbin = maxima[count_maxima].first; 
-
-      bool check = true; // check if sector is not nearby a sector already chosen
-      int sector = maximumbin.first;
-
-      if (sectors.find(sector) != sectors.end()) {check = false;}
-
-      if (check)
-	{
-	  maximumbins.push_back(maximumbin);
-	  sectors.insert(maximumbin.first);
-
-	  int sectormin = sector-1;
-	  int sectorplus = sector+1;
-	  if (sectormin < 0) {sectormin = m_number_of_sectors;}
-	  if (sectorplus > m_number_of_sectors) {sectorplus=0;}
-
-	  sectors.insert(sectormin);
-	  sectors.insert(sectorplus);
-
-	  if (m_number_of_sectors > 20  && maximumbin.first%2 == 1) // hack for new single and overlap filling curved transform!
-	    {
-	      int sectorminmin = sectormin - 1;
-	      int sectorplusplus = sectorplus + 1;
-	      sectors.insert(sectorminmin);
-	      sectors.insert(sectorplusplus);
-	    }
-
-	  count_maxima++;
-	  number_of_patterns++;
-	}
-      else 
-	{
-	  count_maxima++;
-	}
+    sort(maxima.begin(), maxima.end(), maximaCompare());
+
+    unsigned int count_maxima = 0;  // should be iterator
+    int number_of_patterns = 0;
+    std::set<int> sectors;  // sectors that are already used
+    const unsigned int size = maxima.size();
+    while (count_maxima != size && number_of_patterns != max_patterns) {
+        std::pair<int, int> maximumbin = maxima[count_maxima].first;
+
+        bool check = true;  // check if sector is not nearby a sector already chosen
+        int sector = maximumbin.first;
+
+        if (sectors.find(sector) != sectors.end()) { check = false; }
+
+        if (check) {
+            maximumbins.push_back(maximumbin);
+            sectors.insert(maximumbin.first);
+
+            int sectormin = sector - 1;
+            int sectorplus = sector + 1;
+            if (sectormin < 0) { sectormin = m_number_of_sectors; }
+            if (sectorplus > m_number_of_sectors) { sectorplus = 0; }
+
+            sectors.insert(sectormin);
+            sectors.insert(sectorplus);
+
+            if (m_number_of_sectors > 20 && maximumbin.first % 2 == 1)  // hack for new single and overlap filling curved transform!
+            {
+                int sectorminmin = sectormin - 1;
+                int sectorplusplus = sectorplus + 1;
+                sectors.insert(sectorminmin);
+                sectors.insert(sectorplusplus);
+            }
+
+            count_maxima++;
+            number_of_patterns++;
+        } else {
+            count_maxima++;
+        }
     }
 
-  return maximumbins;
+    return maximumbins;
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_CurvedAtACylinder.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_CurvedAtACylinder.cxx
index 382beade1c560a126c42923f47bb97ba3d1737c5..ba78737ef0d1bd3e441fd9b69e9c4f65e491e143 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_CurvedAtACylinder.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_CurvedAtACylinder.cxx
@@ -3,266 +3,253 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_CurvedAtACylinder.h"
+
+#include "AthenaKernel/getMessageSvc.h"
 #include "CxxUtils/sincos.h"
 #include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
 
-MuonHoughTransformer_CurvedAtACylinder::MuonHoughTransformer_CurvedAtACylinder(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors)
-{
-  m_add_weight_radius = false;
-  m_weight_constant_radius=0.;
-  m_add_weight_angle=false;
-
-  // fill array with scanned curvatures
-  
-  m_invcurvature = new double[m_nbins/2];
-  m_weightcurvature = new double[m_nbins/2];
-
-  for (int i=0 ; i<m_nbins/2; i++)
-    {
-      double x0 = -i+24; // 24 ... -55
-      if (x0 > 15.) x0 = 15 + (x0-15)*0.5; // 19.5,19,18.5, .., 15.5,15,14,13,.. 2,1,0,-1...-55  // 80 bins
-
-      double curvature = -3. * 3500. * 20.25 / (x0-19.75); // >0
-      m_invcurvature[i] = 1./curvature;
-      if (i<=10) {
-	m_weightcurvature[i] = 1.;
-      }
-      else if (i<=20) {
-	m_weightcurvature[i] = 1-0.05*(i-10);
-      }
-      else {
-	m_weightcurvature[i] = 0.5;
-      }
+MuonHoughTransformer_CurvedAtACylinder::MuonHoughTransformer_CurvedAtACylinder(int nbins, int nbins_angle, double detectorsize,
+                                                                               double detectorsize_angle, double threshold_histo,
+                                                                               int number_of_sectors) :
+    MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors) {
+    m_add_weight_radius = false;
+    m_weight_constant_radius = 0.;
+    m_add_weight_angle = false;
+
+    // fill array with scanned curvatures
+
+    m_invcurvature = new double[m_nbins / 2];
+    m_weightcurvature = new double[m_nbins / 2];
+
+    for (int i = 0; i < m_nbins / 2; i++) {
+        double x0 = -i + 24;                      // 24 ... -55
+        if (x0 > 15.) x0 = 15 + (x0 - 15) * 0.5;  // 19.5,19,18.5, .., 15.5,15,14,13,.. 2,1,0,-1...-55  // 80 bins
+
+        double curvature = -3. * 3500. * 20.25 / (x0 - 19.75);  // >0
+        m_invcurvature[i] = 1. / curvature;
+        if (i <= 10) {
+            m_weightcurvature[i] = 1.;
+        } else if (i <= 20) {
+            m_weightcurvature[i] = 1 - 0.05 * (i - 10);
+        } else {
+            m_weightcurvature[i] = 0.5;
+        }
     }
 }
 
-MuonHoughTransformer_CurvedAtACylinder::~MuonHoughTransformer_CurvedAtACylinder()
-{
-  delete[] m_invcurvature;
-  delete[] m_weightcurvature;
+MuonHoughTransformer_CurvedAtACylinder::~MuonHoughTransformer_CurvedAtACylinder() {
+    delete[] m_invcurvature;
+    delete[] m_weightcurvature;
 }
 
-void MuonHoughTransformer_CurvedAtACylinder::fillHit(MuonHoughHit* hit, double weight)
-{
-  // MuonHough transform studies
+void MuonHoughTransformer_CurvedAtACylinder::fillHit(MuonHoughHit* hit, double weight) {
+    // MuonHough transform studies
 
-  // cylinder for extrapolation planes in muon system endcap/barrel transition
+    // cylinder for extrapolation planes in muon system endcap/barrel transition
 
-  int sectorhit = sector(hit);
+    int sectorhit = sector(hit);
 
-  bool isbarrel = hit->isBarrel();
+    bool isbarrel = hit->isBarrel();
 
-  for (int i=0 ; i<m_nbins/2; i++)
-    {
-      // not a too large curve for endcap hits (generates peaks in houghtransform)
-      const double ratio = hit->getMagneticTrackRatio()*m_invcurvature[i];
-      if (!isbarrel && std::abs(ratio) > 0.5) break; 
-      
-      // positive curvature (for positive i):
-      double thetas[2];
-      MuonHoughMathUtils::thetasForCurvedHit(ratio,hit,thetas[0],thetas[1]);
+    for (int i = 0; i < m_nbins / 2; i++) {
+        // not a too large curve for endcap hits (generates peaks in houghtransform)
+        const double ratio = hit->getMagneticTrackRatio() * m_invcurvature[i];
+        if (!isbarrel && std::abs(ratio) > 0.5) break;
 
-      const double weight_curvature = weight * 1./ (1.+m_eventsize_weightfactor*(thetas[0]-hit->getTheta()));    //* m_weightcurvature[i]; // m_eventsize_weightfactor is defined in MuonHoughTransformer::fill(event)      
+        // positive curvature (for positive i):
+        double thetas[2];
+        MuonHoughMathUtils::thetasForCurvedHit(ratio, hit, thetas[0], thetas[1]);
 
-      // Remove theta solutions outside 0 - 180 degree range
-      if (thetas[0] > 0. && thetas[0] < M_PI) { 
-	double theta_in_grad = thetas[0] * MuonHough::rad_degree_conversion_factor;
+        const double weight_curvature =
+            weight * 1. /
+            (1. +
+             m_eventsize_weightfactor *
+                 (thetas[0] -
+                  hit->getTheta()));  //* m_weightcurvature[i]; // m_eventsize_weightfactor is defined in MuonHoughTransformer::fill(event)
 
-	const double weight_curvature_theta = weight_curvature * (0.5+0.5*std::sin(thetas[0]));
+        // Remove theta solutions outside 0 - 180 degree range
+        if (thetas[0] > 0. && thetas[0] < M_PI) {
+            double theta_in_grad = thetas[0] * MuonHough::rad_degree_conversion_factor;
 
-	fillHisto(i+0.5,theta_in_grad,weight_curvature_theta,2*sectorhit); // overlap and single sector filling
-      }
-      
-      // negative curvature (for negative i)
-      
-      // Remove theta solutions outside 0 - 180 degree range
-      if (thetas[1] > 0. && thetas[1] < M_PI) { 
-	double theta_in_grad = thetas[1] * MuonHough::rad_degree_conversion_factor;
+            const double weight_curvature_theta = weight_curvature * (0.5 + 0.5 * std::sin(thetas[0]));
 
-	const double weight_curvature_theta = weight_curvature * (0.5+0.5*std::sin(thetas[1]));	
-	fillHisto(-i-0.5,theta_in_grad,weight_curvature_theta,2*sectorhit); // overlap and single sector filling
-      }
-    }
-}
+            fillHisto(i + 0.5, theta_in_grad, weight_curvature_theta, 2 * sectorhit);  // overlap and single sector filling
+        }
 
-int MuonHoughTransformer_CurvedAtACylinder::fillHisto(double xbin, double theta_in_grad, double weight, int sector)
-{
-  MuonHoughHisto2D* histo = m_histos.getHisto(sector);
-
-  const int filled_binnumber = histo->fill(xbin,theta_in_grad,weight); 
-
-  // overlap filling:
-  // overlap and single sector filling:
-  // nearby sectors:
-  if (m_number_of_sectors>=3)
-    {
-      const double reduced_weight = 0.8*weight; // arbitrary should be between 0.5 and 1
-      if (sector != 0 && sector != m_number_of_sectors - 1)
-	{
-	  m_histos.getHisto(sector+1)->fill(filled_binnumber,reduced_weight);
-	  m_histos.getHisto(sector-1)->fill(filled_binnumber,reduced_weight);
-	}
-      else if (sector == 0)
-	{
-	  m_histos.getHisto(sector+1)->fill(filled_binnumber,reduced_weight);
-	  m_histos.getHisto(m_number_of_sectors-1)->fill(filled_binnumber,reduced_weight);
-	}
-      else
-	{
-	  m_histos.getHisto(sector-1)->fill(filled_binnumber,reduced_weight);
-	  m_histos.getHisto(0)->fill(filled_binnumber,reduced_weight);
-	}
-    }
+        // negative curvature (for negative i)
 
-  // smearing effect: 
+        // Remove theta solutions outside 0 - 180 degree range
+        if (thetas[1] > 0. && thetas[1] < M_PI) {
+            double theta_in_grad = thetas[1] * MuonHough::rad_degree_conversion_factor;
 
-  const double fifth_weight = 0.2*weight;
-  const int upperright = filled_binnumber + m_nbins_plus3;
-  const int lowerleft = filled_binnumber - m_nbins_plus3;
+            const double weight_curvature_theta = weight_curvature * (0.5 + 0.5 * std::sin(thetas[1]));
+            fillHisto(-i - 0.5, theta_in_grad, weight_curvature_theta, 2 * sectorhit);  // overlap and single sector filling
+        }
+    }
+}
 
-  if (theta_in_grad - m_binwidthy < 0)
-    {
-      histo->fill(upperright,fifth_weight);
+int MuonHoughTransformer_CurvedAtACylinder::fillHisto(double xbin, double theta_in_grad, double weight, int sector) {
+    MuonHoughHisto2D* histo = m_histos.getHisto(sector);
+
+    const int filled_binnumber = histo->fill(xbin, theta_in_grad, weight);
+
+    // overlap filling:
+    // overlap and single sector filling:
+    // nearby sectors:
+    if (m_number_of_sectors >= 3) {
+        const double reduced_weight = 0.8 * weight;  // arbitrary should be between 0.5 and 1
+        if (sector != 0 && sector != m_number_of_sectors - 1) {
+            m_histos.getHisto(sector + 1)->fill(filled_binnumber, reduced_weight);
+            m_histos.getHisto(sector - 1)->fill(filled_binnumber, reduced_weight);
+        } else if (sector == 0) {
+            m_histos.getHisto(sector + 1)->fill(filled_binnumber, reduced_weight);
+            m_histos.getHisto(m_number_of_sectors - 1)->fill(filled_binnumber, reduced_weight);
+        } else {
+            m_histos.getHisto(sector - 1)->fill(filled_binnumber, reduced_weight);
+            m_histos.getHisto(0)->fill(filled_binnumber, reduced_weight);
+        }
+    }
 
-      if (m_use_negative_weights)
-	{
-	  histo->fill(upperright-2,-fifth_weight);
-	}
+    // smearing effect:
+
+    const double fifth_weight = 0.2 * weight;
+    const int upperright = filled_binnumber + m_nbins_plus3;
+    const int lowerleft = filled_binnumber - m_nbins_plus3;
+
+    if (theta_in_grad - m_binwidthy < 0) {
+        histo->fill(upperright, fifth_weight);
+
+        if (m_use_negative_weights) { histo->fill(upperright - 2, -fifth_weight); }
+    } else if (theta_in_grad + m_binwidthy > 180.) {
+        histo->fill(lowerleft, fifth_weight);
+        if (m_use_negative_weights) { histo->fill(xbin + m_binwidthx, theta_in_grad - m_binwidthy, -fifth_weight); }
+    } else {
+        histo->fill(upperright, fifth_weight);
+        histo->fill(lowerleft, fifth_weight);
+        if (m_use_negative_weights) {
+            histo->fill(upperright - 2, -fifth_weight);
+            histo->fill(lowerleft + 2, -fifth_weight);
+        }
     }
-  else if (theta_in_grad + m_binwidthy > 180.)
-    {
-      histo->fill(lowerleft,fifth_weight);
-      if (m_use_negative_weights)
-	{
-	  histo->fill(xbin+m_binwidthx,theta_in_grad-m_binwidthy,-fifth_weight);
-	}
+    return filled_binnumber;
+}
+
+MuonHoughPattern* MuonHoughTransformer_CurvedAtACylinder::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,
+                                                                                     std::pair<double, double> coordsmaximum,
+                                                                                     double max_residu_mm, double /*max_residu_grad */,
+                                                                                     int maxsector, bool /*which_segment */,
+                                                                                     int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer_CurvedAtACylinder::hookAssociateHitsToMaximum");
+    MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_curved_at_a_cylinder);
+
+    // double ecurvature=0. // todo: recalculate estimated curvature for hits associated to maximum
+    double etheta = 0., sin_phi = 0., cos_phi = 0., sin_theta = 0., cos_theta = 0., ephi = 0.;
+    const double theta = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
+
+    double invcurvature = 0.;
+    double curvature = 0.;
+    if (m_nbins < 40) {
+        curvature = MuonHoughMathUtils::sgn(coordsmaximum.first) / (coordsmaximum.first * coordsmaximum.first);
+        invcurvature = 1. / curvature;
+    } else {
+        // coordsmaximum.first = -80.5 .. 80.5 // 160 bins
+        int index = static_cast<int>(std::floor(std::abs(coordsmaximum.first)));
+        if (index >= m_nbins / 2) {
+            index = m_nbins / 2 - 1;
+            if (printlevel >= 4 || log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "warning overflow maximum found" << endmsg;
+        }
+        invcurvature = MuonHoughMathUtils::sgn(coordsmaximum.first) * m_invcurvature[index];
+        curvature = 1. / invcurvature;
     }
-  else 
-    {
-      histo->fill(upperright,fifth_weight);
-      histo->fill(lowerleft,fifth_weight);      
-      if (m_use_negative_weights)
-	{
-	  histo->fill(upperright-2,-fifth_weight);
-	  histo->fill(lowerleft+2,-fifth_weight);      
-	}
+
+    // allowed sectors:
+    int sector_1 = maxsector / 2;  // primary sector
+    int sector_2 = sector_1 + 1;
+    int sector_3 = sector_1 - 1;
+    if (sector_2 > m_number_of_sectors / 2 - 1) { sector_2 = 0; }  // if sector_2 larger than 15 -> 0
+    if (maxsector % 2 == 1) {                                      // if overlap maximum then only association to 2 sectors
+        sector_3 = sector_1;
+    } else if (sector_3 < 0) {
+        sector_3 = m_number_of_sectors / 2 - 1;
+    }  // if sector_3 smaller than 0 -> 15
+
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "sector: " << maxsector << endmsg;
+        log << MSG::VERBOSE << "coordsmaximumfirst: " << coordsmaximum.first << " curvature: " << curvature << endmsg;
+        log << MSG::VERBOSE << "coordsmaximumsecond: " << coordsmaximum.second << " coordsmaximumsecondinrad: " << theta << endmsg;
+        log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::size of event: " << event->size() << endmsg;
+        log << MSG::VERBOSE << "allowed sectors: " << sector_1 << " , " << sector_2 << " & " << sector_3 << endmsg;
     }
-  return filled_binnumber;
-}
 
-MuonHoughPattern* MuonHoughTransformer_CurvedAtACylinder::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double max_residu_mm,double /*max_residu_grad */, int maxsector, bool /*which_segment */, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer_CurvedAtACylinder::hookAssociateHitsToMaximum");
-  MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_curved_at_a_cylinder);
-
-  // double ecurvature=0. // todo: recalculate estimated curvature for hits associated to maximum
-  double etheta=0., sin_phi=0., cos_phi=0., sin_theta=0., cos_theta=0., ephi=0.; 
-  const double theta = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
-
-  double invcurvature = 0.;
-  double curvature = 0.;
-  if (m_nbins <40) {
-    curvature = MuonHoughMathUtils::sgn(coordsmaximum.first) / (coordsmaximum.first * coordsmaximum.first);
-     invcurvature = 1./curvature;
-  }
-  else {
-    // coordsmaximum.first = -80.5 .. 80.5 // 160 bins
-    int index = static_cast<int> (std::floor(std::abs(coordsmaximum.first)));
-    if (index >= m_nbins/2) {
-      index = m_nbins/2-1;
-      if (printlevel >= 4 || log.level()<=MSG::VERBOSE) log << MSG::VERBOSE << "warning overflow maximum found" << endmsg;
+    for (unsigned int i = 0; i < event->size(); i++) {
+        int sectorhit = sector(event->getHit(i));
+        if (sectorhit == sector_1 || sectorhit == sector_2 || sectorhit == sector_3) {
+            double hitx = event->getHitx(i);
+            double hity = event->getHity(i);
+            double hitz = event->getHitz(i);
+            double z0 = 0.;  // offset from IP on z-axis
+            const double sdis = MuonHoughMathUtils::signedDistanceCurvedToHit(z0, theta, invcurvature, hitx, hity, hitz);
+
+            double radius3d = std::sqrt(hitx * hitx + hity * hity + hitz * hitz);
+            if (radius3d < 5000.)
+                radius3d = 5000.;
+            else if (radius3d > 15000.)
+                radius3d = 15000.;
+            double scale = radius3d / 5000.;
+
+            double residu_distance_mm = std::abs(sdis);
+
+            if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::hitx: " << hitx << " hity: " << hity << " hitz: " << hitz
+                    << endmsg;
+                log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::residu_distance: " << sdis
+                    << " max_residu_mm*scale: " << max_residu_mm * scale << endmsg;
+            }
+
+            if (std::abs(residu_distance_mm) < max_residu_mm * scale)  // here no circular effect
+            {
+                double phi = std::atan2(hity, hitx);
+                CxxUtils::sincos scphi(phi);
+                sin_phi += scphi.sn;
+                cos_phi += scphi.cs;
+
+                const double theta = MuonHoughMathUtils::thetaForCurvedHit(invcurvature, event->getHit(i));
+                if (theta > 0 && theta < M_PI) {
+                    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                        log << MSG::VERBOSE
+                            << "MuonHoughTransformer_CurvedAtACylinder::hit added to houghpattern! Sector number: " << sectorhit << endmsg;
+                        if (event->getHit(i)->getAssociated())
+                            log << MSG::VERBOSE << " hit already earlier associated to pattern!" << endmsg;
+                    }
+                    houghpattern->addHit(event->getHit(i));
+                    event->getHit(i)->setAssociated(true);
+                    CxxUtils::sincos sctheta(theta);
+                    sin_theta += sctheta.sn;
+                    cos_theta += sctheta.cs;
+                }
+            }  // residu
+        }      // sector constraint
+    }          // hitno
+
+    etheta = std::atan2(sin_theta, cos_theta);
+    //  etheta = theta;
+    ephi = std::atan2(sin_phi, cos_phi);
+    houghpattern->setETheta(etheta);
+    houghpattern->setERTheta(0.);
+    houghpattern->setEPhi(ephi);
+    houghpattern->setECurvature(curvature);
+
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << " number of hits added to pattern: " << houghpattern->size() << endmsg;
     }
-    invcurvature = MuonHoughMathUtils::sgn(coordsmaximum.first)*m_invcurvature[index];
-    curvature = 1./invcurvature;
-  }
-
-  // allowed sectors:
-  int sector_1 = maxsector/2; // primary sector
-  int sector_2 = sector_1 + 1;
-  int sector_3 = sector_1 - 1;
-  if (sector_2 > m_number_of_sectors/2 - 1 ) {sector_2=0;} // if sector_2 larger than 15 -> 0
-  if (maxsector%2==1) { // if overlap maximum then only association to 2 sectors
-    sector_3=sector_1;
-  }
-  else if (sector_3 < 0) {sector_3 = m_number_of_sectors/2 - 1;} // if sector_3 smaller than 0 -> 15
-  
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE) {
-    log << MSG::VERBOSE << "sector: " << maxsector << endmsg;
-    log << MSG::VERBOSE << "coordsmaximumfirst: " << coordsmaximum.first << " curvature: " << curvature << endmsg;
-    log << MSG::VERBOSE << "coordsmaximumsecond: " << coordsmaximum.second << " coordsmaximumsecondinrad: " << theta << endmsg;
-    log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::size of event: " << event->size() << endmsg;
-    log << MSG::VERBOSE << "allowed sectors: " << sector_1 << " , " << sector_2  << " & " << sector_3 << endmsg; 
-  }
-
-  for (unsigned int i=0; i<event->size(); i++)
-    {
-      int sectorhit = sector(event->getHit(i));
-      if (sectorhit == sector_1 || sectorhit == sector_2 || sectorhit == sector_3)
-	{
-	  double hitx = event->getHitx(i);
-	  double hity = event->getHity(i);
-	  double hitz = event->getHitz(i);
-	  double z0 = 0.; //offset from IP on z-axis
-          const double sdis = MuonHoughMathUtils::signedDistanceCurvedToHit(z0,theta,invcurvature, hitx, hity , hitz );
-	  
-	  double radius3d = std::sqrt(hitx*hitx+hity*hity+hitz*hitz); 
-          if (radius3d < 5000.) radius3d = 5000.;
-          else if (radius3d > 15000.) radius3d = 15000.;
-          double scale = radius3d/5000.;
-
-	  double residu_distance_mm = std::abs(sdis);
-
-	  if (printlevel>=4 || log.level()<=MSG::VERBOSE) {
-	     log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::hitx: " << hitx << " hity: " << hity << " hitz: " << hitz << endmsg;
-	     log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::residu_distance: " << sdis << " max_residu_mm*scale: " << max_residu_mm*scale << endmsg;
-	  }
-	  
-	  if(std::abs(residu_distance_mm)<max_residu_mm*scale) // here no circular effect
-	    {
-	      double phi = std::atan2(hity,hitx);
-	      CxxUtils::sincos scphi(phi);
-	      sin_phi += scphi.sn;
-	      cos_phi += scphi.cs;
-	      
-              const double theta =  MuonHoughMathUtils::thetaForCurvedHit(invcurvature,event->getHit(i));
-              if ( theta > 0 && theta < M_PI) {
-		if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-		  {
-		    log << MSG::VERBOSE << "MuonHoughTransformer_CurvedAtACylinder::hit added to houghpattern! Sector number: " << sectorhit << endmsg;
-		    if (event->getHit(i)->getAssociated()) log << MSG::VERBOSE << " hit already earlier associated to pattern!" << endmsg;
-		  }
-		houghpattern->addHit(event->getHit(i));
-		event->getHit(i)->setAssociated(true);
-		CxxUtils::sincos sctheta(theta);
-		sin_theta += sctheta.sn;
-		cos_theta += sctheta.cs;
-	      }
-	    } // residu
-	} // sector constraint
-    }// hitno
-      
-  etheta = std::atan2(sin_theta,cos_theta);
-//  etheta = theta; 
-  ephi = std::atan2(sin_phi,cos_phi);
-  houghpattern->setETheta(etheta);
-  houghpattern->setERTheta(0.);
-  houghpattern->setEPhi(ephi);
-  houghpattern->setECurvature(curvature);
-
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE) {
-    log << MSG::VERBOSE << " number of hits added to pattern: " << houghpattern->size() << endmsg;}
-  if (houghpattern->empty() && (printlevel>=1 || log.level()<=MSG::WARNING))
-    {
-      log << MSG::WARNING << "MuonHoughTransformer_CurvedAtACylinder::WARNING : no hits found on pattern" << endmsg;
+    if (houghpattern->empty() && (printlevel >= 1 || log.level() <= MSG::WARNING)) {
+        log << MSG::WARNING << "MuonHoughTransformer_CurvedAtACylinder::WARNING : no hits found on pattern" << endmsg;
     }
-  
-  return houghpattern;
-}
 
-float MuonHoughTransformer_CurvedAtACylinder::weightHoughTransform(double /*r0*/)const
-{
-  // not in use for this transform
-  return 1.;
+    return houghpattern;
 }
 
+float MuonHoughTransformer_CurvedAtACylinder::weightHoughTransform(double /*r0*/) const {
+    // not in use for this transform
+    return 1.;
+}
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rz.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rz.cxx
index 800d5f1ab43816ec58d4fc89efa50913f7456009..8aaa4bea406741a3d8dc14da0b45ab834bbaa0b9 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rz.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rz.cxx
@@ -3,308 +3,290 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_rz.h"
-#include "GaudiKernel/MsgStream.h"
+
 #include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
 
-MuonHoughTransformer_rz::MuonHoughTransformer_rz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors), m_use_residu_grad(false)
-{
-  m_add_weight_radius = false;
-  m_weight_constant_radius=0.;
-  m_add_weight_angle=false;
+MuonHoughTransformer_rz::MuonHoughTransformer_rz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                                 double threshold_histo, int number_of_sectors) :
+    MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors),
+    m_use_residu_grad(false) {
+    m_add_weight_radius = false;
+    m_weight_constant_radius = 0.;
+    m_add_weight_angle = false;
 }
 
-void MuonHoughTransformer_rz::fillHit(MuonHoughHit* hit, double weight)
-{
-  const double hitz = hit->getHitz();
+void MuonHoughTransformer_rz::fillHit(MuonHoughHit* hit, double weight) {
+    const double hitz = hit->getHitz();
 
-  if (m_ip_setting) // niels and peter alg, butterfly to be added, and to be looked into the method
+    if (m_ip_setting)  // niels and peter alg, butterfly to be added, and to be looked into the method
     {
-      const int sectorhit = sector(hit);
-      const double perp = hit->getRadius();
-      const double radius = hit->getAbs();
-
-      double dotprod = 0;
-      MuonHoughHisto2D* histo = m_histos.getHisto(sectorhit);
-      for (double rz0 = histo->getXmin()+m_stepsize/2.; rz0<histo->getXmax(); rz0+=m_stepsize)
-	{
-	  if (std::abs(rz0) > radius) continue;
-
-	  double heigth = sqrt(radius*radius - rz0*rz0);
-	  double theta = std::atan2(perp,hitz)+std::atan2(rz0,heigth); 
-	  double theta_in_grad = (theta/M_PI)*180.;
-
-	  dotprod = perp * std::sin(theta) + hitz * std::cos(theta);
-
-	  if( theta_in_grad > 180. ) continue; // to keep the angle physical
-	  if( theta_in_grad < 0. ) continue; // idem
-  
-	  if (dotprod >=0)
-	    {
-	      fillHisto(rz0,theta_in_grad,weight,sectorhit);
-	    }
-	}
-    }
-  else
-    {
-      int sectorhit = 0;
-      const double radius = hit->getRadius();
-
-      for (double theta=m_stepsize_per_angle/2.; theta<m_detectorsize_angle; theta+=m_stepsize_per_angle)
-	{
-	  double theta_in_rad = M_PI*theta/180.;
-	  double rz0 = hitz*std::sin(theta_in_rad) - radius*std::cos(theta_in_rad);
-	  double dotprod = 0;
-      
-	  dotprod = radius * std::sin(theta_in_rad) + hitz * std::cos(theta_in_rad);
-	  if (dotprod >=0)
-	    {
-	      fillHisto(rz0,theta,weight,sectorhit);
-	    } // dotprod
-	}
-    } // m_atlas_setting
+        const int sectorhit = sector(hit);
+        const double perp = hit->getRadius();
+        const double radius = hit->getAbs();
+
+        double dotprod = 0;
+        MuonHoughHisto2D* histo = m_histos.getHisto(sectorhit);
+        for (double rz0 = histo->getXmin() + m_stepsize / 2.; rz0 < histo->getXmax(); rz0 += m_stepsize) {
+            if (std::abs(rz0) > radius) continue;
+
+            double heigth = sqrt(radius * radius - rz0 * rz0);
+            double theta = std::atan2(perp, hitz) + std::atan2(rz0, heigth);
+            double theta_in_grad = (theta / M_PI) * 180.;
+
+            dotprod = perp * std::sin(theta) + hitz * std::cos(theta);
+
+            if (theta_in_grad > 180.) continue;  // to keep the angle physical
+            if (theta_in_grad < 0.) continue;    // idem
+
+            if (dotprod >= 0) { fillHisto(rz0, theta_in_grad, weight, sectorhit); }
+        }
+    } else {
+        int sectorhit = 0;
+        const double radius = hit->getRadius();
+
+        for (double theta = m_stepsize_per_angle / 2.; theta < m_detectorsize_angle; theta += m_stepsize_per_angle) {
+            double theta_in_rad = M_PI * theta / 180.;
+            double rz0 = hitz * std::sin(theta_in_rad) - radius * std::cos(theta_in_rad);
+            double dotprod = 0;
+
+            dotprod = radius * std::sin(theta_in_rad) + hitz * std::cos(theta_in_rad);
+            if (dotprod >= 0) { fillHisto(rz0, theta, weight, sectorhit); }  // dotprod
+        }
+    }  // m_atlas_setting
 }
 
-int MuonHoughTransformer_rz::fillHisto(double rz0, double theta_in_grad, double weight, int sector)
-{
-  MuonHoughHisto2D* histo = m_histos.getHisto(sector);
-
-  double binwidthx = histo->getBinWidthX();
-  double binwidthy = histo->getBinWidthY();
-  
-  int filled_binnumber = histo->fill(rz0,theta_in_grad,weight); 
-  // butterfly:
-
-  // nearby sectors:
-  if (m_number_of_sectors>=3)
-    {
-      double third_weight = weight/3.;
-      if (sector != 0 && sector != m_number_of_sectors - 1)
-	{
-	  m_histos.getHisto(sector+1)->fill(rz0,theta_in_grad,third_weight);
-	  m_histos.getHisto(sector-1)->fill(rz0,theta_in_grad,third_weight);
-	}
-      else if (sector == 0)
-	{
-	  m_histos.getHisto(sector+1)->fill(rz0,theta_in_grad,third_weight);
-	  m_histos.getHisto(m_number_of_sectors-1)->fill(rz0,theta_in_grad,third_weight);
-	}
-      else
-	{
-	  m_histos.getHisto(sector-1)->fill(rz0,theta_in_grad,third_weight);
-	  m_histos.getHisto(0)->fill(rz0,theta_in_grad,third_weight);
-	}
+int MuonHoughTransformer_rz::fillHisto(double rz0, double theta_in_grad, double weight, int sector) {
+    MuonHoughHisto2D* histo = m_histos.getHisto(sector);
+
+    double binwidthx = histo->getBinWidthX();
+    double binwidthy = histo->getBinWidthY();
+
+    int filled_binnumber = histo->fill(rz0, theta_in_grad, weight);
+    // butterfly:
+
+    // nearby sectors:
+    if (m_number_of_sectors >= 3) {
+        double third_weight = weight / 3.;
+        if (sector != 0 && sector != m_number_of_sectors - 1) {
+            m_histos.getHisto(sector + 1)->fill(rz0, theta_in_grad, third_weight);
+            m_histos.getHisto(sector - 1)->fill(rz0, theta_in_grad, third_weight);
+        } else if (sector == 0) {
+            m_histos.getHisto(sector + 1)->fill(rz0, theta_in_grad, third_weight);
+            m_histos.getHisto(m_number_of_sectors - 1)->fill(rz0, theta_in_grad, third_weight);
+        } else {
+            m_histos.getHisto(sector - 1)->fill(rz0, theta_in_grad, third_weight);
+            m_histos.getHisto(0)->fill(rz0, theta_in_grad, third_weight);
+        }
     }
 
-  double half_weight = 0.5*weight;
-  
-  if (theta_in_grad - binwidthy < 0)
-    {
-      histo->fill(rz0+binwidthx,theta_in_grad+binwidthy,half_weight);
-      if (m_use_negative_weights)
-	{
-	  histo->fill(rz0-binwidthx,theta_in_grad+binwidthy,-half_weight);
-	}
-      
-    }
-  else if (theta_in_grad + binwidthy > 180.)
-    {
-      histo->fill(rz0-binwidthx,theta_in_grad-binwidthy,half_weight);
-      if (m_use_negative_weights)
-	{
-	  histo->fill(rz0+binwidthx,theta_in_grad-binwidthy,-half_weight);
-	}
-    }
-  else 
-    {
-      histo->fill(rz0+binwidthx,theta_in_grad+binwidthy,half_weight);
-      histo->fill(rz0-binwidthx,theta_in_grad-binwidthy,half_weight);
-      if (m_use_negative_weights)
-	{
-	  histo->fill(rz0-binwidthx,theta_in_grad+binwidthy,-half_weight);
-	  histo->fill(rz0+binwidthx,theta_in_grad-binwidthy,-half_weight);
-	}
+    double half_weight = 0.5 * weight;
+
+    if (theta_in_grad - binwidthy < 0) {
+        histo->fill(rz0 + binwidthx, theta_in_grad + binwidthy, half_weight);
+        if (m_use_negative_weights) { histo->fill(rz0 - binwidthx, theta_in_grad + binwidthy, -half_weight); }
+
+    } else if (theta_in_grad + binwidthy > 180.) {
+        histo->fill(rz0 - binwidthx, theta_in_grad - binwidthy, half_weight);
+        if (m_use_negative_weights) { histo->fill(rz0 + binwidthx, theta_in_grad - binwidthy, -half_weight); }
+    } else {
+        histo->fill(rz0 + binwidthx, theta_in_grad + binwidthy, half_weight);
+        histo->fill(rz0 - binwidthx, theta_in_grad - binwidthy, half_weight);
+        if (m_use_negative_weights) {
+            histo->fill(rz0 - binwidthx, theta_in_grad + binwidthy, -half_weight);
+            histo->fill(rz0 + binwidthx, theta_in_grad - binwidthy, -half_weight);
+        }
     }
-  return filled_binnumber;
+    return filled_binnumber;
 }
 
-double MuonHoughTransformer_rz::calculateAngle(double hitx, double hity, double hitz, double z0)
-{
+double MuonHoughTransformer_rz::calculateAngle(double hitx, double hity, double hitz, double z0) {
+    // z0 is cartesian coordinate where track goes through z axis
 
-  // z0 is cartesian coordinate where track goes through z axis
+    // analog to xyz:
+    double theta = 0;
+    double r = std::sqrt(hitx * hitx + hity * hity);
 
-  // analog to xyz:
-  double theta = 0;
-  double r = std::sqrt(hitx*hitx+hity*hity);
-  
-  theta = std::atan2(r,hitz-z0);
+    theta = std::atan2(r, hitz - z0);
 
-  return theta;
+    return theta;
 }
 
-MuonHoughPattern* MuonHoughTransformer_rz::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair <double,double> coordsmaximum,double maximum_residu_mm, double maximum_residu_angle, int maxsector, bool /*which_segment*/, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer_rz::hookAssociateHitsToMaximum");
-  MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_rz);
+MuonHoughPattern* MuonHoughTransformer_rz::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,
+                                                                      std::pair<double, double> coordsmaximum, double maximum_residu_mm,
+                                                                      double maximum_residu_angle, int maxsector, bool /*which_segment*/,
+                                                                      int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer_rz::hookAssociateHitsToMaximum");
+    MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_rz);
+
+    double theta = 0., residu_distance = 0., maximum_residu = 0.;
+    double eradius = 0., etheta = 0., sin_theta = 0., cos_theta = 0., sin_phi = 0., cos_phi = 0., phi = 0., ephi = 0.;
+    double coordsmaximumsecondinrad = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
+    double rz0 = coordsmaximum.first;
+
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "sector: " << maxsector << endmsg;
+        log << MSG::VERBOSE << "coordsmaximumfirst: " << rz0 << endmsg;
+        log << MSG::VERBOSE << "coordsmaximumsecond: " << coordsmaximum.second << " coordsmaximumsecondinrad: " << coordsmaximumsecondinrad
+            << endmsg;
+        log << MSG::VERBOSE << "MuonHoughTransformer_rz::size of event: " << event->size() << endmsg;
+    }
+
+    for (unsigned int i = 0; i < event->size(); i++) {
+        double dotprod = 0;
+        double hitx = event->getHitx(i);
+        double hity = event->getHity(i);
+        int sectorhit = sector(event->getHit(i));
+        int maxsecmax = maxsector + 1;
+        int maxsecmin = maxsector - 1;
+        if (maxsecmin < 0) maxsecmin = m_number_of_sectors - 1;
+        if (maxsecmax > m_number_of_sectors - 1) maxsecmax = 0;
+        // select which hits could be in maximum:
+        if (sectorhit == maxsector || sectorhit == maxsecmin || sectorhit == maxsecmax) {
+            double hitz = event->getHitz(i);
+            double radius = std::sqrt(hitx * hitx + hity * hity);
+
+            dotprod = radius * std::sin(coordsmaximumsecondinrad) + hitz * std::cos(coordsmaximumsecondinrad);
+
+            if (dotprod >= 0) {
+                double residu_distance_mm = MuonHoughMathUtils::signedDistanceToLine(hitz, radius, rz0, coordsmaximumsecondinrad);
+
+                // Use this code for rz scan and theta
+                //
+                double radius3 = sqrt(hitx * hitx + hity * hity + hitz * hitz);
+                double heigth = 0.;
+                if (std::abs(rz0) < radius3) {
+                    heigth = sqrt(radius3 * radius3 - rz0 * rz0);
+                } else {
+                    heigth = sqrt(rz0 * rz0 - radius3 * radius3);
+                }
 
-  double theta=0.,residu_distance=0.,maximum_residu=0.;
-  double eradius=0., etheta=0., sin_theta=0., cos_theta=0., sin_phi=0., cos_phi=0., phi=0., ephi=0.;
-  double coordsmaximumsecondinrad = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
-  double rz0 = coordsmaximum.first;
+                theta = std::atan2(radius, hitz) + std::atan2(rz0, heigth);
 
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-    {
-      log << MSG::VERBOSE << "sector: " << maxsector << endmsg;
-      log << MSG::VERBOSE << "coordsmaximumfirst: " << rz0 << endmsg;
-      log << MSG::VERBOSE << "coordsmaximumsecond: " << coordsmaximum.second << " coordsmaximumsecondinrad: " << coordsmaximumsecondinrad << endmsg;
-      log << MSG::VERBOSE << "MuonHoughTransformer_rz::size of event: " << event->size() << endmsg;
-    }
+                if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                    log << MSG::VERBOSE << "theta: " << theta << " heigth: " << heigth << " radius3: " << radius3
+                        << "  std::atan2(radius,hitz): " << std::atan2(radius, hitz)
+                        << " +std::atan2(rz0,heigth): " << std::atan2(rz0, heigth) << " rz0: " << rz0 << endmsg;
+                }
+                if ((printlevel >= 4 || log.level() <= MSG::VERBOSE) && std::abs(rz0) > radius3) {
+                    log << MSG::VERBOSE << "rz0 > radius3" << endmsg;
+                }
+                if (m_use_residu_grad == 1) {
+                    double residu_distance_grad = std::abs(std::sin(theta - coordsmaximumsecondinrad));
+                    residu_distance = residu_distance_grad;
+                    maximum_residu = maximum_residu_angle;
+                } else {
+                    residu_distance = residu_distance_mm;
+                    maximum_residu = maximum_residu_mm;
+                }
 
-  for (unsigned int i=0; i<event->size(); i++)
-    {
-      double dotprod =0;
-      double hitx = event->getHitx(i);
-      double hity = event->getHity(i);
-      int sectorhit = sector(event->getHit(i));
-      int maxsecmax = maxsector + 1;
-      int maxsecmin = maxsector - 1;
-      if (maxsecmin < 0) maxsecmin = m_number_of_sectors - 1;
-      if (maxsecmax > m_number_of_sectors -1 ) maxsecmax = 0;
-      // select which hits could be in maximum:
-      if (sectorhit == maxsector || sectorhit == maxsecmin || sectorhit == maxsecmax)
-	{
-	  double hitz = event->getHitz(i);
-	  double radius = std::sqrt(hitx*hitx + hity*hity);
-
-	  dotprod = radius * std::sin(coordsmaximumsecondinrad) + hitz * std::cos(coordsmaximumsecondinrad);
-
-	  if (dotprod>=0)
-	    {
-	      double residu_distance_mm = MuonHoughMathUtils::signedDistanceToLine(hitz,radius,rz0,coordsmaximumsecondinrad);
-	      
-// Use this code for rz scan and theta 
-//
-              double radius3 = sqrt(hitx*hitx+hity*hity+hitz*hitz);
-	      double heigth=0.;
-	      if (std::abs(rz0) < radius3) {heigth = sqrt(radius3*radius3 - rz0*rz0);}
-	      else {heigth = sqrt(rz0*rz0 - radius3*radius3);}
-
-	      theta = std::atan2(radius,hitz)+std::atan2(rz0,heigth);
-  	      
-              if (printlevel>=4 || log.level()<=MSG::VERBOSE) { log << MSG::VERBOSE << "theta: " << theta << " heigth: " << heigth << " radius3: " << radius3 << "  std::atan2(radius,hitz): " <<  std::atan2(radius,hitz) << " +std::atan2(rz0,heigth): " << std::atan2(rz0,heigth) << " rz0: " << rz0 << endmsg; }
-              if ((printlevel>=4 || log.level()<=MSG::VERBOSE) && std::abs(rz0) > radius3) {log << MSG::VERBOSE << "rz0 > radius3" << endmsg;}
-	      if (m_use_residu_grad==1) {
-		double residu_distance_grad = std::abs(std::sin(theta-coordsmaximumsecondinrad));
-		residu_distance=residu_distance_grad;
-		maximum_residu=maximum_residu_angle;
-	      }
-	      else {
-		residu_distance=residu_distance_mm;
-		maximum_residu=maximum_residu_mm;  
-	      }
-	      
-	      if (printlevel>=4 || log.level()<=MSG::VERBOSE) {
-		log << MSG::VERBOSE << "MuonHoughTransformer_rz::hitx: " << hitx << " hity: " << hity << " hitz: " << hitz << endmsg;
-		log << MSG::VERBOSE << "MuonHoughTransformer_rz::residu_distance: " << residu_distance << endmsg;
-	      }
-	      bool inmax = false ;  
-              if ( std::abs( theta*180./M_PI - coordsmaximum.second) < 1.1 ) inmax = true ;
-
-	      if(std::abs(residu_distance)<maximum_residu) // here no circular effect
-		{
-		  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-		    {
-		      log << MSG::VERBOSE << "MuonHoughTransformer_rz::hit added to houghpattern!" << endmsg;
-		      log << MSG::VERBOSE << " Sector number hit " << sectorhit << " max " << maxsector << " detector: " << event->getHit(i)->getWhichDetector() << endmsg;
-                      if (inmax) log << MSG::VERBOSE << " MuonHoughTransformer_rz:: in maximum "  << endmsg;
-                      if (!inmax) log << MSG::VERBOSE << " OUTSIDE maximum theta hit "  << theta*180./M_PI << " max Hough theta " << coordsmaximum.second << endmsg;
-		    }
-		  houghpattern->addHit(event->getHit(i));
-		  
-		  event->getHit(i)->setAssociated(true);
-
-		  double rz0hit = residu_distance_mm + rz0;
-		  eradius += rz0hit;
-		  
-		  if (printlevel>=4 || log.level()<=MSG::VERBOSE){
-		    log << MSG::VERBOSE << "MuonHoughTransformer_rz::calculateAngle: " << theta << " calculateradius: " << rz0hit << endmsg;
-		    double radiush = sqrt(event->getHitx(i)*event->getHitx(i)+event->getHity(i)*event->getHity(i));
-		    log << MSG::VERBOSE << " R Z hit added to hough pattern theta hit " << atan2(radiush,event->getHitz(i) ) << " theta all " <<  coordsmaximumsecondinrad << endmsg;
-		  }
-		  
-		  sin_theta += std::sin(theta);
-		  cos_theta += std::cos(theta);
-		  
-		  phi = std::atan2(hity,hitx);
-		  
-		  sin_phi += std::sin(phi);
-		  cos_phi += std::cos(phi);
-		  //}
-		} else  {
-		if (inmax) if (log.level()<=MSG::WARNING)log << MSG::WARNING << "LOST hit in maximum distance" << residu_distance << endmsg;
+                if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                    log << MSG::VERBOSE << "MuonHoughTransformer_rz::hitx: " << hitx << " hity: " << hity << " hitz: " << hitz << endmsg;
+                    log << MSG::VERBOSE << "MuonHoughTransformer_rz::residu_distance: " << residu_distance << endmsg;
+                }
+                bool inmax = false;
+                if (std::abs(theta * 180. / M_PI - coordsmaximum.second) < 1.1) inmax = true;
+
+                if (std::abs(residu_distance) < maximum_residu)  // here no circular effect
+                {
+                    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                        log << MSG::VERBOSE << "MuonHoughTransformer_rz::hit added to houghpattern!" << endmsg;
+                        log << MSG::VERBOSE << " Sector number hit " << sectorhit << " max " << maxsector
+                            << " detector: " << event->getHit(i)->getWhichDetector() << endmsg;
+                        if (inmax) log << MSG::VERBOSE << " MuonHoughTransformer_rz:: in maximum " << endmsg;
+                        if (!inmax)
+                            log << MSG::VERBOSE << " OUTSIDE maximum theta hit " << theta * 180. / M_PI << " max Hough theta "
+                                << coordsmaximum.second << endmsg;
+                    }
+                    houghpattern->addHit(event->getHit(i));
+
+                    event->getHit(i)->setAssociated(true);
+
+                    double rz0hit = residu_distance_mm + rz0;
+                    eradius += rz0hit;
+
+                    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                        log << MSG::VERBOSE << "MuonHoughTransformer_rz::calculateAngle: " << theta << " calculateradius: " << rz0hit
+                            << endmsg;
+                        double radiush = sqrt(event->getHitx(i) * event->getHitx(i) + event->getHity(i) * event->getHity(i));
+                        log << MSG::VERBOSE << " R Z hit added to hough pattern theta hit " << atan2(radiush, event->getHitz(i))
+                            << " theta all " << coordsmaximumsecondinrad << endmsg;
+                    }
+
+                    sin_theta += std::sin(theta);
+                    cos_theta += std::cos(theta);
+
+                    phi = std::atan2(hity, hitx);
+
+                    sin_phi += std::sin(phi);
+                    cos_phi += std::cos(phi);
+                    //}
+                } else {
+                    if (inmax)
+                        if (log.level() <= MSG::WARNING) log << MSG::WARNING << "LOST hit in maximum distance" << residu_distance << endmsg;
                 }
 
-	    }// dotprod
-	} // sector constraint
-    } //hitno
-  
-  etheta = std::atan2(sin_theta,cos_theta);
-  ephi = std::atan2(sin_phi,cos_phi);
-  houghpattern->setEPhi(ephi);
-
-  eradius=eradius/(houghpattern->size()+0.0001);
-  
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-    {
-     log << MSG::VERBOSE << "MuonHoughTransformer_rz::Etheta : " << etheta << " Size houghpattern " << houghpattern->size() << " ephi " << ephi << endmsg;
+            }  // dotprod
+        }      // sector constraint
+    }          // hitno
+
+    etheta = std::atan2(sin_theta, cos_theta);
+    ephi = std::atan2(sin_phi, cos_phi);
+    houghpattern->setEPhi(ephi);
+
+    eradius = eradius / (houghpattern->size() + 0.0001);
+
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "MuonHoughTransformer_rz::Etheta : " << etheta << " Size houghpattern " << houghpattern->size() << " ephi "
+            << ephi << endmsg;
     }
-  
-  houghpattern->setETheta(etheta);
-  houghpattern->setERTheta(eradius);
-  houghpattern->setECurvature(1.);
-  
-  if (houghpattern->empty())
-    {
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE){log << MSG::VERBOSE << "MuonHoughTransformer_rz::WARNING : no hits found on pattern" << endmsg;}
+
+    houghpattern->setETheta(etheta);
+    houghpattern->setERTheta(eradius);
+    houghpattern->setECurvature(1.);
+
+    if (houghpattern->empty()) {
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE << "MuonHoughTransformer_rz::WARNING : no hits found on pattern" << endmsg;
+        }
     }
 
-  else if (std::abs(eradius-rz0) > 500. || std::sin(etheta-coordsmaximumsecondinrad) > 0.05)
-    {
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE){
-	log << MSG::VERBOSE << "MuonHoughTransformer_rz::WARNING Eradius or Etheta calc. WRONG" << endmsg;
-	log << MSG::VERBOSE << "MuonHoughTransformer_rz::eradius: " << rz0 << " etheta: " << coordsmaximumsecondinrad << endmsg;
-	log << MSG::VERBOSE << "MuonHoughTransformer_rz::eradius: " << eradius << " etheta: " << etheta << endmsg;
-      }
-      houghpattern->setETheta(coordsmaximumsecondinrad); //coordsmaximumsecondinrad
-      houghpattern->setERTheta(rz0);
+    else if (std::abs(eradius - rz0) > 500. || std::sin(etheta - coordsmaximumsecondinrad) > 0.05) {
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE << "MuonHoughTransformer_rz::WARNING Eradius or Etheta calc. WRONG" << endmsg;
+            log << MSG::VERBOSE << "MuonHoughTransformer_rz::eradius: " << rz0 << " etheta: " << coordsmaximumsecondinrad << endmsg;
+            log << MSG::VERBOSE << "MuonHoughTransformer_rz::eradius: " << eradius << " etheta: " << etheta << endmsg;
+        }
+        houghpattern->setETheta(coordsmaximumsecondinrad);  // coordsmaximumsecondinrad
+        houghpattern->setERTheta(rz0);
     }
 
-  return houghpattern;
+    return houghpattern;
 }
 
-float MuonHoughTransformer_rz::weightHoughTransform (double r0) const
-{ 
-  if (m_add_weight_radius)
-    {return 1./(std::abs(r0/(m_weight_constant_radius+1.)));}
-  else {return 1;} // weight function, to give more importance to patterns close to origin
+float MuonHoughTransformer_rz::weightHoughTransform(double r0) const {
+    if (m_add_weight_radius) {
+        return 1. / (std::abs(r0 / (m_weight_constant_radius + 1.)));
+    } else {
+        return 1;
+    }  // weight function, to give more importance to patterns close to origin
 }
 
-float MuonHoughTransformer_rz::weightHoughTransform (double r0,double theta) const // theta in grad
-{ 
-  if (!m_add_weight_angle)
-    {
-      return weightHoughTransform(r0);
-    }
-  else 
-    {
-      if (m_add_weight_radius)
-	{
-	  double theta_rad = m_muonhoughmathutils.angleFromGradToRadial(theta);
+float MuonHoughTransformer_rz::weightHoughTransform(double r0, double theta) const  // theta in grad
+{
+    if (!m_add_weight_angle) {
+        return weightHoughTransform(r0);
+    } else {
+        if (m_add_weight_radius) {
+            double theta_rad = m_muonhoughmathutils.angleFromGradToRadial(theta);
 
-	  float r_theta_weight = std::abs(std::sin(theta_rad))/(1. + std::abs((r0/6000.))); 
+            float r_theta_weight = std::abs(std::sin(theta_rad)) / (1. + std::abs((r0 / 6000.)));
 
-	  return r_theta_weight;
-	}
+            return r_theta_weight;
+        }
 
-      else {return 1;} // weight function, to give more importance to patterns close to origin
+        else {
+            return 1;
+        }  // weight function, to give more importance to patterns close to origin
     }
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rzcosmics.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rzcosmics.cxx
index 908384bda44f9552dd677d54d4702b2673f9c9f0..52b8f0d5554b1948a1fa5a7d6a5cf8952697e5de 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rzcosmics.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_rzcosmics.cxx
@@ -3,288 +3,274 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_rzcosmics.h"
+
+#include "AthenaKernel/getMessageSvc.h"
 #include "CxxUtils/sincos.h"
 #include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
 
-MuonHoughTransformer_rzcosmics::MuonHoughTransformer_rzcosmics(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors)
-{
-  m_add_weight_radius = true;
-  m_weight_constant_radius=0.3; // 1./(1 + m_weight_constant_radius*std::abs(r0)/m_detectorsize) = 1/(1+10^-5*r)
-  m_add_weight_angle = true;
-
-  m_phisec = new double[m_number_of_sectors];
-  m_sinphisec = new double[m_number_of_sectors];
-  m_cosphisec = new double[m_number_of_sectors];
-
-  for (int phisector=0; phisector<m_number_of_sectors; phisector++) {
-    m_phisec[phisector] = (phisector+0.5)*M_PI/(m_number_of_sectors+0.)-M_PI; // phi [-Pi,0]
-    CxxUtils::sincos sc (m_phisec[phisector]);
-    m_sinphisec[phisector] = sc.sn;
-    m_cosphisec[phisector] = sc.cs;
-  }
-
-  m_theta_in_grad = new double[m_nbins_angle];
-  m_sintheta = new double[m_nbins_angle];
-  m_costheta = new double[m_nbins_angle];
-
-  for (int i=0; i<m_nbins_angle; i++) {
-    m_theta_in_grad[i] = (i+0.5)*m_stepsize_per_angle;
-    const double theta_in_rad = MuonHough::degree_rad_conversion_factor*m_theta_in_grad[i];
-    CxxUtils::sincos sc(theta_in_rad);
-    m_sintheta[i] = sc.sn;
-    m_costheta[i] = sc.cs;
-  }
-}
+MuonHoughTransformer_rzcosmics::MuonHoughTransformer_rzcosmics(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                                               double threshold_histo, int number_of_sectors) :
+    MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors) {
+    m_add_weight_radius = true;
+    m_weight_constant_radius = 0.3;  // 1./(1 + m_weight_constant_radius*std::abs(r0)/m_detectorsize) = 1/(1+10^-5*r)
+    m_add_weight_angle = true;
+
+    m_phisec = new double[m_number_of_sectors];
+    m_sinphisec = new double[m_number_of_sectors];
+    m_cosphisec = new double[m_number_of_sectors];
+
+    for (int phisector = 0; phisector < m_number_of_sectors; phisector++) {
+        m_phisec[phisector] = (phisector + 0.5) * M_PI / (m_number_of_sectors + 0.) - M_PI;  // phi [-Pi,0]
+        CxxUtils::sincos sc(m_phisec[phisector]);
+        m_sinphisec[phisector] = sc.sn;
+        m_cosphisec[phisector] = sc.cs;
+    }
 
-MuonHoughTransformer_rzcosmics::~MuonHoughTransformer_rzcosmics()
-{
-  delete[] m_phisec;
-  delete[] m_sinphisec;
-  delete[] m_cosphisec;
-  delete[] m_theta_in_grad;
-  delete[] m_sintheta;
-  delete[] m_costheta;
-}
+    m_theta_in_grad = new double[m_nbins_angle];
+    m_sintheta = new double[m_nbins_angle];
+    m_costheta = new double[m_nbins_angle];
 
-void MuonHoughTransformer_rzcosmics::fillHit(MuonHoughHit* hit, double weight)
-{
-  
-  const double invradius = 1./hit->getRadius();
-  const double hitx = hit->getHitx();
-  const double hity = hit->getHity();
-  const double hitz = hit->getHitz();
-
-  for (int phisector=0; phisector<m_number_of_sectors; phisector++)
-    {
-      const double rphi = hitx*m_cosphisec[phisector] + hity*m_sinphisec[phisector];
-      const double dotprod = rphi*invradius;
-
-      //      for (double theta_in_grad=m_stepsize_per_angle/2.; theta_in_grad<m_detectorsize_angle; theta_in_grad+=m_stepsize_per_angle) {
-      for (int i=0; i<m_nbins_angle; i++) {
-	const double rz0 = -m_costheta[i]*rphi + m_sintheta[i]*hitz;
-	const double weighthough = weight * weightHoughTransform(rz0,m_sintheta[i],m_sinphisec[phisector],dotprod);
-	fillHisto(rz0,m_theta_in_grad[i],weighthough,phisector);
-      }
+    for (int i = 0; i < m_nbins_angle; i++) {
+        m_theta_in_grad[i] = (i + 0.5) * m_stepsize_per_angle;
+        const double theta_in_rad = MuonHough::degree_rad_conversion_factor * m_theta_in_grad[i];
+        CxxUtils::sincos sc(theta_in_rad);
+        m_sintheta[i] = sc.sn;
+        m_costheta[i] = sc.cs;
     }
 }
 
-int MuonHoughTransformer_rzcosmics::fillHisto(double rz0, double theta_in_grad, double weight, int sector)
-{
-  MuonHoughHisto2D* histo = m_histos.getHisto(sector);
-
-  int filled_binnumber = histo->fill(rz0,theta_in_grad,weight); 
-
-  // this houghtransform has a full butterfly pattern:
-  double half_weight = 0.5*weight;
-
-  // should be filled using filled_binnumber!
+MuonHoughTransformer_rzcosmics::~MuonHoughTransformer_rzcosmics() {
+    delete[] m_phisec;
+    delete[] m_sinphisec;
+    delete[] m_cosphisec;
+    delete[] m_theta_in_grad;
+    delete[] m_sintheta;
+    delete[] m_costheta;
+}
 
-  if (theta_in_grad - m_binwidthy < 0)
-    {
-      histo->fill(rz0+m_binwidthx,theta_in_grad+m_binwidthy,half_weight);
-      //histo->fill(rz0-m_binwidthx,theta_in_grad-m_binwidthy + 180.,half_weight); // no cyclic angle here
-      histo->fill(rz0-m_binwidthx,theta_in_grad+m_binwidthy,half_weight);
-    }
-  else if (theta_in_grad + m_binwidthy > 180.)
-    {
-      //histo->fill(rz0+m_binwidthx,theta_in_grad+m_binwidthy - 180.,half_weight);
-      histo->fill(rz0-m_binwidthx,theta_in_grad-m_binwidthy,half_weight);
-      histo->fill(rz0+m_binwidthx,theta_in_grad-m_binwidthy,half_weight);
+void MuonHoughTransformer_rzcosmics::fillHit(MuonHoughHit* hit, double weight) {
+    const double invradius = 1. / hit->getRadius();
+    const double hitx = hit->getHitx();
+    const double hity = hit->getHity();
+    const double hitz = hit->getHitz();
+
+    for (int phisector = 0; phisector < m_number_of_sectors; phisector++) {
+        const double rphi = hitx * m_cosphisec[phisector] + hity * m_sinphisec[phisector];
+        const double dotprod = rphi * invradius;
+
+        //      for (double theta_in_grad=m_stepsize_per_angle/2.; theta_in_grad<m_detectorsize_angle; theta_in_grad+=m_stepsize_per_angle)
+        //      {
+        for (int i = 0; i < m_nbins_angle; i++) {
+            const double rz0 = -m_costheta[i] * rphi + m_sintheta[i] * hitz;
+            const double weighthough = weight * weightHoughTransform(rz0, m_sintheta[i], m_sinphisec[phisector], dotprod);
+            fillHisto(rz0, m_theta_in_grad[i], weighthough, phisector);
+        }
     }
-  else 
-    {
-      histo->fill(rz0+m_binwidthx,theta_in_grad+m_binwidthy,half_weight);
-      histo->fill(rz0-m_binwidthx,theta_in_grad-m_binwidthy,half_weight);
-      histo->fill(rz0-m_binwidthx,theta_in_grad+m_binwidthy,half_weight);
-      histo->fill(rz0+m_binwidthx,theta_in_grad-m_binwidthy,half_weight);
+}
+
+int MuonHoughTransformer_rzcosmics::fillHisto(double rz0, double theta_in_grad, double weight, int sector) {
+    MuonHoughHisto2D* histo = m_histos.getHisto(sector);
+
+    int filled_binnumber = histo->fill(rz0, theta_in_grad, weight);
+
+    // this houghtransform has a full butterfly pattern:
+    double half_weight = 0.5 * weight;
+
+    // should be filled using filled_binnumber!
+
+    if (theta_in_grad - m_binwidthy < 0) {
+        histo->fill(rz0 + m_binwidthx, theta_in_grad + m_binwidthy, half_weight);
+        // histo->fill(rz0-m_binwidthx,theta_in_grad-m_binwidthy + 180.,half_weight); // no cyclic angle here
+        histo->fill(rz0 - m_binwidthx, theta_in_grad + m_binwidthy, half_weight);
+    } else if (theta_in_grad + m_binwidthy > 180.) {
+        // histo->fill(rz0+m_binwidthx,theta_in_grad+m_binwidthy - 180.,half_weight);
+        histo->fill(rz0 - m_binwidthx, theta_in_grad - m_binwidthy, half_weight);
+        histo->fill(rz0 + m_binwidthx, theta_in_grad - m_binwidthy, half_weight);
+    } else {
+        histo->fill(rz0 + m_binwidthx, theta_in_grad + m_binwidthy, half_weight);
+        histo->fill(rz0 - m_binwidthx, theta_in_grad - m_binwidthy, half_weight);
+        histo->fill(rz0 - m_binwidthx, theta_in_grad + m_binwidthy, half_weight);
+        histo->fill(rz0 + m_binwidthx, theta_in_grad - m_binwidthy, half_weight);
     }
-  return filled_binnumber;
+    return filled_binnumber;
 }
 
-MuonHoughPattern* MuonHoughTransformer_rzcosmics::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event, std::pair <double,double> coordsmaximum,double maximum_residu_mm, double /*maximum_residu_angle*/, int maxsector, bool /*which_segment*/, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer_rzcosmics::hookAssociateHitsToMaximum");
-  MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_rzcosmics);
+MuonHoughPattern* MuonHoughTransformer_rzcosmics::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,
+                                                                             std::pair<double, double> coordsmaximum,
+                                                                             double maximum_residu_mm, double /*maximum_residu_angle*/,
+                                                                             int maxsector, bool /*which_segment*/, int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer_rzcosmics::hookAssociateHitsToMaximum");
+    MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_rzcosmics);
 
-  double eradius=0.,er0=0.;
-  const double theta = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
-  const double rz0 = coordsmaximum.first;
+    double eradius = 0., er0 = 0.;
+    const double theta = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
+    const double rz0 = coordsmaximum.first;
 
-  const double phimax = m_phisec[maxsector];
+    const double phimax = m_phisec[maxsector];
 
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-    {
-      log << MSG::VERBOSE << "sector: " << maxsector << " phimax: " << phimax << endmsg;
-      log << MSG::VERBOSE << "coordsmaximumfirst: " << rz0 << endmsg;
-      log << MSG::VERBOSE << "coordsmaximumsecond: " << coordsmaximum.second << " coordsmaximumsecondinrad: " << theta << endmsg;
-      log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::size of event: " << event->size() << endmsg;
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "sector: " << maxsector << " phimax: " << phimax << endmsg;
+        log << MSG::VERBOSE << "coordsmaximumfirst: " << rz0 << endmsg;
+        log << MSG::VERBOSE << "coordsmaximumsecond: " << coordsmaximum.second << " coordsmaximumsecondinrad: " << theta << endmsg;
+        log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::size of event: " << event->size() << endmsg;
     }
 
-  for (unsigned int i=0; i<event->size(); i++)
-    {
-      const double hitx = event->getHitx(i);
-      const double hity = event->getHity(i);
-
-      // select which hits could be in maximum:
-      const double hitz = event->getHitz(i);
-      const double perp = hitx*m_cosphisec[maxsector] + hity*m_sinphisec[maxsector];
-      
-      double residu_distance = MuonHoughMathUtils::signedDistanceToLine(hitz,perp,rz0,theta);
-	      
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE) 
-	{
-	  log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::hitx: " << hitx << " hity: " << hity << " hitz: " << hitz << " perp: " << perp << endmsg;
-	  log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::residu_distance: " << residu_distance << endmsg;
-	} 
-
-      if(std::abs(residu_distance)<maximum_residu_mm) // here no circular effect
-	{
-	  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-	    {
-	      log << MSG::VERBOSE<< "MuonHoughTransformer_rzcosmics::hit added to houghpattern! detector: " << event->getHit(i)->getWhichDetector() << endmsg;
-	      if (event->getHit(i)->getAssociated())log << MSG::VERBOSE  << " hit already earlier associated to pattern!" << endmsg;
-	    }
-	  houghpattern->addHit(event->getHit(i));
-	  event->getHit(i)->setAssociated(true);
-	  
-	  double rz0hit = residu_distance + rz0;
-	  eradius += rz0hit;
-	  
-	  double r0hit = hitx * m_sinphisec[maxsector] - hity * m_cosphisec[maxsector];
-	  er0 += r0hit;
-
-	} // hit in distance
-    } //hitno
-  
-  eradius=eradius/(houghpattern->size()+1e-7);
-  er0=er0/(houghpattern->size()+1e-7);
-  
-  houghpattern->setEPhi(phimax);
-  houghpattern->setERPhi(er0);
-  houghpattern->setETheta(theta);
-  houghpattern->setERTheta(eradius);
-  houghpattern->setECurvature(1.);
-  
-  if (houghpattern->empty())
-    {
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE){log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::WARNING : no hits found on pattern" << endmsg;}
+    for (unsigned int i = 0; i < event->size(); i++) {
+        const double hitx = event->getHitx(i);
+        const double hity = event->getHity(i);
+
+        // select which hits could be in maximum:
+        const double hitz = event->getHitz(i);
+        const double perp = hitx * m_cosphisec[maxsector] + hity * m_sinphisec[maxsector];
+
+        double residu_distance = MuonHoughMathUtils::signedDistanceToLine(hitz, perp, rz0, theta);
+
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::hitx: " << hitx << " hity: " << hity << " hitz: " << hitz
+                << " perp: " << perp << endmsg;
+            log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::residu_distance: " << residu_distance << endmsg;
+        }
+
+        if (std::abs(residu_distance) < maximum_residu_mm)  // here no circular effect
+        {
+            if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+                log << MSG::VERBOSE
+                    << "MuonHoughTransformer_rzcosmics::hit added to houghpattern! detector: " << event->getHit(i)->getWhichDetector()
+                    << endmsg;
+                if (event->getHit(i)->getAssociated()) log << MSG::VERBOSE << " hit already earlier associated to pattern!" << endmsg;
+            }
+            houghpattern->addHit(event->getHit(i));
+            event->getHit(i)->setAssociated(true);
+
+            double rz0hit = residu_distance + rz0;
+            eradius += rz0hit;
+
+            double r0hit = hitx * m_sinphisec[maxsector] - hity * m_cosphisec[maxsector];
+            er0 += r0hit;
+
+        }  // hit in distance
+    }      // hitno
+
+    eradius = eradius / (houghpattern->size() + 1e-7);
+    er0 = er0 / (houghpattern->size() + 1e-7);
+
+    houghpattern->setEPhi(phimax);
+    houghpattern->setERPhi(er0);
+    houghpattern->setETheta(theta);
+    houghpattern->setERTheta(eradius);
+    houghpattern->setECurvature(1.);
+
+    if (houghpattern->empty()) {
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::WARNING : no hits found on pattern" << endmsg;
+        }
     }
 
-  else if (std::abs(eradius-rz0) > 500.)
-    {
-      if (printlevel>=4 || log.level()<=MSG::VERBOSE){
-	log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::WARNING Eradius or Etheta calc. WRONG" << endmsg;
-	log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::eradius: " << rz0 << " etheta: " << theta << endmsg;
-	log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::eradius: " << eradius << " etheta: " << theta << endmsg;
-      }
-      houghpattern->setERTheta(rz0);
+    else if (std::abs(eradius - rz0) > 500.) {
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::WARNING Eradius or Etheta calc. WRONG" << endmsg;
+            log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::eradius: " << rz0 << " etheta: " << theta << endmsg;
+            log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::eradius: " << eradius << " etheta: " << theta << endmsg;
+        }
+        houghpattern->setERTheta(rz0);
     }
 
-  updateParameters(houghpattern); // not possible when phi direction not known!
-
-  if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-    {
-      log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new phi: " << houghpattern->getEPhi() << " old phi: " << phimax << endmsg;
-      log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new r0: " << houghpattern->getERPhi() << " old r0: " << er0 << endmsg;
-      log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new theta: " << houghpattern->getETheta() << " old theta: " << theta << endmsg;
-      log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new z0: " << houghpattern->getERTheta() << " old z0: " << eradius << endmsg;
+    updateParameters(houghpattern);  // not possible when phi direction not known!
+
+    if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+        log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new phi: " << houghpattern->getEPhi()
+            << " old phi: " << phimax << endmsg;
+        log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new r0: " << houghpattern->getERPhi()
+            << " old r0: " << er0 << endmsg;
+        log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new theta: " << houghpattern->getETheta()
+            << " old theta: " << theta << endmsg;
+        log << MSG::VERBOSE << "MuonHoughTransformer_rzcosmics::updateParameterstheta new z0: " << houghpattern->getERTheta()
+            << " old z0: " << eradius << endmsg;
     }
 
-  return houghpattern;
+    return houghpattern;
 }
 
-float MuonHoughTransformer_rzcosmics::weightHoughTransform (double r0) const
-{ 
-  if (m_add_weight_radius)
-    {return m_detectorsize/(m_detectorsize + m_weight_constant_radius*std::abs(r0));}
-  else {return 1;} // weight function, to give more importance to patterns close to origin
+float MuonHoughTransformer_rzcosmics::weightHoughTransform(double r0) const {
+    if (m_add_weight_radius) {
+        return m_detectorsize / (m_detectorsize + m_weight_constant_radius * std::abs(r0));
+    } else {
+        return 1;
+    }  // weight function, to give more importance to patterns close to origin
 }
 
-float MuonHoughTransformer_rzcosmics::weightHoughTransform (double r0,double sintheta, double sinphi, double dotprod) const // theta in grad
-{ 
-  if (!m_add_weight_angle)
-    {
-      return weightHoughTransform(r0);
-    }
-  else
-    {
-      double dotprod_part = 0.5 + 0.5*dotprod*dotprod; // preference for angles that are normal to the chamber
-      double sintheta_part = 0.9 + 0.1*sintheta*sintheta; // preference for patterns from above
-      double sinphi_part = 0.75 + 0.25*sinphi*sinphi;  // preference for patterns from above
-      float r_theta_weight = dotprod_part * sintheta_part * sinphi_part;
-      
-      return r_theta_weight * weightHoughTransform(r0); // preference for patterns with low impact parameter
+float MuonHoughTransformer_rzcosmics::weightHoughTransform(double r0, double sintheta, double sinphi,
+                                                           double dotprod) const  // theta in grad
+{
+    if (!m_add_weight_angle) {
+        return weightHoughTransform(r0);
+    } else {
+        double dotprod_part = 0.5 + 0.5 * dotprod * dotprod;     // preference for angles that are normal to the chamber
+        double sintheta_part = 0.9 + 0.1 * sintheta * sintheta;  // preference for patterns from above
+        double sinphi_part = 0.75 + 0.25 * sinphi * sinphi;      // preference for patterns from above
+        float r_theta_weight = dotprod_part * sintheta_part * sinphi_part;
+
+        return r_theta_weight * weightHoughTransform(r0);  // preference for patterns with low impact parameter
     }
 }
 
-int MuonHoughTransformer_rzcosmics::sector(MuonHoughHit* /*hit*/)const
-{
-  // function not implemented for this transform
-  return 0; 
+int MuonHoughTransformer_rzcosmics::sector(MuonHoughHit* /*hit*/) const {
+    // function not implemented for this transform
+    return 0;
 }
 
-void MuonHoughTransformer_rzcosmics::updateParameters(MuonHoughPattern* houghpattern)
-{
-  const unsigned int size = houghpattern->size();
+void MuonHoughTransformer_rzcosmics::updateParameters(MuonHoughPattern* houghpattern) {
+    const unsigned int size = houghpattern->size();
 
-  if (size<=1) return;
+    if (size <= 1) return;
 
-  const double phi = houghpattern->getEPhi();
-  const double cosphi = std::cos(phi);
-  const double sinphi = std::sin(phi);
-  
-  double sum_radii = 0.;
-  double sum_z = 0.;
+    const double phi = houghpattern->getEPhi();
+    const double cosphi = std::cos(phi);
+    const double sinphi = std::sin(phi);
 
-  for (unsigned int i=0; i<size; i++)
-    {
-      sum_radii += houghpattern->getHitx(i)*cosphi + houghpattern->getHity(i)*sinphi;
-      sum_z += houghpattern->getHitz(i);
+    double sum_radii = 0.;
+    double sum_z = 0.;
+
+    for (unsigned int i = 0; i < size; i++) {
+        sum_radii += houghpattern->getHitx(i) * cosphi + houghpattern->getHity(i) * sinphi;
+        sum_z += houghpattern->getHitz(i);
     }
-  
-  const double av_radii = sum_radii / (size+0.);
-  const double av_z = sum_z / (size+0.);
-  
-  double sumr = 0.;
-  double sumz = 0.;
-  for (unsigned int i=0; i<size; i++)
-    {
-      double radius = houghpattern->getHitx(i)*cosphi + houghpattern->getHity(i)*sinphi;
-      double hitz = houghpattern->getHitz(i);
-      double r_offset = radius - av_radii;
-      double z_offset = hitz - av_z;
-      double weight = r_offset*r_offset + z_offset*z_offset;
-      int sign = 1;
-      if (r_offset*radius+z_offset*hitz<0) {sign =-1;}
-      sumr += weight*sign*r_offset;
-      sumz += weight*sign*z_offset;
+
+    const double av_radii = sum_radii / (size + 0.);
+    const double av_z = sum_z / (size + 0.);
+
+    double sumr = 0.;
+    double sumz = 0.;
+    for (unsigned int i = 0; i < size; i++) {
+        double radius = houghpattern->getHitx(i) * cosphi + houghpattern->getHity(i) * sinphi;
+        double hitz = houghpattern->getHitz(i);
+        double r_offset = radius - av_radii;
+        double z_offset = hitz - av_z;
+        double weight = r_offset * r_offset + z_offset * z_offset;
+        int sign = 1;
+        if (r_offset * radius + z_offset * hitz < 0) { sign = -1; }
+        sumr += weight * sign * r_offset;
+        sumz += weight * sign * z_offset;
     }
 
-  if (std::abs(sumr) < 0.000001 || std::abs(sumz) < 0.000001) {
-    return;
-  }
+    if (std::abs(sumr) < 0.000001 || std::abs(sumz) < 0.000001) { return; }
+
+    double theta = std::atan2(sumr, sumz);
 
-  double theta = std::atan2(sumr,sumz);
+    if (theta < 0) theta += M_PI;
 
-  if (theta < 0) theta += M_PI;
-  
-  // if theta almost straight rely on hit for prediction (transform has difficulties prediction direction in this case):
-  double offset = 0.02;
-  if (theta < offset) {
-    if (houghpattern->getHitz(0) < 0) {
-      theta = M_PI - theta;
+    // if theta almost straight rely on hit for prediction (transform has difficulties prediction direction in this case):
+    double offset = 0.02;
+    if (theta < offset) {
+        if (houghpattern->getHitz(0) < 0) { theta = M_PI - theta; }
     }
-  }
 
-  else if (theta > M_PI-offset) {
-    if (houghpattern->getHitz(0) > 0) {
-      theta = M_PI - theta;
+    else if (theta > M_PI - offset) {
+        if (houghpattern->getHitz(0) > 0) { theta = M_PI - theta; }
     }
-  }
 
-  const double rz0 = av_z * std::sin(theta) - av_radii * std::cos(theta);
+    const double rz0 = av_z * std::sin(theta) - av_radii * std::cos(theta);
 
-  houghpattern->setETheta(theta);
-  houghpattern->setERTheta(rz0);
+    houghpattern->setETheta(theta);
+    houghpattern->setERTheta(rz0);
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xy.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xy.cxx
index 4112c637fcfec6b9cf5ad36563346d46e53e0102..03968447cafbb5153291f071f70a9397b0f178a6 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xy.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xy.cxx
@@ -4,25 +4,22 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_xy.h"
 
-MuonHoughTransformer_xy::MuonHoughTransformer_xy(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):MuonHoughTransformer_xyz(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors)
-{
-}
+MuonHoughTransformer_xy::MuonHoughTransformer_xy(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                                 double threshold_histo, int number_of_sectors) :
+    MuonHoughTransformer_xyz(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors) {}
 
-std::pair <double,double> MuonHoughTransformer_xy::getHitPos(const MuonHoughHitContainer * event, int hitid)const //returns the relevant position of the hit (xy-RPC in case of id_number==id_xy_rpc etc.)
+std::pair<double, double> MuonHoughTransformer_xy::getHitPos(const MuonHoughHitContainer* event, int hitid)
+    const  // returns the relevant position of the hit (xy-RPC in case of id_number==id_xy_rpc etc.)
 {
-  std::pair <double,double> hitpos;
-  hitpos.first=event->getHitx(hitid); 
-  hitpos.second=event->getHity(hitid); 
-  return hitpos;
+    std::pair<double, double> hitpos;
+    hitpos.first = event->getHitx(hitid);
+    hitpos.second = event->getHity(hitid);
+    return hitpos;
 }
 
-MuonHoughPattern* MuonHoughTransformer_xy::initialiseHoughPattern()const
-{
-  MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_xy);
-  return houghpattern;
+MuonHoughPattern* MuonHoughTransformer_xy::initialiseHoughPattern() const {
+    MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_xy);
+    return houghpattern;
 }
 
-float MuonHoughTransformer_xy::weightHoughTransform(double r0)const
-{
-  return MuonHoughTransformer_xyz::weightHoughTransform(r0);
-}
+float MuonHoughTransformer_xy::weightHoughTransform(double r0) const { return MuonHoughTransformer_xyz::weightHoughTransform(r0); }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xyz.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xyz.cxx
index 6e7a43cbebafa2349d21f856a48111de9423871c..e308ff09d3947544cf7728a87d649a20014e90da 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xyz.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_xyz.cxx
@@ -3,290 +3,285 @@
 */
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_xyz.h"
+
+#include "AthenaKernel/getMessageSvc.h"
 #include "CxxUtils/sincos.h"
 #include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
-
 
-MuonHoughTransformer_xyz::MuonHoughTransformer_xyz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors) 
-{
-  m_add_weight_radius = true;
-  m_weight_constant_radius = 3000;
+MuonHoughTransformer_xyz::MuonHoughTransformer_xyz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                                   double threshold_histo, int number_of_sectors) :
+    MuonHoughTransformer(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors) {
+    m_add_weight_radius = true;
+    m_weight_constant_radius = 3000;
 }
 
-void MuonHoughTransformer_xyz::fillHit(MuonHoughHit* hit, double weight)
-{
-  double radius = hit->getRadius();
-  double hitx = hit->getHitx();
-  double hity = hit->getHity();
-  int sectorhit = sector(hit);
-  double dotprod = 0.;
-
-  if (m_ip_setting)
-    {
-      std::pair <double,double> endpoints = getEndPointsFillLoop(radius,m_stepsize,sectorhit);
-      for (double r0 = endpoints.first; r0<endpoints.second; r0+=m_stepsize)
-	{
-	  double phi = calculateAngle(hitx, hity, r0);
-	  CxxUtils::sincos scphi(phi);
-	  dotprod = scphi.apply(hity,hitx); // hity * sincosphi[0] + hitx * sincosphi[1];
-	  if (dotprod >=0)
-	    {
-	      double phi_in_grad = phi*MuonHough::rad_degree_conversion_factor;
-	      fillHisto(r0,phi_in_grad,weight,sectorhit);
-	    }
-	}
-    } // m_ip_setting
-  
-  else // m_ip_setting == false
+void MuonHoughTransformer_xyz::fillHit(MuonHoughHit* hit, double weight) {
+    double radius = hit->getRadius();
+    double hitx = hit->getHitx();
+    double hity = hit->getHity();
+    int sectorhit = sector(hit);
+    double dotprod = 0.;
+
+    if (m_ip_setting) {
+        std::pair<double, double> endpoints = getEndPointsFillLoop(radius, m_stepsize, sectorhit);
+        for (double r0 = endpoints.first; r0 < endpoints.second; r0 += m_stepsize) {
+            double phi = calculateAngle(hitx, hity, r0);
+            CxxUtils::sincos scphi(phi);
+            dotprod = scphi.apply(hity, hitx);  // hity * sincosphi[0] + hitx * sincosphi[1];
+            if (dotprod >= 0) {
+                double phi_in_grad = phi * MuonHough::rad_degree_conversion_factor;
+                fillHisto(r0, phi_in_grad, weight, sectorhit);
+            }
+        }
+    }  // m_ip_setting
+
+    else  // m_ip_setting == false
     {
-      for (double phi = m_stepsize_per_angle/2.; phi<m_detectorsize_angle; phi+=m_stepsize_per_angle)
-	{
-	  double phi_in_rad = MuonHough::degree_rad_conversion_factor*phi;
-	  CxxUtils::sincos scphi(phi_in_rad);
-	  double r0 = scphi.apply(hitx,-hity);
-	  fillHisto(r0,phi,weight,sectorhit);
-	}
+        for (double phi = m_stepsize_per_angle / 2.; phi < m_detectorsize_angle; phi += m_stepsize_per_angle) {
+            double phi_in_rad = MuonHough::degree_rad_conversion_factor * phi;
+            CxxUtils::sincos scphi(phi_in_rad);
+            double r0 = scphi.apply(hitx, -hity);
+            fillHisto(r0, phi, weight, sectorhit);
+        }
     }
 }
 
-int MuonHoughTransformer_xyz::fillHisto(double r0, double phi, double weight, int sector) // phi in grad!
+int MuonHoughTransformer_xyz::fillHisto(double r0, double phi, double weight, int sector)  // phi in grad!
 {
-  MuonHoughHisto2D* histo = m_histos.getHisto(sector);
-  
-  const int filled_binnumber = histo->fill(r0,phi,weight);
- 
-  // applying a 'butterfly' weighting effect:
-  bool butterfly = true;
-  if (butterfly)
-    {
-      // nearby sectors:
-      if (m_number_of_sectors>=3)
-	{
-	  double third_weight = weight/3.;
-	  if (sector != 0 && sector != m_number_of_sectors - 1)
-	    {
-	      m_histos.getHisto(sector+1)->fill(filled_binnumber,third_weight);
-	      m_histos.getHisto(sector-1)->fill(filled_binnumber,third_weight);
-	    }
-	  else if (sector == 0)
-	    {
-	      m_histos.getHisto(sector+1)->fill(filled_binnumber,third_weight);
-	    }
-	  else // sector == m_number_of_sectors - 1
-	    {
-	      m_histos.getHisto(sector-1)->fill(filled_binnumber,third_weight);
-	    }
-	}
-
-      double half_weight = 0.5*weight;
-      
-      histo->fill(filled_binnumber-1, half_weight);
-      histo->fill(filled_binnumber+1, half_weight);
-      
-      const int upperright = filled_binnumber + m_nbins_plus3;
-      const int lowerleft = filled_binnumber - m_nbins_plus3;
-
-      if (phi - m_binwidthy < 0)
-	{
-  	  histo->fill(r0-m_binwidthx, phi-m_binwidthy + m_detectorsize_angle, half_weight); // should calculate binnumber..
-	  histo->fill(upperright, half_weight);
-	  if (m_use_negative_weights)
-	    {	  
-	      histo->fill(r0+m_binwidthx, phi-m_binwidthy + m_detectorsize_angle, -half_weight);
-	      histo->fill(upperright-2, -half_weight);
-	    }
-	}
-      else if (phi + m_binwidthy > m_detectorsize_angle)
-	{
-	  histo->fill(lowerleft, half_weight);
-	  histo->fill(r0+m_binwidthx, phi+m_binwidthy -m_detectorsize_angle, half_weight);
-	  if (m_use_negative_weights)
-	    {
-	      histo->fill(lowerleft+2, -half_weight);
-	      histo->fill(r0-m_binwidthx, phi+m_binwidthy -m_detectorsize_angle, -half_weight);
-	    }
-	}
-      else 
-	{
-	  histo->fill(lowerleft, half_weight);
-	  histo->fill(upperright, half_weight);
-	  if (m_use_negative_weights)
-	    {
-	      histo->fill(lowerleft+2, -half_weight);
-	      histo->fill(upperright-2, -half_weight);
-	    }
-	}
+    MuonHoughHisto2D* histo = m_histos.getHisto(sector);
+
+    const int filled_binnumber = histo->fill(r0, phi, weight);
+
+    // applying a 'butterfly' weighting effect:
+    bool butterfly = true;
+    if (butterfly) {
+        // nearby sectors:
+        if (m_number_of_sectors >= 3) {
+            double third_weight = weight / 3.;
+            if (sector != 0 && sector != m_number_of_sectors - 1) {
+                m_histos.getHisto(sector + 1)->fill(filled_binnumber, third_weight);
+                m_histos.getHisto(sector - 1)->fill(filled_binnumber, third_weight);
+            } else if (sector == 0) {
+                m_histos.getHisto(sector + 1)->fill(filled_binnumber, third_weight);
+            } else  // sector == m_number_of_sectors - 1
+            {
+                m_histos.getHisto(sector - 1)->fill(filled_binnumber, third_weight);
+            }
+        }
+
+        double half_weight = 0.5 * weight;
+
+        histo->fill(filled_binnumber - 1, half_weight);
+        histo->fill(filled_binnumber + 1, half_weight);
+
+        const int upperright = filled_binnumber + m_nbins_plus3;
+        const int lowerleft = filled_binnumber - m_nbins_plus3;
+
+        if (phi - m_binwidthy < 0) {
+            histo->fill(r0 - m_binwidthx, phi - m_binwidthy + m_detectorsize_angle, half_weight);  // should calculate binnumber..
+            histo->fill(upperright, half_weight);
+            if (m_use_negative_weights) {
+                histo->fill(r0 + m_binwidthx, phi - m_binwidthy + m_detectorsize_angle, -half_weight);
+                histo->fill(upperright - 2, -half_weight);
+            }
+        } else if (phi + m_binwidthy > m_detectorsize_angle) {
+            histo->fill(lowerleft, half_weight);
+            histo->fill(r0 + m_binwidthx, phi + m_binwidthy - m_detectorsize_angle, half_weight);
+            if (m_use_negative_weights) {
+                histo->fill(lowerleft + 2, -half_weight);
+                histo->fill(r0 - m_binwidthx, phi + m_binwidthy - m_detectorsize_angle, -half_weight);
+            }
+        } else {
+            histo->fill(lowerleft, half_weight);
+            histo->fill(upperright, half_weight);
+            if (m_use_negative_weights) {
+                histo->fill(lowerleft + 2, -half_weight);
+                histo->fill(upperright - 2, -half_weight);
+            }
+        }
     }
-   return filled_binnumber;
+    return filled_binnumber;
 }
 
-double MuonHoughTransformer_xyz::calculateAngle(double hitx, double hity, double r0)
-{
-  double phi=0;
-  double heigth_squared = hitx*hitx + hity*hity - r0*r0;
-  if (heigth_squared>=0)
-    {
-      double heigth = std::sqrt(heigth_squared);  
-      
-      phi = std::atan2(hity,hitx)+std::atan2(r0,heigth); 
+double MuonHoughTransformer_xyz::calculateAngle(double hitx, double hity, double r0) {
+    double phi = 0;
+    double heigth_squared = hitx * hitx + hity * hity - r0 * r0;
+    if (heigth_squared >= 0) {
+        double heigth = std::sqrt(heigth_squared);
+
+        phi = std::atan2(hity, hitx) + std::atan2(r0, heigth);
     }
 
-  else {
-    phi = std::atan2(hity,hitx);
-  }
+    else {
+        phi = std::atan2(hity, hitx);
+    }
 
-  if (phi < 0)
-    {phi += MuonHough::two_Pi;}
-  if (phi > MuonHough::two_Pi)
-    {phi -= MuonHough::two_Pi;}
+    if (phi < 0) { phi += MuonHough::two_Pi; }
+    if (phi > MuonHough::two_Pi) { phi -= MuonHough::two_Pi; }
 
-  return phi;
+    return phi;
 }
 
-MuonHoughPattern* MuonHoughTransformer_xyz::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,std::pair <double,double> coordsmaximum, double max_residu_mm,double /*max_residu_angle*/, int max_sector, bool /*which_segment*/, int printlevel)const
-{
-  MsgStream log(Athena::getMessageSvc(),"MuonHoughTransformer_xyz::hookAssociateHitsToMaximum");
-  MuonHoughPattern* houghpattern = initialiseHoughPattern();
-  if (printlevel>=3 || log.level()<=MSG::DEBUG){
-    log << MSG::DEBUG << "MuonHoughTransformer_xyz::hookAssociateHitsToMaximum  (start)" << endmsg;}
+MuonHoughPattern* MuonHoughTransformer_xyz::hookAssociateHitsToMaximum(const MuonHoughHitContainer* event,
+                                                                       std::pair<double, double> coordsmaximum, double max_residu_mm,
+                                                                       double /*max_residu_angle*/, int max_sector, bool /*which_segment*/,
+                                                                       int printlevel) const {
+    MsgStream log(Athena::getMessageSvc(), "MuonHoughTransformer_xyz::hookAssociateHitsToMaximum");
+    MuonHoughPattern* houghpattern = initialiseHoughPattern();
+    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG << "MuonHoughTransformer_xyz::hookAssociateHitsToMaximum  (start)" << endmsg;
+    }
 
-  double ephi=0., eradius=0., sin_phi=0., cos_phi=0.;
-  double dotprod=0.;
-  double etheta=0.;
-  //  MuonHoughPattern houghpattern;
+    double ephi = 0., eradius = 0., sin_phi = 0., cos_phi = 0.;
+    double dotprod = 0.;
+    double etheta = 0.;
+    //  MuonHoughPattern houghpattern;
 
-  double residu_distance=0.;
+    double residu_distance = 0.;
 
-  if (printlevel >= 3 || log.level()<=MSG::DEBUG)
-    {
-      log << MSG::DEBUG << "MuonHoughTransformer_xyz::size_event: " << event->size() << endmsg;
-      log << MSG::DEBUG << "MuonHoughTransformer_xyz::found_maximum: r: " << coordsmaximum.first << " phi: " << coordsmaximum.second << " sector: " << max_sector << endmsg;
+    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG << "MuonHoughTransformer_xyz::size_event: " << event->size() << endmsg;
+        log << MSG::DEBUG << "MuonHoughTransformer_xyz::found_maximum: r: " << coordsmaximum.first << " phi: " << coordsmaximum.second
+            << " sector: " << max_sector << endmsg;
     }
 
-  double phimax = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
-  CxxUtils::sincos scphimax(phimax);
-  
-  int max_secmax = max_sector + 1;
-  int max_secmin = max_sector - 1;
-  if (max_secmin < 0) max_secmin = max_sector;
-  if (max_secmax > m_number_of_sectors -1 ) max_secmax = max_sector;
-  
-  for (unsigned int i=0; i<event->size(); i++)
-    {
-      double hitx = event->getHitx(i);
-      double hity = event->getHity(i);
-      double hitz = event->getHitz(i);
-
-      double radiushit = std::sqrt(hitx*hitx + hity*hity);
-      int sectorhit = sector(event->getHit(i));
-
-      if (sectorhit == max_sector||sectorhit == max_secmin||sectorhit == max_secmax)
-	{
-	  if (!m_ip_setting){dotprod = 1.;}
-	  else {
-	    dotprod = scphimax.apply(getHitPos(event,i).second, getHitPos(event,i).first); //getHitPos(event,i).first * sincosphimax[1] + getHitPos(event,i).second * sincosphimax[0];
-	  }
-	  if (dotprod>=0)
-	    {	      
-	      residu_distance = - coordsmaximum.first + scphimax.apply(getHitPos(event,i).first,-getHitPos(event,i).second); //- coordsmaximum.first + sincosphimax[0] * getHitPos(event,i).first - sincosphimax[1] * getHitPos(event,i).second; // phimax shoudl be in map, but there are rounding errors..
-	      
-	      if (printlevel>=3 || log.level()<=MSG::DEBUG) {
-		log << MSG::DEBUG << "MuonHoughTransformer_xyz::hitx: " << getHitPos(event,i).first << " hity: " << getHitPos(event,i).second << " dotprod: " << dotprod << " sector: " << sectorhit << endmsg;
-	      
-		log << MSG::DEBUG << "MuonHoughTransformer_xyz::residu_distance: " << residu_distance << endmsg;}
-	      
-	      if(std::abs(residu_distance)<max_residu_mm) 
-		{
-		  houghpattern->addHit(event->getHit(i));
-		  
-		  if (printlevel>=3 || log.level()<=MSG::DEBUG) {
-		    log << MSG::DEBUG << "MuonHoughTransformer_xyz::hit added to houghpattern!" << endmsg;
-		    if (event->getHit(i)->getAssociated())log << MSG::DEBUG << " hit already earlier associated to pattern!" << endmsg;
-		  }
-
-		  event->getHit(i)->setAssociated(true);
-
-		  double phi = calculateAngle(hitx,hity,coordsmaximum.first);
-
-		  double thetah = atan2(radiushit,hitz);		  
- 		  if (printlevel>=3 || log.level()<=MSG::DEBUG) {
-		    log << MSG::DEBUG << " X Y hit added to hough pattern phi hit " <<  atan2(event->getHity(i), event->getHitx(i) ) << " phi_calc: " << phi << " phi all " <<  phimax << " theta hit " << thetah << endmsg;  
-                  } 
-
-                  etheta  +=thetah; 
-		  CxxUtils::sincos scphi(phi);
-
-		  sin_phi += scphi.sn;
-		  cos_phi += scphi.cs;
-		  
-		  double radius = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(event->getHitx(i),event->getHity(i),phimax);
-		  eradius +=radius;
-		  
-		  if (printlevel>=3 || log.level()<=MSG::DEBUG){log << MSG::DEBUG << "MuonHoughTransformer_xyz::calculateAngle: " << phi << " calculateradius: " << radius << endmsg;}
-		  
-		}
-	    } //dotprod >=0
-	} // sector requirement
-    } // size
-
-  eradius=eradius/(houghpattern->size()+0.0001);
-  etheta=etheta/(houghpattern->size()+0.0001);
-  ephi = std::atan2(sin_phi,cos_phi);  
-
-  if (printlevel>=3 || log.level()<=MSG::DEBUG){log << MSG::DEBUG << "MuonHoughTransformer_xyz::ephi: " << ephi << " eradius: " << eradius << " etheta " << etheta << endmsg;}
-
-  if (m_ip_setting) houghpattern->setEPhi(ephi);
-  else {houghpattern->setEPhi(phimax);}
-
-  houghpattern->setERPhi(coordsmaximum.first);
-  houghpattern->setETheta(etheta);
-
-  if (!houghpattern->empty() && std::abs(std::sin(houghpattern->getEPhi()-phimax)) > 0.05 )
-    {
-      if (printlevel>=1 || log.level()<=MSG::WARNING){
-      log << MSG::WARNING << "MuonHoughTransformer_xyz::ERROR Ephi calc. WRONG" << endmsg;
-      log << MSG::WARNING << "MuonHoughTransformer_xyz:: histo: radius: " << coordsmaximum.first << " phi: " << phimax << endmsg;
-      log << MSG::WARNING << "MuonHoughTransformer_xyz::  phi: " << ephi << endmsg;
-      }
-
-      houghpattern->setEPhi(MuonHoughMathUtils::angleFromMinusPiToPi(phimax));
-      houghpattern->setERPhi(coordsmaximum.first);
+    double phimax = m_muonhoughmathutils.angleFromGradToRadial(coordsmaximum.second);
+    CxxUtils::sincos scphimax(phimax);
+
+    int max_secmax = max_sector + 1;
+    int max_secmin = max_sector - 1;
+    if (max_secmin < 0) max_secmin = max_sector;
+    if (max_secmax > m_number_of_sectors - 1) max_secmax = max_sector;
+
+    for (unsigned int i = 0; i < event->size(); i++) {
+        double hitx = event->getHitx(i);
+        double hity = event->getHity(i);
+        double hitz = event->getHitz(i);
+
+        double radiushit = std::sqrt(hitx * hitx + hity * hity);
+        int sectorhit = sector(event->getHit(i));
+
+        if (sectorhit == max_sector || sectorhit == max_secmin || sectorhit == max_secmax) {
+            if (!m_ip_setting) {
+                dotprod = 1.;
+            } else {
+                dotprod = scphimax.apply(
+                    getHitPos(event, i).second,
+                    getHitPos(event, i)
+                        .first);  // getHitPos(event,i).first * sincosphimax[1] + getHitPos(event,i).second * sincosphimax[0];
+            }
+            if (dotprod >= 0) {
+                residu_distance =
+                    -coordsmaximum.first +
+                    scphimax.apply(getHitPos(event, i).first,
+                                   -getHitPos(event, i)
+                                        .second);  //- coordsmaximum.first + sincosphimax[0] * getHitPos(event,i).first - sincosphimax[1] *
+                                                   //getHitPos(event,i).second; // phimax shoudl be in map, but there are rounding errors..
+
+                if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+                    log << MSG::DEBUG << "MuonHoughTransformer_xyz::hitx: " << getHitPos(event, i).first
+                        << " hity: " << getHitPos(event, i).second << " dotprod: " << dotprod << " sector: " << sectorhit << endmsg;
+
+                    log << MSG::DEBUG << "MuonHoughTransformer_xyz::residu_distance: " << residu_distance << endmsg;
+                }
+
+                if (std::abs(residu_distance) < max_residu_mm) {
+                    houghpattern->addHit(event->getHit(i));
+
+                    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+                        log << MSG::DEBUG << "MuonHoughTransformer_xyz::hit added to houghpattern!" << endmsg;
+                        if (event->getHit(i)->getAssociated()) log << MSG::DEBUG << " hit already earlier associated to pattern!" << endmsg;
+                    }
+
+                    event->getHit(i)->setAssociated(true);
+
+                    double phi = calculateAngle(hitx, hity, coordsmaximum.first);
+
+                    double thetah = atan2(radiushit, hitz);
+                    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+                        log << MSG::DEBUG << " X Y hit added to hough pattern phi hit " << atan2(event->getHity(i), event->getHitx(i))
+                            << " phi_calc: " << phi << " phi all " << phimax << " theta hit " << thetah << endmsg;
+                    }
+
+                    etheta += thetah;
+                    CxxUtils::sincos scphi(phi);
+
+                    sin_phi += scphi.sn;
+                    cos_phi += scphi.cs;
+
+                    double radius = MuonHoughMathUtils::signedDistanceOfLineToOrigin2D(event->getHitx(i), event->getHity(i), phimax);
+                    eradius += radius;
+
+                    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+                        log << MSG::DEBUG << "MuonHoughTransformer_xyz::calculateAngle: " << phi << " calculateradius: " << radius
+                            << endmsg;
+                    }
+                }
+            }  // dotprod >=0
+        }      // sector requirement
+    }          // size
+
+    eradius = eradius / (houghpattern->size() + 0.0001);
+    etheta = etheta / (houghpattern->size() + 0.0001);
+    ephi = std::atan2(sin_phi, cos_phi);
+
+    if (printlevel >= 3 || log.level() <= MSG::DEBUG) {
+        log << MSG::DEBUG << "MuonHoughTransformer_xyz::ephi: " << ephi << " eradius: " << eradius << " etheta " << etheta << endmsg;
     }
 
-  if (!m_ip_setting) {
-    houghpattern->updateParametersRPhi(true); // switch off ip constraint! (cosmics==true), on by default (cosmics== false)
-
-    if (printlevel>=4 || log.level()<=MSG::VERBOSE)
-      {
-	log << MSG::VERBOSE << "MuonHoughTransformer_xyz::updateParameterstheta new phi (phi flipped Pi for cosmics): " << houghpattern->getEPhi() << " old phi: " << phimax << endmsg;
-	log << MSG::VERBOSE << "MuonHoughTransformer_xyz::updateParameterstheta new r0: " << houghpattern->getERPhi() << " old r0: " << coordsmaximum.first << endmsg;
-      }
-  }
-  
-  return houghpattern;
-}
+    if (m_ip_setting)
+        houghpattern->setEPhi(ephi);
+    else {
+        houghpattern->setEPhi(phimax);
+    }
 
-float MuonHoughTransformer_xyz::weightHoughTransform (double r0) const
-{ 
-  if (m_add_weight_radius)
-    {
-      return ( 1./(std::abs(r0/m_weight_constant_radius)+1.));
+    houghpattern->setERPhi(coordsmaximum.first);
+    houghpattern->setETheta(etheta);
+
+    if (!houghpattern->empty() && std::abs(std::sin(houghpattern->getEPhi() - phimax)) > 0.05) {
+        if (printlevel >= 1 || log.level() <= MSG::WARNING) {
+            log << MSG::WARNING << "MuonHoughTransformer_xyz::ERROR Ephi calc. WRONG" << endmsg;
+            log << MSG::WARNING << "MuonHoughTransformer_xyz:: histo: radius: " << coordsmaximum.first << " phi: " << phimax << endmsg;
+            log << MSG::WARNING << "MuonHoughTransformer_xyz::  phi: " << ephi << endmsg;
+        }
+
+        houghpattern->setEPhi(MuonHoughMathUtils::angleFromMinusPiToPi(phimax));
+        houghpattern->setERPhi(coordsmaximum.first);
     }
-  else {return 1;} // weight function, to give more importance to patterns close to origin
+
+    if (!m_ip_setting) {
+        houghpattern->updateParametersRPhi(true);  // switch off ip constraint! (cosmics==true), on by default (cosmics== false)
+
+        if (printlevel >= 4 || log.level() <= MSG::VERBOSE) {
+            log << MSG::VERBOSE
+                << "MuonHoughTransformer_xyz::updateParameterstheta new phi (phi flipped Pi for cosmics): " << houghpattern->getEPhi()
+                << " old phi: " << phimax << endmsg;
+            log << MSG::VERBOSE << "MuonHoughTransformer_xyz::updateParameterstheta new r0: " << houghpattern->getERPhi()
+                << " old r0: " << coordsmaximum.first << endmsg;
+        }
+    }
+
+    return houghpattern;
 }
 
-int MuonHoughTransformer_xyz::sector(MuonHoughHit* hit)const
-{
-  double radius = hit->getRadius();
-  double hitz = hit->getHitz();
+float MuonHoughTransformer_xyz::weightHoughTransform(double r0) const {
+    if (m_add_weight_radius) {
+        return (1. / (std::abs(r0 / m_weight_constant_radius) + 1.));
+    } else {
+        return 1;
+    }  // weight function, to give more importance to patterns close to origin
+}
+
+int MuonHoughTransformer_xyz::sector(MuonHoughHit* hit) const {
+    double radius = hit->getRadius();
+    double hitz = hit->getHitz();
 
-  //  returns  the sector number of the hit 0..m_number_of_sectors-1
+    //  returns  the sector number of the hit 0..m_number_of_sectors-1
 
-  // Peter Kluit correction 
-  double theta = std::atan2(radius,hitz); // radius>0 : theta: [0,Pi]
+    // Peter Kluit correction
+    double theta = std::atan2(radius, hitz);  // radius>0 : theta: [0,Pi]
 
-  int sectorhit = static_cast<int> (theta * m_number_of_sectors / M_PI);
-  if (sectorhit == m_number_of_sectors) sectorhit += -1; // could happen in rare cases
-  return sectorhit; // only valid for xy!! yz to be done (or to be abondoned) 
+    int sectorhit = static_cast<int>(theta * m_number_of_sectors / M_PI);
+    if (sectorhit == m_number_of_sectors) sectorhit += -1;  // could happen in rare cases
+    return sectorhit;                                       // only valid for xy!! yz to be done (or to be abondoned)
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_yz.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_yz.cxx
index 8c2ca1d8b8a30b5eb4d774888e43c2bc3f3bb234..ab613528488e778aea4d613e84db3c3b827dbfd0 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_yz.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonHoughPatternEvent/src/MuonHoughTransformer_yz.cxx
@@ -4,25 +4,22 @@
 
 #include "MuonHoughPatternEvent/MuonHoughTransformer_yz.h"
 
-MuonHoughTransformer_yz::MuonHoughTransformer_yz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle, double threshold_histo, int number_of_sectors):MuonHoughTransformer_xyz(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors)
-{
-}
+MuonHoughTransformer_yz::MuonHoughTransformer_yz(int nbins, int nbins_angle, double detectorsize, double detectorsize_angle,
+                                                 double threshold_histo, int number_of_sectors) :
+    MuonHoughTransformer_xyz(nbins, nbins_angle, detectorsize, detectorsize_angle, threshold_histo, number_of_sectors) {}
 
-std::pair <double,double> MuonHoughTransformer_yz::getHitPos(const MuonHoughHitContainer * event, int hitid)const //returns the relevant position of the hit (xy-RPC in case of id_number==id_xy_rpc etc.)
+std::pair<double, double> MuonHoughTransformer_yz::getHitPos(const MuonHoughHitContainer* event, int hitid)
+    const  // returns the relevant position of the hit (xy-RPC in case of id_number==id_xy_rpc etc.)
 {
-  std::pair <double,double> hitpos;
-  hitpos.first=event->getHity(hitid); 
-  hitpos.second=event->getHitz(hitid); 
-  return hitpos;
+    std::pair<double, double> hitpos;
+    hitpos.first = event->getHity(hitid);
+    hitpos.second = event->getHitz(hitid);
+    return hitpos;
 }
 
-MuonHoughPattern* MuonHoughTransformer_yz::initialiseHoughPattern()const
-{
-  MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_yz);
-  return houghpattern;
+MuonHoughPattern* MuonHoughTransformer_yz::initialiseHoughPattern() const {
+    MuonHoughPattern* houghpattern = new MuonHoughPattern(MuonHough::hough_yz);
+    return houghpattern;
 }
 
-float MuonHoughTransformer_yz::weightHoughTransform(double r0)const
-{
-  return MuonHoughTransformer_xyz::weightHoughTransform(r0);
-}
+float MuonHoughTransformer_yz::weightHoughTransform(double r0) const { return MuonHoughTransformer_xyz::weightHoughTransform(r0); }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/DetailedMuonPatternTruthCollection.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/DetailedMuonPatternTruthCollection.h
index 3c1a6000bcd4dbb0166acac9f2ab90997bb1cac0..70372936d6e1da2af80d26d95d3b802d69d03b41 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/DetailedMuonPatternTruthCollection.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/DetailedMuonPatternTruthCollection.h
@@ -5,31 +5,31 @@
 #ifndef DETAILEDMUONPATTERNTRUTHCOLLECTION_H
 #define DETAILEDMUONPATTERNTRUTHCOLLECTION_H
 
-#include "TrkTruthData/TrackTruthKey.h"
-#include "TrkTruthData/DetailedTrackTruth.h"
-#include "TrkTrack/TrackCollection.h"
+#include <map>
+
 #include "AthLinks/DataLink.h"
 #include "AthenaKernel/CLASS_DEF.h"
-#include "MuonPattern/MuonPatternCombinationCollection.h"
 #include "MuonPattern/MuonPatternCombination.h"
-
-#include <map>
+#include "MuonPattern/MuonPatternCombinationCollection.h"
+#include "TrkTrack/TrackCollection.h"
+#include "TrkTruthData/DetailedTrackTruth.h"
+#include "TrkTruthData/TrackTruthKey.h"
 
 class TrackTruthCollectionAccessor;
 
-class DetailedMuonPatternTruthCollection : public std::multimap<ElementLink<DataVector<Muon::MuonPatternCombination> >, DetailedTrackTruth> 
-{
-  friend class TrackTruthCollectionAccessor; // in TrackTruthTPCnv
-  DataLink<MuonPatternCombinationCollection> m_trackCollection;
- public:
-  DetailedMuonPatternTruthCollection(const DataLink<MuonPatternCombinationCollection> tracks) : m_trackCollection(tracks) {}
-  DataLink<MuonPatternCombinationCollection> trackCollectionLink() const { return m_trackCollection; }
+class DetailedMuonPatternTruthCollection
+    : public std::multimap<ElementLink<DataVector<Muon::MuonPatternCombination> >, DetailedTrackTruth> {
+    friend class TrackTruthCollectionAccessor;  // in TrackTruthTPCnv
+    DataLink<MuonPatternCombinationCollection> m_trackCollection;
 
-  // for POOL
-  DetailedMuonPatternTruthCollection() {}
-};
+public:
+    DetailedMuonPatternTruthCollection(const DataLink<MuonPatternCombinationCollection> tracks) : m_trackCollection(tracks) {}
+    DataLink<MuonPatternCombinationCollection> trackCollectionLink() const { return m_trackCollection; }
 
+    // for POOL
+    DetailedMuonPatternTruthCollection() {}
+};
 
 CLASS_DEF(DetailedMuonPatternTruthCollection, 1289199398, 1)
 
-#endif/*DETAILEDMUONPATTERNTRUTHCOLLECTION_H*/
+#endif /*DETAILEDMUONPATTERNTRUTHCOLLECTION_H*/
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPattern.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPattern.h
index b6302e490e94ee5ae69c68ac7b2294a668636721..62000e8b1aa27197561c2ce8bdcc17e6b3323533 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPattern.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPattern.h
@@ -5,59 +5,57 @@
 #ifndef MUON_MUONPATTERN_H
 #define MUON_MUONPATTERN_H
 
-#include "EventPrimitives/EventPrimitives.h"   
+#include "EventPrimitives/EventPrimitives.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 
 namespace Trk {
-  class PrepRawData;
+    class PrepRawData;
 }
 
 namespace Muon {
-  /** 
-      @brief Basic class for patterns in the muon spectrometer consistig out of a list of Trk::PrepRawData objects.
-             The class also provides the possibility to store a first estimate of the particle parameters 
-	     in form of a global position and direction 
-      
-      The base-class gives access to the PrepRawData.
-  */
-  class MuonPattern {
-  public:
-    /** Constructor */
-    //MuonPattern( const Trk::GlobalPosition& pos, const Trk::GlobalMomentum& dir );
-   MuonPattern( const Amg::Vector3D& pos, const Amg::Vector3D& dir );
-
-    /** Destructor */
-    virtual ~MuonPattern();
-
-    /** add hit to pattern */
-    virtual void addPrd( const Trk::PrepRawData* prd ) = 0;
-
-    /** Global position of the pattern */
-    const Amg::Vector3D& globalPosition() const;
-
-    /** Global direction of the pattern */
-    const Amg::Vector3D& globalDirection() const;
-
-    /** Number or PrepRawData contained by this Pattern */
-    virtual unsigned int numberOfContainedPrds() const = 0;
-     
-    /** returns the PrepRawData objects depending on the integer, return zero if index out of range */
-    virtual const Trk::PrepRawData* prd(unsigned int) const = 0;
-    
-    /** clone methode */
-    virtual MuonPattern* clone() const = 0;
-
-  private:    
-    /** global position of the pattern */
-    Amg::Vector3D m_globalPosition;
-
-    /** global direction of the pattern */
-    Amg::Vector3D m_globalDirection;
-
-    
-  };
-  inline const Amg::Vector3D& MuonPattern::globalPosition() const { return m_globalPosition; }
-  inline const Amg::Vector3D& MuonPattern::globalDirection() const { return m_globalDirection; }
-}
+    /**
+        @brief Basic class for patterns in the muon spectrometer consistig out of a list of Trk::PrepRawData objects.
+               The class also provides the possibility to store a first estimate of the particle parameters
+               in form of a global position and direction
+
+        The base-class gives access to the PrepRawData.
+    */
+    class MuonPattern {
+    public:
+        /** Constructor */
+        // MuonPattern( const Trk::GlobalPosition& pos, const Trk::GlobalMomentum& dir );
+        MuonPattern(const Amg::Vector3D& pos, const Amg::Vector3D& dir);
+
+        /** Destructor */
+        virtual ~MuonPattern();
+
+        /** add hit to pattern */
+        virtual void addPrd(const Trk::PrepRawData* prd) = 0;
+
+        /** Global position of the pattern */
+        const Amg::Vector3D& globalPosition() const;
+
+        /** Global direction of the pattern */
+        const Amg::Vector3D& globalDirection() const;
+
+        /** Number or PrepRawData contained by this Pattern */
+        virtual unsigned int numberOfContainedPrds() const = 0;
+
+        /** returns the PrepRawData objects depending on the integer, return zero if index out of range */
+        virtual const Trk::PrepRawData* prd(unsigned int) const = 0;
+
+        /** clone methode */
+        virtual MuonPattern* clone() const = 0;
+
+    private:
+        /** global position of the pattern */
+        Amg::Vector3D m_globalPosition;
+
+        /** global direction of the pattern */
+        Amg::Vector3D m_globalDirection;
+    };
+    inline const Amg::Vector3D& MuonPattern::globalPosition() const { return m_globalPosition; }
+    inline const Amg::Vector3D& MuonPattern::globalDirection() const { return m_globalDirection; }
+}  // namespace Muon
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternChamberIntersect.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternChamberIntersect.h
index e56f32af24e0b8723659f427e67395caa1600c87..c8bc88ff2f0b6ce49bd2959e6201909e93eca926 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternChamberIntersect.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternChamberIntersect.h
@@ -16,82 +16,67 @@
 #include "TrkExUtils/TrackSurfaceIntersection.h"
 //#include "TrkEventPrimitives/GlobalPosition.h"
 //#include "TrkEventPrimitives/GlobalDirection.h"
-#include "EventPrimitives/EventPrimitives.h"   
+#include "EventPrimitives/EventPrimitives.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "MuonPrepRawData/SortMuonPrepData.h"
 
-
 namespace Trk {
-  class PrepRawData;
+    class PrepRawData;
 }
 
-
 #include <vector>
 
 namespace Muon {
 
-
-  /** 
-      @brief This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
-      It is designed to pass information of a global road search on PRDs to a segment maker
-      The information includes:
-      - the predicted intersection + direction of the global road with the chamber reference plane
-      - a list of PrepRawData objects in the given chamber
-  */
-  class MuonPatternChamberIntersect {
-  public:
-    /** @brief constructor taking a Trk::TrackSurfaceIntersection
-	@param intersect the intersect of the pattern with the chamber  
-	@param rios a vector of Trk::PrepRawData objects in the chamber that were associated with the pattern
+    /**
+        @brief This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
+        It is designed to pass information of a global road search on PRDs to a segment maker
+        The information includes:
+        - the predicted intersection + direction of the global road with the chamber reference plane
+        - a list of PrepRawData objects in the given chamber
     */
-    MuonPatternChamberIntersect(  const Trk::TrackSurfaceIntersection& intersect,
-				  const std::vector< const Trk::PrepRawData* >& rios );
+    class MuonPatternChamberIntersect {
+    public:
+        /** @brief constructor taking a Trk::TrackSurfaceIntersection
+            @param intersect the intersect of the pattern with the chamber
+            @param rios a vector of Trk::PrepRawData objects in the chamber that were associated with the pattern
+        */
+        MuonPatternChamberIntersect(const Trk::TrackSurfaceIntersection& intersect, const std::vector<const Trk::PrepRawData*>& rios);
 
-    /** @brief constructor taking the global intersect position and direction as input 
-	@param intersect the intersect of the pattern with the chamber  
-	@param rios a vector of Trk::PrepRawData objects in the chamber that were associated with the pattern
-    */
-    MuonPatternChamberIntersect(  const Amg::Vector3D& pos, const Amg::Vector3D& dir,
-				  const std::vector< const Trk::PrepRawData* >& rios );
-
-    /** @brief intersect position in chamber */
-    const Amg::Vector3D&        intersectPosition() const;
-
-    /** @brief intersect position in chamber */
-    const Amg::Vector3D&       intersectDirection() const;
-
-    /** @brief reference to the Trk::TrackSurfaceIntersection */
-    const Trk::TrackSurfaceIntersection&       stationIntersect() const;
-    
-    /** @brief Access to the vector of associated Trk::PrepRawData */
-    const std::vector< const Trk::PrepRawData* >&  prepRawDataVec() const;
-
-  private:
-    // Prediction of the extrapolated position and direction of the road in the chamber     
-    Trk::TrackSurfaceIntersection m_intersect;
-    
-    // vector of PRDs in the chamber
-    std::vector< const Trk::PrepRawData* > m_rios;
-    
-  };
-
-  inline const Amg::Vector3D& MuonPatternChamberIntersect::intersectPosition() const {
-    return stationIntersect().position();
-  }
-
-  inline const Amg::Vector3D& MuonPatternChamberIntersect::intersectDirection() const {
-    return stationIntersect().direction();
-  }
-
-  inline const Trk::TrackSurfaceIntersection& MuonPatternChamberIntersect::stationIntersect() const {  
-    return m_intersect;
-  }
-
-  inline const std::vector< const Trk::PrepRawData* >& MuonPatternChamberIntersect::prepRawDataVec() const {
-    return m_rios;
-  }
-  
-
-} 
+        /** @brief constructor taking the global intersect position and direction as input
+            @param intersect the intersect of the pattern with the chamber
+            @param rios a vector of Trk::PrepRawData objects in the chamber that were associated with the pattern
+        */
+        MuonPatternChamberIntersect(const Amg::Vector3D& pos, const Amg::Vector3D& dir, const std::vector<const Trk::PrepRawData*>& rios);
+
+        /** @brief intersect position in chamber */
+        const Amg::Vector3D& intersectPosition() const;
+
+        /** @brief intersect position in chamber */
+        const Amg::Vector3D& intersectDirection() const;
+
+        /** @brief reference to the Trk::TrackSurfaceIntersection */
+        const Trk::TrackSurfaceIntersection& stationIntersect() const;
+
+        /** @brief Access to the vector of associated Trk::PrepRawData */
+        const std::vector<const Trk::PrepRawData*>& prepRawDataVec() const;
+
+    private:
+        // Prediction of the extrapolated position and direction of the road in the chamber
+        Trk::TrackSurfaceIntersection m_intersect;
+
+        // vector of PRDs in the chamber
+        std::vector<const Trk::PrepRawData*> m_rios;
+    };
+
+    inline const Amg::Vector3D& MuonPatternChamberIntersect::intersectPosition() const { return stationIntersect().position(); }
+
+    inline const Amg::Vector3D& MuonPatternChamberIntersect::intersectDirection() const { return stationIntersect().direction(); }
+
+    inline const Trk::TrackSurfaceIntersection& MuonPatternChamberIntersect::stationIntersect() const { return m_intersect; }
+
+    inline const std::vector<const Trk::PrepRawData*>& MuonPatternChamberIntersect::prepRawDataVec() const { return m_rios; }
+
+}  // namespace Muon
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCollection.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCollection.h
index a404de2693b9bea1f04f4e0632a7a9c61587ee6b..78f92eeb2446994034b69091581dccc0989015dc 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCollection.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCollection.h
@@ -6,18 +6,18 @@
 #define MUON_MUONPATTERNCOLLECTION_H
 
 #include "AthContainers/DataVector.h"
-#include "MuonPattern/MuonPrdPattern.h"
 #include "AthenaKernel/CLASS_DEF.h"
+#include "MuonPattern/MuonPrdPattern.h"
 
 /**
-This typedef represents a collection of MuonPatternCombination objects. 
+This typedef represents a collection of MuonPatternCombination objects.
 It is a DataVector. It can be saved
 to storegate and persistified using POOL.
 */
 typedef DataVector<Muon::MuonPattern> MuonPatternCollection;
-CLASS_DEF(MuonPatternCollection , 1141514 , 1 )
+CLASS_DEF(MuonPatternCollection, 1141514, 1)
 
 typedef DataVector<Muon::MuonPrdPattern> MuonPrdPatternCollection;
-CLASS_DEF(MuonPrdPatternCollection , 1141515 , 1 )
+CLASS_DEF(MuonPrdPatternCollection, 1141515, 1)
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombination.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombination.h
index e3355efebf0a5aa1ef6df1b6075f9438e2417095..ec6d9235e78f4a74d0481bca650c0452039806a1 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombination.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombination.h
@@ -13,71 +13,60 @@
 #ifndef MUON_MUONPATTERNCOMBINATION_H
 #define MUON_MUONPATTERNCOMBINATION_H
 
+#include <vector>
+
 #include "MuonPattern/MuonPatternChamberIntersect.h"
+#include "TrkParameters/TrackParameters.h"
 
+namespace Muon {
 
-#include "TrkParameters/TrackParameters.h"
+    /**
+       @brief The MuonPatternCombination class provides the means to store the output of the initial
+              global pattern recognition in the muon spectrometer.
+       The parameters of the road (position, direction, momentum) are stored in form of a TrackParameter.
+       The hits are stored sorted per chambers in form a MuonPatternChamberIntersect objects.
+    */
+    class MuonPatternCombination {
+    public:
+        /** constructor taking as argmuents:
+            @param parameter the road prediction (Trk::TrackParameter), ownership is transfered to the MuonPatternCombination, the user may
+           pass a zero pointer
+            @param pat a list of associated MuonPatternChamberIntersect objects */
+        MuonPatternCombination(const Trk::TrackParameters* parameter, const std::vector<MuonPatternChamberIntersect>& chamberData);
 
-#include <vector>
+        MuonPatternCombination(const MuonPatternCombination& pat);
 
-namespace Muon {
+        MuonPatternCombination& operator=(const MuonPatternCombination& pat);
+
+        ~MuonPatternCombination();
+
+        /** access to the global position, direction and if available momentum of the road, the pointer might be zero! */
+        const Trk::TrackParameters* trackParameter() const;
+
+        /** access to the MuonPatternChamberIntersect associated with the MuonPatternCombination */
+        const std::vector<MuonPatternChamberIntersect>& chamberData() const;
+
+    private:
+        /** Position and direction of the road
+            In addition the track parameter can provides a first estimate of the momentum */
+        const Trk::TrackParameters* m_parameter;
+
+        /** vector of hits per chamber */
+        std::vector<MuonPatternChamberIntersect> m_chamberData;
+
+        /** type of road **/
+        int m_roadType;
+
+    public:
+        int trackRoadType() const;
+    };
+
+    inline const Trk::TrackParameters* MuonPatternCombination::trackParameter() const { return m_parameter; }
+
+    inline const std::vector<MuonPatternChamberIntersect>& MuonPatternCombination::chamberData() const { return m_chamberData; }
+
+    inline int MuonPatternCombination::trackRoadType() const { return m_roadType; }
 
-  /**
-     @brief The MuonPatternCombination class provides the means to store the output of the initial 
-            global pattern recognition in the muon spectrometer. 
-     The parameters of the road (position, direction, momentum) are stored in form of a TrackParameter. 
-     The hits are stored sorted per chambers in form a MuonPatternChamberIntersect objects.
-  */
-  class MuonPatternCombination {
-  public:
-    /** constructor taking as argmuents:
-	@param parameter the road prediction (Trk::TrackParameter), ownership is transfered to the MuonPatternCombination, the user may pass a zero pointer 
-	@param pat a list of associated MuonPatternChamberIntersect objects */
-    MuonPatternCombination( const Trk::TrackParameters* parameter, 
-			    const std::vector< MuonPatternChamberIntersect >& chamberData );
-    
-    MuonPatternCombination( const MuonPatternCombination& pat );
-
-    MuonPatternCombination&  operator=( const MuonPatternCombination& pat );
-    
-    ~MuonPatternCombination();
-  
-
-   /** access to the global position, direction and if available momentum of the road, the pointer might be zero! */
-    const Trk::TrackParameters* trackParameter() const;
-
-    /** access to the MuonPatternChamberIntersect associated with the MuonPatternCombination */
-    const std::vector< MuonPatternChamberIntersect >& chamberData() const;
-
-  private:
-    /** Position and direction of the road
-	In addition the track parameter can provides a first estimate of the momentum */
-    const Trk::TrackParameters* m_parameter;
-
-    /** vector of hits per chamber */
-    std::vector< MuonPatternChamberIntersect > m_chamberData;
-
-    /** type of road **/
-    int m_roadType;
-
-  public:
-    int trackRoadType() const;
-
-  };
-
-  inline const Trk::TrackParameters* MuonPatternCombination::trackParameter() const{
-    return m_parameter;
-  }
-
-  inline const std::vector< MuonPatternChamberIntersect >& MuonPatternCombination::chamberData() const {
-    return m_chamberData;
-  }
-
-  inline int MuonPatternCombination::trackRoadType() const {
-    return m_roadType;
-  }
-
-}
- 
+}  // namespace Muon
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombinationCollection.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombinationCollection.h
index 19feb1808d8a717f94c6deb9b7fea01940c31fb2..81e3ec0d95afa75cf89b57783e480bc786575014 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombinationCollection.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternCombinationCollection.h
@@ -6,17 +6,15 @@
 #define MUON_MUONPATTERNCOMBINATIONCOLLECTION_H
 
 #include "AthContainers/DataVector.h"
-#include "MuonPattern/MuonPatternCombination.h"
 #include "AthenaKernel/CLASS_DEF.h"
+#include "MuonPattern/MuonPatternCombination.h"
 
 /**
-This typedef represents a collection of MuonPatternCombination objects. 
+This typedef represents a collection of MuonPatternCombination objects.
 It is a DataVector. It can be saved
 to storegate and persistified using POOL.
 */
 typedef DataVector<Muon::MuonPatternCombination> MuonPatternCombinationCollection;
-CLASS_DEF(MuonPatternCombinationCollection , 1141513 , 1 )
-
-
+CLASS_DEF(MuonPatternCombinationCollection, 1141513, 1)
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternDict.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternDict.h
index 75c62f7331f61c53e5dfe4ed2f7ef4c806fbae60..3b01db1548208658cc967653a9cda98fdf1dde15 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternDict.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPatternDict.h
@@ -5,12 +5,12 @@
 #ifndef MUONPATTERN_MUONPATTERNDICT_H
 #define MUONPATTERN_MUONPATTERNDICT_H
 
-#include "MuonPattern/MuonPatternCombinationCollection.h"
 #include "MuonPattern/MuonPatternCombination.h"
+#include "MuonPattern/MuonPatternCombinationCollection.h"
 
 class MuonPatternDummyDict {
-  MuonPatternCombinationCollection m_myPattCombColl;
-  Muon::MuonPatternCombination m_myTempPattComb;
+    MuonPatternCombinationCollection m_myPattCombColl;
+    Muon::MuonPatternCombination m_myTempPattComb;
 };
 
-#endif 
+#endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPrdPattern.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPrdPattern.h
index 8ba679dc85491316193c9baa21375aedfd12b271..1b3d6538aa8689de2b038e1e39a171f00c94c5df 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPrdPattern.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/MuonPattern/MuonPrdPattern.h
@@ -13,72 +13,64 @@
 #ifndef MUON_MUONPRDPATTERN_H
 #define MUON_MUONPRDPATTERN_H
 
-
 #include <vector>
 
 #include "MuonPattern/MuonPattern.h"
 
-
 namespace Muon {
-  
-  
-  /** 
-      @brief Class to store a pattern in the muon system containing PrepRawData pointers. 
-             The class inherits from MuonPattern.
-      
-  */
-  class MuonPrdPattern : public MuonPattern {
-  public:
-    typedef std::vector< const Trk::PrepRawData* > PrdVector;
-
-  public:
-    /** Constructor */
-    MuonPrdPattern( const Amg::Vector3D& pos, const Amg::Vector3D& dir );
-
-    /** Constructor with vector of prds */
-    MuonPrdPattern( const Amg::Vector3D& pos, const Amg::Vector3D& dir, const PrdVector& prds );
-
-    /** Destructor */
-    ~MuonPrdPattern();
-
-    /** add hit to pattern */
-    virtual void addPrd( const Trk::PrepRawData* prd );
-
-    /** Number or PrepRawData contained by this Pattern */
-    virtual unsigned int numberOfContainedPrds() const ;
-     
-    /** returns the PrepRawData objects depending on the integer, return zero if index out of range */
-    virtual const Trk::PrepRawData* prd(unsigned int index) const;
-    
-    /** clone methode */
-    virtual MuonPrdPattern* clone() const;
-
-    const PrdVector&  prepRawDataVec() const;
-
-  private:    
-
-    /** vector of PrepRawData pointers */
-    PrdVector m_prds;
-    
-  };
-
-  inline void MuonPrdPattern::addPrd( const Trk::PrepRawData* prd ) { 
-    if( prd ) m_prds.push_back( prd ); 
-  }
-
-  inline unsigned int MuonPrdPattern::numberOfContainedPrds() const { return m_prds.size(); }
-
-  inline const Trk::PrepRawData* MuonPrdPattern::prd(unsigned int index) const { 
-    if( index < numberOfContainedPrds() ) return m_prds[index];
-    return 0;
-  }
-
-  inline MuonPrdPattern* MuonPrdPattern::clone() const { return new MuonPrdPattern( *this ); }
-
-  inline const std::vector< const Trk::PrepRawData* >& MuonPrdPattern::prepRawDataVec() const {
-    return m_prds;
-  }
-}
 
+    /**
+        @brief Class to store a pattern in the muon system containing PrepRawData pointers.
+               The class inherits from MuonPattern.
+
+    */
+    class MuonPrdPattern : public MuonPattern {
+    public:
+        typedef std::vector<const Trk::PrepRawData*> PrdVector;
+
+    public:
+        /** Constructor */
+        MuonPrdPattern(const Amg::Vector3D& pos, const Amg::Vector3D& dir);
+
+        /** Constructor with vector of prds */
+        MuonPrdPattern(const Amg::Vector3D& pos, const Amg::Vector3D& dir, const PrdVector& prds);
+
+        /** Destructor */
+        ~MuonPrdPattern();
+
+        /** add hit to pattern */
+        virtual void addPrd(const Trk::PrepRawData* prd);
+
+        /** Number or PrepRawData contained by this Pattern */
+        virtual unsigned int numberOfContainedPrds() const;
+
+        /** returns the PrepRawData objects depending on the integer, return zero if index out of range */
+        virtual const Trk::PrepRawData* prd(unsigned int index) const;
+
+        /** clone methode */
+        virtual MuonPrdPattern* clone() const;
+
+        const PrdVector& prepRawDataVec() const;
+
+    private:
+        /** vector of PrepRawData pointers */
+        PrdVector m_prds;
+    };
+
+    inline void MuonPrdPattern::addPrd(const Trk::PrepRawData* prd) {
+        if (prd) m_prds.push_back(prd);
+    }
+
+    inline unsigned int MuonPrdPattern::numberOfContainedPrds() const { return m_prds.size(); }
+
+    inline const Trk::PrepRawData* MuonPrdPattern::prd(unsigned int index) const {
+        if (index < numberOfContainedPrds()) return m_prds[index];
+        return 0;
+    }
+
+    inline MuonPrdPattern* MuonPrdPattern::clone() const { return new MuonPrdPattern(*this); }
+
+    inline const std::vector<const Trk::PrepRawData*>& MuonPrdPattern::prepRawDataVec() const { return m_prds; }
+}  // namespace Muon
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/doc/packagedoc.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/doc/packagedoc.h
index 203c4edadf94b6deabe16c76c64a871f4b7f964d..460adf31c852539bd15dd677d7d7bb8a4e2e6684 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/doc/packagedoc.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/doc/packagedoc.h
@@ -5,29 +5,29 @@
 /**
 
 @page MuonPattern_page MuonPattern package
-	@author Niels Van Eldik <niels.van.eldik@cern.ch>
-	
+        @author Niels Van Eldik <niels.van.eldik@cern.ch>
+
 @section MuonPattern_MuonPatternIntro Introduction
 
 Package containing classes to store sets of Trk::PrepRawData objects that are the output of the
 initial road finding in the muon spectrometer.
 
 The package contains the following objects:
-- Muon::MuonPattern: base class for simple lists of Trk::PrepRawData objects. 
+- Muon::MuonPattern: base class for simple lists of Trk::PrepRawData objects.
 - Muon::MuonPrdPattern: concrete implementation of a Muon::MuonPattern storing a list of Trk::PrepRawData objects
-- Muon::MuonPatternCombination: The output of the global pattern recognition in the muon spectrometer consists of 
-                          global roads in the detector. The Muon::MuonPatternCombination provides the means to 
-			  store the Trk::PrepRawData objects sorted by chamber in form of a Muon::MuonPatternChamberIntersect. 
-- Muon::MuonPatternChamberIntersect: Object to store a list of PrepRawData objects in a given chamber that 
-                               were associated with a pattern. In addition to a list of Trk::PrepRawData, the 
-			       Muon::MuonPatternChamberIntersect provides a placeholder for a Trk::TrackParameters 
-			       allowing the user to store the intersect of a given pattern with the station.
-			       
+- Muon::MuonPatternCombination: The output of the global pattern recognition in the muon spectrometer consists of
+                          global roads in the detector. The Muon::MuonPatternCombination provides the means to
+                          store the Trk::PrepRawData objects sorted by chamber in form of a Muon::MuonPatternChamberIntersect.
+- Muon::MuonPatternChamberIntersect: Object to store a list of PrepRawData objects in a given chamber that
+                               were associated with a pattern. In addition to a list of Trk::PrepRawData, the
+                               Muon::MuonPatternChamberIntersect provides a placeholder for a Trk::TrackParameters
+                               allowing the user to store the intersect of a given pattern with the station.
+
 The objects can be stored in StoreGate using the following collections:
 - MuonPatternCollection: a vector of Muon::MuonPattern objects
 - MuonPrdPatternCollection: a vector of Muon::MuonPrdPattern objects
 - MuonPatternCombinationCollection: a vector of Muon::MuonPatternCombination objects
-	
+
 @section MuonPattern_ExtrasMuonPattern Extra Pages
 
 */
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPattern.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPattern.cxx
index 43a7b01d0c1576f2cdc8102ba03eab18ad9dcac9..865e26397b677c77e1e3146c9774d81b2635652c 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPattern.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPattern.cxx
@@ -11,20 +11,12 @@
  * Last Update  : 27 July 2005
  ***************************************************************************/
 
-
 #include "MuonPattern/MuonPattern.h"
 
 namespace Muon {
 
-  MuonPattern::MuonPattern( const Amg::Vector3D& pos, const Amg::Vector3D& dir ) : 
-    m_globalPosition(pos), m_globalDirection(dir) 
-  {
-
-  }
+    MuonPattern::MuonPattern(const Amg::Vector3D& pos, const Amg::Vector3D& dir) : m_globalPosition(pos), m_globalDirection(dir) {}
 
-  MuonPattern::~MuonPattern() 
-  {
-  
-  }
+    MuonPattern::~MuonPattern() {}
 
-}
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternChamberIntersect.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternChamberIntersect.cxx
index 16ba2d5b3f742b96b7e44f2996b7063dcd38ec68..2485bf91bbf0ca4c9f04c4a126b471007344a1e0 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternChamberIntersect.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternChamberIntersect.cxx
@@ -4,22 +4,18 @@
 
 #include "MuonPattern/MuonPatternChamberIntersect.h"
 
-
-
 namespace Muon {
 
-  MuonPatternChamberIntersect::MuonPatternChamberIntersect(  const Trk::TrackSurfaceIntersection& intersect,
-							     const std::vector< const Trk::PrepRawData* >& rios ) :
-    m_intersect(intersect), m_rios(rios)
-  {
-    std::sort( m_rios.begin(), m_rios.end(), SortMuonPrepData() );
-  }
-  
-  MuonPatternChamberIntersect::MuonPatternChamberIntersect(  const Amg::Vector3D& pos, const Amg::Vector3D& dir,
-							     const std::vector< const Trk::PrepRawData* >& rios ) :
-    m_intersect(pos,dir,0.), m_rios(rios)
-  {
-    std::sort( m_rios.begin(), m_rios.end(), SortMuonPrepData() );
-  }
+    MuonPatternChamberIntersect::MuonPatternChamberIntersect(const Trk::TrackSurfaceIntersection& intersect,
+                                                             const std::vector<const Trk::PrepRawData*>& rios) :
+        m_intersect(intersect), m_rios(rios) {
+        std::sort(m_rios.begin(), m_rios.end(), SortMuonPrepData());
+    }
+
+    MuonPatternChamberIntersect::MuonPatternChamberIntersect(const Amg::Vector3D& pos, const Amg::Vector3D& dir,
+                                                             const std::vector<const Trk::PrepRawData*>& rios) :
+        m_intersect(pos, dir, 0.), m_rios(rios) {
+        std::sort(m_rios.begin(), m_rios.end(), SortMuonPrepData());
+    }
 
-}
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternCombination.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternCombination.cxx
index cded846a9efcb50a08e3adbb84db24e909443225..bdf1e5f349d724867fe5e8f547a4482f4d6f19b5 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternCombination.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPatternCombination.cxx
@@ -11,45 +11,27 @@
  * Last Update  : 27 July 2005
  ***************************************************************************/
 
-
 #include "MuonPattern/MuonPatternCombination.h"
 
 namespace Muon {
 
-
-
-  MuonPatternCombination::MuonPatternCombination( const Trk::TrackParameters* parameter, 
-						  const std::vector< MuonPatternChamberIntersect >& chamberData ) :
-    m_parameter( parameter ),
-    m_chamberData( chamberData ),
-    m_roadType(0)
-  {
-
-  }
-  
-  MuonPatternCombination::MuonPatternCombination( const MuonPatternCombination& pat ) :
-    m_parameter( pat.m_parameter ? pat.m_parameter->clone() : nullptr ),
-    m_chamberData( pat.m_chamberData ),
-    m_roadType(0)
-  {
-    
-  }
-
-  MuonPatternCombination&  MuonPatternCombination::operator=( const MuonPatternCombination& pat )
-  {
-    if (this!=&pat ){
-      // delete old MuonPatterns
-      delete m_parameter;
-      m_parameter = pat.m_parameter ? pat.m_parameter->clone() : nullptr;
-      m_chamberData = pat.m_chamberData;
+    MuonPatternCombination::MuonPatternCombination(const Trk::TrackParameters* parameter,
+                                                   const std::vector<MuonPatternChamberIntersect>& chamberData) :
+        m_parameter(parameter), m_chamberData(chamberData), m_roadType(0) {}
+
+    MuonPatternCombination::MuonPatternCombination(const MuonPatternCombination& pat) :
+        m_parameter(pat.m_parameter ? pat.m_parameter->clone() : nullptr), m_chamberData(pat.m_chamberData), m_roadType(0) {}
+
+    MuonPatternCombination& MuonPatternCombination::operator=(const MuonPatternCombination& pat) {
+        if (this != &pat) {
+            // delete old MuonPatterns
+            delete m_parameter;
+            m_parameter = pat.m_parameter ? pat.m_parameter->clone() : nullptr;
+            m_chamberData = pat.m_chamberData;
+        }
+        return *this;
     }
-    return *this;
-  }
-
-  MuonPatternCombination::~MuonPatternCombination(){
-    delete m_parameter;
-  }
-
 
+    MuonPatternCombination::~MuonPatternCombination() { delete m_parameter; }
 
-}
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPrdPattern.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPrdPattern.cxx
index 924f6ed842b01acdc65dc174897fc7f0940eaa6b..711b1602f61314a666191ab8af8c80510878d556 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPrdPattern.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPattern/src/MuonPrdPattern.cxx
@@ -11,27 +11,14 @@
  * Last Update  : 27 July 2005
  ***************************************************************************/
 
-
 #include "MuonPattern/MuonPrdPattern.h"
 
 namespace Muon {
 
-  MuonPrdPattern::MuonPrdPattern( const Amg::Vector3D& pos, const Amg::Vector3D& dir ) : 
-    MuonPattern(pos,dir) 
-  {
-
-  } 
-
-  MuonPrdPattern::MuonPrdPattern( const Amg::Vector3D& pos, const Amg::Vector3D& dir, const PrdVector& prds ) : 
-    MuonPattern(pos,dir) , m_prds(prds)
-  {
-
-  }
-
-  MuonPrdPattern::~MuonPrdPattern()
-  {
+    MuonPrdPattern::MuonPrdPattern(const Amg::Vector3D& pos, const Amg::Vector3D& dir) : MuonPattern(pos, dir) {}
 
-  }
-}
+    MuonPrdPattern::MuonPrdPattern(const Amg::Vector3D& pos, const Amg::Vector3D& dir, const PrdVector& prds) :
+        MuonPattern(pos, dir), m_prds(prds) {}
 
- 
+    MuonPrdPattern::~MuonPrdPattern() {}
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonCombinePatternTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonCombinePatternTool.h
index d300ae4d9c90246cc7d3c8ee71e490d19fb4e736..1a7a0eb7d2c010978197a3f4b2d6687eb4612827 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonCombinePatternTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonCombinePatternTool.h
@@ -8,57 +8,41 @@
 #include "TrkPrepRawData/PrepRawData.h"
 
 /** Must declare this, with name of interface*/
-static const InterfaceID
-  IID_IMuonCombinePatternTool("Muon::IMuonCombinePatternTool", 1, 0);
+static const InterfaceID IID_IMuonCombinePatternTool("Muon::IMuonCombinePatternTool", 1, 0);
 
 namespace Muon {
 
-/** comparison functor for Trk::PrepRawData* (on identfier) used for sorting
-   set<Trk::PrepRawData*> , else these sets are sorted by memory address
-   (introduces random behaviour)
-*/
+    /** comparison functor for Trk::PrepRawData* (on identfier) used for sorting
+       set<Trk::PrepRawData*> , else these sets are sorted by memory address
+       (introduces random behaviour)
+    */
 
-struct IdentifierPrdLess
-{
-  bool operator()(const Trk::PrepRawData* pT1,
-                  const Trk::PrepRawData* pT2) const
-  {
-    return pT1->identify() < pT2->identify();
-  }
-};
+    struct IdentifierPrdLess {
+        bool operator()(const Trk::PrepRawData* pT1, const Trk::PrepRawData* pT2) const { return pT1->identify() < pT2->identify(); }
+    };
 
-/** Interface for tools combining Muon::MuonPattern objects */
-class IMuonCombinePatternTool : virtual public IAlgTool
-{
-public:
-  /**Declared here, and defined below*/
-  static const InterfaceID& interfaceID();
+    /** Interface for tools combining Muon::MuonPattern objects */
+    class IMuonCombinePatternTool : virtual public IAlgTool {
+    public:
+        /**Declared here, and defined below*/
+        static const InterfaceID& interfaceID();
 
-  /** @brief combine a collection of Muon::MuonPattern object in the phi-plane
-   * with a collection of Muon::MuonPattern objects in the eta plane */
-  virtual MuonPrdPatternCollection* combineEtaPhiPatterns(
-    const MuonPrdPatternCollection* phipatterns,
-    const MuonPrdPatternCollection* etapatterns,
-    const std::map<const Trk::PrepRawData*,
-                   std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>*
-      phiEtaHitAssMap) const = 0;
+        /** @brief combine a collection of Muon::MuonPattern object in the phi-plane
+         * with a collection of Muon::MuonPattern objects in the eta plane */
+        virtual MuonPrdPatternCollection* combineEtaPhiPatterns(
+            const MuonPrdPatternCollection* phipatterns, const MuonPrdPatternCollection* etapatterns,
+            const std::map<const Trk::PrepRawData*, std::set<const Trk::PrepRawData*, Muon::IdentifierPrdLess>>* phiEtaHitAssMap) const = 0;
 
-  /** @brief combine a Muon::MuonPattern object in the phi-plane with one the in
-   * the eta plane */
-  virtual Muon::MuonPrdPattern* makeCombinedPattern(
-    const Muon::MuonPrdPattern* phipattern,
-    const Muon::MuonPrdPattern* etapattern) const = 0;
+        /** @brief combine a Muon::MuonPattern object in the phi-plane with one the in
+         * the eta plane */
+        virtual Muon::MuonPrdPattern* makeCombinedPattern(const Muon::MuonPrdPattern* phipattern,
+                                                          const Muon::MuonPrdPattern* etapattern) const = 0;
 
-  /** @brief create a collection of Muon::MuonPatternCombination from a
-   * collection of Muon::MuonPrdPattern objects */
-  virtual MuonPatternCombinationCollection* makePatternCombinations(
-    const MuonPrdPatternCollection* combinedpatterns) const = 0;
-};
+        /** @brief create a collection of Muon::MuonPatternCombination from a
+         * collection of Muon::MuonPrdPattern objects */
+        virtual MuonPatternCombinationCollection* makePatternCombinations(const MuonPrdPatternCollection* combinedpatterns) const = 0;
+    };
 
-inline const InterfaceID&
-IMuonCombinePatternTool::interfaceID()
-{
-  return IID_IMuonCombinePatternTool;
-}
+    inline const InterfaceID& IMuonCombinePatternTool::interfaceID() { return IID_IMuonCombinePatternTool; }
 
-} // namespace Muon
+}  // namespace Muon
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/Hit.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/Hit.h
index 0f7ad72c0a90c213d3e0f6e0bbbe21411e5e900e..c08fab912bc1b6408fd2f26aa0f3fd2c42bfd859 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/Hit.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/Hit.h
@@ -7,199 +7,191 @@
 
 #include <functional>
 #include <map>
+
 #include "CxxUtils/fpcompare.h"
 #include "MuonStationIndex/MuonStationIndex.h"
 
 namespace Trk {
-  class PrepRawData;
+    class PrepRawData;
 }
 namespace Muon {
-  class TgcClusterObj3D;
+    class TgcClusterObj3D;
 }
 
 namespace MuonHough {
-  static const int UNINITIALIZED = -99999;
-  /// struct containing additional debug information on the hits that is not needed for the actual alg
-  /// but very useful for debugging
-  class HitDebugInfo {
-  public:
-    HitDebugInfo();
-
-    HitDebugInfo( int type_, int sector_, Muon::MuonStationIndex::DetectorRegionIndex region_,
-                  Muon::MuonStationIndex::LayerIndex layer_, int sublayer_ );
-      
-    int type;           /// technology type
-    int sector;         /// sector
-    Muon::MuonStationIndex::DetectorRegionIndex region; /// detector region (endcapA/barrel/endcapC)
-    Muon::MuonStationIndex::LayerIndex layer;           /// layer (inner/middle/outer)
-    int sublayer;       /// sublayer within layer
-    int pdgId;          /// pdgId of the associated truth particle (if any)
-    int barcode;        /// barcode of truth particle
-    int muonIndex;      /// index of reconstructed muon 
-    int clusterSize;    /// cluster size 
-    int clusterLayers;  /// number of layers in the cluster
-    int isEtaPhi;       /// flag whether confirmed in the other projection
-    int trigConfirm;    /// flag whether confirmed by a trigger hit
-    int binpos;         /// spacial bin of the hit with the highest value in the hough space 
-    int bintheta;       /// angular bin of the hit with the highest value in the hough space 
-    float time;         /// measured time 
-    float r;            /// drift radius for MDT, strip pitch for strips
-    float ph;           /// maximum value in the hough space 
-    float phn;          /// maximum value in the hough space in neighbouring sector; dege
-    float ph1;          /// maximum value of the hit projected into the first other layer in the hough space 
-    float ph2;          /// maximum value of the hit projected into the second other layer in the hough space 
-    float rot;          /// angle corresponding to the maximum in the hough space; poin to IP
-  };
-
-
-  /// struct containing all hit information needed for the Hough transform
-  class Hit {
-  public:
-    
-    /// constructor, takes ownership of the HitDebugInfo pointer
-    Hit( int layer_, float x_, float ymin_, float ymax_, float w_, HitDebugInfo* d_ = 0, 
-	 const Trk::PrepRawData* prd_ = 0, const Muon::TgcClusterObj3D* tgc_ = 0 );
-
-    /// destructor
-    ~Hit();
-
-    /// copy constructor
-    Hit( const Hit& h_);
-
-    /// =operator
-    Hit& operator=( const Hit& h_ );
-
-    int   layer{};        /// layer identifier (packed word containing technology/sublayer)
-    float x{};            /// global hit position (x=r in barrel, x=z in endcap)
-    float ymin{};         /// minimum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
-    float ymax{};         /// maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
-    float w{};            /// weight of the hit
-
-    /// access to debug information
-    const HitDebugInfo* debugInfo() const { return m_debug; } 
-    HitDebugInfo* debugInfo() { return m_debug; }
-
-    /// access to assiciated hit, either the prd or the tgc pointer is set in athena
-    const Trk::PrepRawData* prd{};
-    const Muon::TgcClusterObj3D* tgc{};
-
-  private:
-  
-    HitDebugInfo* m_debug{};  /// pointer to debug information
-
-    /// copy function for internal use
-    void copy( const Hit& hit );
-  };
-
-  /// struct containing all hit information needed for the Hough transform
-  struct PhiHit {
-    
-    /// constructor, takes ownership of the HitDebugInfo pointer
-    PhiHit( int layer_, float r_, float phimin_, float phimax_, float w_, HitDebugInfo* d_ = 0, 
-	    const Trk::PrepRawData* prd_ = 0, const Muon::TgcClusterObj3D* tgc_ = 0 );
-
-    /// destructor
-    ~PhiHit();
-
-    /// copy constructor
-    PhiHit( const PhiHit& h_);
-
-    /// =operator
-    PhiHit& operator=( const PhiHit& h_ );
-
-    int   layer{};   /// layer identifier (packed word containing technology/sublayer)
-    float r{};       /// global hit position (x=r in barrel, x=z in endcap)
-    float phimin{};  /// minimum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
-    float phimax{};  /// maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
-    float w{};       /// weight of the hit
-
-    /// access to debug information
-    const HitDebugInfo* debugInfo() const { return m_debug; }
-    HitDebugInfo* debugInfo() { return m_debug; }
-
-    /// access to assiciated hit, either the prd or the tgc pointer is set in athena
-    const Trk::PrepRawData* prd{};
-    const Muon::TgcClusterObj3D* tgc{};
-
-  private:
-    HitDebugInfo* m_debug{}; /// pointer to debug information
-
-    /// copy function for internal use
-    void copy( const PhiHit& hit );
-  };
-
-
-  /// struct containing truth or track information
-  struct MuonDebugInfo {
-    int pdgId;      /// pdgId of the true muon
-    int barcode;    /// barcode of the true muon
-    int muonIndex;  /// index of the associated track
-    float pt;       /// pt 
-    float eta;      /// eta
-    float phi;      /// phi
-    
-    // number of reconstructed hits
-    int nmdts;      
-    int nrpcs;
-    int ntgcs;
-    int ncscs;
-    int nmms;
-    int nstgcs;
-
-    // number of true hits
-    int ntmdts;
-    int ntrpcs;
-    int nttgcs;
-    int ntcscs;
-    int ntmms;
-    int ntstgcs;
-  };
-
-  /// struct containing truth or segment information
-  struct SegDebugInfo {
-    float  sposx;
-    float  sposy;
-    float  sposz;
-    float  sdirx;
-    float  sdiry;
-    float  sdirz;
-    int    snPrecHits;
-    int    snTrigHits;
-    int    sSector;
-    int    sChIndex;
-  };
-
-  /// struct to sort the hits
-  struct SortHitsPerLayer {
-    bool operator()(const Hit& hit1, const Hit& hit2 ) const {
-      return compare(hit1.ymin, hit2.ymin, hit1.layer, hit2.layer, hit1.debugInfo(), hit2.debugInfo() );  
-    }
-
-    bool operator()(const PhiHit& hit1, const PhiHit& hit2 ) const {
-      return compare(hit1.phimin, hit2.phimin, hit1.layer, hit2.layer, hit1.debugInfo(), hit2.debugInfo() );  
-    }
-
-    bool compare( float val1, float val2, int lay1, int lay2, const HitDebugInfo* db1, const HitDebugInfo* db2 ) const {
-      if( db1 && db2 ){
-	if( db1->sector != db2->sector ) return db1->sector < db2->sector;
-	if( db1->region != db2->region ) return db1->region < db2->region;
-	if( db1->type != db2->type ) return db1->type < db2->type;
-	if( db1->layer != db2->layer ) return db1->layer < db2->layer;
-	if( db1->sublayer != db2->sublayer ) return db1->sublayer < db2->sublayer;
-      }else{
-	if( lay1 != lay2 ) return lay1 < lay2;
-      }
-      return CxxUtils::fpcompare::less (val1,val2); 
-    }
-
-    bool operator()(const Hit* hit1, const Hit* hit2 ) const {
-      return operator()(*hit1,*hit2);
-    }
-    bool operator()(const PhiHit* hit1, const PhiHit* hit2 ) const {
-      return operator()(*hit1,*hit2);
-    }
-  };
-
-}
+    static const int UNINITIALIZED = -99999;
+    /// struct containing additional debug information on the hits that is not needed for the actual alg
+    /// but very useful for debugging
+    class HitDebugInfo {
+    public:
+        HitDebugInfo();
+
+        HitDebugInfo(int type_, int sector_, Muon::MuonStationIndex::DetectorRegionIndex region_, Muon::MuonStationIndex::LayerIndex layer_,
+                     int sublayer_);
+
+        int type;                                            /// technology type
+        int sector;                                          /// sector
+        Muon::MuonStationIndex::DetectorRegionIndex region;  /// detector region (endcapA/barrel/endcapC)
+        Muon::MuonStationIndex::LayerIndex layer;            /// layer (inner/middle/outer)
+        int sublayer;                                        /// sublayer within layer
+        int pdgId;                                           /// pdgId of the associated truth particle (if any)
+        int barcode;                                         /// barcode of truth particle
+        int muonIndex;                                       /// index of reconstructed muon
+        int clusterSize;                                     /// cluster size
+        int clusterLayers;                                   /// number of layers in the cluster
+        int isEtaPhi;                                        /// flag whether confirmed in the other projection
+        int trigConfirm;                                     /// flag whether confirmed by a trigger hit
+        int binpos;                                          /// spacial bin of the hit with the highest value in the hough space
+        int bintheta;                                        /// angular bin of the hit with the highest value in the hough space
+        float time;                                          /// measured time
+        float r;                                             /// drift radius for MDT, strip pitch for strips
+        float ph;                                            /// maximum value in the hough space
+        float phn;                                           /// maximum value in the hough space in neighbouring sector; dege
+        float ph1;  /// maximum value of the hit projected into the first other layer in the hough space
+        float ph2;  /// maximum value of the hit projected into the second other layer in the hough space
+        float rot;  /// angle corresponding to the maximum in the hough space; poin to IP
+    };
+
+    /// struct containing all hit information needed for the Hough transform
+    class Hit {
+    public:
+        /// constructor, takes ownership of the HitDebugInfo pointer
+        Hit(int layer_, float x_, float ymin_, float ymax_, float w_, HitDebugInfo* d_ = 0, const Trk::PrepRawData* prd_ = 0,
+            const Muon::TgcClusterObj3D* tgc_ = 0);
+
+        /// destructor
+        ~Hit();
+
+        /// copy constructor
+        Hit(const Hit& h_);
+
+        /// =operator
+        Hit& operator=(const Hit& h_);
+
+        int layer{};   /// layer identifier (packed word containing technology/sublayer)
+        float x{};     /// global hit position (x=r in barrel, x=z in endcap)
+        float ymin{};  /// minimum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
+        float ymax{};  /// maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
+        float w{};     /// weight of the hit
+
+        /// access to debug information
+        const HitDebugInfo* debugInfo() const { return m_debug; }
+        HitDebugInfo* debugInfo() { return m_debug; }
+
+        /// access to assiciated hit, either the prd or the tgc pointer is set in athena
+        const Trk::PrepRawData* prd{};
+        const Muon::TgcClusterObj3D* tgc{};
+
+    private:
+        HitDebugInfo* m_debug{};  /// pointer to debug information
+
+        /// copy function for internal use
+        void copy(const Hit& hit);
+    };
+
+    /// struct containing all hit information needed for the Hough transform
+    struct PhiHit {
+        /// constructor, takes ownership of the HitDebugInfo pointer
+        PhiHit(int layer_, float r_, float phimin_, float phimax_, float w_, HitDebugInfo* d_ = 0, const Trk::PrepRawData* prd_ = 0,
+               const Muon::TgcClusterObj3D* tgc_ = 0);
+
+        /// destructor
+        ~PhiHit();
+
+        /// copy constructor
+        PhiHit(const PhiHit& h_);
+
+        /// =operator
+        PhiHit& operator=(const PhiHit& h_);
+
+        int layer{};     /// layer identifier (packed word containing technology/sublayer)
+        float r{};       /// global hit position (x=r in barrel, x=z in endcap)
+        float phimin{};  /// minimum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
+        float phimax{};  /// maximum value of the hit in the precision coordinate (y=z in barrel, y=r in endcap)
+        float w{};       /// weight of the hit
+
+        /// access to debug information
+        const HitDebugInfo* debugInfo() const { return m_debug; }
+        HitDebugInfo* debugInfo() { return m_debug; }
+
+        /// access to assiciated hit, either the prd or the tgc pointer is set in athena
+        const Trk::PrepRawData* prd{};
+        const Muon::TgcClusterObj3D* tgc{};
+
+    private:
+        HitDebugInfo* m_debug{};  /// pointer to debug information
+
+        /// copy function for internal use
+        void copy(const PhiHit& hit);
+    };
+
+    /// struct containing truth or track information
+    struct MuonDebugInfo {
+        int pdgId;      /// pdgId of the true muon
+        int barcode;    /// barcode of the true muon
+        int muonIndex;  /// index of the associated track
+        float pt;       /// pt
+        float eta;      /// eta
+        float phi;      /// phi
+
+        // number of reconstructed hits
+        int nmdts;
+        int nrpcs;
+        int ntgcs;
+        int ncscs;
+        int nmms;
+        int nstgcs;
+
+        // number of true hits
+        int ntmdts;
+        int ntrpcs;
+        int nttgcs;
+        int ntcscs;
+        int ntmms;
+        int ntstgcs;
+    };
+
+    /// struct containing truth or segment information
+    struct SegDebugInfo {
+        float sposx;
+        float sposy;
+        float sposz;
+        float sdirx;
+        float sdiry;
+        float sdirz;
+        int snPrecHits;
+        int snTrigHits;
+        int sSector;
+        int sChIndex;
+    };
+
+    /// struct to sort the hits
+    struct SortHitsPerLayer {
+        bool operator()(const Hit& hit1, const Hit& hit2) const {
+            return compare(hit1.ymin, hit2.ymin, hit1.layer, hit2.layer, hit1.debugInfo(), hit2.debugInfo());
+        }
+
+        bool operator()(const PhiHit& hit1, const PhiHit& hit2) const {
+            return compare(hit1.phimin, hit2.phimin, hit1.layer, hit2.layer, hit1.debugInfo(), hit2.debugInfo());
+        }
+
+        bool compare(float val1, float val2, int lay1, int lay2, const HitDebugInfo* db1, const HitDebugInfo* db2) const {
+            if (db1 && db2) {
+                if (db1->sector != db2->sector) return db1->sector < db2->sector;
+                if (db1->region != db2->region) return db1->region < db2->region;
+                if (db1->type != db2->type) return db1->type < db2->type;
+                if (db1->layer != db2->layer) return db1->layer < db2->layer;
+                if (db1->sublayer != db2->sublayer) return db1->sublayer < db2->sublayer;
+            } else {
+                if (lay1 != lay2) return lay1 < lay2;
+            }
+            return CxxUtils::fpcompare::less(val1, val2);
+        }
+
+        bool operator()(const Hit* hit1, const Hit* hit2) const { return operator()(*hit1, *hit2); }
+        bool operator()(const PhiHit* hit1, const PhiHit* hit2) const { return operator()(*hit1, *hit2); }
+    };
+
+}  // namespace MuonHough
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/HitNtuple.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/HitNtuple.h
index 8737a888118fc6b58d40deae73e10a8eea210562..b72d38ea6b3720123db2e43a8739dfc9ca5ace93 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/HitNtuple.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/HitNtuple.h
@@ -5,185 +5,182 @@
 #ifndef MUONHOUGH_HITNTUPLE_H
 #define MUONHOUGH_HITNTUPLE_H
 
+#include <map>
+#include <vector>
+
 #include "MuonLayerHough/Hit.h"
 #include "MuonStationIndex/MuonStationIndex.h"
 
-#include <vector>
-#include <map>
-
 class TTree;
 
 namespace MuonHough {
 
-  struct DataIndex {
-    DataIndex( int key ) : m_data(key) {}
-    DataIndex( int sector, int region, int layer, int type ) : m_data(100000*sector+10000*region+100*layer+type) {}
-    int sector() const { return m_data/100000; }
-    Muon::MuonStationIndex::DetectorRegionIndex region() const { return static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(m_data/10000%10); }
-    Muon::MuonStationIndex::LayerIndex layer() const { return static_cast<Muon::MuonStationIndex::LayerIndex>(m_data/100%10); }
-    int type() const { return m_data%100; }
-    int key() const { return m_data; }
-    int m_data;
-  };
-  bool operator<( const DataIndex& index1,const DataIndex& index2 );
-
-  typedef std::vector< Hit* > HitList;
-  typedef std::map< DataIndex, HitList > SectorData;
-  
-
-  struct EventData {
-    std::map< int, SectorData > sectors;
-
-    void dump() const;
-    static void dump( const std::map<int,SectorData>& data ) ;
-    void reset() {
-      reset(sectors);
-    }
-    void reset(  std::map< int, SectorData >& region ){
-      std::map< int, SectorData >::iterator it=region.begin();
-      std::map< int, SectorData >::iterator it_end=region.end();
-      for( ;it!=it_end;++it ){
-	SectorData::iterator sit = it->second.begin();
-	SectorData::iterator sit_end = it->second.end();
-	for( ;sit!=sit_end;++sit ){
-	  HitList::iterator hit = sit->second.begin();
-	  HitList::iterator hit_end = sit->second.end();
-	  for( ;hit!=hit_end;++hit ) delete *hit;
-	}
-      }
-      region.clear();
-    }
-    void sort();
-    static void sort( std::map< int, SectorData >& data );
-  }; 
-  
-  struct HitNtuple {
-
-    void initForWrite(TTree& tree);
-
-    void initForRead(TTree& tree);
-    void initForReadseg(TTree& tree);
-    
-    void fill( std::vector<MuonDebugInfo>& muons );
-    void fill( MuonDebugInfo& muon );
-
-    void fill( const Hit& hit );
-    void fill( const std::vector<Hit*>& hits );
-
-    void fill( const PhiHit& hit );
-    void fill( const std::vector<PhiHit*>& hits );
-
-    void fill( int sTgcPadAssociated, int sTgcPadNotAssociated);
-
-    bool read( EventData& event, std::vector<MuonDebugInfo>& muons );
-    bool readseg( std::vector<SegDebugInfo>& segments );
-    
-    void reset();
-    void init();
-
-    static const int HITSIZE = 50000;
-    // hit info
-    int    nhits;
-    int    lay[HITSIZE]; 
-    float  x[HITSIZE]; 
-    float  ymin[HITSIZE];
-    float  ymax[HITSIZE];
-    float  w[HITSIZE]; 
-
-    // extra hit info
-    int    ndebug;
-    int    type[HITSIZE];
-    int    region[HITSIZE];
-    int    sector[HITSIZE];
-    int    layer[HITSIZE];
-    int    sublayer[HITSIZE];
-    int    pdgId[HITSIZE];
-    int    barcode[HITSIZE];
-    int    muonIndex[HITSIZE];
-    int    clusterSize[HITSIZE];
-    int    clusterLayers[HITSIZE];
-    int    isEtaPhi[HITSIZE];
-    int    trigConfirm[HITSIZE];
-    int    binpos[HITSIZE];
-    int    bintheta[HITSIZE];
-    float  time[HITSIZE];
-    float  r[HITSIZE];
-    float  ph[HITSIZE];
-    float  phn[HITSIZE];
-    float  ph1[HITSIZE];
-    float  ph2[HITSIZE];
-    float  rot[HITSIZE];
-
-    static const int PHIHITSIZE = 1000;
-    // hit info
-    int    pnhits;
-    int    play[PHIHITSIZE]; 
-    float  pr[PHIHITSIZE]; 
-    float  phimin[PHIHITSIZE];
-    float  phimax[PHIHITSIZE];
-    float  pw[PHIHITSIZE]; 
-
-    // extra hit info
-    int    pndebug;
-    int    ptype[PHIHITSIZE];
-    int    pregion[PHIHITSIZE];
-    int    psector[PHIHITSIZE];
-    int    player[PHIHITSIZE];
-    int    psublayer[PHIHITSIZE];
-    int    ppdgId[PHIHITSIZE];
-    int    pbarcode[PHIHITSIZE];
-    int    pmuonIndex[PHIHITSIZE];
-    int    pclusterSize[PHIHITSIZE];
-    int    pclusterLayers[PHIHITSIZE];
-    int    pisEtaPhi[PHIHITSIZE];
-    int    pbinpos[PHIHITSIZE];
-    int    pbintheta[PHIHITSIZE];
-    float  ptime[PHIHITSIZE];
-    float  ppr[PHIHITSIZE];
-    float  pph[PHIHITSIZE];
-    float  pph1[PHIHITSIZE];
-    float  pph2[PHIHITSIZE];
-    float  prot[PHIHITSIZE];
-
-    static const int ETAMAXSIZE = 100;
-    int    netamaxima;
-    int    nsTgcPadAssociated[ETAMAXSIZE];
-    int    nsTgcPadNotAssociated[ETAMAXSIZE];
-
-    static const int MUONSIZE = 50;
-    // muon/truth info
-    int    nmuons;
-    int    tpdgId[MUONSIZE];
-    int    tbarcode[MUONSIZE];
-    int    tmuonIndex[MUONSIZE];
-    float  pt[MUONSIZE];
-    float  eta[MUONSIZE];
-    float  phi[MUONSIZE];
-    int    nmdts[MUONSIZE];
-    int    nrpcs[MUONSIZE];
-    int    ntgcs[MUONSIZE];
-    int    ncscs[MUONSIZE];
-    int    ntmdts[MUONSIZE];
-    int    ntrpcs[MUONSIZE];
-    int    nttgcs[MUONSIZE];
-    int    ntcscs[MUONSIZE];
-
-    // muon truth seg info
-    static const int SEGSIZE =  150;
-    int    nsegs;
-    int    sbarcode[SEGSIZE];
-    float  sposx[SEGSIZE];
-    float  sposy[SEGSIZE];
-    float  sposz[SEGSIZE];
-    float  sdirx[SEGSIZE];
-    float  sdiry[SEGSIZE];
-    float  sdirz[SEGSIZE];
-    int    snPrecHits[SEGSIZE];
-    int    snTrigHits[SEGSIZE];
-    int    sSector[SEGSIZE];
-    int    sChIndex[SEGSIZE];
-
-  };   
-}
+    struct DataIndex {
+        DataIndex(int key) : m_data(key) {}
+        DataIndex(int sector, int region, int layer, int type) : m_data(100000 * sector + 10000 * region + 100 * layer + type) {}
+        int sector() const { return m_data / 100000; }
+        Muon::MuonStationIndex::DetectorRegionIndex region() const {
+            return static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(m_data / 10000 % 10);
+        }
+        Muon::MuonStationIndex::LayerIndex layer() const { return static_cast<Muon::MuonStationIndex::LayerIndex>(m_data / 100 % 10); }
+        int type() const { return m_data % 100; }
+        int key() const { return m_data; }
+        int m_data;
+    };
+    bool operator<(const DataIndex& index1, const DataIndex& index2);
+
+    typedef std::vector<Hit*> HitList;
+    typedef std::map<DataIndex, HitList> SectorData;
+
+    struct EventData {
+        std::map<int, SectorData> sectors;
+
+        void dump() const;
+        static void dump(const std::map<int, SectorData>& data);
+        void reset() { reset(sectors); }
+        void reset(std::map<int, SectorData>& region) {
+            std::map<int, SectorData>::iterator it = region.begin();
+            std::map<int, SectorData>::iterator it_end = region.end();
+            for (; it != it_end; ++it) {
+                SectorData::iterator sit = it->second.begin();
+                SectorData::iterator sit_end = it->second.end();
+                for (; sit != sit_end; ++sit) {
+                    HitList::iterator hit = sit->second.begin();
+                    HitList::iterator hit_end = sit->second.end();
+                    for (; hit != hit_end; ++hit) delete *hit;
+                }
+            }
+            region.clear();
+        }
+        void sort();
+        static void sort(std::map<int, SectorData>& data);
+    };
+
+    struct HitNtuple {
+        void initForWrite(TTree& tree);
+
+        void initForRead(TTree& tree);
+        void initForReadseg(TTree& tree);
+
+        void fill(std::vector<MuonDebugInfo>& muons);
+        void fill(MuonDebugInfo& muon);
+
+        void fill(const Hit& hit);
+        void fill(const std::vector<Hit*>& hits);
+
+        void fill(const PhiHit& hit);
+        void fill(const std::vector<PhiHit*>& hits);
+
+        void fill(int sTgcPadAssociated, int sTgcPadNotAssociated);
+
+        bool read(EventData& event, std::vector<MuonDebugInfo>& muons);
+        bool readseg(std::vector<SegDebugInfo>& segments);
+
+        void reset();
+        void init();
+
+        static const int HITSIZE = 50000;
+        // hit info
+        int nhits;
+        int lay[HITSIZE];
+        float x[HITSIZE];
+        float ymin[HITSIZE];
+        float ymax[HITSIZE];
+        float w[HITSIZE];
+
+        // extra hit info
+        int ndebug;
+        int type[HITSIZE];
+        int region[HITSIZE];
+        int sector[HITSIZE];
+        int layer[HITSIZE];
+        int sublayer[HITSIZE];
+        int pdgId[HITSIZE];
+        int barcode[HITSIZE];
+        int muonIndex[HITSIZE];
+        int clusterSize[HITSIZE];
+        int clusterLayers[HITSIZE];
+        int isEtaPhi[HITSIZE];
+        int trigConfirm[HITSIZE];
+        int binpos[HITSIZE];
+        int bintheta[HITSIZE];
+        float time[HITSIZE];
+        float r[HITSIZE];
+        float ph[HITSIZE];
+        float phn[HITSIZE];
+        float ph1[HITSIZE];
+        float ph2[HITSIZE];
+        float rot[HITSIZE];
+
+        static const int PHIHITSIZE = 1000;
+        // hit info
+        int pnhits;
+        int play[PHIHITSIZE];
+        float pr[PHIHITSIZE];
+        float phimin[PHIHITSIZE];
+        float phimax[PHIHITSIZE];
+        float pw[PHIHITSIZE];
+
+        // extra hit info
+        int pndebug;
+        int ptype[PHIHITSIZE];
+        int pregion[PHIHITSIZE];
+        int psector[PHIHITSIZE];
+        int player[PHIHITSIZE];
+        int psublayer[PHIHITSIZE];
+        int ppdgId[PHIHITSIZE];
+        int pbarcode[PHIHITSIZE];
+        int pmuonIndex[PHIHITSIZE];
+        int pclusterSize[PHIHITSIZE];
+        int pclusterLayers[PHIHITSIZE];
+        int pisEtaPhi[PHIHITSIZE];
+        int pbinpos[PHIHITSIZE];
+        int pbintheta[PHIHITSIZE];
+        float ptime[PHIHITSIZE];
+        float ppr[PHIHITSIZE];
+        float pph[PHIHITSIZE];
+        float pph1[PHIHITSIZE];
+        float pph2[PHIHITSIZE];
+        float prot[PHIHITSIZE];
+
+        static const int ETAMAXSIZE = 100;
+        int netamaxima;
+        int nsTgcPadAssociated[ETAMAXSIZE];
+        int nsTgcPadNotAssociated[ETAMAXSIZE];
+
+        static const int MUONSIZE = 50;
+        // muon/truth info
+        int nmuons;
+        int tpdgId[MUONSIZE];
+        int tbarcode[MUONSIZE];
+        int tmuonIndex[MUONSIZE];
+        float pt[MUONSIZE];
+        float eta[MUONSIZE];
+        float phi[MUONSIZE];
+        int nmdts[MUONSIZE];
+        int nrpcs[MUONSIZE];
+        int ntgcs[MUONSIZE];
+        int ncscs[MUONSIZE];
+        int ntmdts[MUONSIZE];
+        int ntrpcs[MUONSIZE];
+        int nttgcs[MUONSIZE];
+        int ntcscs[MUONSIZE];
+
+        // muon truth seg info
+        static const int SEGSIZE = 150;
+        int nsegs;
+        int sbarcode[SEGSIZE];
+        float sposx[SEGSIZE];
+        float sposy[SEGSIZE];
+        float sposz[SEGSIZE];
+        float sdirx[SEGSIZE];
+        float sdiry[SEGSIZE];
+        float sdirz[SEGSIZE];
+        int snPrecHits[SEGSIZE];
+        int snTrigHits[SEGSIZE];
+        int sSector[SEGSIZE];
+        int sChIndex[SEGSIZE];
+    };
+}  // namespace MuonHough
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h
index 1b9aa527a9f9bcf5fce1b4546c4e759ac7ae36be..d8e064d6bb19d16bc4d3730ea10c35539f714110 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h
@@ -5,100 +5,96 @@
 #ifndef LAYERANALYSIS_H
 #define LAYERANALYSIS_H
 
+#include "CxxUtils/checker_macros.h"
 #include "MuonLayerHough/HitNtuple.h"
-#include "MuonLayerHough/MuonLayerHoughSelector.h"
 #include "MuonLayerHough/MuonLayerHough.h"
+#include "MuonLayerHough/MuonLayerHoughSelector.h"
 #include "MuonLayerHough/MuonRegionHough.h"
 #include "MuonStationIndex/MuonStationIndex.h"
-#include "CxxUtils/checker_macros.h"
 
 class TH1F;
 class TH2F;
 
 namespace MuonHough {
-  
-  class MuonDetectorHough;
 
-  struct Plots {
-    Plots(const char* title, int nBinsX, float xMin, float xMax, int nBinsY, float yMin, float yMax);
-      
-    TH2F* Reco;
-    TH2F* Truth;
-    TH2F* Matched;
-    TH2F* Unmatched;
-    TH1F* Efficiency;
-    TH1F* FakeEfficiency;
-    TH2F* Diff;
-  };
+    class MuonDetectorHough;
+
+    struct Plots {
+        Plots(const char* title, int nBinsX, float xMin, float xMax, int nBinsY, float yMin, float yMax);
 
+        TH2F* Reco;
+        TH2F* Truth;
+        TH2F* Matched;
+        TH2F* Unmatched;
+        TH1F* Efficiency;
+        TH1F* FakeEfficiency;
+        TH2F* Diff;
+    };
 
-  class LayerAnalysis {
-  public:
-    
-    LayerAnalysis( TTree& tree ) : m_tree(&tree), m_ncalls(0) {
-      m_ntuple.reset();
-      m_ntuple.initForRead(tree);
-    }
-    
-    void initialize ATLAS_NOT_THREAD_SAFE();
-    void analyse ATLAS_NOT_THREAD_SAFE();
-    void finalize();
-    
-  private:
+    class LayerAnalysis {
+    public:
+        LayerAnalysis(TTree& tree) : m_tree(&tree), m_ncalls(0) {
+            m_ntuple.reset();
+            m_ntuple.initForRead(tree);
+        }
 
-    void analysis( std::map<int,SectorData>& data );
-    void drawSector( int region, int sector, SectorData& data, MuonDetectorHough& detectorHough, MuonDetectorHough& detectorHoughTruth ) const;
-    static void calculateVariables(Plots* Plot);
-    static void SetStyle ATLAS_NOT_THREAD_SAFE();
-    static int getMaxLayers(Muon::MuonStationIndex::DetectorRegionIndex region, int sector);
-    void finishplot(TH1F* h) const;
-    static float linear_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex);
-    float parab_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex) const;
+        void initialize ATLAS_NOT_THREAD_SAFE();
+        void analyse ATLAS_NOT_THREAD_SAFE();
+        void finalize();
 
-    TTree*    m_tree;
-    HitNtuple m_ntuple;
-    EventData m_event;
-    int       m_ncalls;
-    std::vector<MuonDebugInfo> m_muons;
-    std::vector<SegDebugInfo> m_segs;
-    std::vector<MuonHough::MuonLayerHoughSelector> m_selectors;
-    
-    std::vector<Plots*> m_hMaximaHeightPerChIndex;
-    bool m_DEBUG;    
-    bool m_DEBUG_seg;
-    TH1F*     m_h_dtheta;    
-    TH1F*     m_h_dtheta_truth;    
-    TH1F*     m_h_diff_MI_e;
-    TH1F*     m_h_diff_MO_e;
-    TH1F*     m_h_diff_MI_b;
-    TH1F*     m_h_diff_MO_b;  
-    TH1F*     m_h_diff_MI_e_truth;  
-    TH1F*     m_h_diff_MO_e_truth;  
-    TH1F*     m_h_diff_MI_b_truth;  
-    TH1F*     m_h_diff_MO_b_truth;  
-    TH1F*     m_h_expt_MI_e;
-    TH1F*     m_h_expt_MO_e;
-    TH1F*     m_h_expt_MI_b;
-    TH1F*     m_h_expt_MO_b;  
-    TH1F*     m_h_expt_MI_e_truth;  
-    TH1F*     m_h_expt_MO_e_truth;  
-    TH1F*     m_h_expt_MI_b_truth;  
-    TH1F*     m_h_expt_MO_b_truth;   
-    TH1F*     m_h_comp_MI_e;  
-    TH1F*     m_h_comp_MO_e;  
-    TH1F*     m_h_comp_MI_b;  
-    TH1F*     m_h_comp_MO_b; 
-    TH1F*     m_h_comp_MI_e_truth;  
-    TH1F*     m_h_comp_MO_e_truth;  
-    TH1F*     m_h_comp_MI_b_truth;  
-    TH1F*     m_h_comp_MO_b_truth;  
+    private:
+        void analysis(std::map<int, SectorData>& data);
+        void drawSector(int region, int sector, SectorData& data, MuonDetectorHough& detectorHough,
+                        MuonDetectorHough& detectorHoughTruth) const;
+        static void calculateVariables(Plots* Plot);
+        static void SetStyle ATLAS_NOT_THREAD_SAFE();
+        static int getMaxLayers(Muon::MuonStationIndex::DetectorRegionIndex region, int sector);
+        void finishplot(TH1F* h) const;
+        static float linear_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex);
+        float parab_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex) const;
 
-    MuonHough::MuonDetectorHough m_detectorHough;
-    MuonHough::MuonDetectorHough m_detectorHoughTruth;    
-  };
+        TTree* m_tree;
+        HitNtuple m_ntuple;
+        EventData m_event;
+        int m_ncalls;
+        std::vector<MuonDebugInfo> m_muons;
+        std::vector<SegDebugInfo> m_segs;
+        std::vector<MuonHough::MuonLayerHoughSelector> m_selectors;
 
+        std::vector<Plots*> m_hMaximaHeightPerChIndex;
+        bool m_DEBUG;
+        bool m_DEBUG_seg;
+        TH1F* m_h_dtheta;
+        TH1F* m_h_dtheta_truth;
+        TH1F* m_h_diff_MI_e;
+        TH1F* m_h_diff_MO_e;
+        TH1F* m_h_diff_MI_b;
+        TH1F* m_h_diff_MO_b;
+        TH1F* m_h_diff_MI_e_truth;
+        TH1F* m_h_diff_MO_e_truth;
+        TH1F* m_h_diff_MI_b_truth;
+        TH1F* m_h_diff_MO_b_truth;
+        TH1F* m_h_expt_MI_e;
+        TH1F* m_h_expt_MO_e;
+        TH1F* m_h_expt_MI_b;
+        TH1F* m_h_expt_MO_b;
+        TH1F* m_h_expt_MI_e_truth;
+        TH1F* m_h_expt_MO_e_truth;
+        TH1F* m_h_expt_MI_b_truth;
+        TH1F* m_h_expt_MO_b_truth;
+        TH1F* m_h_comp_MI_e;
+        TH1F* m_h_comp_MO_e;
+        TH1F* m_h_comp_MI_b;
+        TH1F* m_h_comp_MO_b;
+        TH1F* m_h_comp_MI_e_truth;
+        TH1F* m_h_comp_MO_e_truth;
+        TH1F* m_h_comp_MI_b_truth;
+        TH1F* m_h_comp_MO_b_truth;
 
-}
+        MuonHough::MuonDetectorHough m_detectorHough;
+        MuonHough::MuonDetectorHough m_detectorHoughTruth;
+    };
 
+}  // namespace MuonHough
 
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h
index c6683e085231bb3440f68bcaae24ec586542141c..841cb6bd0195809745518575a0ce7658330911ba 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h
@@ -5,202 +5,219 @@
 #ifndef MUONLAYERHOUGH_H
 #define MUONLAYERHOUGH_H
 
-#include "MuonStationIndex/MuonStationIndex.h"
-#include "MuonLayerHough/Hit.h"
-#include "MuonLayerHough/MuonLayerHoughSelector.h"
-
-#include <vector>
-#include <iostream>
-#include <string>
 #include <cmath>
+#include <iostream>
 #include <memory>
+#include <string>
+#include <vector>
+
+#include "MuonLayerHough/Hit.h"
+#include "MuonLayerHough/MuonLayerHoughSelector.h"
+#include "MuonStationIndex/MuonStationIndex.h"
 
 class TH1;
 
 namespace MuonHough {
 
-  /** struct containing all information to build a Hough transform for a given chamber index */
-  struct RegionDescriptor {
-    RegionDescriptor( int sector_, Muon::MuonStationIndex::DetectorRegionIndex region_, Muon::MuonStationIndex::ChIndex chIndex_,
-                      float referencePosition_, float yMinRange_, float yMaxRange_, float yBinSize_, float thetaStep_,
-                      unsigned int nthetaSamples_ ) :  sector(sector_),region(region_),chIndex(chIndex_),
-                                                       referencePosition(referencePosition_),yMinRange(yMinRange_),yMaxRange(yMaxRange_),
-                                                       yBinSize(yBinSize_),thetaStep(thetaStep_),nthetaSamples(nthetaSamples_){}
-    RegionDescriptor() :  sector(0),region(Muon::MuonStationIndex::DetectorRegionUnknown),
-                          chIndex(Muon::MuonStationIndex::ChUnknown),referencePosition(0),yMinRange(0),yMaxRange(0),
-                          yBinSize(1),thetaStep(1),nthetaSamples(1){}
-
-    int                                         sector;
-    Muon::MuonStationIndex::DetectorRegionIndex region;
-    Muon::MuonStationIndex::ChIndex             chIndex;
-    float referencePosition;
-    float yMinRange;
-    float yMaxRange;
-    float yBinSize;
-    float thetaStep;
-    unsigned int nthetaSamples;
-  };
-  typedef std::vector<RegionDescriptor> RegionDescriptionVec;
-
-  struct MuonLayerHough {
-
-    /// struct representing the maximum in the hough space 
-    struct Maximum {
-      Maximum() : max(0.), pos(0.), theta(0.), refpos(0.), refregion(0), refchIndex(0), binpos(-1), binposmin(-1),
-                        binposmax(-1), binsize(0.), bintheta(-1), triggerConfirmed(0), hough(0) {}
-
-      float max;    // value of the maximum
-      float pos;    // spacial position
-      float theta;  // angle
-
-      float refpos; // reference position
-      int refregion;  // reference region
-      int refchIndex;  // reference chamber index
-      
-      int binpos;    // position bin
-      int binposmin; // lower edge of the maximum
-      int binposmax; // upper edge of the maximu 
-      float binsize; // size of bin
-      int bintheta;  // theta bin
-      int triggerConfirmed; // number of in time trigger hits associated with the maximum
-      std::vector<Hit*> hits; // vector of associated hits
-       
-      const MuonLayerHough* hough;  // pointer to the corresponding hough
-
-      bool isEndcap() const{   
-        // refers to the chamber orientation!!!! so BEE is a barell in this def
-        Muon::MuonStationIndex::DetectorRegionIndex region = hough->m_descriptor.region;
-        Muon::MuonStationIndex::ChIndex chIndex = hough->m_descriptor.chIndex;
-        //need to make sure BEE's reference plane is the same as barrel
-        if (region != Muon::MuonStationIndex::Barrel && chIndex != Muon::MuonStationIndex::BEE) {return true;}
-        return false;
-      };
-      float getGlobalR() const{
-        if (isEndcap()){return pos;}
-        return refpos;
-      };
-      float getGlobalZ() const{
-        if (isEndcap()){return refpos;}
-        return pos;
-      };
-      float getGlobalTheta() const{
-        if (isEndcap()){
-          //return M_PI/2.0 - theta;
-          if (theta > 0) {return M_PI/2.0 - theta;}
-          else {return -M_PI/2.0 - theta;}
-        }
-        return theta;
-      };
+    /** struct containing all information to build a Hough transform for a given chamber index */
+    struct RegionDescriptor {
+        RegionDescriptor(int sector_, Muon::MuonStationIndex::DetectorRegionIndex region_, Muon::MuonStationIndex::ChIndex chIndex_,
+                         float referencePosition_, float yMinRange_, float yMaxRange_, float yBinSize_, float thetaStep_,
+                         unsigned int nthetaSamples_) :
+            sector(sector_),
+            region(region_),
+            chIndex(chIndex_),
+            referencePosition(referencePosition_),
+            yMinRange(yMinRange_),
+            yMaxRange(yMaxRange_),
+            yBinSize(yBinSize_),
+            thetaStep(thetaStep_),
+            nthetaSamples(nthetaSamples_) {}
+        RegionDescriptor() :
+            sector(0),
+            region(Muon::MuonStationIndex::DetectorRegionUnknown),
+            chIndex(Muon::MuonStationIndex::ChUnknown),
+            referencePosition(0),
+            yMinRange(0),
+            yMaxRange(0),
+            yBinSize(1),
+            thetaStep(1),
+            nthetaSamples(1) {}
+
+        int sector;
+        Muon::MuonStationIndex::DetectorRegionIndex region;
+        Muon::MuonStationIndex::ChIndex chIndex;
+        float referencePosition;
+        float yMinRange;
+        float yMaxRange;
+        float yBinSize;
+        float thetaStep;
+        unsigned int nthetaSamples;
     };
-  
-
-    /// constructor 
-    MuonLayerHough( const RegionDescriptor& descriptor );
-
-    /// destructor 
-    ~MuonLayerHough()=default;
-
-    /// reset the transform 
-    void reset();
-
-    /// enable debug output 
-    void setDebug( bool d ) { m_debug = d; }
-    
-    /// calculate the position bin the hit will endup in 
-    int bin( const Hit& hit ) const;
-
-    /// calculate the bin corresponing to the given x,y position
-    int bin( float x, float y ) const;
-    
-    /// access to y coordinate of a given bin
-    float yval( int posBin ) const;
+    typedef std::vector<RegionDescriptor> RegionDescriptionVec;
+
+    struct MuonLayerHough {
+        /// struct representing the maximum in the hough space
+        struct Maximum {
+            Maximum() :
+                max(0.),
+                pos(0.),
+                theta(0.),
+                refpos(0.),
+                refregion(0),
+                refchIndex(0),
+                binpos(-1),
+                binposmin(-1),
+                binposmax(-1),
+                binsize(0.),
+                bintheta(-1),
+                triggerConfirmed(0),
+                hough(0) {}
+
+            float max;    // value of the maximum
+            float pos;    // spacial position
+            float theta;  // angle
+
+            float refpos;    // reference position
+            int refregion;   // reference region
+            int refchIndex;  // reference chamber index
+
+            int binpos;              // position bin
+            int binposmin;           // lower edge of the maximum
+            int binposmax;           // upper edge of the maximu
+            float binsize;           // size of bin
+            int bintheta;            // theta bin
+            int triggerConfirmed;    // number of in time trigger hits associated with the maximum
+            std::vector<Hit*> hits;  // vector of associated hits
+
+            const MuonLayerHough* hough;  // pointer to the corresponding hough
+
+            bool isEndcap() const {
+                // refers to the chamber orientation!!!! so BEE is a barell in this def
+                Muon::MuonStationIndex::DetectorRegionIndex region = hough->m_descriptor.region;
+                Muon::MuonStationIndex::ChIndex chIndex = hough->m_descriptor.chIndex;
+                // need to make sure BEE's reference plane is the same as barrel
+                if (region != Muon::MuonStationIndex::Barrel && chIndex != Muon::MuonStationIndex::BEE) { return true; }
+                return false;
+            };
+            float getGlobalR() const {
+                if (isEndcap()) { return pos; }
+                return refpos;
+            };
+            float getGlobalZ() const {
+                if (isEndcap()) { return refpos; }
+                return pos;
+            };
+            float getGlobalTheta() const {
+                if (isEndcap()) {
+                    // return M_PI/2.0 - theta;
+                    if (theta > 0) {
+                        return M_PI / 2.0 - theta;
+                    } else {
+                        return -M_PI / 2.0 - theta;
+                    }
+                }
+                return theta;
+            };
+        };
+
+        /// constructor
+        MuonLayerHough(const RegionDescriptor& descriptor);
+
+        /// destructor
+        ~MuonLayerHough() = default;
+
+        /// reset the transform
+        void reset();
+
+        /// enable debug output
+        void setDebug(bool d) { m_debug = d; }
+
+        /// calculate the position bin the hit will endup in
+        int bin(const Hit& hit) const;
+
+        /// calculate the bin corresponing to the given x,y position
+        int bin(float x, float y) const;
+
+        /// access to y coordinate of a given bin
+        float yval(int posBin) const;
+
+        /// calculate x,y for the given position bin
+        void pars(int posBin, int /*thetaBin*/, float& x, float& y) const;
+
+        /// calculate the highest value of the hough transform within the specified range for the given hit
+        float layerConfirmation(const Hit& hit, float range = 1000.) const;
+
+        /// calculate the highest value of the hough transform within the specified range for the given hit position
+        float layerConfirmation(float x, float y, float range = 1000.) const;
+
+        /// calculate the highest value of the hough transform within the specified range for the given hit position
+        std::pair<float, float> layerConfirmation(unsigned int thetaBin, float x, float y, float range = 1000.) const;
+
+        /// find the highest maximum that is above maxval
+        bool findMaximum(Maximum& maximum, const MuonLayerHoughSelector& selector) const;
+
+        /// associates the list of input hits to the provided maximum
+        void associateHitsToMaximum(Maximum& maximum, const std::vector<Hit*>& hits) const;
+
+        /// calculates the first and last bin the hit should be filled in for a given theta bin
+        std::pair<int, int> range(const float x, const float y1, const float y2, const int bintheta) const;
+
+        /// returns a pair with the position and angle corresponing to the input x,y values
+        std::pair<float, float> maximum(float x, float y, int& posbin, int& thetabin) const;
+
+        /// fill the hough space with a single position
+        void fill(const Hit& hit);
+
+        /// fill the hough space with a single position
+        void fill(float x, float y, float weight);
+
+        /// fill the hough space with a vector of hits using the layer mode
+        void fillLayer(const std::vector<Hit*>& hits, bool substract = false);
+
+        //  fill the hough space with a vector of hits using the layer mode
+        void fillLayer2(const std::vector<Hit*>& hits, bool subtract = false);
+
+        /// returns a vector with all the histograms of the hough as TH1*
+        std::vector<TH1*> rootHistos(const std::string& prefix, const float* rmin = 0, const float* rmax = 0) const;
+
+        // members
+
+        float m_binsize;     /// binsize
+        float m_invbinsize;  /// inverse binsize
+
+        // unsigned int m_nthetasamples;
+        int m_nbins;
 
-    /// calculate x,y for the given position bin
-    void pars( int posBin, int /*thetaBin*/, float& x, float& y ) const;
-
-    /// calculate the highest value of the hough transform within the specified range for the given hit 
-    float layerConfirmation( const Hit& hit, float range = 1000. ) const;
-
-    /// calculate the highest value of the hough transform within the specified range for the given hit position
-    float layerConfirmation( float x, float y, float range = 1000. ) const;
-
-    /// calculate the highest value of the hough transform within the specified range for the given hit position
-    std::pair<float,float> layerConfirmation( unsigned int thetaBin, float x, float y, float range = 1000. ) const;
-
-    /// find the highest maximum that is above maxval
-    bool findMaximum( Maximum& maximum, const MuonLayerHoughSelector& selector ) const;
-
-    /// associates the list of input hits to the provided maximum
-    void associateHitsToMaximum( Maximum& maximum, const std::vector<Hit*>& hits ) const;
-
-    /// calculates the first and last bin the hit should be filled in for a given theta bin
-    std::pair<int,int> range(const float x, const float y1, const float y2, const int bintheta) const;
-
-    /// returns a pair with the position and angle corresponing to the input x,y values
-    std::pair<float,float> maximum( float x, float y, int& posbin, int& thetabin ) const;
-
-    /// fill the hough space with a single position
-    void fill( const Hit& hit );
-
-    /// fill the hough space with a single position
-    void fill( float x, float y, float weight );
-
-    /// fill the hough space with a vector of hits using the layer mode
-    void fillLayer( const std::vector<Hit*>& hits, bool substract = false );
-
-    //  fill the hough space with a vector of hits using the layer mode
-    void fillLayer2( const std::vector<Hit*>& hits, bool subtract = false );
-
-    /// returns a vector with all the histograms of the hough as TH1*
-    std::vector<TH1*> rootHistos(const std::string& prefix, const float* rmin=0,const float* rmax=0) const;
-
-    // members
-
-    float m_binsize;      /// binsize 
-    float m_invbinsize;   /// inverse binsize
-
-    // unsigned int m_nthetasamples;
-    int m_nbins;
-
-    unsigned int max;
-    int maxhist;
-    int maxbin;
-    bool m_debug;
-    std::vector< std::unique_ptr<unsigned int[]> > m_histos;//the maximum contents of all the histograms, overlayed
-    RegionDescriptor m_descriptor;
-  };
-
-
-  inline int MuonLayerHough::bin( const Hit& hit ) const {
-    return bin(hit.x,hit.ymin);
-  }
+        unsigned int max;
+        int maxhist;
+        int maxbin;
+        bool m_debug;
+        std::vector<std::unique_ptr<unsigned int[]> > m_histos;  // the maximum contents of all the histograms, overlayed
+        RegionDescriptor m_descriptor;
+    };
 
-  inline int MuonLayerHough::bin( float x, float y ) const {
-    float yref = y*(m_descriptor.referencePosition-x)/x+y;
-    int in = (yref-m_descriptor.yMinRange)/m_binsize;
-    if( in < 0 || in >= m_nbins ) in = -1;
-    return in;
-  }
+    inline int MuonLayerHough::bin(const Hit& hit) const { return bin(hit.x, hit.ymin); }
 
-  inline void MuonLayerHough::pars( int posBin, int /*thetaBin*/, float& x, float& y ) const {
-    x = m_descriptor.referencePosition;
-    y = yval(posBin);
-  }
+    inline int MuonLayerHough::bin(float x, float y) const {
+        float yref = y * (m_descriptor.referencePosition - x) / x + y;
+        int in = (yref - m_descriptor.yMinRange) / m_binsize;
+        if (in < 0 || in >= m_nbins) in = -1;
+        return in;
+    }
 
-  inline float MuonLayerHough::yval( int posBin ) const {
-    return m_descriptor.yMinRange + posBin*m_binsize;
-  }
+    inline void MuonLayerHough::pars(int posBin, int /*thetaBin*/, float& x, float& y) const {
+        x = m_descriptor.referencePosition;
+        y = yval(posBin);
+    }
 
-  inline float MuonLayerHough::layerConfirmation( const Hit& hit, float range ) const {
-    return layerConfirmation(hit.x,hit.ymin,range);
-  }
+    inline float MuonLayerHough::yval(int posBin) const { return m_descriptor.yMinRange + posBin * m_binsize; }
 
+    inline float MuonLayerHough::layerConfirmation(const Hit& hit, float range) const { return layerConfirmation(hit.x, hit.ymin, range); }
 
-  inline void MuonLayerHough:: fill( const Hit& hit ) {
-    fill(hit.x,hit.ymin,hit.w);
-  }
+    inline void MuonLayerHough::fill(const Hit& hit) { fill(hit.x, hit.ymin, hit.w); }
 
-  //function for linear/parabolic extrapolation from maxima to maxima in a different station
-  float extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex, bool doparabolic=false);
-}
-#endif 
+    // function for linear/parabolic extrapolation from maxima to maxima in a different station
+    float extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex, bool doparabolic = false);
+}  // namespace MuonHough
+#endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHoughSelector.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHoughSelector.h
index 68b631aacd7d2bf12fb61acc6b41fe2b284bb724..32f6cf96220f02aceebee65140a9d90e1b59609f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHoughSelector.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHoughSelector.h
@@ -8,24 +8,23 @@
 #include <vector>
 
 namespace MuonHough {
-  class MuonLayerHoughSelector {
-  public:
-    /** Default constructor */
-    MuonLayerHoughSelector(){}
-    MuonLayerHoughSelector(std::vector<std::pair<int, float>> cutValues);
+    class MuonLayerHoughSelector {
+    public:
+        /** Default constructor */
+        MuonLayerHoughSelector() {}
+        MuonLayerHoughSelector(std::vector<std::pair<int, float>> cutValues);
 
-    /** Destructor */
-    virtual ~MuonLayerHoughSelector();
+        /** Destructor */
+        virtual ~MuonLayerHoughSelector();
 
-    /** Getter Methods */
-    float getCutValue(float pos) const;
-    float getMinCutValue() const;
-    bool  passesCutValue(float testValue, float position) const;
-    
-  private:  
-    std::vector<std::pair<int, float>> m_cutValues;
+        /** Getter Methods */
+        float getCutValue(float pos) const;
+        float getMinCutValue() const;
+        bool passesCutValue(float testValue, float position) const;
 
-  };
+    private:
+        std::vector<std::pair<int, float>> m_cutValues;
+    };
 
-}
-#endif 
+}  // namespace MuonHough
+#endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonPhiLayerHough.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonPhiLayerHough.h
index 9f5e8fffe8c69b75f6e275d303667e916ceda9e4..8f2d88a52e950961402858b1e5c0ee8501b2daf1 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonPhiLayerHough.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonPhiLayerHough.h
@@ -5,105 +5,97 @@
 #ifndef MUONPHILAYERHOUGH_H
 #define MUONPHILAYERHOUGH_H
 
-#include "MuonLayerHough/Hit.h"
-#include <vector>
+#include <cmath>
 #include <iostream>
 #include <string>
-#include <cmath>
+#include <vector>
+
+#include "MuonLayerHough/Hit.h"
 
 class TH1;
 
 namespace MuonHough {
 
-  struct MuonPhiLayerHough {
-
-    struct Maximum {
-      Maximum() : max(0.), pos(0.), binpos(-1), binposmin(-1), binposmax(-1), sector(-1), hough(nullptr) {}
-
-      float max;
-      float pos;
-
-      int binpos;
-      int binposmin;
-      int binposmax;
-      
-      int sector;
-
-      std::vector<PhiHit*> hits;
-      
-      const MuonPhiLayerHough* hough;
-    };
-  
-    MuonPhiLayerHough( int nbins, float rangemin, float rangemax, Muon::MuonStationIndex::DetectorRegionIndex region_ );
-    ~MuonPhiLayerHough();
-
-    void reset() const;
-    void setDebug( bool d ) { m_debug = d; }
-
-
-    bool findMaximum( Maximum& maximum, float maxval ) const;
-    void associateHitsToMaximum( Maximum& maximum, const std::vector<PhiHit*>& hits ) const;
-
-
-    std::pair<int,int> range( float /*r*/, float phi1, float phi2 ) const {
-
-      float phimin = std::min( phi1, phi2 );
-      float phimax = std::max( phi1, phi2 );
-      // if( phimin < m_rangemin ) phimin = m_rangemin;
-      // if( phimax > m_rangemax ) phimax = m_rangemax;
-      int bphimin = (phimin-m_rangemin)*m_invbinsize;
-      int bphimax = (phimax-m_rangemin)*m_invbinsize;
-      // add neighbouring bin
-      if( (m_rangemin + m_binsize*bphimin - phimin)*m_invbinsize > 0 ) bphimin -= 1;
-      if( (m_rangemin + m_binsize*bphimax - phimax)*m_invbinsize < 0 ) bphimax += 1;
-      return std::make_pair(bphimin,bphimax);
-    }
-
-    void fillLayer( const std::vector<PhiHit*>& hits, bool substract = false ) const;
-    void fillLayer2( const std::vector<PhiHit*>& hits, bool substract = false ) const;
-
-    float maximum( float r, float phimin, float phimax, int& posbin ) const {
-      unsigned int max = 0;
-      posbin = -1;
-
-      std::pair<int,int> minMax = range( r,phimin,phimax );
-      for( int n=minMax.first;n<=minMax.second;++n ) {
-
-	if( max < m_histo[n] ) {
-	  max = m_histo[n];
-	  posbin = n;
-	}
-      }
-      if( max > 100000 ){
-	std::cout << " maximum too large " << max*0.001 << " min " << minMax.first << " max " << minMax.second << " nbins " << m_nbins
-		  << " phimin " << phimin << " phimax " << phimax << std::endl;
-	for( int n=minMax.first;n<=minMax.second;++n ) {
-	  std::cout << " bin " << n << " val " <<  m_histo[n] << std::endl;
-	}
-      }
-
-      return 0.001*max;
-    }
-
-
-    std::vector<TH1*> rootHistos(const std::string& prefix, const float* phimin=0,const float* phimax=0) const;
-
-    float m_binsize; 
-    float m_invbinsize; 
-    float m_rangemin;
-    float m_rangemax; 
-    
-    Muon::MuonStationIndex::DetectorRegionIndex m_region;
-    int  m_nbins;
-    bool m_debug;
-    unsigned int* m_histo;
+    struct MuonPhiLayerHough {
+        struct Maximum {
+            Maximum() : max(0.), pos(0.), binpos(-1), binposmin(-1), binposmax(-1), sector(-1), hough(nullptr) {}
+
+            float max;
+            float pos;
+
+            int binpos;
+            int binposmin;
+            int binposmax;
+
+            int sector;
+
+            std::vector<PhiHit*> hits;
+
+            const MuonPhiLayerHough* hough;
+        };
+
+        MuonPhiLayerHough(int nbins, float rangemin, float rangemax, Muon::MuonStationIndex::DetectorRegionIndex region_);
+        ~MuonPhiLayerHough();
+
+        void reset() const;
+        void setDebug(bool d) { m_debug = d; }
+
+        bool findMaximum(Maximum& maximum, float maxval) const;
+        void associateHitsToMaximum(Maximum& maximum, const std::vector<PhiHit*>& hits) const;
+
+        std::pair<int, int> range(float /*r*/, float phi1, float phi2) const {
+            float phimin = std::min(phi1, phi2);
+            float phimax = std::max(phi1, phi2);
+            // if( phimin < m_rangemin ) phimin = m_rangemin;
+            // if( phimax > m_rangemax ) phimax = m_rangemax;
+            int bphimin = (phimin - m_rangemin) * m_invbinsize;
+            int bphimax = (phimax - m_rangemin) * m_invbinsize;
+            // add neighbouring bin
+            if ((m_rangemin + m_binsize * bphimin - phimin) * m_invbinsize > 0) bphimin -= 1;
+            if ((m_rangemin + m_binsize * bphimax - phimax) * m_invbinsize < 0) bphimax += 1;
+            return std::make_pair(bphimin, bphimax);
+        }
+
+        void fillLayer(const std::vector<PhiHit*>& hits, bool substract = false) const;
+        void fillLayer2(const std::vector<PhiHit*>& hits, bool substract = false) const;
+
+        float maximum(float r, float phimin, float phimax, int& posbin) const {
+            unsigned int max = 0;
+            posbin = -1;
+
+            std::pair<int, int> minMax = range(r, phimin, phimax);
+            for (int n = minMax.first; n <= minMax.second; ++n) {
+                if (max < m_histo[n]) {
+                    max = m_histo[n];
+                    posbin = n;
+                }
+            }
+            if (max > 100000) {
+                std::cout << " maximum too large " << max * 0.001 << " min " << minMax.first << " max " << minMax.second << " nbins "
+                          << m_nbins << " phimin " << phimin << " phimax " << phimax << std::endl;
+                for (int n = minMax.first; n <= minMax.second; ++n) { std::cout << " bin " << n << " val " << m_histo[n] << std::endl; }
+            }
+
+            return 0.001 * max;
+        }
+
+        std::vector<TH1*> rootHistos(const std::string& prefix, const float* phimin = 0, const float* phimax = 0) const;
+
+        float m_binsize;
+        float m_invbinsize;
+        float m_rangemin;
+        float m_rangemax;
+
+        Muon::MuonStationIndex::DetectorRegionIndex m_region;
+        int m_nbins;
+        bool m_debug;
+        unsigned int* m_histo;
 
     private:
-      // fake copy constructor and assignment operator
-      MuonPhiLayerHough(const MuonPhiLayerHough&);
-      MuonPhiLayerHough & operator=(const MuonPhiLayerHough &right);
-
-  };
+        // fake copy constructor and assignment operator
+        MuonPhiLayerHough(const MuonPhiLayerHough&);
+        MuonPhiLayerHough& operator=(const MuonPhiLayerHough& right);
+    };
 
-}
-#endif 
+}  // namespace MuonHough
+#endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonRegionHough.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonRegionHough.h
index 122adaa75d17d05564bbbdfeec337dbeeaf031d2..0686d6008ff9f8cefac196ba8b0a94c599c120c7 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonRegionHough.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonRegionHough.h
@@ -5,94 +5,95 @@
 #ifndef MUONREGIONHOUGH_H
 #define MUONREGIONHOUGH_H
 
-#include "MuonStationIndex/MuonStationIndex.h"
-#include "MuonLayerHough/MuonLayerHough.h"
-#include "MuonLayerHough/MuonPhiLayerHough.h"
-#include <vector>
 #include <cmath>
 #include <iostream>
+#include <vector>
+
+#include "MuonLayerHough/MuonLayerHough.h"
+#include "MuonLayerHough/MuonPhiLayerHough.h"
+#include "MuonStationIndex/MuonStationIndex.h"
 
 namespace MuonHough {
 
-   /** class managing geometry of the Hough spaces */
-  class MuonDetectorDescription {
-  public:
-    /// constructor
-    MuonDetectorDescription();
+    /** class managing geometry of the Hough spaces */
+    class MuonDetectorDescription {
+    public:
+        /// constructor
+        MuonDetectorDescription();
 
-    RegionDescriptor getDescriptor( int sector, Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer ) const;
+        RegionDescriptor getDescriptor(int sector, Muon::MuonStationIndex::DetectorRegionIndex region,
+                                       Muon::MuonStationIndex::LayerIndex layer) const;
 
-  private:
-    /// initialize default geometry
-    void initDefaultRegions();
+    private:
+        /// initialize default geometry
+        void initDefaultRegions();
 
-    /// cached geometry
-    RegionDescriptionVec              m_regionDescriptions; /// region descriptions
-  };
+        /// cached geometry
+        RegionDescriptionVec m_regionDescriptions;  /// region descriptions
+    };
 
+    /** class managing all precision Hough transforms in a sector */
+    class MuonSectorHough {
+    public:
+        /// constructor for a given sector using the default geometry
+        MuonSectorHough(int sector, const MuonDetectorDescription& regionDescriptions);
 
-  /** class managing all precision Hough transforms in a sector */
-  class MuonSectorHough {
-  public:
-    /// constructor for a given sector using the default geometry
-    MuonSectorHough( int sector, const MuonDetectorDescription& regionDescriptions );
-    
-    /// destructor
-    ~MuonSectorHough();
+        /// destructor
+        ~MuonSectorHough();
 
-    /// access the Hough transform for a given region
-    MuonLayerHough& hough( Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer );
+        /// access the Hough transform for a given region
+        MuonLayerHough& hough(Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer);
 
-    /// reset histograms
-    void reset();
+        /// reset histograms
+        void reset();
 
-  private:
-    std::vector< MuonLayerHough* > m_transforms; /// Hough transforms for all regions
-    //int m_sector;                                /// sector number
-  };
+    private:
+        std::vector<MuonLayerHough*> m_transforms;  /// Hough transforms for all regions
+                                                    // int m_sector;                                /// sector number
+    };
 
-  /** class managing all Hough transforms in the detector */
-  class MuonDetectorHough {
-  public:
+    /** class managing all Hough transforms in the detector */
+    class MuonDetectorHough {
+    public:
+        /// access phi transform
+        MuonPhiLayerHough& phiHough(Muon::MuonStationIndex::DetectorRegionIndex region);
 
-    /// access phi transform 
-    MuonPhiLayerHough& phiHough(Muon::MuonStationIndex::DetectorRegionIndex region);
-    
-    /// access precision transform
-    MuonLayerHough& hough( int sector, Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer );  
-  
-    /// reset histograms
-    void reset();
+        /// access precision transform
+        MuonLayerHough& hough(int sector, Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer);
 
-    /// constructor using default region definitions
-    MuonDetectorHough();
+        /// reset histograms
+        void reset();
 
-    /// constructor using custom region definitions
-    MuonDetectorHough( const RegionDescriptionVec& regionDescriptors );
+        /// constructor using default region definitions
+        MuonDetectorHough();
 
-    /// destructor
-    ~MuonDetectorHough();
+        /// constructor using custom region definitions
+        MuonDetectorHough(const RegionDescriptionVec& regionDescriptors);
 
-  private:
-    void init();
+        /// destructor
+        ~MuonDetectorHough();
 
-    std::vector< MuonSectorHough* >   m_sectors;           /// sector transforms
-    std::vector< MuonPhiLayerHough* > m_phiTransforms;     /// phi transforms
-  };
+    private:
+        void init();
 
-  inline MuonLayerHough& MuonSectorHough::hough( Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer ){ 
-    int index = Muon::MuonStationIndex::sectorLayerHash(region,layer);
-    return *m_transforms[index];
-  }
+        std::vector<MuonSectorHough*> m_sectors;          /// sector transforms
+        std::vector<MuonPhiLayerHough*> m_phiTransforms;  /// phi transforms
+    };
 
+    inline MuonLayerHough& MuonSectorHough::hough(Muon::MuonStationIndex::DetectorRegionIndex region,
+                                                  Muon::MuonStationIndex::LayerIndex layer) {
+        int index = Muon::MuonStationIndex::sectorLayerHash(region, layer);
+        return *m_transforms[index];
+    }
 
-  inline MuonPhiLayerHough& MuonDetectorHough::phiHough(Muon::MuonStationIndex::DetectorRegionIndex region) {
-    return *m_phiTransforms[region];
-  }
+    inline MuonPhiLayerHough& MuonDetectorHough::phiHough(Muon::MuonStationIndex::DetectorRegionIndex region) {
+        return *m_phiTransforms[region];
+    }
 
-  inline MuonLayerHough& MuonDetectorHough::hough( int sector, Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer ){
-    return m_sectors[sector-1]->hough(region,layer);
-  }
+    inline MuonLayerHough& MuonDetectorHough::hough(int sector, Muon::MuonStationIndex::DetectorRegionIndex region,
+                                                    Muon::MuonStationIndex::LayerIndex layer) {
+        return m_sectors[sector - 1]->hough(region, layer);
+    }
 
-}
+}  // namespace MuonHough
 #endif
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx
index 6a6e9fc12992068256eb748df3c798c7ecdd84c2..1ed76652acf71c5be238f2142c09e13c6709295b 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx
@@ -2,60 +2,60 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "MuonLayerHough/LayerAnalysis.h"
+#include <TApplication.h>
+
+#include <fstream>
+#include <iostream>
+#include <string>
 
+#include "MuonLayerHough/LayerAnalysis.h"
 #include "TChain.h"
-#include "TString.h"
 #include "TFile.h"
+#include "TString.h"
 #include "TSystem.h"
-#include <string>
-#include <iostream>
-#include <fstream>
-#include <TApplication.h> 
 
 int main ATLAS_NOT_THREAD_SAFE(int argc, char* argv[]) {
-  
-  TApplication theApp("App", &argc, argv);
+    TApplication theApp("App", &argc, argv);
 
-  //set the input text file
-  TString filename = "input";
-  if (argc <= 1){std::cout << " Default input!" << std::endl;} 
-  else {filename = argv[1];} 
-  std::cout<< " The input root file is in " << filename << std::endl;
-  std::string line;
-  std::vector<std::string> fileList;
-  std::ifstream file(filename + ".txt", std::ifstream::in);
-  if (file.is_open()) {
-    while (!file.eof()) {
-        getline(file, line);
-        if (line.empty()) continue;
-        if (line.find('#')!=std::string::npos) continue;
-        fileList.push_back(line);
-        std::cout << "  " << line << std::endl;
+    // set the input text file
+    TString filename = "input";
+    if (argc <= 1) {
+        std::cout << " Default input!" << std::endl;
+    } else {
+        filename = argv[1];
+    }
+    std::cout << " The input root file is in " << filename << std::endl;
+    std::string line;
+    std::vector<std::string> fileList;
+    std::ifstream file(filename + ".txt", std::ifstream::in);
+    if (file.is_open()) {
+        while (!file.eof()) {
+            getline(file, line);
+            if (line.empty()) continue;
+            if (line.find('#') != std::string::npos) continue;
+            fileList.push_back(line);
+            std::cout << "  " << line << std::endl;
+        }
+    } else {
+        std::cout << " Could not open input file!" << std::endl;
+        return 0;
     }
-  }
-  else {
-    std::cout << " Could not open input file!" << std::endl;
-    return 0;
-  }
-  file.close();
+    file.close();
 
-  std::cout << " opening dataset " << filename << std::endl;
-  TChain* ntupleToRead = new TChain("data") ;
-  ntupleToRead->SetMakeClass(1);
-  TString outName = "LayerAnalysis";
-  TString postFix = filename;
-  for (unsigned int i = 0; i < fileList.size(); i++) {
-    ntupleToRead->Add(fileList.at(i).c_str());
-  }
-  outName += "_" + postFix;
-  outName += ".root";
-  TFile* output = new TFile(outName,"RECREATE");
-  std::cout << " creating analysis " << outName << std::endl;
-  MuonHough::LayerAnalysis analysis(*ntupleToRead);
-  analysis.analyse();
-  std::cout << " done, closing file " << std::endl;
+    std::cout << " opening dataset " << filename << std::endl;
+    TChain* ntupleToRead = new TChain("data");
+    ntupleToRead->SetMakeClass(1);
+    TString outName = "LayerAnalysis";
+    TString postFix = filename;
+    for (unsigned int i = 0; i < fileList.size(); i++) { ntupleToRead->Add(fileList.at(i).c_str()); }
+    outName += "_" + postFix;
+    outName += ".root";
+    TFile* output = new TFile(outName, "RECREATE");
+    std::cout << " creating analysis " << outName << std::endl;
+    MuonHough::LayerAnalysis analysis(*ntupleToRead);
+    analysis.analyse();
+    std::cout << " done, closing file " << std::endl;
 
-  output->Write();
-  output->Close();
+    output->Write();
+    output->Close();
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/Hit.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/Hit.cxx
index f8fc9ab542fa26a9922e377948f5090ec5d461f6..bbb9227dc0bcd59f8920653b7f558943bac4a630 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/Hit.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/Hit.cxx
@@ -2,94 +2,118 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "MuonLayerHough/HitNtuple.h"
 #include <iostream>
 
+#include "MuonLayerHough/HitNtuple.h"
 
 namespace MuonHough {
 
-  HitDebugInfo::HitDebugInfo() : 
-    type(UNINITIALIZED),sector(UNINITIALIZED),region(Muon::MuonStationIndex::DetectorRegionUnknown),
-    layer(Muon::MuonStationIndex::LayerUnknown),sublayer(UNINITIALIZED),pdgId(UNINITIALIZED),
-    barcode(UNINITIALIZED),muonIndex(UNINITIALIZED),clusterSize(UNINITIALIZED),clusterLayers(UNINITIALIZED),
-    isEtaPhi(UNINITIALIZED),trigConfirm(UNINITIALIZED),binpos(UNINITIALIZED),bintheta(UNINITIALIZED),
-    time(UNINITIALIZED),r(UNINITIALIZED),ph(UNINITIALIZED),phn(UNINITIALIZED),
-    ph1(UNINITIALIZED),ph2(UNINITIALIZED),rot(UNINITIALIZED) {}
+    HitDebugInfo::HitDebugInfo() :
+        type(UNINITIALIZED),
+        sector(UNINITIALIZED),
+        region(Muon::MuonStationIndex::DetectorRegionUnknown),
+        layer(Muon::MuonStationIndex::LayerUnknown),
+        sublayer(UNINITIALIZED),
+        pdgId(UNINITIALIZED),
+        barcode(UNINITIALIZED),
+        muonIndex(UNINITIALIZED),
+        clusterSize(UNINITIALIZED),
+        clusterLayers(UNINITIALIZED),
+        isEtaPhi(UNINITIALIZED),
+        trigConfirm(UNINITIALIZED),
+        binpos(UNINITIALIZED),
+        bintheta(UNINITIALIZED),
+        time(UNINITIALIZED),
+        r(UNINITIALIZED),
+        ph(UNINITIALIZED),
+        phn(UNINITIALIZED),
+        ph1(UNINITIALIZED),
+        ph2(UNINITIALIZED),
+        rot(UNINITIALIZED) {}
 
-  HitDebugInfo::HitDebugInfo( int type_, int sector_, Muon::MuonStationIndex::DetectorRegionIndex region_,
-                              Muon::MuonStationIndex::LayerIndex layer_, int sublayer_ ) : 
-    type(type_),sector(sector_),region(region_),layer(layer_),sublayer(sublayer_),pdgId(UNINITIALIZED),
-    barcode(UNINITIALIZED),muonIndex(UNINITIALIZED),clusterSize(UNINITIALIZED),clusterLayers(UNINITIALIZED),
-    isEtaPhi(UNINITIALIZED),trigConfirm(UNINITIALIZED),binpos(UNINITIALIZED),bintheta(UNINITIALIZED),
-    time(UNINITIALIZED),r(UNINITIALIZED),ph(UNINITIALIZED),phn(UNINITIALIZED),
-    ph1(UNINITIALIZED),ph2(UNINITIALIZED),rot(UNINITIALIZED) {}
+    HitDebugInfo::HitDebugInfo(int type_, int sector_, Muon::MuonStationIndex::DetectorRegionIndex region_,
+                               Muon::MuonStationIndex::LayerIndex layer_, int sublayer_) :
+        type(type_),
+        sector(sector_),
+        region(region_),
+        layer(layer_),
+        sublayer(sublayer_),
+        pdgId(UNINITIALIZED),
+        barcode(UNINITIALIZED),
+        muonIndex(UNINITIALIZED),
+        clusterSize(UNINITIALIZED),
+        clusterLayers(UNINITIALIZED),
+        isEtaPhi(UNINITIALIZED),
+        trigConfirm(UNINITIALIZED),
+        binpos(UNINITIALIZED),
+        bintheta(UNINITIALIZED),
+        time(UNINITIALIZED),
+        r(UNINITIALIZED),
+        ph(UNINITIALIZED),
+        phn(UNINITIALIZED),
+        ph1(UNINITIALIZED),
+        ph2(UNINITIALIZED),
+        rot(UNINITIALIZED) {}
 
+    Hit::Hit(int layer_, float x_, float ymin_, float ymax_, float w_, HitDebugInfo* d_, const Trk::PrepRawData* prd_,
+             const Muon::TgcClusterObj3D* tgc_) :
+        layer(layer_), x(x_), ymin(ymin_), ymax(ymax_), w(w_), prd(prd_), tgc(tgc_), m_debug(d_) {}
 
-  Hit::Hit( int layer_, float x_, float ymin_, float ymax_, float w_, 
-	    HitDebugInfo* d_, const Trk::PrepRawData* prd_, const Muon::TgcClusterObj3D* tgc_ ) : 
-    layer(layer_),x(x_),ymin(ymin_),ymax(ymax_),w(w_),
-    prd(prd_),tgc(tgc_),m_debug(d_) {
-  }
+    Hit::~Hit() { delete m_debug; }
 
-  Hit::~Hit() {
-    delete m_debug;
-  }
+    Hit::Hit(const Hit& h_) { copy(h_); }
 
-  Hit::Hit( const Hit& h_) {
-    copy(h_);
-  }
-  
-  Hit& Hit::operator=(const Hit& h_ ){
-    if( &h_ != this ){
-      delete m_debug;
-      m_debug = nullptr;
-      copy(h_);
+    Hit& Hit::operator=(const Hit& h_) {
+        if (&h_ != this) {
+            delete m_debug;
+            m_debug = nullptr;
+            copy(h_);
+        }
+        return *this;
     }
-    return *this;
-  }
 
-  void Hit::copy( const Hit& hit ){
-    layer = hit.layer;
-    x = hit.x;
-    ymin = hit.ymin;
-    ymax = hit.ymax;
-    w = hit.w;
-    if( hit.m_debug ) m_debug = new HitDebugInfo(*hit.m_debug);
-    else m_debug = nullptr;
-    prd = hit.prd;
-    tgc = hit.tgc;
-  }
+    void Hit::copy(const Hit& hit) {
+        layer = hit.layer;
+        x = hit.x;
+        ymin = hit.ymin;
+        ymax = hit.ymax;
+        w = hit.w;
+        if (hit.m_debug)
+            m_debug = new HitDebugInfo(*hit.m_debug);
+        else
+            m_debug = nullptr;
+        prd = hit.prd;
+        tgc = hit.tgc;
+    }
 
-  PhiHit::PhiHit( int layer_, float r_, float phimin_, float phimax_, float w_, 
-		  HitDebugInfo* d_, const Trk::PrepRawData* prd_, const Muon::TgcClusterObj3D* tgc_ ) : 
-    layer(layer_),r(r_),phimin(phimin_),phimax(phimax_),w(w_),prd(prd_),tgc(tgc_),m_debug(d_) {}
+    PhiHit::PhiHit(int layer_, float r_, float phimin_, float phimax_, float w_, HitDebugInfo* d_, const Trk::PrepRawData* prd_,
+                   const Muon::TgcClusterObj3D* tgc_) :
+        layer(layer_), r(r_), phimin(phimin_), phimax(phimax_), w(w_), prd(prd_), tgc(tgc_), m_debug(d_) {}
 
-  PhiHit::~PhiHit() {
-    delete m_debug;
-  }
+    PhiHit::~PhiHit() { delete m_debug; }
 
-  PhiHit::PhiHit( const PhiHit& h_) {
-    copy(h_);
-  }
-  
-  PhiHit& PhiHit::operator=(const PhiHit& h_ ){
-    if( &h_ != this ){
-      delete m_debug;
-      m_debug = nullptr;
-      copy(h_);
+    PhiHit::PhiHit(const PhiHit& h_) { copy(h_); }
+
+    PhiHit& PhiHit::operator=(const PhiHit& h_) {
+        if (&h_ != this) {
+            delete m_debug;
+            m_debug = nullptr;
+            copy(h_);
+        }
+        return *this;
     }
-    return *this;
-  }
 
-  void PhiHit::copy( const PhiHit& hit ){
-    layer = hit.layer;
-    r = hit.r;
-    phimin = hit.phimin;
-    phimax = hit.phimax;
-    w = hit.w;
-    if( hit.m_debug ) m_debug = new HitDebugInfo(*hit.m_debug);
-    else m_debug = nullptr;
-    prd = hit.prd;
-    tgc = hit.tgc;
-  }
-}
+    void PhiHit::copy(const PhiHit& hit) {
+        layer = hit.layer;
+        r = hit.r;
+        phimin = hit.phimin;
+        phimax = hit.phimax;
+        w = hit.w;
+        if (hit.m_debug)
+            m_debug = new HitDebugInfo(*hit.m_debug);
+        else
+            m_debug = nullptr;
+        prd = hit.prd;
+        tgc = hit.tgc;
+    }
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/HitNtuple.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/HitNtuple.cxx
index 84e3b6b60b76fa773a766cd22662ef02a88f9b11..a761dde6044ef1f52be70d519a9b3d73605e291c 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/HitNtuple.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/HitNtuple.cxx
@@ -4,439 +4,418 @@
 
 #include "MuonLayerHough/HitNtuple.h"
 
-#include <iostream>
-#include <algorithm>
 #include <TTree.h>
 
+#include <algorithm>
+#include <iostream>
+
 namespace MuonHough {
 
-  void EventData::sort() {
-    sort(sectors);
-  }
-
-  void EventData::sort( std::map< int, SectorData >& data ) {
-    std::map<int,SectorData>::iterator it = data.begin();
-    std::map<int,SectorData>::iterator it_end = data.end();
-    for( ;it!=it_end;++it ){
-
-      SectorData::iterator sit = it->second.begin();
-      SectorData::iterator sit_end = it->second.end();
-      for( ;sit!=sit_end;++sit ){
-    	HitList& list = sit->second;
-      	std::stable_sort(list.begin(),list.end(),SortHitsPerLayer());
-      }
+    void EventData::sort() { sort(sectors); }
+
+    void EventData::sort(std::map<int, SectorData>& data) {
+        std::map<int, SectorData>::iterator it = data.begin();
+        std::map<int, SectorData>::iterator it_end = data.end();
+        for (; it != it_end; ++it) {
+            SectorData::iterator sit = it->second.begin();
+            SectorData::iterator sit_end = it->second.end();
+            for (; sit != sit_end; ++sit) {
+                HitList& list = sit->second;
+                std::stable_sort(list.begin(), list.end(), SortHitsPerLayer());
+            }
+        }
+    }
+
+    bool operator<(const DataIndex& index1, const DataIndex& index2) { return index1.m_data < index2.m_data; }
+
+    void HitNtuple::initForWrite(TTree& tree) {
+        init();
+        tree.Branch("nhits", &nhits, "nhits/I");
+        tree.Branch("lay", &lay, "lay[nhits]/I");
+        tree.Branch("x", &x, "x[nhits]/F");
+        tree.Branch("ymin", &ymin, "ymin[nhits]/F");
+        tree.Branch("ymax", &ymax, "ymax[nhits]/F");
+        tree.Branch("w", &w, "w[nhits]/F");
+
+        // extra hit info
+        tree.Branch("ndebug", &ndebug, "ndebug/I");
+        tree.Branch("type", &type, "type[ndebug]/I");
+        tree.Branch("region", &region, "region[ndebug]/I");
+        tree.Branch("sector", &sector, "sector[ndebug]/I");
+        tree.Branch("layer", &layer, "layer[ndebug]/I");
+        tree.Branch("sublayer", &sublayer, "sublayer[ndebug]/I");
+        tree.Branch("pdgId", &pdgId, "pdgId[ndebug]/I");
+        tree.Branch("barcode", &barcode, "barcode[ndebug]/I");
+        tree.Branch("muonIndex", &muonIndex, "muonIndex[ndebug]/I");
+        tree.Branch("clusterSize", &clusterSize, "clusterSize[ndebug]/I");
+        tree.Branch("clusterLayers", &clusterLayers, "clusterLayers[ndebug]/I");
+        tree.Branch("isEtaPhi", &isEtaPhi, "isEtaPhi[ndebug]/I");
+        tree.Branch("trigConfirm", &trigConfirm, "trigConfirm[ndebug]/I");
+        tree.Branch("binpos", &binpos, "binpos[ndebug]/I");
+        tree.Branch("bintheta", &bintheta, "bintheta[ndebug]/I");
+        tree.Branch("time", &time, "time[ndebug]/F");
+        tree.Branch("r", &r, "r[ndebug]/F");
+        tree.Branch("ph", &ph, "ph[ndebug]/F");
+        tree.Branch("phn", &phn, "phn[ndebug]/F");
+        tree.Branch("ph1", &ph1, "ph1[ndebug]/F");
+        tree.Branch("ph2", &ph2, "ph2[ndebug]/F");
+        tree.Branch("rot", &rot, "rot[ndebug]/F");
+
+        tree.Branch("pnhits", &pnhits, "pnhits/I");
+        tree.Branch("play", &play, "play[pnhits]/I");
+        tree.Branch("pr", &pr, "pr[pnhits]/F");
+        tree.Branch("phimin", &phimin, "phimin[pnhits]/F");
+        tree.Branch("phimax", &phimax, "phimax[pnhits]/F");
+        tree.Branch("pw", &pw, "pw[pnhits]/F");
+
+        // extra hit info
+        tree.Branch("pndebug", &pndebug, "pndebug/I");
+        tree.Branch("ptype", &ptype, "ptype[pndebug]/I");
+        tree.Branch("pregion", &pregion, "pregion[pndebug]/I");
+        tree.Branch("psector", &psector, "psector[pndebug]/I");
+        tree.Branch("player", &player, "player[pndebug]/I");
+        tree.Branch("psublayer", &psublayer, "psublayer[pndebug]/I");
+        tree.Branch("ppdgId", &ppdgId, "ppdgId[pndebug]/I");
+        tree.Branch("pbarcode", &pbarcode, "pbarcode[pndebug]/I");
+        tree.Branch("pmuonIndex", &pmuonIndex, "pmuonIndex[pndebug]/I");
+        tree.Branch("pclusterSize", &pclusterSize, "pclusterSize[pndebug]/I");
+        tree.Branch("pclusterLayers", &pclusterLayers, "pclusterLayers[pndebug]/I");
+        tree.Branch("pisEtaPhi", &pisEtaPhi, "pisEtaPhi[pndebug]/I");
+        tree.Branch("pbinpos", &pbinpos, "pbinpos[pndebug]/I");
+        tree.Branch("pbintheta", &pbintheta, "pbintheta[pndebug]/I");
+        tree.Branch("ptime", &ptime, "ptime[pndebug]/F");
+        tree.Branch("ppr", &ppr, "ppr[pndebug]/F");
+        tree.Branch("pph", &pph, "pph[pndebug]/F");
+        tree.Branch("pph1", &pph1, "pph1[pndebug]/F");
+        tree.Branch("pph2", &pph2, "pph2[pndebug]/F");
+        tree.Branch("prot", &prot, "prot[pndebug]/F");
+
+        tree.Branch("netamaxima", &netamaxima, "netamaxima/I");
+        tree.Branch("sTgcPadAssociated", &nsTgcPadAssociated, "nsTgcPadAssociated[netamaxima]/I");
+        tree.Branch("sTgcPadNotAssociated", &nsTgcPadNotAssociated, "nsTgcPadNotAssociated[netamaxima]/I");
+
+        tree.Branch("nmuons", &nmuons, "nmuons/I");
+        tree.Branch("tpdgId", &tpdgId, "tpdgId[nmuons]/I");
+        tree.Branch("tbarcode", &tbarcode, "tbarcode[nmuons]/I");
+        tree.Branch("tmuonIndex", &tmuonIndex, "tmuonIndex[nmuons]/I");
+        tree.Branch("pt", &pt, "pt[nmuons]/F");
+        tree.Branch("eta", &eta, "eta[nmuons]/F");
+        tree.Branch("phi", &phi, "phi[nmuons]/F");
+        tree.Branch("nmdts", &nmdts, "nmdts[nmuons]/I");
+        tree.Branch("nrpcs", &nrpcs, "nrpcs[nmuons]/I");
+        tree.Branch("ntgcs", &ntgcs, "ntgcs[nmuons]/I");
+        tree.Branch("ncscs", &ncscs, "ncscs[nmuons]/I");
+        tree.Branch("ntmdts", &ntmdts, "ntmdts[nmuons]/I");
+        tree.Branch("ntrpcs", &ntrpcs, "ntrpcs[nmuons]/I");
+        tree.Branch("nttgcs", &nttgcs, "nttgcs[nmuons]/I");
+        tree.Branch("ntcscs", &ntcscs, "ntcscs[nmuons]/I");
+
+        tree.Branch("nsegs", &nsegs, "nsegs/I");
+        tree.Branch("sbarcode", &sbarcode, "sbarcode[nsegs]/I");
+        tree.Branch("sposx", &sposx, "sposx[nsegs]/F");
+        tree.Branch("sposy", &sposy, "sposy[nsegs]/F");
+        tree.Branch("sposz", &sposz, "sposz[nsegs]/F");
+        tree.Branch("sdirx", &sdirx, "sdirx[nsegs]/F");
+        tree.Branch("sdiry", &sdiry, "sdiry[nsegs]/F");
+        tree.Branch("sdirz", &sdirz, "sdirz[nsegs]/F");
+        tree.Branch("snPrecHits", &snPrecHits, "snPrecHits[nsegs]/I");
+        tree.Branch("snTrigHits", &snTrigHits, "snTrigHits[nsegs]/I");
+        tree.Branch("sSector", &sSector, "sSector[nsegs]/I");
+        tree.Branch("sChIndex", &sChIndex, "sChIndex[nsegs]/I");
+    }
+
+    void HitNtuple::initForRead(TTree& tree) {
+        tree.SetBranchAddress("nhits", &nhits);
+        tree.SetBranchAddress("lay", &lay);
+        tree.SetBranchAddress("x", &x);
+        tree.SetBranchAddress("ymin", &ymin);
+        tree.SetBranchAddress("ymax", &ymax);
+        tree.SetBranchAddress("w", &w);
+
+        // extra hit info
+        tree.SetBranchAddress("ndebug", &ndebug);
+        tree.SetBranchAddress("type", &type);
+        tree.SetBranchAddress("region", &region);
+        tree.SetBranchAddress("sector", &sector);
+        tree.SetBranchAddress("layer", &layer);
+        tree.SetBranchAddress("sublayer", &sublayer);
+        tree.SetBranchAddress("pdgId", &pdgId);
+        tree.SetBranchAddress("barcode", &barcode);
+        tree.SetBranchAddress("muonIndex", &muonIndex);
+        tree.SetBranchAddress("clusterSize", &clusterSize);
+        tree.SetBranchAddress("clusterLayers", &clusterLayers);
+        tree.SetBranchAddress("isEtaPhi", &isEtaPhi);
+        tree.SetBranchAddress("trigConfirm", &trigConfirm);
+        tree.SetBranchAddress("binpos", &binpos);
+        tree.SetBranchAddress("bintheta", &bintheta);
+        tree.SetBranchAddress("time", &time);
+        tree.SetBranchAddress("r", &r);
+        tree.SetBranchAddress("ph", &ph);
+        tree.SetBranchAddress("phn", &phn);
+        tree.SetBranchAddress("ph1", &ph1);
+        tree.SetBranchAddress("ph2", &ph2);
+        tree.SetBranchAddress("rot", &rot);
+
+        tree.SetBranchAddress("netamaxima", &netamaxima);
+        tree.SetBranchAddress("sTgcPadAssociated", &nsTgcPadAssociated);
+        tree.SetBranchAddress("sTgcPadNotAssociated", &nsTgcPadNotAssociated);
+
+        tree.SetBranchAddress("nmuons", &nmuons);
+        tree.SetBranchAddress("tpdgId", &tpdgId);
+        tree.SetBranchAddress("tbarcode", &tbarcode);
+        tree.SetBranchAddress("tmuonIndex", &tmuonIndex);
+        tree.SetBranchAddress("pt", &pt);
+        tree.SetBranchAddress("eta", &eta);
+        tree.SetBranchAddress("phi", &phi);
+        tree.SetBranchAddress("nmdts", &nmdts);
+        tree.SetBranchAddress("nrpcs", &nrpcs);
+        tree.SetBranchAddress("ntgcs", &ntgcs);
+        tree.SetBranchAddress("ncscs", &ncscs);
+        tree.SetBranchAddress("ntmdts", &ntmdts);
+        tree.SetBranchAddress("ntrpcs", &ntrpcs);
+        tree.SetBranchAddress("nttgcs", &nttgcs);
+        tree.SetBranchAddress("ntcscs", &ntcscs);
+    }
+
+    void HitNtuple::initForReadseg(TTree& tree) {
+        tree.SetBranchAddress("nsegs", &nsegs);
+        tree.SetBranchAddress("sbarcode", &sbarcode);
+        tree.SetBranchAddress("sposx", &sposx);
+        tree.SetBranchAddress("sposy", &sposy);
+        tree.SetBranchAddress("sposz", &sposz);
+        tree.SetBranchAddress("sdirx", &sdirx);
+        tree.SetBranchAddress("sdiry", &sdiry);
+        tree.SetBranchAddress("sdirz", &sdirz);
+        tree.SetBranchAddress("snPrecHits", &snPrecHits);
+        tree.SetBranchAddress("snTrigHits", &snTrigHits);
+        tree.SetBranchAddress("sSector", &sSector);
+        tree.SetBranchAddress("sChIndex", &sChIndex);
+    }
+
+    void HitNtuple::fill(int sTgcPadAssociated, int sTgcPadNotAssociated) {
+        if (netamaxima >= ETAMAXSIZE) return;
+
+        nsTgcPadAssociated[netamaxima] = sTgcPadAssociated;
+        nsTgcPadNotAssociated[netamaxima] = sTgcPadNotAssociated;
+        ++netamaxima;
     }
-  }
-
-
-  bool operator<( const DataIndex& index1,const DataIndex& index2 ){
-    return index1.m_data < index2.m_data;
-  }
-
-  void HitNtuple::initForWrite(TTree& tree){
-    init();
-    tree.Branch("nhits",&nhits,"nhits/I");
-    tree.Branch("lay",&lay,"lay[nhits]/I");
-    tree.Branch("x",&x,"x[nhits]/F");
-    tree.Branch("ymin",&ymin,"ymin[nhits]/F");
-    tree.Branch("ymax",&ymax,"ymax[nhits]/F");
-    tree.Branch("w",&w,"w[nhits]/F");
-
-    // extra hit info
-    tree.Branch("ndebug",&ndebug,"ndebug/I");
-    tree.Branch("type",&type,"type[ndebug]/I");
-    tree.Branch("region",&region,"region[ndebug]/I");
-    tree.Branch("sector",&sector,"sector[ndebug]/I");
-    tree.Branch("layer",&layer,"layer[ndebug]/I");
-    tree.Branch("sublayer",&sublayer,"sublayer[ndebug]/I");
-    tree.Branch("pdgId",&pdgId,"pdgId[ndebug]/I");
-    tree.Branch("barcode",&barcode,"barcode[ndebug]/I");
-    tree.Branch("muonIndex",&muonIndex,"muonIndex[ndebug]/I");
-    tree.Branch("clusterSize",&clusterSize,"clusterSize[ndebug]/I");
-    tree.Branch("clusterLayers",&clusterLayers,"clusterLayers[ndebug]/I");
-    tree.Branch("isEtaPhi",&isEtaPhi,"isEtaPhi[ndebug]/I");
-    tree.Branch("trigConfirm",&trigConfirm,"trigConfirm[ndebug]/I");
-    tree.Branch("binpos",&binpos,"binpos[ndebug]/I");
-    tree.Branch("bintheta",&bintheta,"bintheta[ndebug]/I");
-    tree.Branch("time",&time,"time[ndebug]/F");
-    tree.Branch("r",&r,"r[ndebug]/F");
-    tree.Branch("ph",&ph,"ph[ndebug]/F");
-    tree.Branch("phn",&phn,"phn[ndebug]/F");
-    tree.Branch("ph1",&ph1,"ph1[ndebug]/F");
-    tree.Branch("ph2",&ph2,"ph2[ndebug]/F");
-    tree.Branch("rot",&rot,"rot[ndebug]/F");
-
-    tree.Branch("pnhits",&pnhits,"pnhits/I");
-    tree.Branch("play",&play,"play[pnhits]/I");
-    tree.Branch("pr",&pr,"pr[pnhits]/F");
-    tree.Branch("phimin",&phimin,"phimin[pnhits]/F");
-    tree.Branch("phimax",&phimax,"phimax[pnhits]/F");
-    tree.Branch("pw",&pw,"pw[pnhits]/F");
-
-    // extra hit info
-    tree.Branch("pndebug",&pndebug,"pndebug/I");
-    tree.Branch("ptype",&ptype,"ptype[pndebug]/I");
-    tree.Branch("pregion",&pregion,"pregion[pndebug]/I");
-    tree.Branch("psector",&psector,"psector[pndebug]/I");
-    tree.Branch("player",&player,"player[pndebug]/I");
-    tree.Branch("psublayer",&psublayer,"psublayer[pndebug]/I");
-    tree.Branch("ppdgId",&ppdgId,"ppdgId[pndebug]/I");
-    tree.Branch("pbarcode",&pbarcode,"pbarcode[pndebug]/I");
-    tree.Branch("pmuonIndex",&pmuonIndex,"pmuonIndex[pndebug]/I");
-    tree.Branch("pclusterSize",&pclusterSize,"pclusterSize[pndebug]/I");
-    tree.Branch("pclusterLayers",&pclusterLayers,"pclusterLayers[pndebug]/I");
-    tree.Branch("pisEtaPhi",&pisEtaPhi,"pisEtaPhi[pndebug]/I");
-    tree.Branch("pbinpos",&pbinpos,"pbinpos[pndebug]/I");
-    tree.Branch("pbintheta",&pbintheta,"pbintheta[pndebug]/I");
-    tree.Branch("ptime",&ptime,"ptime[pndebug]/F");
-    tree.Branch("ppr",&ppr,"ppr[pndebug]/F");
-    tree.Branch("pph",&pph,"pph[pndebug]/F");
-    tree.Branch("pph1",&pph1,"pph1[pndebug]/F");
-    tree.Branch("pph2",&pph2,"pph2[pndebug]/F");
-    tree.Branch("prot",&prot,"prot[pndebug]/F");
-
-    tree.Branch("netamaxima",&netamaxima,"netamaxima/I");
-    tree.Branch("sTgcPadAssociated",&nsTgcPadAssociated,"nsTgcPadAssociated[netamaxima]/I");
-    tree.Branch("sTgcPadNotAssociated",&nsTgcPadNotAssociated,"nsTgcPadNotAssociated[netamaxima]/I");
-
-    tree.Branch("nmuons",&nmuons,"nmuons/I");
-    tree.Branch("tpdgId",&tpdgId,"tpdgId[nmuons]/I");
-    tree.Branch("tbarcode",&tbarcode,"tbarcode[nmuons]/I");
-    tree.Branch("tmuonIndex",&tmuonIndex,"tmuonIndex[nmuons]/I");
-    tree.Branch("pt",&pt,"pt[nmuons]/F");
-    tree.Branch("eta",&eta,"eta[nmuons]/F");
-    tree.Branch("phi",&phi,"phi[nmuons]/F");
-    tree.Branch("nmdts",&nmdts,"nmdts[nmuons]/I");
-    tree.Branch("nrpcs",&nrpcs,"nrpcs[nmuons]/I");
-    tree.Branch("ntgcs",&ntgcs,"ntgcs[nmuons]/I");
-    tree.Branch("ncscs",&ncscs,"ncscs[nmuons]/I");
-    tree.Branch("ntmdts",&ntmdts,"ntmdts[nmuons]/I");
-    tree.Branch("ntrpcs",&ntrpcs,"ntrpcs[nmuons]/I");
-    tree.Branch("nttgcs",&nttgcs,"nttgcs[nmuons]/I");
-    tree.Branch("ntcscs",&ntcscs,"ntcscs[nmuons]/I");
-
-    tree.Branch("nsegs", &nsegs, "nsegs/I");
-    tree.Branch("sbarcode", &sbarcode, "sbarcode[nsegs]/I");
-    tree.Branch("sposx", &sposx, "sposx[nsegs]/F");
-    tree.Branch("sposy", &sposy, "sposy[nsegs]/F");
-    tree.Branch("sposz", &sposz, "sposz[nsegs]/F");
-    tree.Branch("sdirx", &sdirx, "sdirx[nsegs]/F");
-    tree.Branch("sdiry", &sdiry, "sdiry[nsegs]/F");
-    tree.Branch("sdirz", &sdirz, "sdirz[nsegs]/F");
-    tree.Branch("snPrecHits", &snPrecHits, "snPrecHits[nsegs]/I");
-    tree.Branch("snTrigHits", &snTrigHits, "snTrigHits[nsegs]/I");
-    tree.Branch("sSector", &sSector, "sSector[nsegs]/I");
-    tree.Branch("sChIndex", &sChIndex, "sChIndex[nsegs]/I");
-  }
-
-  void HitNtuple::initForRead(TTree& tree) { 
-    tree.SetBranchAddress("nhits",&nhits);
-    tree.SetBranchAddress("lay",&lay);
-    tree.SetBranchAddress("x",&x);
-    tree.SetBranchAddress("ymin",&ymin);
-    tree.SetBranchAddress("ymax",&ymax);
-    tree.SetBranchAddress("w",&w);
-
-    // extra hit info
-    tree.SetBranchAddress("ndebug",&ndebug);
-    tree.SetBranchAddress("type",&type);
-    tree.SetBranchAddress("region",&region);
-    tree.SetBranchAddress("sector",&sector);
-    tree.SetBranchAddress("layer",&layer);
-    tree.SetBranchAddress("sublayer",&sublayer);
-    tree.SetBranchAddress("pdgId",&pdgId);
-    tree.SetBranchAddress("barcode",&barcode);
-    tree.SetBranchAddress("muonIndex",&muonIndex);
-    tree.SetBranchAddress("clusterSize",&clusterSize);
-    tree.SetBranchAddress("clusterLayers",&clusterLayers);
-    tree.SetBranchAddress("isEtaPhi",&isEtaPhi);
-    tree.SetBranchAddress("trigConfirm",&trigConfirm);
-    tree.SetBranchAddress("binpos",&binpos);
-    tree.SetBranchAddress("bintheta",&bintheta);
-    tree.SetBranchAddress("time",&time);
-    tree.SetBranchAddress("r",&r);
-    tree.SetBranchAddress("ph",&ph);
-    tree.SetBranchAddress("phn",&phn);
-    tree.SetBranchAddress("ph1",&ph1);
-    tree.SetBranchAddress("ph2",&ph2);
-    tree.SetBranchAddress("rot",&rot);
-
-    tree.SetBranchAddress("netamaxima",&netamaxima);
-    tree.SetBranchAddress("sTgcPadAssociated",&nsTgcPadAssociated);
-    tree.SetBranchAddress("sTgcPadNotAssociated",&nsTgcPadNotAssociated);
-
-    tree.SetBranchAddress("nmuons",&nmuons);
-    tree.SetBranchAddress("tpdgId",&tpdgId);
-    tree.SetBranchAddress("tbarcode",&tbarcode);
-    tree.SetBranchAddress("tmuonIndex",&tmuonIndex);
-    tree.SetBranchAddress("pt",&pt);
-    tree.SetBranchAddress("eta",&eta);
-    tree.SetBranchAddress("phi",&phi);
-    tree.SetBranchAddress("nmdts",&nmdts);
-    tree.SetBranchAddress("nrpcs",&nrpcs);
-    tree.SetBranchAddress("ntgcs",&ntgcs);
-    tree.SetBranchAddress("ncscs",&ncscs);
-    tree.SetBranchAddress("ntmdts",&ntmdts);
-    tree.SetBranchAddress("ntrpcs",&ntrpcs);
-    tree.SetBranchAddress("nttgcs",&nttgcs);
-    tree.SetBranchAddress("ntcscs",&ntcscs);
-
-  }
-
-  void HitNtuple::initForReadseg(TTree& tree) { 
-
-    tree.SetBranchAddress("nsegs", &nsegs);
-    tree.SetBranchAddress("sbarcode", &sbarcode);
-    tree.SetBranchAddress("sposx", &sposx);
-    tree.SetBranchAddress("sposy", &sposy);
-    tree.SetBranchAddress("sposz", &sposz);
-    tree.SetBranchAddress("sdirx", &sdirx);
-    tree.SetBranchAddress("sdiry", &sdiry);
-    tree.SetBranchAddress("sdirz", &sdirz);
-    tree.SetBranchAddress("snPrecHits", &snPrecHits);
-    tree.SetBranchAddress("snTrigHits", &snTrigHits);
-    tree.SetBranchAddress("sSector", &sSector);
-    tree.SetBranchAddress("sChIndex", &sChIndex);
-   }
-
-  void HitNtuple::fill( int sTgcPadAssociated, int sTgcPadNotAssociated) {
-    if( netamaxima >= ETAMAXSIZE ) return;
-
-    nsTgcPadAssociated[netamaxima] = sTgcPadAssociated;
-    nsTgcPadNotAssociated[netamaxima] = sTgcPadNotAssociated; 
-    ++netamaxima;
-  }
-    
-  void HitNtuple::fill( std::vector<MuonDebugInfo>& muons ) {
-    for( std::vector<MuonDebugInfo>::iterator it=muons.begin();it!=muons.end();++it) fill(*it);
-  }
-
-  void HitNtuple::fill( MuonDebugInfo& muon ) {
-    if( nmuons >= MUONSIZE ) return;
-
-    tpdgId[nmuons] = muon.pdgId;
-    tbarcode[nmuons] = muon.barcode;
-    tmuonIndex[nmuons] = muon.muonIndex;
-    pt[nmuons] = muon.pt;
-    eta[nmuons] = muon.eta;
-    phi[nmuons] = muon.phi;
-    nmdts[nmuons] = muon.nmdts;
-    nrpcs[nmuons] = muon.nrpcs;
-    ntgcs[nmuons] = muon.ntgcs;
-    ncscs[nmuons] = muon.ncscs;
-    ntmdts[nmuons] = muon.ntmdts;
-    ntrpcs[nmuons] = muon.ntrpcs;
-    nttgcs[nmuons] = muon.nttgcs;
-    ntcscs[nmuons] = muon.ntcscs;
-    ++nmuons;
-  }
-
-  void HitNtuple::fill( const Hit& hit ){
-    if( nhits >= HITSIZE ) return;
-
-    lay[nhits] = hit.layer;
-    x[nhits] = hit.x;
-    ymin[nhits] = hit.ymin;
-    ymax[nhits] = hit.ymax;
-    w[nhits] = hit.w;
-      
-    if( hit.debugInfo() && ndebug < HITSIZE){
-      const HitDebugInfo* debug = hit.debugInfo();
-      type[ndebug] = debug->type;
-      region[ndebug] = debug->region;
-      sector[ndebug] = debug->sector;
-      layer[ndebug] = debug->layer;
-      sublayer[ndebug] = debug->sublayer;
-      pdgId[ndebug] = debug->pdgId;
-      barcode[ndebug] = debug->barcode;
-      muonIndex[ndebug] = debug->muonIndex;
-      clusterSize[ndebug] = debug->clusterSize;
-      clusterLayers[ndebug] = debug->clusterLayers;
-      isEtaPhi[ndebug] = debug->isEtaPhi;
-      trigConfirm[ndebug] = debug->trigConfirm;
-      time[ndebug] = debug->time;
-      binpos[ndebug] = debug->binpos;
-      bintheta[ndebug] = debug->bintheta;
-      r[ndebug] = debug->r;
-      rot[ndebug] = debug->rot;
-      ph[ndebug] = debug->ph;
-      phn[ndebug] = debug->phn;
-      ph1[ndebug] = debug->ph1;
-      ph2[ndebug] = debug->ph2;
-      ++ndebug;
-    } 
-    ++nhits;
-  }
-  void HitNtuple::fill( const PhiHit& hit ){
-    if( pnhits >= PHIHITSIZE ) return;
-
-    play[pnhits] = hit.layer;
-    pr[pnhits] = hit.r;
-    phimin[pnhits] = hit.phimin;
-    phimax[pnhits] = hit.phimax;
-    pw[pnhits] = hit.w;
-      
-    if( hit.debugInfo() && pndebug < PHIHITSIZE){
-      const HitDebugInfo* debug = hit.debugInfo();
-      ptype[pndebug] = debug->type;
-      pregion[pndebug] = debug->region;
-      psector[pndebug] = debug->sector;
-      player[pndebug] = debug->layer;
-      psublayer[pndebug] = debug->sublayer;
-      ppdgId[pndebug] = debug->pdgId;
-      pbarcode[pndebug] = debug->barcode;
-      pmuonIndex[pndebug] = debug->muonIndex;
-      pclusterSize[pndebug] = debug->clusterSize;
-      pclusterLayers[pndebug] = debug->clusterLayers;
-      ptime[pndebug] = debug->time;
-      pbinpos[pndebug] = debug->binpos;
-      pbintheta[pndebug] = debug->bintheta;
-      ppr[pndebug] = debug->r;
-      prot[pndebug] = debug->rot;
-      pph[pndebug] = debug->ph;
-      pph1[pndebug] = debug->ph1;
-      pph2[pndebug] = debug->ph2;
-      ++pndebug;
-    } 
-    ++pnhits;
-  }
-
-
-  void HitNtuple::reset() {
-    nmuons = 0;
-    nsegs = 0;
-    nhits = 0;
-    ndebug = 0;
-    pnhits = 0;
-    pndebug = 0;
-  }
-
-
-
-  void HitNtuple::fill( const std::vector<Hit*>& hits ) {
-    for( unsigned int i=0;i<hits.size();++i ){
-      fill( *hits[i] );
+
+    void HitNtuple::fill(std::vector<MuonDebugInfo>& muons) {
+        for (std::vector<MuonDebugInfo>::iterator it = muons.begin(); it != muons.end(); ++it) fill(*it);
+    }
+
+    void HitNtuple::fill(MuonDebugInfo& muon) {
+        if (nmuons >= MUONSIZE) return;
+
+        tpdgId[nmuons] = muon.pdgId;
+        tbarcode[nmuons] = muon.barcode;
+        tmuonIndex[nmuons] = muon.muonIndex;
+        pt[nmuons] = muon.pt;
+        eta[nmuons] = muon.eta;
+        phi[nmuons] = muon.phi;
+        nmdts[nmuons] = muon.nmdts;
+        nrpcs[nmuons] = muon.nrpcs;
+        ntgcs[nmuons] = muon.ntgcs;
+        ncscs[nmuons] = muon.ncscs;
+        ntmdts[nmuons] = muon.ntmdts;
+        ntrpcs[nmuons] = muon.ntrpcs;
+        nttgcs[nmuons] = muon.nttgcs;
+        ntcscs[nmuons] = muon.ntcscs;
+        ++nmuons;
+    }
+
+    void HitNtuple::fill(const Hit& hit) {
+        if (nhits >= HITSIZE) return;
+
+        lay[nhits] = hit.layer;
+        x[nhits] = hit.x;
+        ymin[nhits] = hit.ymin;
+        ymax[nhits] = hit.ymax;
+        w[nhits] = hit.w;
+
+        if (hit.debugInfo() && ndebug < HITSIZE) {
+            const HitDebugInfo* debug = hit.debugInfo();
+            type[ndebug] = debug->type;
+            region[ndebug] = debug->region;
+            sector[ndebug] = debug->sector;
+            layer[ndebug] = debug->layer;
+            sublayer[ndebug] = debug->sublayer;
+            pdgId[ndebug] = debug->pdgId;
+            barcode[ndebug] = debug->barcode;
+            muonIndex[ndebug] = debug->muonIndex;
+            clusterSize[ndebug] = debug->clusterSize;
+            clusterLayers[ndebug] = debug->clusterLayers;
+            isEtaPhi[ndebug] = debug->isEtaPhi;
+            trigConfirm[ndebug] = debug->trigConfirm;
+            time[ndebug] = debug->time;
+            binpos[ndebug] = debug->binpos;
+            bintheta[ndebug] = debug->bintheta;
+            r[ndebug] = debug->r;
+            rot[ndebug] = debug->rot;
+            ph[ndebug] = debug->ph;
+            phn[ndebug] = debug->phn;
+            ph1[ndebug] = debug->ph1;
+            ph2[ndebug] = debug->ph2;
+            ++ndebug;
+        }
+        ++nhits;
+    }
+    void HitNtuple::fill(const PhiHit& hit) {
+        if (pnhits >= PHIHITSIZE) return;
+
+        play[pnhits] = hit.layer;
+        pr[pnhits] = hit.r;
+        phimin[pnhits] = hit.phimin;
+        phimax[pnhits] = hit.phimax;
+        pw[pnhits] = hit.w;
+
+        if (hit.debugInfo() && pndebug < PHIHITSIZE) {
+            const HitDebugInfo* debug = hit.debugInfo();
+            ptype[pndebug] = debug->type;
+            pregion[pndebug] = debug->region;
+            psector[pndebug] = debug->sector;
+            player[pndebug] = debug->layer;
+            psublayer[pndebug] = debug->sublayer;
+            ppdgId[pndebug] = debug->pdgId;
+            pbarcode[pndebug] = debug->barcode;
+            pmuonIndex[pndebug] = debug->muonIndex;
+            pclusterSize[pndebug] = debug->clusterSize;
+            pclusterLayers[pndebug] = debug->clusterLayers;
+            ptime[pndebug] = debug->time;
+            pbinpos[pndebug] = debug->binpos;
+            pbintheta[pndebug] = debug->bintheta;
+            ppr[pndebug] = debug->r;
+            prot[pndebug] = debug->rot;
+            pph[pndebug] = debug->ph;
+            pph1[pndebug] = debug->ph1;
+            pph2[pndebug] = debug->ph2;
+            ++pndebug;
+        }
+        ++pnhits;
+    }
+
+    void HitNtuple::reset() {
+        nmuons = 0;
+        nsegs = 0;
+        nhits = 0;
+        ndebug = 0;
+        pnhits = 0;
+        pndebug = 0;
+    }
+
+    void HitNtuple::fill(const std::vector<Hit*>& hits) {
+        for (unsigned int i = 0; i < hits.size(); ++i) { fill(*hits[i]); }
     }
-  }
 
-  void HitNtuple::fill( const std::vector<PhiHit*>& hits ) {
-    for( unsigned int i=0;i<hits.size();++i ){
-      fill( *hits[i] );
+    void HitNtuple::fill(const std::vector<PhiHit*>& hits) {
+        for (unsigned int i = 0; i < hits.size(); ++i) { fill(*hits[i]); }
     }
-  }
 
-  bool HitNtuple::read( EventData& event, std::vector<MuonDebugInfo>& muons ){
-    if( nhits == 0 ) {
-      std::cout << " ntuple not initialized for reading " << std::endl;
-      return false;
+    bool HitNtuple::read(EventData& event, std::vector<MuonDebugInfo>& muons) {
+        if (nhits == 0) {
+            std::cout << " ntuple not initialized for reading " << std::endl;
+            return false;
+        }
+        bool hasDebug = nhits == ndebug;
+
+        for (int i = 0; i < nhits; ++i) {
+            HitDebugInfo* debug = nullptr;
+            if (hasDebug) {
+                debug = new HitDebugInfo();
+                debug->type = type[i];
+                debug->region = static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region[i]);
+                debug->sector = sector[i];
+                debug->layer = static_cast<Muon::MuonStationIndex::LayerIndex>(layer[i]);
+                debug->sublayer = sublayer[i];
+                debug->pdgId = pdgId[i];
+                debug->barcode = barcode[i];
+                debug->muonIndex = muonIndex[i];
+                debug->clusterSize = clusterSize[i];
+                debug->clusterLayers = clusterLayers[i];
+                debug->isEtaPhi = isEtaPhi[i];
+                debug->trigConfirm = trigConfirm[i];
+                debug->binpos = binpos[i];
+                debug->bintheta = bintheta[i];
+                debug->time = time[i];
+                debug->r = r[i];
+                debug->ph = ph[i];
+                debug->phn = phn[i];
+                debug->ph1 = ph1[i];
+                debug->ph2 = ph2[i];
+                debug->rot = rot[i];
+            }
+            Hit* hit = new Hit(lay[i], x[i], ymin[i], ymax[i], w[i], debug);
+
+            DataIndex index(sector[i], static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region[i]),
+                            static_cast<Muon::MuonStationIndex::LayerIndex>(layer[i]), type[i]);
+            HitList& hitList = event.sectors[sector[i]][index];
+            hitList.push_back(hit);
+        }
+
+        for (int i = 0; i < nmuons; ++i) {
+            MuonDebugInfo muon{};
+            muon.pdgId = tpdgId[i];
+            muon.barcode = tbarcode[i];
+            muon.muonIndex = tmuonIndex[i];
+            muon.pt = pt[i];
+            muon.eta = eta[i];
+            muon.phi = phi[i];
+            muon.nmdts = nmdts[i];
+            muon.nrpcs = nrpcs[i];
+            muon.ntgcs = ntgcs[i];
+            muon.ncscs = ncscs[i];
+            muon.ntmdts = ntmdts[i];
+            muon.ntrpcs = ntrpcs[i];
+            muon.nttgcs = nttgcs[i];
+            muon.ntcscs = ntcscs[i];
+            muons.push_back(muon);
+        }
+        return true;
     }
-    bool hasDebug = nhits == ndebug;
-    
-    for( int i=0;i<nhits;++i ){
-	
-      HitDebugInfo* debug = nullptr;
-      if( hasDebug ){
-        debug = new HitDebugInfo();
-        debug->type = type[i];
-        debug->region = static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region[i]);
-        debug->sector = sector[i];
-        debug->layer = static_cast<Muon::MuonStationIndex::LayerIndex>(layer[i]);
-        debug->sublayer = sublayer[i];
-        debug->pdgId = pdgId[i];
-        debug->barcode = barcode[i];
-        debug->muonIndex = muonIndex[i];
-        debug->clusterSize = clusterSize[i];
-        debug->clusterLayers = clusterLayers[i];
-        debug->isEtaPhi = isEtaPhi[i];
-        debug->trigConfirm = trigConfirm[i];
-        debug->binpos = binpos[i];
-        debug->bintheta = bintheta[i];
-        debug->time = time[i];
-        debug->r = r[i];
-        debug->ph = ph[i];
-        debug->phn = phn[i];
-        debug->ph1 = ph1[i];
-        debug->ph2 = ph2[i];
-        debug->rot = rot[i];
-      }
-      Hit* hit = new Hit(lay[i],x[i],ymin[i],ymax[i],w[i],debug);
-      
-      DataIndex index(sector[i],
-                      static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region[i]),
-                      static_cast<Muon::MuonStationIndex::LayerIndex>(layer[i]),
-                      type[i]);
-      HitList& hitList = event.sectors[sector[i]][index];
-      hitList.push_back( hit );
+
+    bool HitNtuple::readseg(std::vector<SegDebugInfo>& segments) {
+        for (int i = 0; i < nsegs; ++i) {
+            SegDebugInfo segment{};
+            segment.sposx = sposx[i];
+            segment.sposy = sposy[i];
+            segment.sposz = sposz[i];
+            segment.sdirx = sdirx[i];
+            segment.sdiry = sdiry[i];
+            segment.sdirz = sdirz[i];
+            segment.snPrecHits = snPrecHits[i];
+            segment.snTrigHits = snTrigHits[i];
+            segment.sSector = sSector[i];
+            segment.sChIndex = sChIndex[i];
+            segments.push_back(segment);
+        }
+        return true;
     }
-   
-    for( int i=0;i<nmuons;++i ){
-      MuonDebugInfo muon{};
-      muon.pdgId = tpdgId[i];
-      muon.barcode = tbarcode[i];
-      muon.muonIndex = tmuonIndex[i];
-      muon.pt = pt[i];
-      muon.eta = eta[i];
-      muon.phi = phi[i];
-      muon.nmdts = nmdts[i];
-      muon.nrpcs = nrpcs[i];
-      muon.ntgcs = ntgcs[i];
-      muon.ncscs = ncscs[i];
-      muon.ntmdts = ntmdts[i];
-      muon.ntrpcs = ntrpcs[i];
-      muon.nttgcs = nttgcs[i];
-      muon.ntcscs = ntcscs[i];
-      muons.push_back(muon);
-    }	
-    return true;
-  }
-
-  bool HitNtuple::readseg(std::vector<SegDebugInfo>& segments ){
-    for( int i=0;i<nsegs;++i ){
-      SegDebugInfo segment{};
-      segment.sposx = sposx[i];
-      segment.sposy = sposy[i];
-      segment.sposz = sposz[i];
-      segment.sdirx = sdirx[i];
-      segment.sdiry = sdiry[i];
-      segment.sdirz = sdirz[i];
-      segment.snPrecHits = snPrecHits[i];
-      segment.snTrigHits = snTrigHits[i];
-      segment.sSector = sSector[i];
-      segment.sChIndex = sChIndex[i];
-      segments.push_back(segment);
-    } 
-    return true;
-  }
-
-  void EventData::dump( const std::map<int,SectorData>& data ) {
-    
-    
-    std::cout << " dumping sectors " << data.size() << std::endl;
-    std::map<int,SectorData>::const_iterator it = data.begin();
-    std::map<int,SectorData>::const_iterator it_end = data.end();
-    for( ;it!=it_end;++it ){
-
-      SectorData::const_iterator sit = it->second.begin();
-      SectorData::const_iterator sit_end = it->second.end();
-      for( ;sit!=sit_end;++sit ){
-	std::cout << " sector " << sit->first.sector() << " region " << sit->first.region()
-		  << " layer " << sit->first.layer() << " type " << sit->first.type()
-		  << " hits  " << sit->second.size() << std::endl;
-      }
+
+    void EventData::dump(const std::map<int, SectorData>& data) {
+        std::cout << " dumping sectors " << data.size() << std::endl;
+        std::map<int, SectorData>::const_iterator it = data.begin();
+        std::map<int, SectorData>::const_iterator it_end = data.end();
+        for (; it != it_end; ++it) {
+            SectorData::const_iterator sit = it->second.begin();
+            SectorData::const_iterator sit_end = it->second.end();
+            for (; sit != sit_end; ++sit) {
+                std::cout << " sector " << sit->first.sector() << " region " << sit->first.region() << " layer " << sit->first.layer()
+                          << " type " << sit->first.type() << " hits  " << sit->second.size() << std::endl;
+            }
+        }
+    }
+
+    void EventData::dump() const {
+        if (!sectors.empty()) {
+            std::cout << " endcapC sectors with hits " << sectors.size() << std::endl;
+            dump(sectors);
+        }
     }
-  }
 
-  void EventData::dump() const {
-    if( !sectors.empty() ){
-      std::cout << " endcapC sectors with hits " << sectors.size() << std::endl;
-      dump(sectors);
+    void HitNtuple::init() {
+        nmuons = 0;
+        nsegs = 0;
+        nhits = 0;
+        ndebug = 0;
     }
-  }
-
-  void HitNtuple::init() {
-    nmuons = 0;
-    nsegs = 0;
-    nhits = 0;
-    ndebug = 0;
-  }
-}
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx
index 7c21a60cfb259cd22aa48142e604598a2f128fbb..223820837db7faaba0deb61df627ab02df84c66b 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx
@@ -4,710 +4,737 @@
 
 #include "MuonLayerHough/LayerAnalysis.h"
 
+#include <algorithm>
+#include <cmath>
+#include <cstdlib>
+#include <iostream>
+#include <set>
+
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "MuonLayerHough/MuonLayerHough.h"
 #include "MuonLayerHough/MuonRegionHough.h"
-#include "GeoPrimitives/GeoPrimitives.h"
-
-#include "TROOT.h"
-#include "TTree.h"
-#include "TString.h"
-#include "TDirectory.h"
 #include "TCanvas.h"
+#include "TDirectory.h"
 #include "TEllipse.h"
-#include "TLine.h"
+#include "TFile.h"
 #include "TH1F.h"
 #include "TH2F.h"
-#include "TFile.h"
+#include "TLine.h"
+#include "TROOT.h"
+#include "TString.h"
 #include "TStyle.h"
+#include "TTree.h"
 #include "TVector3.h"
-#include <set>
-#include <cmath>
-
-#include <iostream>
-#include <cstdlib>
-#include <algorithm>
 
 namespace MuonHough {
-  
-  Plots::Plots(const char* title, int nBinsX, float xMin, float xMax, int nBinsY, float yMin, float yMax){
-    Reco           = new TH2F(title, title, nBinsX, xMin, xMax, nBinsY, yMin, yMax);
-    Truth          = new TH2F(Form("Truth_%s",title), Form("Truth_%s",title), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
-    Matched        = new TH2F(Form("Matched_%s" ,title), Form("Matched_%s" ,title), nBinsX, xMin, xMax, nBinsY, yMin, yMax); 
-    Unmatched      = new TH2F(Form("Unmatched_%s" ,title), Form("Unmatched_%s" ,title), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
-    Efficiency     = new TH1F(Form("Eff_%s", title), Form("Eff_%s", title), nBinsY, yMin, yMax); 
-    FakeEfficiency = new TH1F(Form("FakeEff_%s", title), Form("FakeEff_%s", title), nBinsY, yMin, yMax); 
-    Diff           = new TH2F(Form("Diff_%s",title), Form("Diff_%s",title), nBinsX, xMin, xMax, 21, -10.5, 10.5);
-  }
-  
-  void LayerAnalysis::analyse() {
-    gROOT->SetBatch(true);
-    TH1::AddDirectory(false);
-    initialize();//initialize all the plots
-    Long64_t nentries = m_tree->GetEntries();
-    m_ncalls = 0;
-    std::cout << " analysing events " << nentries << std::endl;
-    m_ntuple.initForRead(*m_tree);
-    if (m_DEBUG_seg){std::cout << " here " << nentries << std::endl; m_ntuple.initForReadseg(*m_tree);}
-    std::cout << " after initialize events " << nentries << std::endl;
-
-    m_selectors.resize(Muon::MuonStationIndex::ChIndexMax);//initialzie all the selectors
-    m_selectors[Muon::MuonStationIndex::BIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::BIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::BMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});  
-    m_selectors[Muon::MuonStationIndex::BML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});  
-    m_selectors[Muon::MuonStationIndex::BOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::BOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::BEE] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EES] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-    m_selectors[Muon::MuonStationIndex::EEL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0,1.9)});
-
-    if (m_DEBUG) nentries = 200;//for debugging purpose
-    for( Long64_t evt=0; evt<nentries; ++evt ){
-      if (evt % 1000 == 0) std::cout << "event: " << evt << std::endl;
-      m_tree->LoadTree(evt);
-      m_tree->GetEntry(evt);
-      m_event.reset();//event data
-	    m_muons.clear();
-      m_segs.clear();
-      if(!m_ntuple.read(m_event,m_muons)) {std::cout << "oops bad event: " << evt << std::endl; continue;}
-      if (m_DEBUG_seg && !m_ntuple.readseg(m_segs)) {std::cout << "oops bad segment: " << evt << std::endl; continue;}
-      if (m_DEBUG_seg){
-        for (auto seg = m_segs.begin(); seg != m_segs.end(); seg++){
-          TVector3 globalPos(seg->sposx, seg->sposy, seg->sposz);
-          TVector3 globalDir(seg->sdirx, seg->sdiry, seg->sdirz);
-          //has to do a transformation here to calcualte! or the phi effect is in
-          double globalPos_theta = globalPos.Theta();
-          double globalDir_theta = globalDir.Theta();
-          std::cout << " @@truth segment " << " sector " << seg->sSector << " chamber " << seg->sChIndex << 
-          " r " << globalPos.Perp() <<  " z " <<  globalPos.Z() <<  " postheta " << globalPos_theta << 
-          " dirtheta " << M_PI - globalDir_theta << std::endl;
-        }
-      } 
 
-      if (m_DEBUG) std::cout << "DEBUG: start analyse event evt " << evt << std::endl;
-      analysis( m_event.sectors );
-      ++m_ncalls;
+    Plots::Plots(const char* title, int nBinsX, float xMin, float xMax, int nBinsY, float yMin, float yMax) {
+        Reco = new TH2F(title, title, nBinsX, xMin, xMax, nBinsY, yMin, yMax);
+        Truth = new TH2F(Form("Truth_%s", title), Form("Truth_%s", title), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
+        Matched = new TH2F(Form("Matched_%s", title), Form("Matched_%s", title), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
+        Unmatched = new TH2F(Form("Unmatched_%s", title), Form("Unmatched_%s", title), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
+        Efficiency = new TH1F(Form("Eff_%s", title), Form("Eff_%s", title), nBinsY, yMin, yMax);
+        FakeEfficiency = new TH1F(Form("FakeEff_%s", title), Form("FakeEff_%s", title), nBinsY, yMin, yMax);
+        Diff = new TH2F(Form("Diff_%s", title), Form("Diff_%s", title), nBinsX, xMin, xMax, 21, -10.5, 10.5);
     }
-    finalize();
-  }
-
-  void LayerAnalysis::initialize() {
-    SetStyle();
-    m_h_dtheta = new TH1F("dtheta", "RMS of the #Delta #theta for each clutser; #theta RMS", 315, -0.01, M_PI);
-    m_h_dtheta_truth = new TH1F("dtheta_truth", "RMS of the #Delta #theta for each truth clutser; #theta RMS", 315, -M_PI, M_PI);
-    m_hMaximaHeightPerChIndex.resize(Muon::MuonStationIndex::ChIndexMax);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BIS] = new Plots("max_BIS", /* 20, 0, 10000,*/ 16, 0, 3.2, 15, 0, 15);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BIL] = new Plots("max_BIL", /* 20, 0, 10000,*/ 16, 0, 3.2, 15, 0, 15);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BMS] = new Plots("max_BMS", /* 24, 0, 12000,*/ 16, 0, 3.2, 20, 0, 20);  
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BML] = new Plots("max_BML", /* 24, 0, 12000,*/ 16, 0, 3.2, 20, 0, 20);  
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BOS] = new Plots("max_BOS", /* 30, 0, 15000,*/ 16, 0, 3.2, 15, 0, 15);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BOL] = new Plots("max_BOL", /* 30, 0, 15000,*/ 16, 0, 3.2, 15, 0, 15);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BEE] = new Plots("max_BEE", /*100, 0, 40000,*/ 16, 0, 3.2, 25, 0, 25);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EIS] = new Plots("max_EIS", /* 16, 0,  8000,*/ 16, 0, 3.2, 15, 0, 15);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EIL] = new Plots("max_EIL", /* 16, 0,  8000,*/ 16, 0, 3.2, 15, 0, 15);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EMS] = new Plots("max_EMS", /* 30, 0, 15000,*/ 16, 0, 3.2, 30, 0, 30);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EML] = new Plots("max_EML", /* 30, 0, 15000,*/ 16, 0, 3.2, 30, 0, 30);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EOS] = new Plots("max_EOS", /* 30, 0, 15000,*/ 16, 0, 3.2, 10, 0, 10);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EOL] = new Plots("max_EOL", /* 30, 0, 15000,*/ 16, 0, 3.2, 10, 0, 10);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EES] = new Plots("max_EES", /*100, 0, 40000,*/ 16, 0, 3.2, 25, 0, 25);
-    m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EEL] = new Plots("max_EEL", /*100, 0, 40000,*/ 16, 0, 3.2, 25, 0, 25);
-    
-    float diffbins = 800; float diffxmax = 3000;
-    m_h_diff_MI_e = new TH1F("h_diff_MI_endcap", "h_diff_MI_endcap; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MO_e = new TH1F("h_diff_MO_endcap", "h_diff_MO_endcap; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MI_b = new TH1F("h_diff_MI_barrel", "h_diff_MI_barrel; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MO_b = new TH1F("h_diff_MO_barrel", "h_diff_MO_barrel; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MI_e_truth = new TH1F("h_diff_MI_endcap_truth", "h_diff_MI_endcap_truth; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MO_e_truth = new TH1F("h_diff_MO_endcap_truth", "h_diff_MO_endcap_truth; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MI_b_truth = new TH1F("h_diff_MI_barrel_truth", "h_diff_MI_barrel_truth; diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_diff_MO_b_truth = new TH1F("h_diff_MO_barrel_truth", "h_diff_MO_barrel_truth; diff, mm", diffbins, -diffxmax, diffxmax);
-    //exptaploated plots
-    //diffbins = 100; diffxmax = 0.5;
-    m_h_expt_MI_e = new TH1F("h_expt_MI_endcap", "h_expt_MI_endcap; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MO_e = new TH1F("h_expt_MO_endcap", "h_expt_MO_endcap; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MI_b = new TH1F("h_expt_MI_barrel", "h_expt_MI_barrel; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MO_b = new TH1F("h_expt_MO_barrel", "h_expt_MO_barrel; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MI_e_truth = new TH1F("h_expt_MI_endcap_truth", "h_expt_MI_endcap_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MO_e_truth = new TH1F("h_expt_MO_endcap_truth", "h_expt_MO_endcap_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MI_b_truth = new TH1F("h_expt_MI_barrel_truth", "h_expt_MI_barrel_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    m_h_expt_MO_b_truth = new TH1F("h_expt_MO_barrel_truth", "h_expt_MO_barrel_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
-    //compare the two extrapolations
-    float compbins = 800; float compxmax = 1500;
-    m_h_comp_MI_e = new TH1F("h_comp_MI_endcap", "h_comp_MI_endcap; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MO_e = new TH1F("h_comp_MO_endcap", "h_comp_MO_endcap; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MI_b = new TH1F("h_comp_MI_barrel", "h_comp_MI_barrel; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MO_b = new TH1F("h_comp_MO_barrel", "h_comp_MO_barrel; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MI_e_truth = new TH1F("h_comp_MI_endcap_truth", "h_comp_MI_endcap_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MO_e_truth = new TH1F("h_comp_MO_endcap_truth", "h_comp_MO_endcap_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MI_b_truth = new TH1F("h_comp_MI_barrel_truth", "h_comp_MI_barrel_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    m_h_comp_MO_b_truth = new TH1F("h_comp_MO_barrel_truth", "h_comp_MO_barrel_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
-    //set basic settings
-    m_DEBUG=false;//for understanding output
-    m_DEBUG_seg=false;//for more debug output
-  }
-
-  void LayerAnalysis::analysis( std::map<int,SectorData>& data ) {
-    MuonDetectorHough detectorHough;
-    MuonDetectorHough detectorHoughTruth; 
-    detectorHough.reset();
-    detectorHoughTruth.reset(); 
-    std::set<DataIndex> plotRegion;
-    std::vector<std::vector<MuonLayerHough::Maximum>> plotMaximum;//save the maximum information here
-    std::vector<std::vector<MuonLayerHough::Maximum>> plotMaximum_truth;//save the maximum information here
-    std::set<int> maxset;
-    if (m_DEBUG) std::cout << "DEBUG: the size of this data event(ROI) " << data.size() << std::endl;
-    for(std::map<int,SectorData>::const_iterator it = data.begin() ;it != data.end();++it ){//looping through region?
-      if (m_DEBUG) std::cout << "DEBUG: the size of the hit clusters in this ROI is " << it->second.size() << std::endl;
-      std::vector<MuonLayerHough::Maximum> plotMaximum_roi;
-      std::vector<MuonLayerHough::Maximum> plotMaximum_roi_truth;
-      for(SectorData::const_iterator sit = it->second.begin(); sit != it->second.end(); ++sit ){//looping the dataindex--first, hitlist--second
-        Muon::MuonStationIndex::DetectorRegionIndex region = sit->first.region();// EndcapA, Barrel, EndcapC,
-        Muon::MuonStationIndex::LayerIndex          layer  = sit->first.layer();// Inner, Middle, Outer, Extended, BarrelExtended
-		
-      	if( sit->first.layer() > Muon::MuonStationIndex::LayerIndexMax ) continue;
-      	MuonLayerHough& hough      = detectorHough.hough(sit->first.sector(), region, layer);
-      	MuonLayerHough& houghTruth = detectorHoughTruth.hough(sit->first.sector(), region, layer);
-
-        int chIndex = hough.m_descriptor.chIndex;//BIS, BIL, BMS, BML, BOS, BOL, BEE(6), EIS, EIL, EMS, EML, EOS, EOL, EES, EEL, CSS, CSL,
-
-        if (m_DEBUG) std::cout << "DEBUG: start new cluster; position: sector " << sit->first.sector() << " region(A/B/C) " 
-        << region << " layer: " << layer  << " chindex: " << chIndex << 
-        " && number of the hits in this cluster is " << sit->second.size() << std::endl;
-        //start to looping over layers for this sector
-        for (int iLayer = 0; iLayer < getMaxLayers(region, sit->first.sector()); iLayer++){// Inner, Middle, Outer, Extended, BarrelExtended
-          std::vector<Hit*>  hits; //list of hits: hitlist--second
-          std::vector<Hit*>  hitsTruth;
-          for(HitList::const_iterator hit = sit->second.begin() ;hit != sit->second.end();++hit ){//start looping the hits in the layer
-            if ( (*hit)->debugInfo()->layer != iLayer) continue;//keeping only hits in this layer
-            hits.push_back(*hit);
-            if( abs((*hit)->debugInfo()->pdgId) == 13 ) {//this is a muon hit!
-              hitsTruth.push_back(*hit);
-            }
-          }//end of lopoing all the hits
-          hough.setDebug(false);//to supress output level
-          hough.fillLayer2(hits);//fill all the layers with the weight
-          houghTruth.fillLayer2(hitsTruth);//fill all the layers with the weight
-          MuonLayerHough::Maximum maximum;//this is the maximum of this one layer
-          bool recoMaximumFound = hough.findMaximum( maximum, m_selectors[hough.m_descriptor.chIndex] );
-          MuonLayerHough::Maximum truthMaximum;//this is the truth maximum of this one layer
-		      bool truthMaximumFound = houghTruth.findMaximum( truthMaximum, m_selectors[hough.m_descriptor.chIndex]);
-		      
-          //fill the max information corresponding histograms
-		      if(recoMaximumFound){
-            m_hMaximaHeightPerChIndex[chIndex]->Reco->Fill( maximum.theta, maximum.max);
-            plotRegion.insert(sit->first.key());
-            if(!plotMaximum_roi.empty() && plotMaximum_roi.back().refchIndex ==  maximum.refchIndex && plotMaximum_roi.back().max <=  maximum.max) {
-              plotMaximum_roi.pop_back();//save only the largest maximum
+
+    void LayerAnalysis::analyse() {
+        gROOT->SetBatch(true);
+        TH1::AddDirectory(false);
+        initialize();  // initialize all the plots
+        Long64_t nentries = m_tree->GetEntries();
+        m_ncalls = 0;
+        std::cout << " analysing events " << nentries << std::endl;
+        m_ntuple.initForRead(*m_tree);
+        if (m_DEBUG_seg) {
+            std::cout << " here " << nentries << std::endl;
+            m_ntuple.initForReadseg(*m_tree);
+        }
+        std::cout << " after initialize events " << nentries << std::endl;
+
+        m_selectors.resize(Muon::MuonStationIndex::ChIndexMax);  // initialzie all the selectors
+        m_selectors[Muon::MuonStationIndex::BIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::BIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::BMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::BML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::BOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::BOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::BEE] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EIS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EIL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EMS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EML] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EOS] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EOL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EES] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+        m_selectors[Muon::MuonStationIndex::EEL] = MuonHough::MuonLayerHoughSelector({std::make_pair(0, 1.9)});
+
+        if (m_DEBUG) nentries = 200;  // for debugging purpose
+        for (Long64_t evt = 0; evt < nentries; ++evt) {
+            if (evt % 1000 == 0) std::cout << "event: " << evt << std::endl;
+            m_tree->LoadTree(evt);
+            m_tree->GetEntry(evt);
+            m_event.reset();  // event data
+            m_muons.clear();
+            m_segs.clear();
+            if (!m_ntuple.read(m_event, m_muons)) {
+                std::cout << "oops bad event: " << evt << std::endl;
+                continue;
             }
-            plotMaximum_roi.push_back(maximum);
-          }
-          if(truthMaximumFound ){
-	   	      maxset.insert(sit->first.sector());
-            m_hMaximaHeightPerChIndex[chIndex]->Truth->Fill( truthMaximum.theta, truthMaximum.max);
-            if(!plotMaximum_roi_truth.empty() && plotMaximum_roi_truth.back().refchIndex ==  truthMaximum.refchIndex && plotMaximum_roi_truth.back().max <=  truthMaximum.max) {
-              plotMaximum_roi_truth.pop_back();
+            if (m_DEBUG_seg && !m_ntuple.readseg(m_segs)) {
+                std::cout << "oops bad segment: " << evt << std::endl;
+                continue;
             }
-            plotMaximum_roi_truth.push_back(truthMaximum);            
-          }
-          if(recoMaximumFound && truthMaximumFound){
-		          if (fabs(truthMaximum.theta - maximum.theta) < 0.1){
-              m_hMaximaHeightPerChIndex[chIndex]->Matched->Fill( truthMaximum.theta, truthMaximum.max);
-              m_hMaximaHeightPerChIndex[chIndex]->Diff->Fill(truthMaximum.theta, truthMaximum.max - maximum.max);
-	          }
-            else{
-              m_hMaximaHeightPerChIndex[chIndex]->Unmatched->Fill( maximum.theta, maximum.max);
+            if (m_DEBUG_seg) {
+                for (auto seg = m_segs.begin(); seg != m_segs.end(); seg++) {
+                    TVector3 globalPos(seg->sposx, seg->sposy, seg->sposz);
+                    TVector3 globalDir(seg->sdirx, seg->sdiry, seg->sdirz);
+                    // has to do a transformation here to calcualte! or the phi effect is in
+                    double globalPos_theta = globalPos.Theta();
+                    double globalDir_theta = globalDir.Theta();
+                    std::cout << " @@truth segment "
+                              << " sector " << seg->sSector << " chamber " << seg->sChIndex << " r " << globalPos.Perp() << " z "
+                              << globalPos.Z() << " postheta " << globalPos_theta << " dirtheta " << M_PI - globalDir_theta << std::endl;
+                }
             }
-		      }
-        }//end of looping layers
-      }//end of looping through sectors; end of sit loop
-      plotMaximum.push_back(plotMaximum_roi);
-      plotMaximum_truth.push_back(plotMaximum_roi_truth);
-    }//end of looping through data event
-
-	  //if (maxset.size() != 2) return;//this is when we didn't find 2 maximum for truth; no ROI is found
-    int sectorAlreadyDrawn = -1;
-    for(auto sit = plotRegion.begin(); sit != plotRegion.end(); ++sit ){
-      DataIndex index(*sit);
-      if( index.layer() == 2 ) continue;//just to save output size; could be removed
-      if (sectorAlreadyDrawn == index.sector()) continue; 
-      sectorAlreadyDrawn = index.sector();
-      MuonLayerHough& hough = detectorHough.hough(index.sector(),index.region(),index.layer());
-      
-      
-      TString prefix = "Event_";
-      prefix += m_ncalls;
-      prefix += "_Sector_";
-      prefix += index.sector();
-      prefix += "_Region_";
-      prefix += index.region();
-      prefix += "_Layer_";
-      prefix += index.layer();
-
-      if (m_DEBUG){
-        std::cout << "DEBUG " << prefix.Data() << std::endl;
-        hough.rootHistos(prefix.Data());
-        drawSector(index.region(),index.sector(),data[index.sector()],detectorHough,detectorHoughTruth);
-      }
-    }
-
-    //interate over the maximums
-    for(int i=0; i < int(plotMaximum.size()); i++){
 
-      TH1F* h_dtheta_temp = new TH1F("thetavalues", "theta values of this current cluster", 628, -M_PI, M_PI);
-      for(int j=0; j < int(plotMaximum[i].size()); j++){
-        h_dtheta_temp->Fill(plotMaximum[i][j].theta);
-      }
-
-      m_h_dtheta->Fill(h_dtheta_temp->GetRMS());//the rms of dthetas
-      delete h_dtheta_temp;//remove the pinter
+            if (m_DEBUG) std::cout << "DEBUG: start analyse event evt " << evt << std::endl;
+            analysis(m_event.sectors);
+            ++m_ncalls;
+        }
+        finalize();
+    }
 
-      //linear extrapolation
-      if (int(plotMaximum[i].size()) < 3){continue;}//just add protection
+    void LayerAnalysis::initialize() {
+        SetStyle();
+        m_h_dtheta = new TH1F("dtheta", "RMS of the #Delta #theta for each clutser; #theta RMS", 315, -0.01, M_PI);
+        m_h_dtheta_truth = new TH1F("dtheta_truth", "RMS of the #Delta #theta for each truth clutser; #theta RMS", 315, -M_PI, M_PI);
+        m_hMaximaHeightPerChIndex.resize(Muon::MuonStationIndex::ChIndexMax);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BIS] = new Plots("max_BIS", /* 20, 0, 10000,*/ 16, 0, 3.2, 15, 0, 15);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BIL] = new Plots("max_BIL", /* 20, 0, 10000,*/ 16, 0, 3.2, 15, 0, 15);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BMS] = new Plots("max_BMS", /* 24, 0, 12000,*/ 16, 0, 3.2, 20, 0, 20);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BML] = new Plots("max_BML", /* 24, 0, 12000,*/ 16, 0, 3.2, 20, 0, 20);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BOS] = new Plots("max_BOS", /* 30, 0, 15000,*/ 16, 0, 3.2, 15, 0, 15);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BOL] = new Plots("max_BOL", /* 30, 0, 15000,*/ 16, 0, 3.2, 15, 0, 15);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::BEE] = new Plots("max_BEE", /*100, 0, 40000,*/ 16, 0, 3.2, 25, 0, 25);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EIS] = new Plots("max_EIS", /* 16, 0,  8000,*/ 16, 0, 3.2, 15, 0, 15);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EIL] = new Plots("max_EIL", /* 16, 0,  8000,*/ 16, 0, 3.2, 15, 0, 15);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EMS] = new Plots("max_EMS", /* 30, 0, 15000,*/ 16, 0, 3.2, 30, 0, 30);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EML] = new Plots("max_EML", /* 30, 0, 15000,*/ 16, 0, 3.2, 30, 0, 30);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EOS] = new Plots("max_EOS", /* 30, 0, 15000,*/ 16, 0, 3.2, 10, 0, 10);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EOL] = new Plots("max_EOL", /* 30, 0, 15000,*/ 16, 0, 3.2, 10, 0, 10);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EES] = new Plots("max_EES", /*100, 0, 40000,*/ 16, 0, 3.2, 25, 0, 25);
+        m_hMaximaHeightPerChIndex[Muon::MuonStationIndex::EEL] = new Plots("max_EEL", /*100, 0, 40000,*/ 16, 0, 3.2, 25, 0, 25);
+
+        float diffbins = 800;
+        float diffxmax = 3000;
+        m_h_diff_MI_e = new TH1F("h_diff_MI_endcap", "h_diff_MI_endcap; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MO_e = new TH1F("h_diff_MO_endcap", "h_diff_MO_endcap; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MI_b = new TH1F("h_diff_MI_barrel", "h_diff_MI_barrel; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MO_b = new TH1F("h_diff_MO_barrel", "h_diff_MO_barrel; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MI_e_truth = new TH1F("h_diff_MI_endcap_truth", "h_diff_MI_endcap_truth; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MO_e_truth = new TH1F("h_diff_MO_endcap_truth", "h_diff_MO_endcap_truth; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MI_b_truth = new TH1F("h_diff_MI_barrel_truth", "h_diff_MI_barrel_truth; diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_diff_MO_b_truth = new TH1F("h_diff_MO_barrel_truth", "h_diff_MO_barrel_truth; diff, mm", diffbins, -diffxmax, diffxmax);
+        // exptaploated plots
+        // diffbins = 100; diffxmax = 0.5;
+        m_h_expt_MI_e = new TH1F("h_expt_MI_endcap", "h_expt_MI_endcap; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MO_e = new TH1F("h_expt_MO_endcap", "h_expt_MO_endcap; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MI_b = new TH1F("h_expt_MI_barrel", "h_expt_MI_barrel; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MO_b = new TH1F("h_expt_MO_barrel", "h_expt_MO_barrel; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MI_e_truth =
+            new TH1F("h_expt_MI_endcap_truth", "h_expt_MI_endcap_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MO_e_truth =
+            new TH1F("h_expt_MO_endcap_truth", "h_expt_MO_endcap_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MI_b_truth =
+            new TH1F("h_expt_MI_barrel_truth", "h_expt_MI_barrel_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        m_h_expt_MO_b_truth =
+            new TH1F("h_expt_MO_barrel_truth", "h_expt_MO_barrel_truth; extrapolated diff, mm", diffbins, -diffxmax, diffxmax);
+        // compare the two extrapolations
+        float compbins = 800;
+        float compxmax = 1500;
+        m_h_comp_MI_e = new TH1F("h_comp_MI_endcap", "h_comp_MI_endcap; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MO_e = new TH1F("h_comp_MO_endcap", "h_comp_MO_endcap; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MI_b = new TH1F("h_comp_MI_barrel", "h_comp_MI_barrel; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MO_b = new TH1F("h_comp_MO_barrel", "h_comp_MO_barrel; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MI_e_truth =
+            new TH1F("h_comp_MI_endcap_truth", "h_comp_MI_endcap_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MO_e_truth =
+            new TH1F("h_comp_MO_endcap_truth", "h_comp_MO_endcap_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MI_b_truth =
+            new TH1F("h_comp_MI_barrel_truth", "h_comp_MI_barrel_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        m_h_comp_MO_b_truth =
+            new TH1F("h_comp_MO_barrel_truth", "h_comp_MO_barrel_truth; two extrapolation diff, mm", compbins, -compxmax, compxmax);
+        // set basic settings
+        m_DEBUG = false;      // for understanding output
+        m_DEBUG_seg = false;  // for more debug output
+    }
 
-      double diff_MI = 0; 
-      double diff_MO = 0; 
-      double expt_MI = 0; 
-      double expt_MO = 0;
+    void LayerAnalysis::analysis(std::map<int, SectorData>& data) {
+        MuonDetectorHough detectorHough;
+        MuonDetectorHough detectorHoughTruth;
+        detectorHough.reset();
+        detectorHoughTruth.reset();
+        std::set<DataIndex> plotRegion;
+        std::vector<std::vector<MuonLayerHough::Maximum>> plotMaximum;        // save the maximum information here
+        std::vector<std::vector<MuonLayerHough::Maximum>> plotMaximum_truth;  // save the maximum information here
+        std::set<int> maxset;
+        if (m_DEBUG) std::cout << "DEBUG: the size of this data event(ROI) " << data.size() << std::endl;
+        for (std::map<int, SectorData>::const_iterator it = data.begin(); it != data.end(); ++it) {  // looping through region?
+            if (m_DEBUG) std::cout << "DEBUG: the size of the hit clusters in this ROI is " << it->second.size() << std::endl;
+            std::vector<MuonLayerHough::Maximum> plotMaximum_roi;
+            std::vector<MuonLayerHough::Maximum> plotMaximum_roi_truth;
+            for (SectorData::const_iterator sit = it->second.begin(); sit != it->second.end();
+                 ++sit) {                                                                  // looping the dataindex--first, hitlist--second
+                Muon::MuonStationIndex::DetectorRegionIndex region = sit->first.region();  // EndcapA, Barrel, EndcapC,
+                Muon::MuonStationIndex::LayerIndex layer = sit->first.layer();             // Inner, Middle, Outer, Extended, BarrelExtended
+
+                if (sit->first.layer() > Muon::MuonStationIndex::LayerIndexMax) continue;
+                MuonLayerHough& hough = detectorHough.hough(sit->first.sector(), region, layer);
+                MuonLayerHough& houghTruth = detectorHoughTruth.hough(sit->first.sector(), region, layer);
+
+                int chIndex =
+                    hough.m_descriptor.chIndex;  // BIS, BIL, BMS, BML, BOS, BOL, BEE(6), EIS, EIL, EMS, EML, EOS, EOL, EES, EEL, CSS, CSL,
+
+                if (m_DEBUG)
+                    std::cout << "DEBUG: start new cluster; position: sector " << sit->first.sector() << " region(A/B/C) " << region
+                              << " layer: " << layer << " chindex: " << chIndex << " && number of the hits in this cluster is "
+                              << sit->second.size() << std::endl;
+                // start to looping over layers for this sector
+                for (int iLayer = 0; iLayer < getMaxLayers(region, sit->first.sector());
+                     iLayer++) {             // Inner, Middle, Outer, Extended, BarrelExtended
+                    std::vector<Hit*> hits;  // list of hits: hitlist--second
+                    std::vector<Hit*> hitsTruth;
+                    for (HitList::const_iterator hit = sit->second.begin(); hit != sit->second.end();
+                         ++hit) {                                            // start looping the hits in the layer
+                        if ((*hit)->debugInfo()->layer != iLayer) continue;  // keeping only hits in this layer
+                        hits.push_back(*hit);
+                        if (abs((*hit)->debugInfo()->pdgId) == 13) {  // this is a muon hit!
+                            hitsTruth.push_back(*hit);
+                        }
+                    }                                  // end of lopoing all the hits
+                    hough.setDebug(false);             // to supress output level
+                    hough.fillLayer2(hits);            // fill all the layers with the weight
+                    houghTruth.fillLayer2(hitsTruth);  // fill all the layers with the weight
+                    MuonLayerHough::Maximum maximum;   // this is the maximum of this one layer
+                    bool recoMaximumFound = hough.findMaximum(maximum, m_selectors[hough.m_descriptor.chIndex]);
+                    MuonLayerHough::Maximum truthMaximum;  // this is the truth maximum of this one layer
+                    bool truthMaximumFound = houghTruth.findMaximum(truthMaximum, m_selectors[hough.m_descriptor.chIndex]);
+
+                    // fill the max information corresponding histograms
+                    if (recoMaximumFound) {
+                        m_hMaximaHeightPerChIndex[chIndex]->Reco->Fill(maximum.theta, maximum.max);
+                        plotRegion.insert(sit->first.key());
+                        if (!plotMaximum_roi.empty() && plotMaximum_roi.back().refchIndex == maximum.refchIndex &&
+                            plotMaximum_roi.back().max <= maximum.max) {
+                            plotMaximum_roi.pop_back();  // save only the largest maximum
+                        }
+                        plotMaximum_roi.push_back(maximum);
+                    }
+                    if (truthMaximumFound) {
+                        maxset.insert(sit->first.sector());
+                        m_hMaximaHeightPerChIndex[chIndex]->Truth->Fill(truthMaximum.theta, truthMaximum.max);
+                        if (!plotMaximum_roi_truth.empty() && plotMaximum_roi_truth.back().refchIndex == truthMaximum.refchIndex &&
+                            plotMaximum_roi_truth.back().max <= truthMaximum.max) {
+                            plotMaximum_roi_truth.pop_back();
+                        }
+                        plotMaximum_roi_truth.push_back(truthMaximum);
+                    }
+                    if (recoMaximumFound && truthMaximumFound) {
+                        if (fabs(truthMaximum.theta - maximum.theta) < 0.1) {
+                            m_hMaximaHeightPerChIndex[chIndex]->Matched->Fill(truthMaximum.theta, truthMaximum.max);
+                            m_hMaximaHeightPerChIndex[chIndex]->Diff->Fill(truthMaximum.theta, truthMaximum.max - maximum.max);
+                        } else {
+                            m_hMaximaHeightPerChIndex[chIndex]->Unmatched->Fill(maximum.theta, maximum.max);
+                        }
+                    }
+                }  // end of looping layers
+            }      // end of looping through sectors; end of sit loop
+            plotMaximum.push_back(plotMaximum_roi);
+            plotMaximum_truth.push_back(plotMaximum_roi_truth);
+        }  // end of looping through data event
+
+        // if (maxset.size() != 2) return;//this is when we didn't find 2 maximum for truth; no ROI is found
+        int sectorAlreadyDrawn = -1;
+        for (auto sit = plotRegion.begin(); sit != plotRegion.end(); ++sit) {
+            DataIndex index(*sit);
+            if (index.layer() == 2) continue;  // just to save output size; could be removed
+            if (sectorAlreadyDrawn == index.sector()) continue;
+            sectorAlreadyDrawn = index.sector();
+            MuonLayerHough& hough = detectorHough.hough(index.sector(), index.region(), index.layer());
+
+            TString prefix = "Event_";
+            prefix += m_ncalls;
+            prefix += "_Sector_";
+            prefix += index.sector();
+            prefix += "_Region_";
+            prefix += index.region();
+            prefix += "_Layer_";
+            prefix += index.layer();
+
+            if (m_DEBUG) {
+                std::cout << "DEBUG " << prefix.Data() << std::endl;
+                hough.rootHistos(prefix.Data());
+                drawSector(index.region(), index.sector(), data[index.sector()], detectorHough, detectorHoughTruth);
+            }
+        }
 
-      if (!m_DEBUG){
-        diff_MI = linear_extrapolate(plotMaximum[i][1], plotMaximum[i][0]);
-        diff_MO = linear_extrapolate(plotMaximum[i][1], plotMaximum[i][2]);
-        expt_MI = parab_extrapolate(plotMaximum[i][1], plotMaximum[i][0]);
-        expt_MO = parab_extrapolate(plotMaximum[i][1], plotMaximum[i][2]);
+        // interate over the maximums
+        for (int i = 0; i < int(plotMaximum.size()); i++) {
+            TH1F* h_dtheta_temp = new TH1F("thetavalues", "theta values of this current cluster", 628, -M_PI, M_PI);
+            for (int j = 0; j < int(plotMaximum[i].size()); j++) { h_dtheta_temp->Fill(plotMaximum[i][j].theta); }
+
+            m_h_dtheta->Fill(h_dtheta_temp->GetRMS());  // the rms of dthetas
+            delete h_dtheta_temp;                       // remove the pinter
+
+            // linear extrapolation
+            if (int(plotMaximum[i].size()) < 3) { continue; }  // just add protection
+
+            double diff_MI = 0;
+            double diff_MO = 0;
+            double expt_MI = 0;
+            double expt_MO = 0;
+
+            if (!m_DEBUG) {
+                diff_MI = linear_extrapolate(plotMaximum[i][1], plotMaximum[i][0]);
+                diff_MO = linear_extrapolate(plotMaximum[i][1], plotMaximum[i][2]);
+                expt_MI = parab_extrapolate(plotMaximum[i][1], plotMaximum[i][0]);
+                expt_MO = parab_extrapolate(plotMaximum[i][1], plotMaximum[i][2]);
+
+                if (plotMaximum[i][1].refregion == 1) {
+                    m_h_diff_MI_b->Fill(diff_MI);
+                    m_h_diff_MO_b->Fill(diff_MO);
+                    m_h_expt_MI_b->Fill(expt_MI);
+                    m_h_expt_MO_b->Fill(expt_MO);
+                    m_h_comp_MI_b->Fill(fabs(diff_MI) - fabs(expt_MI));
+                    m_h_comp_MO_b->Fill(fabs(diff_MO) - fabs(expt_MO));
+                } else {
+                    m_h_diff_MI_e->Fill(diff_MI);
+                    m_h_diff_MO_e->Fill(diff_MO);
+                    m_h_expt_MI_e->Fill(expt_MI);
+                    m_h_expt_MO_e->Fill(expt_MO);
+                    m_h_comp_MI_e->Fill(fabs(diff_MI) - fabs(expt_MI));
+                    m_h_comp_MO_e->Fill(fabs(diff_MO) - fabs(expt_MO));
+                }
+            }
+        }
 
-        if(plotMaximum[i][1].refregion == 1) { 
+        // interate over the truth maximums
+        for (int i = 0; i < int(plotMaximum_truth.size()); i++) {
+            TH1F* h_dtheta_temp = new TH1F("thetavalues", "theta values of this current cluster", 628, -M_PI, M_PI);
+            if (m_DEBUG) std::cout << "DEBUG: maximum found ! " << std::endl;
+            for (int j = 0; j < int(plotMaximum_truth[i].size()); j++) {
+                if (m_DEBUG)
+                    std::cout << "DEBUG: maximum " << j << " theta " << plotMaximum_truth[i][j].getGlobalTheta() << " max "
+                              << plotMaximum_truth[i][j].max << " pos " << plotMaximum_truth[i][j].pos << " refpos "
+                              << plotMaximum_truth[i][j].refpos << " refchIndex " << plotMaximum_truth[i][j].refchIndex << " binpos "
+                              << plotMaximum_truth[i][j].binpos << " binposmin " << plotMaximum_truth[i][j].binposmin << " binposmax "
+                              << plotMaximum_truth[i][j].binposmax << std::endl;
+                h_dtheta_temp->Fill(plotMaximum_truth[i][j].theta);
+            }
+            delete h_dtheta_temp;  // remove the pinter
+
+            if (int(plotMaximum_truth[i].size()) < 3) { continue; }  // just add protection
+            double diff_MI_truth = 0;
+            double diff_MO_truth = 0;
+            double expt_MI_truth = 0;
+            double expt_MO_truth = 0;
+            if (true) {  // fill the truth informations; always for now
+                if (plotMaximum_truth[i][1].hough->m_descriptor.chIndex < 2) {
+                    continue;
+                }  // this is extrapolating from BI outwards, won't work
+                diff_MI_truth = linear_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][0]);
+                diff_MO_truth = linear_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][2]);
+                expt_MI_truth = parab_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][0]);
+                expt_MO_truth = parab_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][2]);
+                if (plotMaximum_truth[i][1].refregion == 1) {  // all in barrel
+
+                    m_h_diff_MI_b_truth->Fill(diff_MI_truth);
+                    m_h_diff_MO_b_truth->Fill(diff_MO_truth);
+                    m_h_expt_MI_b_truth->Fill(expt_MI_truth);
+                    m_h_expt_MO_b_truth->Fill(expt_MO_truth);
+                    m_h_comp_MI_b_truth->Fill(fabs(diff_MI_truth) - fabs(expt_MI_truth));
+                    m_h_comp_MO_b_truth->Fill(fabs(diff_MO_truth) - fabs(expt_MO_truth));
+                } else {  // all not in barrel
+                    m_h_diff_MI_e_truth->Fill(diff_MI_truth);
+                    m_h_diff_MO_e_truth->Fill(diff_MO_truth);
+                    m_h_expt_MI_e_truth->Fill(expt_MI_truth);
+                    m_h_expt_MO_e_truth->Fill(expt_MO_truth);
+                    m_h_comp_MI_e_truth->Fill(fabs(diff_MI_truth) - fabs(expt_MI_truth));
+                    m_h_comp_MO_e_truth->Fill(fabs(diff_MO_truth) - fabs(expt_MO_truth));
+                }
+            }
+            if (m_DEBUG)
+                std::cout << "**** compare two extrapolations! inner region: " << plotMaximum_truth[i][0].refregion
+                          << " parabolic: " << expt_MI_truth << " linear: " << diff_MI_truth << std::endl;
 
-          m_h_diff_MI_b->Fill(diff_MI);
-          m_h_diff_MO_b->Fill(diff_MO);
-          m_h_expt_MI_b->Fill(expt_MI);
-          m_h_expt_MO_b->Fill(expt_MO);
-          m_h_comp_MI_b->Fill(fabs(diff_MI) - fabs(expt_MI));
-          m_h_comp_MO_b->Fill(fabs(diff_MO) - fabs(expt_MO));
+            if (m_DEBUG)
+                std::cout << "**** compare two extrapolations! outer region: " << plotMaximum_truth[i][2].refregion
+                          << " parabolic: " << expt_MO_truth << " linear: " << diff_MO_truth << std::endl;
         }
-        else{ 
-          m_h_diff_MI_e->Fill(diff_MI);
-          m_h_diff_MO_e->Fill(diff_MO);
-          m_h_expt_MI_e->Fill(expt_MI);
-          m_h_expt_MO_e->Fill(expt_MO);
-          m_h_comp_MI_e->Fill(fabs(diff_MI) - fabs(expt_MI));
-          m_h_comp_MO_e->Fill(fabs(diff_MO) - fabs(expt_MO));
-        }
-      }
     }
 
-
-
-    //interate over the truth maximums
-    for(int i=0; i < int(plotMaximum_truth.size()); i++){
-      TH1F* h_dtheta_temp = new TH1F("thetavalues", "theta values of this current cluster", 628, -M_PI, M_PI);
-      if (m_DEBUG) std::cout << "DEBUG: maximum found ! " << std::endl;
-      for(int j=0; j < int(plotMaximum_truth[i].size()); j++){
-        if (m_DEBUG) std::cout << "DEBUG: maximum " << j << " theta " << plotMaximum_truth[i][j].getGlobalTheta() << " max " << plotMaximum_truth[i][j].max 
-            << " pos " << plotMaximum_truth[i][j].pos  << " refpos " << plotMaximum_truth[i][j].refpos  << " refchIndex " << plotMaximum_truth[i][j].refchIndex << " binpos " << plotMaximum_truth[i][j].binpos
-            << " binposmin " << plotMaximum_truth[i][j].binposmin  << " binposmax " << plotMaximum_truth[i][j].binposmax
-            << std::endl;
-        h_dtheta_temp->Fill(plotMaximum_truth[i][j].theta);
-      }
-      delete h_dtheta_temp;//remove the pinter
-
-      if (int(plotMaximum_truth[i].size()) < 3){continue;}//just add protection
-      double diff_MI_truth = 0; 
-      double diff_MO_truth = 0; 
-      double expt_MI_truth = 0; 
-      double expt_MO_truth = 0;
-      if (true){//fill the truth informations; always for now
-        if (plotMaximum_truth[i][1].hough->m_descriptor.chIndex < 2){continue;}//this is extrapolating from BI outwards, won't work
-        diff_MI_truth = linear_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][0]);
-        diff_MO_truth = linear_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][2]);
-        expt_MI_truth = parab_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][0]);
-        expt_MO_truth = parab_extrapolate(plotMaximum_truth[i][1], plotMaximum_truth[i][2]);
-        if(plotMaximum_truth[i][1].refregion == 1) { //all in barrel
-          
-          m_h_diff_MI_b_truth->Fill(diff_MI_truth);
-          m_h_diff_MO_b_truth->Fill(diff_MO_truth);
-          m_h_expt_MI_b_truth->Fill(expt_MI_truth);
-          m_h_expt_MO_b_truth->Fill(expt_MO_truth);
-          m_h_comp_MI_b_truth->Fill(fabs(diff_MI_truth) - fabs(expt_MI_truth));
-          m_h_comp_MO_b_truth->Fill(fabs(diff_MO_truth) - fabs(expt_MO_truth));
+    void LayerAnalysis::drawSector(int region, int sector, SectorData& data, MuonDetectorHough& detectorHough,
+                                   MuonDetectorHough& detectorHoughTruth) const {
+        TString canvasName = Form("event_%i_sector_%i,_display_%i", m_ncalls, sector, region);
+        TCanvas canvas0(canvasName, canvasName, 1500, 1100);
+        canvas0.cd();
+        TString histName = Form("hist_%s", canvasName.Data());
+        TH1F* hist = nullptr;
+        if (region == 1)
+            hist = new TH1F(histName, histName, 100, -13000, 13000);
+        else if (region == 0)
+            hist = new TH1F(histName, histName, 100, -25000, -6500);
+        else if (region == 2)
+            hist = new TH1F(histName, histName, 100, 6500, 25000);
+        hist->SetMinimum(0);
+        hist->SetMaximum(12000);
+        hist->Draw();
+        std::vector<double> min(3, 1e9);
+        std::vector<double> max(3, -1e9);
+        std::vector<double> rmin(3, 1e9);
+        std::vector<double> rmax(3, -1e9);
+        std::vector<std::vector<TObject*>> shapes(3);
+        unsigned int ntubes(0);
+        unsigned int nstrips(0);
+
+        // loop over layers in sector
+        for (SectorData::const_iterator it = data.begin(); it != data.end(); ++it) {
+            // only consider the selected region
+            if (it->first.region() != region) continue;
+            // loop over hits
+            for (HitList::const_iterator hit_it = it->second.begin(); hit_it != it->second.end(); ++hit_it) {
+                Hit& hit = **hit_it;
+                HitDebugInfo* debug = hit.debugInfo();
+                if (!debug) continue;
+                int layer = debug->layer;
+                if (layer > 2) continue;
+                // number of layers per multi layer
+                if (abs(debug->pdgId) == 13) {
+                    if (hit.ymin < min[layer]) min[layer] = hit.ymin;
+                    if (hit.ymax > max[layer]) max[layer] = hit.ymax;
+                    if (hit.x < rmin[layer]) rmin[layer] = hit.x;
+                    if (hit.x > rmax[layer]) rmax[layer] = hit.x;
+                }
+                if (debug->type == 0) {
+                    double y = (hit.ymax + hit.ymin) * 0.5;
+                    double x = hit.x;
+                    double radius = debug->r;
+                    if (radius < 1) radius = 1;
+                    TEllipse* tube = new TEllipse(x, y, radius);
+                    shapes[layer].push_back(tube);
+                    tube->SetLineColor(1);
+                    tube->SetLineWidth(3);
+                    tube->SetFillStyle(1001);
+                    tube->SetFillColor(1);
+                    if (abs(debug->pdgId) == 13) {
+                        tube->SetLineColor(2);
+                        tube->SetFillColor(2);
+                        tube->SetLineWidth(5);
+                    }
+                    tube->Draw("SAME");
+                    ++ntubes;
+                } else {
+                    TLine* box = new TLine(hit.x, hit.ymin - 5, hit.x, hit.ymax + 5);
+                    int color = 1;
+                    box->SetLineColor(color);
+                    box->SetLineWidth(3);
+                    box->Draw("SAME");
+                    if (abs(debug->pdgId) == 13) {
+                        box->SetLineColor(2);
+                        box->SetLineWidth(5);
+                    }
+                    shapes[layer].push_back(box);
+                    ++nstrips;
+                }
+            }
         }
-        else{ //all not in barrel
-          m_h_diff_MI_e_truth->Fill(diff_MI_truth);
-          m_h_diff_MO_e_truth->Fill(diff_MO_truth);
-          m_h_expt_MI_e_truth->Fill(expt_MI_truth);
-          m_h_expt_MO_e_truth->Fill(expt_MO_truth);
-          m_h_comp_MI_e_truth->Fill(fabs(diff_MI_truth) - fabs(expt_MI_truth));
-          m_h_comp_MO_e_truth->Fill(fabs(diff_MO_truth) - fabs(expt_MO_truth));
+
+        canvas0.Draw();
+        canvas0.Update();
+        canvas0.Write();
+
+        canvasName += "_hough";
+        TCanvas canvas(canvasName, canvasName, 1000, 1000);
+        Muon::MuonStationIndex::DetectorRegionIndex region_index =
+            static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region);  // have to convert type...
+        const int iLayers = getMaxLayers(region_index, sector);                // be careful here, only loop through the correct layers
+
+        canvas.Divide(1, iLayers);
+        for (int i = 0; i < iLayers; ++i) {
+            canvas.cd(i + 1);
+            MuonLayerHough& hough = detectorHough.hough(sector, static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region),
+                                                        static_cast<Muon::MuonStationIndex::LayerIndex>(i));
+            std::vector<TH1*> hists = hough.rootHistos(canvasName.Data());
+            MuonLayerHough& houghTruth = detectorHoughTruth.hough(sector, static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region),
+                                                                  static_cast<Muon::MuonStationIndex::LayerIndex>(i));
+            std::vector<TH1*> histsTruth = houghTruth.rootHistos((canvasName + "_T").Data());
+            int pos = hists.size() * 0.5;
+            float maximum = std::max(hists[pos]->GetMaximum(), histsTruth[pos]->GetMaximum()) * 1.2;
+            hists[pos]->SetMaximum(maximum);
+            hists[pos]->SetLineColor(1);
+            hists[pos]->SetFillStyle(3244);
+            hists[pos]->SetFillColor(1);
+            hists[pos]->Draw();
+            histsTruth[pos]->SetLineColor(2);
+            histsTruth[pos]->Draw("SAME");
         }
-      }
-      if (m_DEBUG) std::cout << "**** compare two extrapolations! inner region: " << plotMaximum_truth[i][0].refregion 
-      << " parabolic: " << expt_MI_truth
-      << " linear: " << diff_MI_truth
-      << std::endl;
-
-      if (m_DEBUG) std::cout << "**** compare two extrapolations! outer region: " << plotMaximum_truth[i][2].refregion 
-      << " parabolic: " << expt_MO_truth
-      << " linear: " << diff_MO_truth
-      << std::endl;
-     
+        canvas.Draw();
+        canvas.Update();
+        canvas.Write();
     }
-  }
-
-
-  void LayerAnalysis::drawSector( int region, int sector, SectorData& data, MuonDetectorHough& detectorHough, MuonDetectorHough& detectorHoughTruth ) const {
- 
-    TString canvasName = Form("event_%i_sector_%i,_display_%i", m_ncalls, sector, region);
-    TCanvas canvas0(canvasName,canvasName,1500,1100);
-    canvas0.cd();
-    TString histName = Form("hist_%s", canvasName.Data());
-    TH1F* hist = nullptr;
-    if( region == 1 )       hist = new TH1F(histName,histName,100,-13000,13000);
-    else if( region == 0 )  hist = new TH1F(histName,histName,100,-25000,-6500);
-    else if( region == 2 )  hist = new TH1F(histName,histName,100,6500,25000);
-    hist->SetMinimum(0);
-    hist->SetMaximum(12000);
-    hist->Draw();
-    std::vector< double > min(3,1e9);
-    std::vector< double > max(3,-1e9);
-    std::vector< double > rmin(3,1e9);
-    std::vector< double > rmax(3,-1e9);
-    std::vector< std::vector<TObject*> > shapes(3);
-    unsigned int ntubes(0);
-    unsigned int nstrips(0);
-
-    // loop over layers in sector
-    for(SectorData::const_iterator it = data.begin();it!=data.end();++it ){
-      // only consider the selected region
-      if( it->first.region() != region ) continue;
-      // loop over hits
-      for(HitList::const_iterator hit_it = it->second.begin(); hit_it != it->second.end();++hit_it ){
-        Hit& hit = **hit_it;
-        HitDebugInfo* debug = hit.debugInfo();
-        if( !debug ) continue;	
-        int layer = debug->layer;
-        if( layer > 2 ) continue;
-        // number of layers per multi layer
-        if( abs(debug->pdgId) == 13 ){
-          if( hit.ymin < min[layer] ) min[layer] = hit.ymin;
-          if( hit.ymax > max[layer] ) max[layer] = hit.ymax;
-          if( hit.x < rmin[layer] ) rmin[layer] = hit.x;
-          if( hit.x > rmax[layer] ) rmax[layer] = hit.x;
-        }
-        if( debug->type == 0 ){        
-          double y = (hit.ymax+hit.ymin)*0.5;
-          double x = hit.x;
-          double radius = debug->r;
-          if(radius<1 ) radius = 1;
-          TEllipse* tube = new TEllipse(x,y,radius); 
-          shapes[layer].push_back(tube);
-          tube->SetLineColor(1);
-          tube->SetLineWidth(3);
-          tube->SetFillStyle(1001);
-          tube->SetFillColor(1);
-          if( abs(debug->pdgId) == 13 ) {
-            tube->SetLineColor(2);
-            tube->SetFillColor(2);
-            tube->SetLineWidth(5);
-          }
-          tube->Draw("SAME");
-          ++ntubes;
-        }
-        else{
-          TLine* box = new TLine(hit.x,hit.ymin-5,hit.x,hit.ymax+5);
-          int color = 1;
-          box->SetLineColor(color);
-          box->SetLineWidth(3);
-          box->Draw("SAME");
-          if( abs(debug->pdgId) == 13 ) {
-            box->SetLineColor(2);
-            box->SetLineWidth(5);
-          }
-          shapes[layer].push_back(box);
-          ++nstrips;
+
+    void LayerAnalysis::finalize() {
+        for (auto* Plot : m_hMaximaHeightPerChIndex) {
+            if (Plot == nullptr) continue;
+            calculateVariables(Plot);  // for calculation efficiencies
+            delete Plot->Reco;
+            delete Plot->Truth;
+            delete Plot->Matched;
+            delete Plot->Efficiency;
+            delete Plot->FakeEfficiency;
+            delete Plot->Diff;
         }
-      }
-    } 
-
-    canvas0.Draw();
-    canvas0.Update();
-    canvas0.Write();
-
-    canvasName += "_hough";
-    TCanvas canvas(canvasName,canvasName,1000,1000);
-    Muon::MuonStationIndex::DetectorRegionIndex region_index = static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region);//have to convert type...
-    const int iLayers = getMaxLayers(region_index, sector);//be careful here, only loop through the correct layers
-
-    canvas.Divide(1,iLayers);
-    for( int i=0;i < iLayers;++i){
-      canvas.cd(i+1);
-      MuonLayerHough& hough = detectorHough.hough(sector,static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region), static_cast<Muon::MuonStationIndex::LayerIndex>(i));
-      std::vector<TH1*> hists = hough.rootHistos(canvasName.Data());
-      MuonLayerHough& houghTruth = detectorHoughTruth.hough(sector,static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region), static_cast<Muon::MuonStationIndex::LayerIndex>(i));
-      std::vector<TH1*> histsTruth = houghTruth.rootHistos((canvasName+"_T").Data());
-      int pos = hists.size()*0.5;
-      float maximum = std::max(hists[pos]->GetMaximum(), histsTruth[pos]->GetMaximum())*1.2;
-      hists[pos]->SetMaximum(maximum);
-      hists[pos]->SetLineColor(1);
-      hists[pos]->SetFillStyle(3244);
-      hists[pos]->SetFillColor(1);
-      hists[pos]->Draw();
-      histsTruth[pos]->SetLineColor(2);
-      histsTruth[pos]->Draw("SAME");
+        // for tony plots
+        TCanvas c1("c1", "c1", 800, 700);
+        c1.SetLogy();
+        c1.cd();
+        m_h_dtheta->Draw();
+        m_h_dtheta->Write();
+        m_h_dtheta_truth->SetLineColor(2);
+        m_h_dtheta_truth->Draw("SAME");
+        m_h_dtheta_truth->Write();
+
+        finishplot(m_h_diff_MI_e);
+        finishplot(m_h_diff_MO_e);
+        finishplot(m_h_diff_MI_b);
+        finishplot(m_h_diff_MO_b);
+        finishplot(m_h_diff_MI_e_truth);
+        finishplot(m_h_diff_MO_e_truth);
+        finishplot(m_h_diff_MI_b_truth);
+        finishplot(m_h_diff_MO_b_truth);
+        finishplot(m_h_expt_MI_e);
+        finishplot(m_h_expt_MO_e);
+        finishplot(m_h_expt_MI_b);
+        finishplot(m_h_expt_MO_b);
+        finishplot(m_h_expt_MI_e_truth);
+        finishplot(m_h_expt_MO_e_truth);
+        finishplot(m_h_expt_MI_b_truth);
+        finishplot(m_h_expt_MO_b_truth);
+        finishplot(m_h_comp_MI_e);
+        finishplot(m_h_comp_MO_e);
+        finishplot(m_h_comp_MI_b);
+        finishplot(m_h_comp_MO_b);
+        finishplot(m_h_comp_MI_e_truth);
+        finishplot(m_h_comp_MO_e_truth);
+        finishplot(m_h_comp_MI_b_truth);
+        finishplot(m_h_comp_MO_b_truth);
     }
-    canvas.Draw();
-    canvas.Update();
-    canvas.Write();
-  }
-
-  void LayerAnalysis::finalize(){
-    for (auto *Plot : m_hMaximaHeightPerChIndex){
-      if (Plot == nullptr) continue;
-        calculateVariables(Plot);//for calculation efficiencies
-        delete Plot->Reco; delete Plot->Truth; delete Plot->Matched;
-        delete Plot->Efficiency; delete Plot->FakeEfficiency; delete Plot->Diff;
-    }
-    //for tony plots
-    TCanvas c1("c1","c1",800,700);
-    c1.SetLogy();
-    c1.cd();
-    m_h_dtheta->Draw();
-    m_h_dtheta->Write();
-    m_h_dtheta_truth->SetLineColor(2);
-    m_h_dtheta_truth->Draw("SAME");
-    m_h_dtheta_truth->Write();
-
-    finishplot(m_h_diff_MI_e);
-    finishplot(m_h_diff_MO_e);
-    finishplot(m_h_diff_MI_b);
-    finishplot(m_h_diff_MO_b);
-    finishplot(m_h_diff_MI_e_truth);
-    finishplot(m_h_diff_MO_e_truth);
-    finishplot(m_h_diff_MI_b_truth);
-    finishplot(m_h_diff_MO_b_truth);
-    finishplot(m_h_expt_MI_e);
-    finishplot(m_h_expt_MO_e);
-    finishplot(m_h_expt_MI_b);
-    finishplot(m_h_expt_MO_b);
-    finishplot(m_h_expt_MI_e_truth);
-    finishplot(m_h_expt_MO_e_truth);
-    finishplot(m_h_expt_MI_b_truth);
-    finishplot(m_h_expt_MO_b_truth);
-    finishplot(m_h_comp_MI_e);
-    finishplot(m_h_comp_MO_e);
-    finishplot(m_h_comp_MI_b);
-    finishplot(m_h_comp_MO_b);
-    finishplot(m_h_comp_MI_e_truth);
-    finishplot(m_h_comp_MO_e_truth);
-    finishplot(m_h_comp_MI_b_truth);
-    finishplot(m_h_comp_MO_b_truth);
-  }
-
-  void LayerAnalysis::calculateVariables(Plots* Plot){
-    TH1D* Reco      = Plot->Reco->ProjectionY();
-    TH1D* Truth     = Plot->Truth->ProjectionY(); 
-    TH1D* Matched   = Plot->Matched->ProjectionY();
-    TH1D* Unmatched = Plot->Unmatched->ProjectionY();
-    
-    int nBins = Truth->GetNbinsX();
-    for (int i = 1; i < nBins; ++i){
-      if (Truth->Integral(i,nBins) != 0) Plot->Efficiency->SetBinContent(i, Matched->Integral(i, nBins)/Truth->Integral(1, nBins ));
-      if (Reco->Integral(i,nBins)  != 0) Plot->FakeEfficiency->SetBinContent(i, Unmatched->Integral(i, nBins)/Reco->Integral(i,nBins));
+
+    void LayerAnalysis::calculateVariables(Plots* Plot) {
+        TH1D* Reco = Plot->Reco->ProjectionY();
+        TH1D* Truth = Plot->Truth->ProjectionY();
+        TH1D* Matched = Plot->Matched->ProjectionY();
+        TH1D* Unmatched = Plot->Unmatched->ProjectionY();
+
+        int nBins = Truth->GetNbinsX();
+        for (int i = 1; i < nBins; ++i) {
+            if (Truth->Integral(i, nBins) != 0) Plot->Efficiency->SetBinContent(i, Matched->Integral(i, nBins) / Truth->Integral(1, nBins));
+            if (Reco->Integral(i, nBins) != 0)
+                Plot->FakeEfficiency->SetBinContent(i, Unmatched->Integral(i, nBins) / Reco->Integral(i, nBins));
+        }
+
+        // clean up
+        delete Reco;
+        delete Truth;
+        delete Matched;
+        delete Unmatched;
     }
 
-    //clean up
-    delete Reco; delete Truth; delete Matched; delete Unmatched;
-  }
-
-  void LayerAnalysis::SetStyle(){
-    // use plain black on white colors
-    Int_t icol=0; // WHITE
-    gStyle->SetFrameBorderMode(icol);
-    gStyle->SetFrameFillColor(icol);
-    gStyle->SetCanvasBorderMode(icol);
-    gStyle->SetCanvasColor(icol);
-    gStyle->SetPadBorderMode(icol);
-    gStyle->SetPadColor(icol);
-    gStyle->SetStatColor(icol);
-    // set the paper & margin sizes
-    gStyle->SetPaperSize(20,26);
-    // set margin sizes
-    gStyle->SetPadTopMargin(0.09);
-    gStyle->SetPadRightMargin(0.12);
-    gStyle->SetPadBottomMargin(0.20);
-    gStyle->SetPadLeftMargin(0.14);
-    // set title offsets (for axis label)
-    gStyle->SetTitleXOffset(1.4);
-    gStyle->SetTitleYOffset(1.6);
-    // use large fonts
-    Int_t fontT=42; // Helvetica italics
-    Int_t font=42; // Helvetica
-    Double_t tsize=0.025;
-    gStyle->SetTextFont(font);
-    gStyle->SetTextSize(tsize);
-    gStyle->SetLabelFont(font,"x");
-    gStyle->SetTitleFont(fontT,"x");
-    gStyle->SetLabelFont(font,"y");
-    gStyle->SetTitleFont(fontT,"y");
-    gStyle->SetLabelFont(font,"z");
-    gStyle->SetTitleFont(fontT,"z");
-    gStyle->SetLabelSize(tsize,"x");
-    gStyle->SetLabelSize(tsize,"y");
-    gStyle->SetLabelSize(tsize,"z");
-    // use bold lines and markers
-    gStyle->SetMarkerStyle(20);
-    gStyle->SetMarkerSize(1.5);
-    gStyle->SetHistLineWidth(2.);
-    gStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
-    gStyle->SetPalette(1);//colz color
-    // get rid of X error bars 
-    // get rid of error bar caps
-    gStyle->SetEndErrorSize(0.);
-    // do not display any of the standard histogram decorations
-    gStyle->SetOptTitle(1);
-    gStyle->SetOptStat(1111);
-    gStyle->SetOptFit(1111);
-    // put tick marks on top and RHS of plots
-    gStyle->SetPadTickX(1);
-    gStyle->SetPadTickY(1);
-  }
-
-  void LayerAnalysis::finishplot(TH1F* h) const{
-    TCanvas c1("c1","c1",700,600);
-    c1.cd();
-
-    h->SetBinContent(h->GetNbinsX(), h->GetBinContent(h->GetNbinsX() + 1) + h->GetBinContent(h->GetNbinsX()));
-    h->SetBinContent(h->GetNbinsX() + 1, 0);
-    h->SetBinContent(1, h->GetBinContent(0) +  h->GetBinContent(1));
-
-    h->Draw();
-    h->Write();
-    if(m_DEBUG) gPad->SaveAs("../Output/"+ TString(h->GetName()) + ".png");
-    delete h;
-  }
-
-
-  float LayerAnalysis::linear_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex){
-    //z is always the precision plane. r is the reference plane, simple and robust
-    double ref_z = ref.getGlobalZ();
-    double ref_r = ref.getGlobalR();
-    double ex_z  = ex.getGlobalZ();
-    double ex_r  = ex.getGlobalR();
-    if (ex.hough->m_descriptor.chIndex <= 6){
-      return ex_z - ex_r / ref_r * ref_z;
+    void LayerAnalysis::SetStyle() {
+        // use plain black on white colors
+        Int_t icol = 0;  // WHITE
+        gStyle->SetFrameBorderMode(icol);
+        gStyle->SetFrameFillColor(icol);
+        gStyle->SetCanvasBorderMode(icol);
+        gStyle->SetCanvasColor(icol);
+        gStyle->SetPadBorderMode(icol);
+        gStyle->SetPadColor(icol);
+        gStyle->SetStatColor(icol);
+        // set the paper & margin sizes
+        gStyle->SetPaperSize(20, 26);
+        // set margin sizes
+        gStyle->SetPadTopMargin(0.09);
+        gStyle->SetPadRightMargin(0.12);
+        gStyle->SetPadBottomMargin(0.20);
+        gStyle->SetPadLeftMargin(0.14);
+        // set title offsets (for axis label)
+        gStyle->SetTitleXOffset(1.4);
+        gStyle->SetTitleYOffset(1.6);
+        // use large fonts
+        Int_t fontT = 42;  // Helvetica italics
+        Int_t font = 42;   // Helvetica
+        Double_t tsize = 0.025;
+        gStyle->SetTextFont(font);
+        gStyle->SetTextSize(tsize);
+        gStyle->SetLabelFont(font, "x");
+        gStyle->SetTitleFont(fontT, "x");
+        gStyle->SetLabelFont(font, "y");
+        gStyle->SetTitleFont(fontT, "y");
+        gStyle->SetLabelFont(font, "z");
+        gStyle->SetTitleFont(fontT, "z");
+        gStyle->SetLabelSize(tsize, "x");
+        gStyle->SetLabelSize(tsize, "y");
+        gStyle->SetLabelSize(tsize, "z");
+        // use bold lines and markers
+        gStyle->SetMarkerStyle(20);
+        gStyle->SetMarkerSize(1.5);
+        gStyle->SetHistLineWidth(2.);
+        gStyle->SetLineStyleString(2, "[12 12]");  // postscript dashes
+        gStyle->SetPalette(1);                     // colz color
+        // get rid of X error bars
+        // get rid of error bar caps
+        gStyle->SetEndErrorSize(0.);
+        // do not display any of the standard histogram decorations
+        gStyle->SetOptTitle(1);
+        gStyle->SetOptStat(1111);
+        gStyle->SetOptFit(1111);
+        // put tick marks on top and RHS of plots
+        gStyle->SetPadTickX(1);
+        gStyle->SetPadTickY(1);
     }
-    else{
-      return ex_r - ex_z * ref_r / ref_z;
+
+    void LayerAnalysis::finishplot(TH1F* h) const {
+        TCanvas c1("c1", "c1", 700, 600);
+        c1.cd();
+
+        h->SetBinContent(h->GetNbinsX(), h->GetBinContent(h->GetNbinsX() + 1) + h->GetBinContent(h->GetNbinsX()));
+        h->SetBinContent(h->GetNbinsX() + 1, 0);
+        h->SetBinContent(1, h->GetBinContent(0) + h->GetBinContent(1));
+
+        h->Draw();
+        h->Write();
+        if (m_DEBUG) gPad->SaveAs("../Output/" + TString(h->GetName()) + ".png");
+        delete h;
     }
-  }
-
-  float LayerAnalysis::parab_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex) const{
-    //z is always the precision plane. r is the reference plane, simple and robust
-    int    ex_region = ex.refregion;
-    int    ref_region = ref.refregion;
-    int    ex_chIndex = ex.hough->m_descriptor.chIndex;
-    int    ref_chIndex = ref.hough->m_descriptor.chIndex;
-
-    double z_extrapolated = ex.getGlobalZ();
-    double r_extrapolated = ex.getGlobalR();
-    double theta_extrapolated = ex.getGlobalTheta();
-    double z_segment = ref.getGlobalZ();
-    double r_segment = ref.getGlobalR();
-    double theta_segment = ref.getGlobalTheta();
-    double expected = 0;
-    //order: reference position, reference maximum, reference theta, extrapolated reference position, extrapolated region, extrapolated layer
-    float extrapolated_diff = 9999;
-    //this code now only start from middle
-    if (z_segment == 0){ return extrapolated_diff;}//this is out of range
-    if (theta_segment == 0){ return extrapolated_diff;}//this is out of range
-    //for debug popose
-    if (m_DEBUG) std::cout << "DEBUG!!! refregion " << ref_region << " chIndex " << ref_chIndex << " ref_r " << r_segment << " ref_z " << z_segment << " ref_theta " 
-      << theta_segment  << " angle diff " << theta_segment - atan2(r_segment, z_segment)
-      << " theta binstep " << ref.hough->m_descriptor.thetaStep << " theta bin " << ref.bintheta << std::endl;
-
-    if (m_DEBUG) std::cout << "DEBUG!!! exregion " << ex_region << " chIndex " << ex_chIndex << " ex_r " << r_extrapolated << " ex_z " << z_extrapolated << " ex_theta " 
-      << theta_extrapolated  << " angle diff " << theta_extrapolated - atan2(r_extrapolated, z_extrapolated)
-      << " theta binstep " << ex.hough->m_descriptor.thetaStep << " theta bin " << ex.bintheta << std::endl;
-    //for real extrapolation
-    if (ref_chIndex <= 6){//this is starting with barrel chamber; BEE is 6
-      double r_start =  5000.;//used to be 4500; should start at 5000; should end at 10500
-      double z_SL = z_segment + (r_extrapolated-r_segment) * 1.0 / tan(theta_segment);
-      double r_SL = r_segment + (z_extrapolated-z_segment) * tan(theta_segment);
-
-      if (ex_chIndex <= 6){//this ends with barrel chamber; BEE is 6
-        if(r_segment < 5000.) {//  Forward direction from BI to BM, BO
-          expected = z_SL;
-        }
-        else { // Extrapolation from BM or BO, to other stations
-          double rgeo = (r_segment-r_start)*(r_segment-r_start)/r_segment - 2*(r_segment-r_start);
-          double rhoInv = (z_segment/r_segment - 1.0 / tan(theta_segment))/rgeo;
-          double cotant0 = 1.0 / tan(theta_segment) - 2*(r_segment-r_start)*rhoInv;//- sign come from taking inverse derivative
-          expected = r_extrapolated * cotant0 + (r_extrapolated-r_start)*(r_extrapolated-r_start)*rhoInv;
+
+    float LayerAnalysis::linear_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex) {
+        // z is always the precision plane. r is the reference plane, simple and robust
+        double ref_z = ref.getGlobalZ();
+        double ref_r = ref.getGlobalR();
+        double ex_z = ex.getGlobalZ();
+        double ex_r = ex.getGlobalR();
+        if (ex.hough->m_descriptor.chIndex <= 6) {
+            return ex_z - ex_r / ref_r * ref_z;
+        } else {
+            return ex_r - ex_z * ref_r / ref_z;
         }
-        extrapolated_diff =  z_extrapolated - expected;
-      }//end with barrel to barrel extrapolation
-      else{//this is a barrel to endcap extrapolation, mostly in the transition region? no B field, use SL
-        expected = r_SL;
-        extrapolated_diff =  r_extrapolated - expected;
-      }
     }
-    else{//this starts with endcap chamber;
-        double z_start =  8500.;//used to be 6500; should start at 8500
-        double z_end   = 12500.;//used to be 12000; should end at 12500
-
-        if(tan(theta_segment)<0) z_start = - z_start;
-        if(tan(theta_segment)<0)   z_end = - z_end;
-
-        double r_SL = r_segment + (z_extrapolated-z_segment)*tan(theta_segment);
-        double z_SL = z_segment + (r_extrapolated-r_segment) * 1.0 / tan(theta_segment);
-
-        if (ex_chIndex >= 7){//extrapolate to endcap
-          if (std::abs(z_segment) < std::abs(z_end)){//extrapolate from EI or EE, have to use linear
-            expected = r_SL;
-            extrapolated_diff =  r_extrapolated - expected;
-          }
-          else{// from EM or EO
-            if (std::abs(z_extrapolated) > std::abs(z_end)){//to EM or EO
-              //extrapolate to outer layer, just using theta of the middle measurement; only works if the theta measurement is correct
-              //can extrapolate with either the outside theta or middle theta; outside theta is better; father away from the B field
-              expected = r_SL;
-              extrapolated_diff =  r_extrapolated - expected;
+
+    float LayerAnalysis::parab_extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex) const {
+        // z is always the precision plane. r is the reference plane, simple and robust
+        int ex_region = ex.refregion;
+        int ref_region = ref.refregion;
+        int ex_chIndex = ex.hough->m_descriptor.chIndex;
+        int ref_chIndex = ref.hough->m_descriptor.chIndex;
+
+        double z_extrapolated = ex.getGlobalZ();
+        double r_extrapolated = ex.getGlobalR();
+        double theta_extrapolated = ex.getGlobalTheta();
+        double z_segment = ref.getGlobalZ();
+        double r_segment = ref.getGlobalR();
+        double theta_segment = ref.getGlobalTheta();
+        double expected = 0;
+        // order: reference position, reference maximum, reference theta, extrapolated reference position, extrapolated region, extrapolated
+        // layer
+        float extrapolated_diff = 9999;
+        // this code now only start from middle
+        if (z_segment == 0) { return extrapolated_diff; }      // this is out of range
+        if (theta_segment == 0) { return extrapolated_diff; }  // this is out of range
+        // for debug popose
+        if (m_DEBUG)
+            std::cout << "DEBUG!!! refregion " << ref_region << " chIndex " << ref_chIndex << " ref_r " << r_segment << " ref_z "
+                      << z_segment << " ref_theta " << theta_segment << " angle diff " << theta_segment - atan2(r_segment, z_segment)
+                      << " theta binstep " << ref.hough->m_descriptor.thetaStep << " theta bin " << ref.bintheta << std::endl;
+
+        if (m_DEBUG)
+            std::cout << "DEBUG!!! exregion " << ex_region << " chIndex " << ex_chIndex << " ex_r " << r_extrapolated << " ex_z "
+                      << z_extrapolated << " ex_theta " << theta_extrapolated << " angle diff "
+                      << theta_extrapolated - atan2(r_extrapolated, z_extrapolated) << " theta binstep " << ex.hough->m_descriptor.thetaStep
+                      << " theta bin " << ex.bintheta << std::endl;
+        // for real extrapolation
+        if (ref_chIndex <= 6) {      // this is starting with barrel chamber; BEE is 6
+            double r_start = 5000.;  // used to be 4500; should start at 5000; should end at 10500
+            double z_SL = z_segment + (r_extrapolated - r_segment) * 1.0 / tan(theta_segment);
+            double r_SL = r_segment + (z_extrapolated - z_segment) * tan(theta_segment);
+
+            if (ex_chIndex <= 6) {        // this ends with barrel chamber; BEE is 6
+                if (r_segment < 5000.) {  //  Forward direction from BI to BM, BO
+                    expected = z_SL;
+                } else {  // Extrapolation from BM or BO, to other stations
+                    double rgeo = (r_segment - r_start) * (r_segment - r_start) / r_segment - 2 * (r_segment - r_start);
+                    double rhoInv = (z_segment / r_segment - 1.0 / tan(theta_segment)) / rgeo;
+                    double cotant0 =
+                        1.0 / tan(theta_segment) - 2 * (r_segment - r_start) * rhoInv;  //- sign come from taking inverse derivative
+                    expected = r_extrapolated * cotant0 + (r_extrapolated - r_start) * (r_extrapolated - r_start) * rhoInv;
+                }
+                extrapolated_diff = z_extrapolated - expected;
+            }       // end with barrel to barrel extrapolation
+            else {  // this is a barrel to endcap extrapolation, mostly in the transition region? no B field, use SL
+                expected = r_SL;
+                extrapolated_diff = r_extrapolated - expected;
             }
-            else if (std::abs(z_segment) > std::abs(z_extrapolated)){//to EI or EE
-              double r_end = r_segment + (z_end-z_segment)*tan(theta_segment);
-              double zgeo = (z_end-z_start)*(z_end-z_start) -2*z_end*(z_end-z_start);
-              double rhoInv = (r_end - z_end*tan(theta_segment)) / zgeo;
-              double tantheta = tan(theta_segment) - 2*(z_end - z_start)*rhoInv;
-              expected = z_extrapolated*tantheta + (z_extrapolated-z_start)*(z_extrapolated-z_start)*rhoInv;//???
-
-              extrapolated_diff = r_extrapolated - expected;
+        } else {                     // this starts with endcap chamber;
+            double z_start = 8500.;  // used to be 6500; should start at 8500
+            double z_end = 12500.;   // used to be 12000; should end at 12500
+
+            if (tan(theta_segment) < 0) z_start = -z_start;
+            if (tan(theta_segment) < 0) z_end = -z_end;
+
+            double r_SL = r_segment + (z_extrapolated - z_segment) * tan(theta_segment);
+            double z_SL = z_segment + (r_extrapolated - r_segment) * 1.0 / tan(theta_segment);
+
+            if (ex_chIndex >= 7) {                            // extrapolate to endcap
+                if (std::abs(z_segment) < std::abs(z_end)) {  // extrapolate from EI or EE, have to use linear
+                    expected = r_SL;
+                    extrapolated_diff = r_extrapolated - expected;
+                } else {                                               // from EM or EO
+                    if (std::abs(z_extrapolated) > std::abs(z_end)) {  // to EM or EO
+                        // extrapolate to outer layer, just using theta of the middle measurement; only works if the theta measurement is
+                        // correct can extrapolate with either the outside theta or middle theta; outside theta is better; father away from
+                        // the B field
+                        expected = r_SL;
+                        extrapolated_diff = r_extrapolated - expected;
+                    } else if (std::abs(z_segment) > std::abs(z_extrapolated)) {  // to EI or EE
+                        double r_end = r_segment + (z_end - z_segment) * tan(theta_segment);
+                        double zgeo = (z_end - z_start) * (z_end - z_start) - 2 * z_end * (z_end - z_start);
+                        double rhoInv = (r_end - z_end * tan(theta_segment)) / zgeo;
+                        double tantheta = tan(theta_segment) - 2 * (z_end - z_start) * rhoInv;
+                        expected = z_extrapolated * tantheta + (z_extrapolated - z_start) * (z_extrapolated - z_start) * rhoInv;  //???
+
+                        extrapolated_diff = r_extrapolated - expected;
+                    }
+                }
+            } else {  // exrapolate to barrel; again verly likely to be in transition region, just use linear
+                expected = z_SL;
+                extrapolated_diff = z_extrapolated - expected;
             }
-          }
-        }
-        else{//exrapolate to barrel; again verly likely to be in transition region, just use linear 
-          expected = z_SL;
-          extrapolated_diff = z_extrapolated - expected;
         }
+        float new_parabolic = MuonHough::extrapolate(ref, ex, true);
+
+        return new_parabolic;
     }
-    float new_parabolic = MuonHough::extrapolate(ref, ex, true);
-
-    return new_parabolic;
-  }
-
-  int LayerAnalysis::getMaxLayers(Muon::MuonStationIndex::DetectorRegionIndex region, int sector) {
-    bool isSmall = (sector%2==0);
-    int maxLayers = 0;
-    for( int lay = 0; lay < Muon::MuonStationIndex::LayerIndexMax; ++lay ){
-      Muon::MuonStationIndex::LayerIndex layer = static_cast<Muon::MuonStationIndex::LayerIndex>(lay);
-      Muon::MuonStationIndex::ChIndex chIndex = Muon::MuonStationIndex::toChamberIndex(region, layer, isSmall);
-      if( chIndex == Muon::MuonStationIndex::ChUnknown || chIndex >= Muon::MuonStationIndex::ChIndexMax ) {continue;}
-      maxLayers++;
+
+    int LayerAnalysis::getMaxLayers(Muon::MuonStationIndex::DetectorRegionIndex region, int sector) {
+        bool isSmall = (sector % 2 == 0);
+        int maxLayers = 0;
+        for (int lay = 0; lay < Muon::MuonStationIndex::LayerIndexMax; ++lay) {
+            Muon::MuonStationIndex::LayerIndex layer = static_cast<Muon::MuonStationIndex::LayerIndex>(lay);
+            Muon::MuonStationIndex::ChIndex chIndex = Muon::MuonStationIndex::toChamberIndex(region, layer, isSmall);
+            if (chIndex == Muon::MuonStationIndex::ChUnknown || chIndex >= Muon::MuonStationIndex::ChIndexMax) { continue; }
+            maxLayers++;
+        }
+        return maxLayers;
     }
-    return maxLayers;
-  }
 
-}
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx
index 088d08dc47c5e0a72be1a02fe75a10c35bdee7f7..4f60e7c6bb9f60cbf68ba7dfe6ac6ee36fca9104 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx
@@ -3,576 +3,580 @@
 */
 
 #include "MuonLayerHough/MuonLayerHough.h"
-#include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/getMessageSvc.h"
-#include <TString.h> // for Form
 
 #include <TH1.h>
-#include <bitset>
-#include <cmath>
+#include <TString.h>  // for Form
 #include <memory.h>
 
+#include <bitset>
+#include <cmath>
 #include <cstdlib>
 #include <iostream>
 
+#include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
 
 namespace {
-    // Avoid floating point exceptions arising from cases of x = 0 or x = PI 
+    // Avoid floating point exceptions arising from cases of x = 0 or x = PI
     // by extending the inverse tan function towards a large number
     // Avoid FPEs occuring in clang 10 , e.g.,
     // FPEAuditor  2   1 WARNING FPE OVERFLOW in [Execute] of [MuGirlStauAlg] on event 257948896 0 0
     // by large number
-    float invtan(const float x){
-        return x == 0 || x == M_PI ? 1.e12 : 1./ std::tan(x);
-    }
-}
+    float invtan(const float x) { return x == 0 || x == M_PI ? 1.e12 : 1. / std::tan(x); }
+}  // namespace
 namespace MuonHough {
 
-  MuonLayerHough::MuonLayerHough(  const RegionDescriptor& descriptor ) : 
-    max(0),
-    maxhist(-1),
-    maxbin(-1),
-    m_debug(false),
-    m_descriptor(descriptor) {
-
-    // calculate the number of bins
-    m_nbins = (m_descriptor.yMaxRange-m_descriptor.yMinRange)/m_descriptor.yBinSize;//the same for all the cycles
-    m_binsize = (m_descriptor.yMaxRange-m_descriptor.yMinRange)/m_nbins;
-    m_invbinsize = 1./m_binsize;//binsize in the floating plane
-    
-    // setup the histograms; determines the number of theta slices
-    m_histos.reserve(m_descriptor.nthetaSamples);//it contains all the theta layers
-    for( unsigned int i=0;i<m_descriptor.nthetaSamples;++i ) m_histos.emplace_back(new unsigned int[m_nbins]);
-    reset();
-  }
-  
-  void MuonLayerHough::reset() {
-    for( unsigned int i=0;i<m_histos.size();++i ) memset( m_histos[i].get(), 0, sizeof(unsigned int)*m_nbins );  
-    max = 0;
-    maxhist = -1;
-    maxbin = -1;
-  }
-
-  void MuonLayerHough::fill( float x, float y, float weight ) {
-
-    int cycles = m_histos.size();
-    for( int ci=0;ci<cycles;++ci ){
-      float dtheta = m_descriptor.thetaStep;
-      float dthetaOffset = 2*m_descriptor.thetaStep*(ci-(cycles-1)/2.);
-      float theta = std::atan2(x,y);
-      float zref = (m_descriptor.referencePosition-x)*invtan(theta-dthetaOffset)+y;
-      float z0 = (m_descriptor.referencePosition-x)*invtan(theta-dthetaOffset+dtheta)+y;
-      float z1 = (m_descriptor.referencePosition-x)*invtan(theta-dthetaOffset-dtheta)+y;
-
-      float zmin = z0<z1?z0:z1;
-      float zmax = z0<z1?z1:z0;
-      int bincenter = (zref-m_descriptor.yMinRange)*m_invbinsize;
-
-      int binmin = (zmin-m_descriptor.yMinRange)*m_invbinsize;
-      int binmax = (zmax-m_descriptor.yMinRange)*m_invbinsize;
-      if( binmin - bincenter < -3 ) binmin = bincenter-3;
-      if( binmin == bincenter ) binmin -= 1;
-      if( binmax == bincenter ) binmax += 1;
-      if( binmin >= m_nbins ) continue;
-      if( binmax - bincenter > 3 )  binmax = bincenter+3;
-      if( binmax < 0 ) continue;
-
-      if(binmin<0) binmin = 0;
-      if( binmax >= m_nbins ) binmax = m_nbins-1;
-      if( m_debug) std::cout << " filling " << x << " y " << binmin << " " << binmax << " w " << weight <<  " center " << bincenter 
-			   << " range " << (zmin-m_descriptor.yMinRange)*m_invbinsize << " " << (zmax-m_descriptor.yMinRange)*m_invbinsize << std::endl;
-      for( int n=binmin;n<=binmax;++n ) {
-        unsigned int& val = m_histos[ci][n];
-        int w = 1000*weight;
-        if( w < 0 && (int)val < -w ) val = 0;
-        else                         val += weight;
-        if( val > max ) {
-          max = val;
-          maxhist = ci;
-          maxbin = n;
-        }
-      }
+    MuonLayerHough::MuonLayerHough(const RegionDescriptor& descriptor) :
+        max(0), maxhist(-1), maxbin(-1), m_debug(false), m_descriptor(descriptor) {
+        // calculate the number of bins
+        m_nbins = (m_descriptor.yMaxRange - m_descriptor.yMinRange) / m_descriptor.yBinSize;  // the same for all the cycles
+        m_binsize = (m_descriptor.yMaxRange - m_descriptor.yMinRange) / m_nbins;
+        m_invbinsize = 1. / m_binsize;  // binsize in the floating plane
+
+        // setup the histograms; determines the number of theta slices
+        m_histos.reserve(m_descriptor.nthetaSamples);  // it contains all the theta layers
+        for (unsigned int i = 0; i < m_descriptor.nthetaSamples; ++i) m_histos.emplace_back(new unsigned int[m_nbins]);
+        reset();
     }
-  }
-
-  void MuonLayerHough::fillLayer( const std::vector<Hit*>& hits, bool subtract ) {
-    if( hits.empty() ) return;
-
-    // outer loop over cycles
-    int cycles = m_histos.size();
-    for( int ci=0;ci<cycles;++ci ){
-      // float dtheta = m_descriptor.thetaStep;
-      // float dthetaOffset = 2*m_descriptor.thetaStep*(ci-(cycles-1)/2.);
-
-      int prevlayer = -1;
-      int prevbinmin = 10000;
-      int prevbinmax = -1;
-      // inner loop over hits
-      std::vector<Hit*>::const_iterator it = hits.begin();
-      std::vector<Hit*>::const_iterator it_end = hits.end();
-      for( ;it!=it_end;++it ){
-	float x = (*it)->x;
-	float y1 = (*it)->ymin;
-	float y2 = (*it)->ymax;
-	std::pair<int,int> minMax = range((*it)->x,(*it)->ymin,(*it)->ymax,ci);
-	int binmin = minMax.first;
-	int binmax = minMax.second;
-	if( binmin >= m_nbins ) continue;
-	if( binmax < 0 ) continue;
-
-	if(binmin<0) binmin = 0;
-	if( binmax >= m_nbins ) binmax = m_nbins-1;
-	if( m_debug ) {
-	  std::cout << " filling hit " << x << " refpos " << m_descriptor.referencePosition << " ymin " << y1 << " ymax " << y2 << " layer " << (*it)->layer
-		    << " binmin " << binmin << " max " << binmax;
-	  if( (*it)->debugInfo() ) {
-	    const HitDebugInfo* db1 = (*it)->debugInfo();
-	    std::cout << " sec " << db1->sector << " r " << db1->region << " type " << db1->type << " lay " << db1->layer << " slay " << db1->sublayer<< std::endl;
-	  }else std::cout << std::endl;
-	}
-	// first hit within range
-	if( prevbinmax == -1 ){
-	  if( m_debug ) std::cout << " first range " << binmin << "  " << binmax << std::endl;
-	  prevbinmin = binmin;
-	  prevbinmax = binmax;
-	  prevlayer  = (*it)->layer;
-	  continue;
-	}
-
-	if( binmin < prevbinmin && prevlayer == (*it)->layer ) {
-	  std::cout << "Error hits are out of order: min " << binmin << " max " << binmax << " lay " << (*it)->layer << std::endl;
-	}
-	// if the max value of the previous hit is smaller than the current minvalue fill the histogram of the previous hit
-	// do the same when reached last hit
-	if( prevbinmax < binmin || prevlayer != (*it)->layer ) {
-	  if( m_debug ) std::cout << " filling range " << prevbinmin << " " << prevbinmax << " new min " << binmin << "  " << binmax << " weight " << (*it)->w << std::endl;
-	  for( int n=prevbinmin;n<=prevbinmax;++n ) {
-	    unsigned int& val = m_histos[ci][n];
-	    int w = 1000*(*it)->w;
-	    if( subtract ) w *= -1;
-	    if( w < 0 && (int)val < -w ) val = 0;
-	    else                         val += w;
-	    if( val > max ) {
-	      max = val;
-	      maxhist = ci;
-	      maxbin = n;
-	    }
-	  }
-	  prevbinmin = binmin;
-	  prevbinmax = binmax;
-	  prevlayer  = (*it)->layer;
-
-	}else{
-	  // update the maximum value of the window
-	  if( m_debug ) std::cout << " updating range " << prevbinmin << " " << prevbinmax << " hit " << binmin << "  " << binmax 
-				<< "  new " << prevbinmin << " " << binmax << std::endl;
-	  prevbinmax = binmax;
-	}
-      }
-      if( prevbinmax != -1 ){
-	if( m_debug ) std::cout << " filling last range " << prevbinmin << " " << prevbinmax << " weight " << hits.back()->w << std::endl;
-	for( int n=prevbinmin;n<=prevbinmax;++n ) {
-	  unsigned int& val = m_histos[ci][n];
-	  int w = 1000*hits.back()->w;
-	  if( subtract ) w *= -1;
-	  if( w < 0 && (int)val < -w ) val = 0;
-	  else                         val += w;
-	  if( val > max ) {
-	    max = val;
-	    maxhist = ci;
-	    maxbin = n;
-	  }
-	} 
-
-      }
+
+    void MuonLayerHough::reset() {
+        for (unsigned int i = 0; i < m_histos.size(); ++i) memset(m_histos[i].get(), 0, sizeof(unsigned int) * m_nbins);
+        max = 0;
+        maxhist = -1;
+        maxbin = -1;
     }
-  }
-
-  void MuonLayerHough::fillLayer2( const std::vector<Hit*>& hits, bool subtract ) {
-    if( hits.empty() ) return;
-
-    std::vector<int> layerCounts(m_nbins,0);
-    int sign = subtract ? -1000 : 1000;
-    // outer loop over cycles
-    int cycles = m_histos.size();
-    for( int ci=0;ci<cycles;++ci ){
-      
-      // keep track of the previous layer
-      int prevlayer = hits.front()->layer;
-
-      // inner loop over hits
-      std::vector<Hit*>::const_iterator it = hits.begin();
-      std::vector<Hit*>::const_iterator it_end = hits.end();
-      for( ;it!=it_end;++it ){
-	
-        // if we get to the next layer process the current one and fill the Hough space
-        if( prevlayer != (*it)->layer ) {
-          for( int i=0;i<m_nbins;++i ) {
-            if( subtract && -layerCounts[i] >= static_cast<int>(m_histos[ci][i]) ) m_histos[ci][i] = 0; 
-            else                                                                   m_histos[ci][i] += layerCounts[i];
-            layerCounts[i] = 0; // reset bin
-          }
-          prevlayer = (*it)->layer;
-        }
 
-        // get bin range
-        std::pair<int,int> minMax = range((*it)->x,(*it)->ymin,(*it)->ymax,ci);
-        int binmin = minMax.first;
-        int binmax = minMax.second;
-
-        // check wether we are within the Hough space
-        if( binmin >= m_nbins ) continue;
-        if( binmax < 0 ) continue;
-
-        // adjust boundaries if needed
-        if( binmin < 0 ) binmin = 0;
-        if( binmax >= m_nbins ) binmax = m_nbins-1;
-
-        // output hit for debug purposes
-        if( m_debug ) {
-          std::cout << " cycle(theta layers) " << ci << " filling hit " << (*it)->x << " refpos " << m_descriptor.referencePosition 
-            << " ymin " << (*it)->ymin << " ymax " << (*it)->ymax << " layer " << (*it)->layer
-            << " weight " << (*it)->w << " binmin " << binmin << " max " << binmax;
-          std::cout << " zmin " << binmin * m_binsize + m_descriptor.yMinRange << " zmax " << binmax * m_binsize + m_descriptor.yMinRange;
-          if( (*it)->debugInfo() ) {
-            const HitDebugInfo* db1 = (*it)->debugInfo();
-            std::cout << " sec " << db1->sector << " r " << db1->region << " type " << db1->type 
-                      << " lay " << db1->layer << " bc " << db1->barcode << std::endl;
-          }
-          else std::cout << std::endl;
+    void MuonLayerHough::fill(float x, float y, float weight) {
+        int cycles = m_histos.size();
+        for (int ci = 0; ci < cycles; ++ci) {
+            float dtheta = m_descriptor.thetaStep;
+            float dthetaOffset = 2 * m_descriptor.thetaStep * (ci - (cycles - 1) / 2.);
+            float theta = std::atan2(x, y);
+            float zref = (m_descriptor.referencePosition - x) * invtan(theta - dthetaOffset) + y;
+            float z0 = (m_descriptor.referencePosition - x) * invtan(theta - dthetaOffset + dtheta) + y;
+            float z1 = (m_descriptor.referencePosition - x) * invtan(theta - dthetaOffset - dtheta) + y;
+
+            float zmin = z0 < z1 ? z0 : z1;
+            float zmax = z0 < z1 ? z1 : z0;
+            int bincenter = (zref - m_descriptor.yMinRange) * m_invbinsize;
+
+            int binmin = (zmin - m_descriptor.yMinRange) * m_invbinsize;
+            int binmax = (zmax - m_descriptor.yMinRange) * m_invbinsize;
+            if (binmin - bincenter < -3) binmin = bincenter - 3;
+            if (binmin == bincenter) binmin -= 1;
+            if (binmax == bincenter) binmax += 1;
+            if (binmin >= m_nbins) continue;
+            if (binmax - bincenter > 3) binmax = bincenter + 3;
+            if (binmax < 0) continue;
+
+            if (binmin < 0) binmin = 0;
+            if (binmax >= m_nbins) binmax = m_nbins - 1;
+            if (m_debug)
+                std::cout << " filling " << x << " y " << binmin << " " << binmax << " w " << weight << " center " << bincenter << " range "
+                          << (zmin - m_descriptor.yMinRange) * m_invbinsize << " " << (zmax - m_descriptor.yMinRange) * m_invbinsize
+                          << std::endl;
+            for (int n = binmin; n <= binmax; ++n) {
+                unsigned int& val = m_histos[ci][n];
+                int w = 1000 * weight;
+                if (w < 0 && (int)val < -w)
+                    val = 0;
+                else
+                    val += weight;
+                if (val > max) {
+                    max = val;
+                    maxhist = ci;
+                    maxbin = n;
+                }
+            }
         }
-        int weight = sign*(*it)->w;// set the hit weight
-        // set bits to true
-        for( ;binmin<=binmax;++binmin ) layerCounts[binmin] = weight;
-      }//end of loopin gover hits
-      // if the last set of hits was not filled, fill them now; just for the last layer
-      for( int i=0;i<m_nbins;++i ){
-        if( subtract && -layerCounts[i] >= static_cast<int>(m_histos[ci][i]) ) m_histos[ci][i] = 0; 
-        else                                                                   m_histos[ci][i] += layerCounts[i];
-        //if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << " val " << layerCounts[i] << " tot " << m_histos[ci][i] << std::endl;
-        layerCounts[i] = 0; // reset bin
-      }
     }
-  }
 
+    void MuonLayerHough::fillLayer(const std::vector<Hit*>& hits, bool subtract) {
+        if (hits.empty()) return;
+
+        // outer loop over cycles
+        int cycles = m_histos.size();
+        for (int ci = 0; ci < cycles; ++ci) {
+            // float dtheta = m_descriptor.thetaStep;
+            // float dthetaOffset = 2*m_descriptor.thetaStep*(ci-(cycles-1)/2.);
+
+            int prevlayer = -1;
+            int prevbinmin = 10000;
+            int prevbinmax = -1;
+            // inner loop over hits
+            std::vector<Hit*>::const_iterator it = hits.begin();
+            std::vector<Hit*>::const_iterator it_end = hits.end();
+            for (; it != it_end; ++it) {
+                float x = (*it)->x;
+                float y1 = (*it)->ymin;
+                float y2 = (*it)->ymax;
+                std::pair<int, int> minMax = range((*it)->x, (*it)->ymin, (*it)->ymax, ci);
+                int binmin = minMax.first;
+                int binmax = minMax.second;
+                if (binmin >= m_nbins) continue;
+                if (binmax < 0) continue;
+
+                if (binmin < 0) binmin = 0;
+                if (binmax >= m_nbins) binmax = m_nbins - 1;
+                if (m_debug) {
+                    std::cout << " filling hit " << x << " refpos " << m_descriptor.referencePosition << " ymin " << y1 << " ymax " << y2
+                              << " layer " << (*it)->layer << " binmin " << binmin << " max " << binmax;
+                    if ((*it)->debugInfo()) {
+                        const HitDebugInfo* db1 = (*it)->debugInfo();
+                        std::cout << " sec " << db1->sector << " r " << db1->region << " type " << db1->type << " lay " << db1->layer
+                                  << " slay " << db1->sublayer << std::endl;
+                    } else
+                        std::cout << std::endl;
+                }
+                // first hit within range
+                if (prevbinmax == -1) {
+                    if (m_debug) std::cout << " first range " << binmin << "  " << binmax << std::endl;
+                    prevbinmin = binmin;
+                    prevbinmax = binmax;
+                    prevlayer = (*it)->layer;
+                    continue;
+                }
+
+                if (binmin < prevbinmin && prevlayer == (*it)->layer) {
+                    std::cout << "Error hits are out of order: min " << binmin << " max " << binmax << " lay " << (*it)->layer << std::endl;
+                }
+                // if the max value of the previous hit is smaller than the current minvalue fill the histogram of the previous hit
+                // do the same when reached last hit
+                if (prevbinmax < binmin || prevlayer != (*it)->layer) {
+                    if (m_debug)
+                        std::cout << " filling range " << prevbinmin << " " << prevbinmax << " new min " << binmin << "  " << binmax
+                                  << " weight " << (*it)->w << std::endl;
+                    for (int n = prevbinmin; n <= prevbinmax; ++n) {
+                        unsigned int& val = m_histos[ci][n];
+                        int w = 1000 * (*it)->w;
+                        if (subtract) w *= -1;
+                        if (w < 0 && (int)val < -w)
+                            val = 0;
+                        else
+                            val += w;
+                        if (val > max) {
+                            max = val;
+                            maxhist = ci;
+                            maxbin = n;
+                        }
+                    }
+                    prevbinmin = binmin;
+                    prevbinmax = binmax;
+                    prevlayer = (*it)->layer;
+
+                } else {
+                    // update the maximum value of the window
+                    if (m_debug)
+                        std::cout << " updating range " << prevbinmin << " " << prevbinmax << " hit " << binmin << "  " << binmax
+                                  << "  new " << prevbinmin << " " << binmax << std::endl;
+                    prevbinmax = binmax;
+                }
+            }
+            if (prevbinmax != -1) {
+                if (m_debug)
+                    std::cout << " filling last range " << prevbinmin << " " << prevbinmax << " weight " << hits.back()->w << std::endl;
+                for (int n = prevbinmin; n <= prevbinmax; ++n) {
+                    unsigned int& val = m_histos[ci][n];
+                    int w = 1000 * hits.back()->w;
+                    if (subtract) w *= -1;
+                    if (w < 0 && (int)val < -w)
+                        val = 0;
+                    else
+                        val += w;
+                    if (val > max) {
+                        max = val;
+                        maxhist = ci;
+                        maxbin = n;
+                    }
+                }
+            }
+        }
+    }
 
-  std::vector<TH1*> MuonLayerHough::rootHistos(const std::string& prefix, const float* rmi, const float* rma ) const {
+    void MuonLayerHough::fillLayer2(const std::vector<Hit*>& hits, bool subtract) {
+        if (hits.empty()) return;
+
+        std::vector<int> layerCounts(m_nbins, 0);
+        int sign = subtract ? -1000 : 1000;
+        // outer loop over cycles
+        int cycles = m_histos.size();
+        for (int ci = 0; ci < cycles; ++ci) {
+            // keep track of the previous layer
+            int prevlayer = hits.front()->layer;
+
+            // inner loop over hits
+            std::vector<Hit*>::const_iterator it = hits.begin();
+            std::vector<Hit*>::const_iterator it_end = hits.end();
+            for (; it != it_end; ++it) {
+                // if we get to the next layer process the current one and fill the Hough space
+                if (prevlayer != (*it)->layer) {
+                    for (int i = 0; i < m_nbins; ++i) {
+                        if (subtract && -layerCounts[i] >= static_cast<int>(m_histos[ci][i]))
+                            m_histos[ci][i] = 0;
+                        else
+                            m_histos[ci][i] += layerCounts[i];
+                        layerCounts[i] = 0;  // reset bin
+                    }
+                    prevlayer = (*it)->layer;
+                }
+
+                // get bin range
+                std::pair<int, int> minMax = range((*it)->x, (*it)->ymin, (*it)->ymax, ci);
+                int binmin = minMax.first;
+                int binmax = minMax.second;
+
+                // check wether we are within the Hough space
+                if (binmin >= m_nbins) continue;
+                if (binmax < 0) continue;
+
+                // adjust boundaries if needed
+                if (binmin < 0) binmin = 0;
+                if (binmax >= m_nbins) binmax = m_nbins - 1;
+
+                // output hit for debug purposes
+                if (m_debug) {
+                    std::cout << " cycle(theta layers) " << ci << " filling hit " << (*it)->x << " refpos "
+                              << m_descriptor.referencePosition << " ymin " << (*it)->ymin << " ymax " << (*it)->ymax << " layer "
+                              << (*it)->layer << " weight " << (*it)->w << " binmin " << binmin << " max " << binmax;
+                    std::cout << " zmin " << binmin * m_binsize + m_descriptor.yMinRange << " zmax "
+                              << binmax * m_binsize + m_descriptor.yMinRange;
+                    if ((*it)->debugInfo()) {
+                        const HitDebugInfo* db1 = (*it)->debugInfo();
+                        std::cout << " sec " << db1->sector << " r " << db1->region << " type " << db1->type << " lay " << db1->layer
+                                  << " bc " << db1->barcode << std::endl;
+                    } else
+                        std::cout << std::endl;
+                }
+                int weight = sign * (*it)->w;  // set the hit weight
+                // set bits to true
+                for (; binmin <= binmax; ++binmin) layerCounts[binmin] = weight;
+            }  // end of loopin gover hits
+            // if the last set of hits was not filled, fill them now; just for the last layer
+            for (int i = 0; i < m_nbins; ++i) {
+                if (subtract && -layerCounts[i] >= static_cast<int>(m_histos[ci][i]))
+                    m_histos[ci][i] = 0;
+                else
+                    m_histos[ci][i] += layerCounts[i];
+                // if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << " val " <<
+                // layerCounts[i] << " tot " << m_histos[ci][i] << std::endl;
+                layerCounts[i] = 0;  // reset bin
+            }
+        }
+    }
 
-    std::vector<TH1*> hists;
-    hists.reserve(m_histos.size());
+    std::vector<TH1*> MuonLayerHough::rootHistos(const std::string& prefix, const float* rmi, const float* rma) const {
+        std::vector<TH1*> hists;
+        hists.reserve(m_histos.size());
 
-    float rmin = rmi ? *rmi : m_descriptor.yMinRange;
-    float rmax = rma ? *rma : m_descriptor.yMaxRange;
+        float rmin = rmi ? *rmi : m_descriptor.yMinRange;
+        float rmax = rma ? *rma : m_descriptor.yMaxRange;
 
-    int cycles = m_histos.size();
-    for( int ci=0;ci<cycles;++ci ){
-    
-      TString hname = prefix + "_hist";
-      hname += ci;
-      TH1F* h = new TH1F(hname,hname,m_nbins,rmin,rmax);//register the new histograms here
-      for( int n=0;n<m_nbins;++n ) h->SetBinContent(n+1,m_histos[ci][n]*0.001);
-      hists.push_back(h);
-    }
-    return hists;
-  }
-
-  bool MuonLayerHough::findMaximum( Maximum& maximum, const MuonLayerHoughSelector& selector ) const {
-    const float preMaxCut = selector.getMinCutValue();//in this case it is likely to be 1.9
-    maximum.max = 0;
-    maximum.pos = 0;
-    maximum.theta = 0;
-    maximum.refpos = 0;
-    maximum.refregion = -1;
-    maximum.refchIndex = -1;
-    maximum.binpos = -1;
-    maximum.binposmin = -1;
-    maximum.binposmax = -1;
-    maximum.binsize = -1;
-    maximum.bintheta = -1;
-    maximum.triggerConfirmed = 0;
-    maximum.hits.clear();
-    maximum.hough = this;
-
-    if( preMaxCut < 0 ) return false;//this is where there is no cut
-
-    float tmax = 0;
-    int posb = -1;
-    int thetab = -1;
-    int imaxval = preMaxCut*1000;
-    const int cycles = m_histos.size();
-    // loop over histograms and find maximum
-    for( int ci=0;ci<cycles;++ci ){
-      const float scale = 1. - 0.01*std::abs(ci-cycles/2.0); // small deweighting of non pointing bins; weighting more on the central part
-      for( int n=0;n<m_nbins;++n ) {
-        const int val = m_histos[ci][n];
-        if( val < imaxval ) continue;
-
-        if( scale*val > tmax ) {
-          tmax = scale*val;
-          posb = n;
-          thetab = ci;
+        int cycles = m_histos.size();
+        for (int ci = 0; ci < cycles; ++ci) {
+            TString hname = prefix + "_hist";
+            hname += ci;
+            TH1F* h = new TH1F(hname, hname, m_nbins, rmin, rmax);  // register the new histograms here
+            for (int n = 0; n < m_nbins; ++n) h->SetBinContent(n + 1, m_histos[ci][n] * 0.001);
+            hists.push_back(h);
         }
-      }
-    }
-    if( posb == -1 )    return false;//didn't find a max
-
-    const float candidatePos = m_descriptor.yMinRange + m_binsize*posb;
-    if( tmax < selector.getCutValue(candidatePos) ) return false;
-
-    maximum.max   = tmax*0.001;
-    maximum.pos   = candidatePos;
-    maximum.theta = -m_descriptor.thetaStep*(thetab-(m_histos.size()-1)*0.5) + std::atan2(m_descriptor.referencePosition,maximum.pos);    
-    maximum.refpos   = m_descriptor.referencePosition;
-    maximum.refregion = m_descriptor.region;
-    maximum.refchIndex = m_descriptor.chIndex;
-    maximum.binpos    = posb;
-    maximum.binposmin = posb;
-    maximum.binposmax = posb;
-    maximum.binsize   = m_binsize;
-    maximum.bintheta  = thetab; 
-    
-    // determin width of maximum; now to be 70% of the original height
-    unsigned int imax = m_histos[thetab][posb];
-    unsigned int sidemax = 0.7*imax;
-    // loop down, catch case the maximum is in the first bin
-    for( int n=posb != 0 ? posb-1 : posb;n>=0;--n ) {
-      if( m_histos[thetab][n] > sidemax ) {
-        maximum.binposmin = n;
-      }
-      else{
-        break;
-      }
+        return hists;
     }
-    for( int n=posb+1;n<m_nbins;++n ) {
-      if( m_histos[thetab][n] > sidemax ) {
-        maximum.binposmax = n;
-      }
-      else{
-        break;
-      }
-    }
-    return true;
-  }
-
-  void MuonLayerHough::associateHitsToMaximum( MuonLayerHough::Maximum& maximum, const std::vector<Hit*>& hits ) const {
-    if( maximum.bintheta == -1 || maximum.binposmax == -1 || maximum.binposmin == -1 ) return;
-    // loop over hits and find those that are compatible with the maximum
-    std::vector<Hit*>::const_iterator it = hits.begin();
-    std::vector<Hit*>::const_iterator it_end = hits.end();
-    for( ;it!=it_end;++it ){
-      // calculate the bins associated with the hit and check whether any of they are part of the maximum
-      std::pair<int,int> minMax = range((*it)->x,(*it)->ymin,(*it)->ymax,maximum.bintheta);
-      if( m_debug ) {
-	std::cout << " associating hit: x " << (*it)->x << " ymin " << (*it)->ymin << " ymax " << (*it)->ymax
-		  << " layer " << (*it)->layer << " range " << minMax.first << "  " << minMax.second 
-		  << "  max range " << maximum.binposmin << "  " << maximum.binposmax 
-		  << " prd " << (*it)->prd << " tgc " << (*it)->tgc;
-	if( (*it)->debugInfo() ) std::cout << " trigC " << (*it)->debugInfo()->trigConfirm;
-	std::cout << std::endl;
-      }
-      if( minMax.first  > maximum.binposmax ) continue; // minimum bin large than the maximum, drop
-      if( minMax.second < maximum.binposmin ) continue; // maximum bin smaller than the minimum, drop
-      // keep everything else
-      maximum.hits.push_back(*it);
-      if( (*it)->debugInfo() && (*it)->debugInfo()->trigConfirm > 0 ) ++maximum.triggerConfirmed;
+
+    bool MuonLayerHough::findMaximum(Maximum& maximum, const MuonLayerHoughSelector& selector) const {
+        const float preMaxCut = selector.getMinCutValue();  // in this case it is likely to be 1.9
+        maximum.max = 0;
+        maximum.pos = 0;
+        maximum.theta = 0;
+        maximum.refpos = 0;
+        maximum.refregion = -1;
+        maximum.refchIndex = -1;
+        maximum.binpos = -1;
+        maximum.binposmin = -1;
+        maximum.binposmax = -1;
+        maximum.binsize = -1;
+        maximum.bintheta = -1;
+        maximum.triggerConfirmed = 0;
+        maximum.hits.clear();
+        maximum.hough = this;
+
+        if (preMaxCut < 0) return false;  // this is where there is no cut
+
+        float tmax = 0;
+        int posb = -1;
+        int thetab = -1;
+        int imaxval = preMaxCut * 1000;
+        const int cycles = m_histos.size();
+        // loop over histograms and find maximum
+        for (int ci = 0; ci < cycles; ++ci) {
+            const float scale =
+                1. - 0.01 * std::abs(ci - cycles / 2.0);  // small deweighting of non pointing bins; weighting more on the central part
+            for (int n = 0; n < m_nbins; ++n) {
+                const int val = m_histos[ci][n];
+                if (val < imaxval) continue;
+
+                if (scale * val > tmax) {
+                    tmax = scale * val;
+                    posb = n;
+                    thetab = ci;
+                }
+            }
+        }
+        if (posb == -1) return false;  // didn't find a max
+
+        const float candidatePos = m_descriptor.yMinRange + m_binsize * posb;
+        if (tmax < selector.getCutValue(candidatePos)) return false;
+
+        maximum.max = tmax * 0.001;
+        maximum.pos = candidatePos;
+        maximum.theta =
+            -m_descriptor.thetaStep * (thetab - (m_histos.size() - 1) * 0.5) + std::atan2(m_descriptor.referencePosition, maximum.pos);
+        maximum.refpos = m_descriptor.referencePosition;
+        maximum.refregion = m_descriptor.region;
+        maximum.refchIndex = m_descriptor.chIndex;
+        maximum.binpos = posb;
+        maximum.binposmin = posb;
+        maximum.binposmax = posb;
+        maximum.binsize = m_binsize;
+        maximum.bintheta = thetab;
+
+        // determin width of maximum; now to be 70% of the original height
+        unsigned int imax = m_histos[thetab][posb];
+        unsigned int sidemax = 0.7 * imax;
+        // loop down, catch case the maximum is in the first bin
+        for (int n = posb != 0 ? posb - 1 : posb; n >= 0; --n) {
+            if (m_histos[thetab][n] > sidemax) {
+                maximum.binposmin = n;
+            } else {
+                break;
+            }
+        }
+        for (int n = posb + 1; n < m_nbins; ++n) {
+            if (m_histos[thetab][n] > sidemax) {
+                maximum.binposmax = n;
+            } else {
+                break;
+            }
+        }
+        return true;
     }
-  }
-
-
-  std::pair<float,float> MuonLayerHough::maximum( float x, float y, int& posbin, int& thetabin ) const {
-    unsigned int max = 0;
-    thetabin = -1;
-    posbin = -1;
-
-    int cycles = m_histos.size();
-    for( int ci=0;ci<cycles;++ci ){
-      int relbin = ci-(cycles-1)/2;
-      float dtheta = m_descriptor.thetaStep;
-      float dthetaOffset = 2*m_descriptor.thetaStep*(relbin);//if bintheta = cycles, this is the same as dtheta * (cycles + 1 )
-      float theta = std::atan2(x,y);
-      float z0 = (m_descriptor.referencePosition-x)*invtan(theta-dthetaOffset+dtheta)+y;//move the angle by a step, recalculate the new y value
-      float z1 = (m_descriptor.referencePosition-x)*invtan(theta-dthetaOffset-dtheta)+y;
-      
-      float zmin = z0<z1?z0:z1;
-      float zmax = z0<z1?z1:z0;
-      int binmin = (zmin-m_descriptor.yMinRange)/m_binsize-1;
-      int binmax = (zmax-m_descriptor.yMinRange)/m_binsize+1;
-      if( binmin >= m_nbins ) continue;
-      if( binmax < 0 ) continue;
-
-      if(binmin<0) binmin = 0;
-      if( binmax >= m_nbins ) binmax = m_nbins-1;
-      for( int n=binmin;n<binmax;++n ) {
-        if( max < m_histos[ci][n] ) {
-          max = m_histos[ci][n];
-          posbin = n;
-          thetabin = ci;
+
+    void MuonLayerHough::associateHitsToMaximum(MuonLayerHough::Maximum& maximum, const std::vector<Hit*>& hits) const {
+        if (maximum.bintheta == -1 || maximum.binposmax == -1 || maximum.binposmin == -1) return;
+        // loop over hits and find those that are compatible with the maximum
+        std::vector<Hit*>::const_iterator it = hits.begin();
+        std::vector<Hit*>::const_iterator it_end = hits.end();
+        for (; it != it_end; ++it) {
+            // calculate the bins associated with the hit and check whether any of they are part of the maximum
+            std::pair<int, int> minMax = range((*it)->x, (*it)->ymin, (*it)->ymax, maximum.bintheta);
+            if (m_debug) {
+                std::cout << " associating hit: x " << (*it)->x << " ymin " << (*it)->ymin << " ymax " << (*it)->ymax << " layer "
+                          << (*it)->layer << " range " << minMax.first << "  " << minMax.second << "  max range " << maximum.binposmin
+                          << "  " << maximum.binposmax << " prd " << (*it)->prd << " tgc " << (*it)->tgc;
+                if ((*it)->debugInfo()) std::cout << " trigC " << (*it)->debugInfo()->trigConfirm;
+                std::cout << std::endl;
+            }
+            if (minMax.first > maximum.binposmax) continue;   // minimum bin large than the maximum, drop
+            if (minMax.second < maximum.binposmin) continue;  // maximum bin smaller than the minimum, drop
+            // keep everything else
+            maximum.hits.push_back(*it);
+            if ((*it)->debugInfo() && (*it)->debugInfo()->trigConfirm > 0) ++maximum.triggerConfirmed;
         }
-      }
     }
-    float dthetaOffset = 2*m_descriptor.thetaStep*(thetabin-(cycles-1)/2.);
-    return std::make_pair(0.001*max,-dthetaOffset);
-  }
-
-  float MuonLayerHough::layerConfirmation( float x, float y, float range ) const {
-    unsigned int max = 0;
-    if( x == 0 ) return 0;
-
-    float yloc = m_descriptor.referencePosition*y/x;
-    int bincenter = (yloc-m_descriptor.yMinRange)/m_binsize;
-    int scanRange = range/m_binsize;
-    int binmin = bincenter - scanRange;
-    int binmax = bincenter + scanRange;
-    if( binmin >= m_nbins ) return 0;
-    if( binmax < 0 )        return 0;
-
-    int maxbin = -1;
-    if(binmin<0) binmin = 0;
-    if( binmax >= m_nbins ) binmax = m_nbins-1;
-    int cyclesmin = 0;
-    int cycles = m_histos.size();
-    if( cycles > 3 ){
-      int c0 = cycles/2;
-      cyclesmin = c0-1;
-      cycles = c0+1;
+
+    std::pair<float, float> MuonLayerHough::maximum(float x, float y, int& posbin, int& thetabin) const {
+        unsigned int max = 0;
+        thetabin = -1;
+        posbin = -1;
+
+        int cycles = m_histos.size();
+        for (int ci = 0; ci < cycles; ++ci) {
+            int relbin = ci - (cycles - 1) / 2;
+            float dtheta = m_descriptor.thetaStep;
+            float dthetaOffset = 2 * m_descriptor.thetaStep * (relbin);  // if bintheta = cycles, this is the same as dtheta * (cycles + 1 )
+            float theta = std::atan2(x, y);
+            float z0 = (m_descriptor.referencePosition - x) * invtan(theta - dthetaOffset + dtheta) +
+                       y;  // move the angle by a step, recalculate the new y value
+            float z1 = (m_descriptor.referencePosition - x) * invtan(theta - dthetaOffset - dtheta) + y;
+
+            float zmin = z0 < z1 ? z0 : z1;
+            float zmax = z0 < z1 ? z1 : z0;
+            int binmin = (zmin - m_descriptor.yMinRange) / m_binsize - 1;
+            int binmax = (zmax - m_descriptor.yMinRange) / m_binsize + 1;
+            if (binmin >= m_nbins) continue;
+            if (binmax < 0) continue;
+
+            if (binmin < 0) binmin = 0;
+            if (binmax >= m_nbins) binmax = m_nbins - 1;
+            for (int n = binmin; n < binmax; ++n) {
+                if (max < m_histos[ci][n]) {
+                    max = m_histos[ci][n];
+                    posbin = n;
+                    thetabin = ci;
+                }
+            }
+        }
+        float dthetaOffset = 2 * m_descriptor.thetaStep * (thetabin - (cycles - 1) / 2.);
+        return std::make_pair(0.001 * max, -dthetaOffset);
     }
-    for( int n=binmin;n<binmax;++n ) {
-      for( int ci=cyclesmin;ci<cycles;++ci ){
-	if( max < m_histos[ci][n] ) {
-	  max = m_histos[ci][n];
-	  maxbin = n;
-	}
-      }
+
+    float MuonLayerHough::layerConfirmation(float x, float y, float range) const {
+        unsigned int max = 0;
+        if (x == 0) return 0;
+
+        float yloc = m_descriptor.referencePosition * y / x;
+        int bincenter = (yloc - m_descriptor.yMinRange) / m_binsize;
+        int scanRange = range / m_binsize;
+        int binmin = bincenter - scanRange;
+        int binmax = bincenter + scanRange;
+        if (binmin >= m_nbins) return 0;
+        if (binmax < 0) return 0;
+
+        int maxbin = -1;
+        if (binmin < 0) binmin = 0;
+        if (binmax >= m_nbins) binmax = m_nbins - 1;
+        int cyclesmin = 0;
+        int cycles = m_histos.size();
+        if (cycles > 3) {
+            int c0 = cycles / 2;
+            cyclesmin = c0 - 1;
+            cycles = c0 + 1;
+        }
+        for (int n = binmin; n < binmax; ++n) {
+            for (int ci = cyclesmin; ci < cycles; ++ci) {
+                if (max < m_histos[ci][n]) {
+                    max = m_histos[ci][n];
+                    maxbin = n;
+                }
+            }
+        }
+        if (range == 900) std::cout << " layerConfirmation " << max << " bin " << maxbin << " entry " << bincenter << std::endl;
+        return 0.001 * max;
     }
-    if( range == 900 ) std::cout << " layerConfirmation " << max << " bin " << maxbin << " entry " << bincenter << std::endl;
-    return 0.001*max;
-  }
-
-  std::pair<float,float> MuonLayerHough::layerConfirmation( unsigned int thetaBin, float x, float y, float range ) const {
-    unsigned int max = 0;
-    if( x == 0 ) return std::make_pair(0.,0.);
-    if( thetaBin >= m_histos.size() ) return std::make_pair(0.,0.);
-    float yloc = m_descriptor.referencePosition*y/x;
-    int bincenter = (yloc-m_descriptor.yMinRange)/m_binsize;
-    int scanRange = range/m_binsize;
-    int binmin = bincenter - scanRange;
-    int binmax = bincenter + scanRange;
-    if( binmin >= m_nbins ) return std::make_pair(0.,0.);
-    if( binmax < 0 )        return std::make_pair(0.,0.);
-
-    int maxbin = -1;
-    if(binmin<0) binmin = 0;
-    if( binmax >= m_nbins ) binmax = m_nbins-1;
-    for( int n=binmin;n<binmax;++n ) {
-      if( max < m_histos[thetaBin][n] ) {
-	max = m_histos[thetaBin][n];
-	maxbin = n;
-      }
+
+    std::pair<float, float> MuonLayerHough::layerConfirmation(unsigned int thetaBin, float x, float y, float range) const {
+        unsigned int max = 0;
+        if (x == 0) return std::make_pair(0., 0.);
+        if (thetaBin >= m_histos.size()) return std::make_pair(0., 0.);
+        float yloc = m_descriptor.referencePosition * y / x;
+        int bincenter = (yloc - m_descriptor.yMinRange) / m_binsize;
+        int scanRange = range / m_binsize;
+        int binmin = bincenter - scanRange;
+        int binmax = bincenter + scanRange;
+        if (binmin >= m_nbins) return std::make_pair(0., 0.);
+        if (binmax < 0) return std::make_pair(0., 0.);
+
+        int maxbin = -1;
+        if (binmin < 0) binmin = 0;
+        if (binmax >= m_nbins) binmax = m_nbins - 1;
+        for (int n = binmin; n < binmax; ++n) {
+            if (max < m_histos[thetaBin][n]) {
+                max = m_histos[thetaBin][n];
+                maxbin = n;
+            }
+        }
+        std::cout << " layerConfirmation " << max << " bin " << maxbin << " entry " << bincenter << " val " << yval(max) << std::endl;
+        return std::make_pair(0.001 * max, yval(maxbin));
     }
-    std::cout << " layerConfirmation " << max << " bin " << maxbin << " entry " << bincenter << " val " << yval(max) << std::endl;
-    return std::make_pair(0.001*max,yval(maxbin));
-  }
-
-
-  std::pair<int,int> MuonLayerHough::range(const float x, const float y1, const float y2, const int bintheta) const {
-    int cycles = m_histos.size();
-    float dx = m_descriptor.referencePosition-x;
-    float dtheta = m_descriptor.thetaStep;
-    if (dtheta<=0) throw std::runtime_error(Form("File: %s, Line: %d\nMuonLayerHough::range() - dtheta is not positive (%.4f)", __FILE__, __LINE__, dtheta));
-    float dthetaOffset = 2*dtheta*(bintheta-(cycles-1)/2.);
-    
-    float theta1 = std::atan2(x,y1)-dthetaOffset;
-    float z01 = dx*invtan(theta1+dtheta)+y1;
-    float z11 = dx*invtan(theta1-dtheta)+y1;
-    float zmin1 = std::min(z01,z11);
-    float zmax1 = std::max(z01,z11);
-    
-    float theta2 = std::atan2(x,y2)-dthetaOffset;    
-    float z02 = dx*invtan(theta2+dtheta)+y2;
-    float z12 = dx*invtan(theta2-dtheta)+y2;
-    float zmin2 = std::min(z02,z12);
-    float zmax2 = std::max(z02,z12);
-    
-    float zmin = std::min(zmin1,zmin2);
-    float zmax = std::max(zmax1,zmax2);
-      
-    return std::make_pair<int,int>(std::floor((zmin-m_descriptor.yMinRange)*m_invbinsize), std::floor((zmax-m_descriptor.yMinRange)*m_invbinsize));//convert the output to bins
-  }
-
-  float extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex, bool doparabolic){
-    //z is always the precision plane. r is the reference plane, simple and robust
-    double ref_z = ref.getGlobalZ();
-    double ref_r = ref.getGlobalR();
-    double ex_z  = ex.getGlobalZ();
-    double ex_r  = ex.getGlobalR();
-    float theta_ref = ref.getGlobalTheta();
-    if (!doparabolic || ref_z == 0 || theta_ref == 0){//do linear extrapolation
-      if (!ex.isEndcap()){//if extrapolate to barell
-        return ex_z - ex_r / ref_r * ref_z;
-      }
-      else{//if extrapolate to endcap
-        return ex_r - ex_z * ref_r / ref_z;
-      }
+
+    std::pair<int, int> MuonLayerHough::range(const float x, const float y1, const float y2, const int bintheta) const {
+        int cycles = m_histos.size();
+        float dx = m_descriptor.referencePosition - x;
+        float dtheta = m_descriptor.thetaStep;
+        if (dtheta <= 0)
+            throw std::runtime_error(
+                Form("File: %s, Line: %d\nMuonLayerHough::range() - dtheta is not positive (%.4f)", __FILE__, __LINE__, dtheta));
+        float dthetaOffset = 2 * dtheta * (bintheta - (cycles - 1) / 2.);
+
+        float theta1 = std::atan2(x, y1) - dthetaOffset;
+        float z01 = dx * invtan(theta1 + dtheta) + y1;
+        float z11 = dx * invtan(theta1 - dtheta) + y1;
+        float zmin1 = std::min(z01, z11);
+        float zmax1 = std::max(z01, z11);
+
+        float theta2 = std::atan2(x, y2) - dthetaOffset;
+        float z02 = dx * invtan(theta2 + dtheta) + y2;
+        float z12 = dx * invtan(theta2 - dtheta) + y2;
+        float zmin2 = std::min(z02, z12);
+        float zmax2 = std::max(z02, z12);
+
+        float zmin = std::min(zmin1, zmin2);
+        float zmax = std::max(zmax1, zmax2);
+
+        return std::make_pair<int, int>(std::floor((zmin - m_descriptor.yMinRange) * m_invbinsize),
+                                        std::floor((zmax - m_descriptor.yMinRange) * m_invbinsize));  // convert the output to bins
     }
-    else{//do parabolic
-      float expected = 0;
-      float extrapolated_diff = 9999;
-      float tan_theta_ref = std::tan(theta_ref);
-      float invtan_theta_ref = 1.*invtan(theta_ref);
-      float r_start = ref.hough->m_descriptor.chIndex%2 > 0? 4900.:5200.; //start of barrel B field; values could be further optimized; 5500.:6500.
-      float z_start = 8500.; //start of endcap B field; used to be 6500; should start at 8500
-      float z_end   = 12500.;  //end of endcap B field; used to be 12000; should end at 12500
-      float r_SL = ref_r + (ex_z-ref_z) * tan_theta_ref;
-      float z_SL = ref_z + (ex_r-ref_r) * invtan_theta_ref;
-      //start extrapolation
-      if (!ref.isEndcap()){//this is starting with barrel chamber; BEE is 6
-        float rgeo    = ref_r*ref_r - r_start*r_start;
-        float rhoInv  = (invtan_theta_ref*ref_r - ref_z)/rgeo;
-        if (!ex.isEndcap()){//this ends with barrel chamber; BEE is 6
-          expected          = ref_z + (ex_r-ref_r) * invtan_theta_ref + (ex_r-ref_r)*(ex_r-ref_r)*rhoInv;
-          extrapolated_diff =  ex_z - expected;
-        }//end with barrel to barrel extrapolation
-        else{//this is a barrel to endcap extrapolation, mostly in the transition region
-          //recalculate z start
-          z_start           = ref_z + (r_start-ref_r) * invtan_theta_ref + (r_start-ref_r)*(r_start-ref_r)*rhoInv;
-          float zgeo        = ref_z*ref_z - z_start*z_start;
-          float rho         = (tan_theta_ref*ref_z - ref_r)/zgeo;
-          expected          = ref_r + (ex_z-ref_z) * tan_theta_ref + (ex_z-ref_z)*(ex_z-ref_z)*rho;
-          extrapolated_diff = ex_r - expected;
-        }
-      }
-      else{//this starts with endcap chamber;
-        //swap the starting position if on the other side
-        if(tan_theta_ref < 0){
-          z_start = - z_start;
-          z_end = - z_end;
-        }
-        if (ex.isEndcap()){//extrapolate to endcap
-          if (std::abs(ref_z) < std::abs(z_end)){//extrapolate from EI or EE, have to use linear
-            expected = r_SL;
-          }
-          else{// from EM or EO or EE
-            if (std::abs(ex_z) > std::abs(z_start)){//extrapolate to EM or EO
-              //extrapolate to outer layer, just using theta of the middle measurement; only works if the theta measurement is correct
-              //can extrapolate with either the outside theta or middle theta; outside theta is better; farther away from the B field
-              expected = r_SL;
+
+    float extrapolate(const MuonLayerHough::Maximum& ref, const MuonLayerHough::Maximum& ex, bool doparabolic) {
+        // z is always the precision plane. r is the reference plane, simple and robust
+        double ref_z = ref.getGlobalZ();
+        double ref_r = ref.getGlobalR();
+        double ex_z = ex.getGlobalZ();
+        double ex_r = ex.getGlobalR();
+        float theta_ref = ref.getGlobalTheta();
+        if (!doparabolic || ref_z == 0 || theta_ref == 0) {  // do linear extrapolation
+            if (!ex.isEndcap()) {                            // if extrapolate to barell
+                return ex_z - ex_r / ref_r * ref_z;
+            } else {  // if extrapolate to endcap
+                return ex_r - ex_z * ref_r / ref_z;
             }
-            else{//to EI
-              float r_end    = ref_r + (z_end-ref_z)*tan_theta_ref;
-              float zgeo     = z_start * z_start - z_end * z_end;
-              float rhoInv   = (r_end - z_end*tan_theta_ref) / zgeo;
-              float tantheta = tan_theta_ref - 2*(z_end - z_start)*rhoInv;
-              expected       = ex_z*tantheta + (ex_z-z_start)*(ex_z-z_start)*rhoInv;
+        } else {  // do parabolic
+            float expected = 0;
+            float extrapolated_diff = 9999;
+            float tan_theta_ref = std::tan(theta_ref);
+            float invtan_theta_ref = 1. * invtan(theta_ref);
+            float r_start = ref.hough->m_descriptor.chIndex % 2 > 0
+                                ? 4900.
+                                : 5200.;  // start of barrel B field; values could be further optimized; 5500.:6500.
+            float z_start = 8500.;        // start of endcap B field; used to be 6500; should start at 8500
+            float z_end = 12500.;         // end of endcap B field; used to be 12000; should end at 12500
+            float r_SL = ref_r + (ex_z - ref_z) * tan_theta_ref;
+            float z_SL = ref_z + (ex_r - ref_r) * invtan_theta_ref;
+            // start extrapolation
+            if (!ref.isEndcap()) {  // this is starting with barrel chamber; BEE is 6
+                float rgeo = ref_r * ref_r - r_start * r_start;
+                float rhoInv = (invtan_theta_ref * ref_r - ref_z) / rgeo;
+                if (!ex.isEndcap()) {  // this ends with barrel chamber; BEE is 6
+                    expected = ref_z + (ex_r - ref_r) * invtan_theta_ref + (ex_r - ref_r) * (ex_r - ref_r) * rhoInv;
+                    extrapolated_diff = ex_z - expected;
+                }       // end with barrel to barrel extrapolation
+                else {  // this is a barrel to endcap extrapolation, mostly in the transition region
+                    // recalculate z start
+                    z_start = ref_z + (r_start - ref_r) * invtan_theta_ref + (r_start - ref_r) * (r_start - ref_r) * rhoInv;
+                    float zgeo = ref_z * ref_z - z_start * z_start;
+                    float rho = (tan_theta_ref * ref_z - ref_r) / zgeo;
+                    expected = ref_r + (ex_z - ref_z) * tan_theta_ref + (ex_z - ref_z) * (ex_z - ref_z) * rho;
+                    extrapolated_diff = ex_r - expected;
+                }
+            } else {  // this starts with endcap chamber;
+                // swap the starting position if on the other side
+                if (tan_theta_ref < 0) {
+                    z_start = -z_start;
+                    z_end = -z_end;
+                }
+                if (ex.isEndcap()) {                          // extrapolate to endcap
+                    if (std::abs(ref_z) < std::abs(z_end)) {  // extrapolate from EI or EE, have to use linear
+                        expected = r_SL;
+                    } else {                                       // from EM or EO or EE
+                        if (std::abs(ex_z) > std::abs(z_start)) {  // extrapolate to EM or EO
+                            // extrapolate to outer layer, just using theta of the middle measurement; only works if the theta measurement
+                            // is correct can extrapolate with either the outside theta or middle theta; outside theta is better; farther
+                            // away from the B field
+                            expected = r_SL;
+                        } else {  // to EI
+                            float r_end = ref_r + (z_end - ref_z) * tan_theta_ref;
+                            float zgeo = z_start * z_start - z_end * z_end;
+                            float rhoInv = (r_end - z_end * tan_theta_ref) / zgeo;
+                            float tantheta = tan_theta_ref - 2 * (z_end - z_start) * rhoInv;
+                            expected = ex_z * tantheta + (ex_z - z_start) * (ex_z - z_start) * rhoInv;
+                        }
+                    }
+                    extrapolated_diff = ex_r - expected;
+                } else {  // exrapolate to barrel; again verly likely to be in transition region, complicated B field; just use linear
+                    expected = z_SL;
+                    extrapolated_diff = ex_z - expected;
+                }
             }
-          }
-          extrapolated_diff = ex_r - expected;
-        }
-        else{//exrapolate to barrel; again verly likely to be in transition region, complicated B field; just use linear
-          expected = z_SL;
-          extrapolated_diff = ex_z - expected;
-        }
-      }
-      return extrapolated_diff;
-    }//end of parabolic extrapolation
-  }
-}
+            return extrapolated_diff;
+        }  // end of parabolic extrapolation
+    }
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHoughSelector.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHoughSelector.cxx
index 4b696a1e2863eec0bad18c50d38164000d69a804..88bc8aab28d142ba6a45e9fa1a9c341d5990eb99 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHoughSelector.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHoughSelector.cxx
@@ -3,54 +3,43 @@
 */
 
 #include "MuonLayerHough/MuonLayerHoughSelector.h"
+
 #include <algorithm>
 #include <cmath>
 #include <iostream>
 #include <utility>
 
-
 namespace MuonHough {
 
-  typedef std::pair<int, double> valPair;
+    typedef std::pair<int, double> valPair;
 
-  MuonLayerHoughSelector::MuonLayerHoughSelector(std::vector<std::pair <int, float>> cutValues)
-  {
-    m_cutValues   = std::move(cutValues);
+    MuonLayerHoughSelector::MuonLayerHoughSelector(std::vector<std::pair<int, float>> cutValues) {
+        m_cutValues = std::move(cutValues);
 
-    auto comp = [](const valPair & a, const valPair & b) -> bool { return a.first < b.first;};
-    std::sort(m_cutValues.begin(), m_cutValues.end(), comp);
+        auto comp = [](const valPair& a, const valPair& b) -> bool { return a.first < b.first; };
+        std::sort(m_cutValues.begin(), m_cutValues.end(), comp);
 
-    if (getMinCutValue() < 0) std::cout << std::endl << "MuonLayerHoughSelector: Negative cuts found!!!" << std::endl;
-  }
+        if (getMinCutValue() < 0) std::cout << std::endl << "MuonLayerHoughSelector: Negative cuts found!!!" << std::endl;
+    }
 
-  MuonLayerHoughSelector::~MuonLayerHoughSelector()
-  {
-    
-  }
+    MuonLayerHoughSelector::~MuonLayerHoughSelector() {}
 
-  float MuonLayerHoughSelector::getCutValue(float position) const 
-  {
-    const float pos = std::abs(position);
-    for (const auto& cut : m_cutValues) 
-    {
-      if (cut.first < pos) return cut.second;//notice the array is already sorted
+    float MuonLayerHoughSelector::getCutValue(float position) const {
+        const float pos = std::abs(position);
+        for (const auto& cut : m_cutValues) {
+            if (cut.first < pos) return cut.second;  // notice the array is already sorted
+        }
+        return m_cutValues.back().second;
     }
-    return m_cutValues.back().second;
-  }
-
-  float MuonLayerHoughSelector::getMinCutValue() const
-  {
-    if (m_cutValues.empty()) 
-    {
-      std::cout << "MuonLayerHoughSelector: cutValues not available, returning invalid value";
-      return -999;
+
+    float MuonLayerHoughSelector::getMinCutValue() const {
+        if (m_cutValues.empty()) {
+            std::cout << "MuonLayerHoughSelector: cutValues not available, returning invalid value";
+            return -999;
+        }
+        return m_cutValues[0].second;
     }
-    return m_cutValues[0].second;
-  }
 
-  bool MuonLayerHoughSelector::passesCutValue(float testValue, float position) const
-  {
-    return testValue > getCutValue(position);
-  }
+    bool MuonLayerHoughSelector::passesCutValue(float testValue, float position) const { return testValue > getCutValue(position); }
 
-}
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonPhiLayerHough.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonPhiLayerHough.cxx
index 989b04c58a50014f79d9b7f3e394e52cd2f3f809..cddccd2fae215f2e4c21d03e3a14b7a4ca7bdaee 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonPhiLayerHough.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonPhiLayerHough.cxx
@@ -3,265 +3,264 @@
 */
 
 #include "MuonLayerHough/MuonPhiLayerHough.h"
+
+#include <TH1.h>
 #include <memory.h>
+
 #include <cmath>
-#include <TH1.h>
 #include <iostream>
 
 namespace MuonHough {
 
-  MuonPhiLayerHough::MuonPhiLayerHough(int nbins, float rangemin, float rangemax, Muon::MuonStationIndex::DetectorRegionIndex region ) :
-    m_rangemin(rangemin), 
-    m_rangemax(rangemax), 
-    m_region(region),
-    m_nbins(nbins),
-    m_debug(false)
-  {
-
-    // calculate the binsize
-    m_binsize = (m_rangemax-m_rangemin)/m_nbins;
-    m_invbinsize = 1./m_binsize,
-  
-    // setup the histograms
-    m_histo = new unsigned int[m_nbins];
-    reset();
-  }
-
-
-  MuonPhiLayerHough::~MuonPhiLayerHough() {
-    delete[] m_histo;
-  }
-
-  void MuonPhiLayerHough::reset() const {
-    memset( m_histo, 0, sizeof(unsigned int)*m_nbins );  
-  }
-
-  void MuonPhiLayerHough::fillLayer2( const std::vector<PhiHit*>& hits, bool subtract ) const {
-    if( hits.empty() ) return;
-
-    std::vector<int> layerCounts(m_nbins,0);
-    int sign = subtract ? -1000 : 1000;
-    // outer loop over cycles
-
-    // keep track of the previous layer
-    int prevlayer = hits.front()->layer;
-
-    // inner loop over hits
-    std::vector<PhiHit*>::const_iterator it = hits.begin();
-    std::vector<PhiHit*>::const_iterator it_end = hits.end();
-    for( ;it!=it_end;++it ){
-
-      // if we get to the next layer process the current one and fill the Hough space
-      if( prevlayer != (*it)->layer ) {
-        for( int i=0;i<m_nbins;++i ) {
-          if( subtract && -layerCounts[i] >= static_cast<int>(m_histo[i]) ) m_histo[i] = 0; 
-          else                                                              m_histo[i] += layerCounts[i];
-          //if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << std::endl;
-          layerCounts[i] = 0; // reset bin
-        }
-        prevlayer = (*it)->layer;
-      }
-
-      // get bin range
-      std::pair<int,int> minMax = range((*it)->r,(*it)->phimin,(*it)->phimax);
-      int binmin = minMax.first;
-      int binmax = minMax.second;
-
-      // check wether we are within the Hough space
-      if( binmin >= m_nbins ) continue;
-      if( binmax < 0 ) continue;
-      
-      // adjust boundaries if needed
-      if( binmin < 0 ) binmin = 0;
-      if( binmax >= m_nbins ) binmax = m_nbins-1;
-      
-      // output hit for debug purposes
-      if( m_debug ) {
-        std::cout << " filling hit " << (*it)->layer << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax
-                  << " weight " << (*it)->w << " binmin " << binmin << " max " << binmax;
-        if( (*it)->debugInfo() ) {
-          const HitDebugInfo* db1 = (*it)->debugInfo();
-          std::cout << " sec " << db1->sector << " r " << db1->region << " type " << db1->type 
-                    << " lay " << db1->layer << " bc " << db1->barcode << std::endl;
-        }else std::cout << std::endl;
-      }
-      int weight = sign*(*it)->w;
-      // set bits to true
-      for( ;binmin<=binmax;++binmin ) layerCounts[binmin] = weight;
+    MuonPhiLayerHough::MuonPhiLayerHough(int nbins, float rangemin, float rangemax, Muon::MuonStationIndex::DetectorRegionIndex region) :
+        m_rangemin(rangemin), m_rangemax(rangemax), m_region(region), m_nbins(nbins), m_debug(false) {
+        // calculate the binsize
+        m_binsize = (m_rangemax - m_rangemin) / m_nbins;
+        m_invbinsize = 1. / m_binsize,
 
+        // setup the histograms
+            m_histo = new unsigned int[m_nbins];
+        reset();
     }
-    // if the last set of hits was not filled, fill them now
-    for( int i=0;i<m_nbins;++i ){
-      if( subtract && -layerCounts[i] >= static_cast<int>(m_histo[i]) ) m_histo[i] = 0; 
-      else                                                              m_histo[i] += layerCounts[i];
-      //if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << std::endl;
-    }
-  }
-
-  void MuonPhiLayerHough::fillLayer( const std::vector<PhiHit*>& hits, bool subtract ) const {
-    if( hits.empty() ) return;
-    if( m_debug ) std::cout << " filling layers, hits " << hits.size() << " subtract " << subtract << std::endl;
-    int prevlayer = -1;
-    int prevbinmin = 10000;
-    int prevbinmax = -1;
-    //  loop over hits
-    std::vector<PhiHit*>::const_iterator it = hits.begin();
-    std::vector<PhiHit*>::const_iterator it_end = hits.end();
-    for( ;it!=it_end;++it ){
-
-      std::pair<int,int> minMax = range((*it)->r,(*it)->phimin,(*it)->phimax);
-      //if( m_debug ) std::cout << " filling: min " << minMax.first << "  max " << minMax.second << std::endl;
-      int binmin = minMax.first;
-      int binmax = minMax.second;
-
-      if( binmin >= m_nbins ) continue;
-      if( binmax < 0 ) continue;
-
-      if( binmin < 0 ) binmin = 0;
-      if( binmax >= m_nbins ) binmax = m_nbins-1;
-      if( m_debug )  std::cout << "  layer " << (*it)->layer << " r " << (*it)->r << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax
-                               << " new min " << binmin << "  " << binmax << std::endl;
-
-      // first hit within range
-      if( prevbinmax == -1 ){
-	if( m_debug )  std::cout << " first range " << (*it)->layer << " r " << (*it)->r 
-				 << " range " << binmin << " " << binmax << " new min " << binmin << "  " << binmax << std::endl;
-	prevbinmin = binmin;
-	prevbinmax = binmax;
-	prevlayer  = (*it)->layer;
-	continue;
-      }
-
-      if( binmin < prevbinmin && prevlayer == (*it)->layer ) std::cout << "Error hits are out of order: min " << binmin << " max " << binmax << std::endl;
-	
-      // if the max value of the previous hit is smaller than the current minvalue fill the histogram of the previous hit
-      // do the same when reached last hit
-      if( prevbinmax < binmin || prevlayer != (*it)->layer ) {
-	if( m_debug ) std::cout << " filling " << (*it)->layer << " r " << (*it)->r << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax
-				<< " range " << prevbinmin << " " << prevbinmax << " new min " << binmin << "  " << binmax << std::endl;
-	for( int n=prevbinmin;n<=prevbinmax;++n ) {
-	  unsigned int& val = m_histo[n];
-	  int w = 1000*(*it)->w;
-	  if( subtract ) w *= -1;
-	  if( w < 0 && (int)val < -w ) val = 0;
-	  else                         val += w;
-	}
-	prevbinmin = binmin;
-	prevbinmax = binmax;
-	prevlayer  = (*it)->layer;
-
-      }else{
-	// update the maximum value of the window
-	if( m_debug ) std::cout << " updating range " << (*it)->layer << " r " << (*it)->r 
-				<< " phimin " << (*it)->phimin << " phimax " << (*it)->phimax
-				<< " range " << prevbinmin << " " << prevbinmax << " new min " << binmin << "  " << binmax << std::endl;
-	prevbinmax = binmax;
-      }
-    }
-    if( prevbinmax != -1 ){
-      if( m_debug ) std::cout << " filling " << hits.back()->layer << " r " << hits.back()->r 
-			      << " phimin " << hits.back()->phimin << " phimax " << hits.back()->phimax
-			      << " range " << prevbinmin << " " << prevbinmax << std::endl;
-      for( int n=prevbinmin;n<=prevbinmax;++n ) {
-	unsigned int& val = m_histo[n];
-	int w = 1000*hits.back()->w;
-	if( subtract ) w *= -1;
-	if( w < 0 && (int)val < -w ) val = 0;
-	else                         val += w;
-      }
-    }
-  }
 
+    MuonPhiLayerHough::~MuonPhiLayerHough() { delete[] m_histo; }
+
+    void MuonPhiLayerHough::reset() const { memset(m_histo, 0, sizeof(unsigned int) * m_nbins); }
+
+    void MuonPhiLayerHough::fillLayer2(const std::vector<PhiHit*>& hits, bool subtract) const {
+        if (hits.empty()) return;
+
+        std::vector<int> layerCounts(m_nbins, 0);
+        int sign = subtract ? -1000 : 1000;
+        // outer loop over cycles
+
+        // keep track of the previous layer
+        int prevlayer = hits.front()->layer;
+
+        // inner loop over hits
+        std::vector<PhiHit*>::const_iterator it = hits.begin();
+        std::vector<PhiHit*>::const_iterator it_end = hits.end();
+        for (; it != it_end; ++it) {
+            // if we get to the next layer process the current one and fill the Hough space
+            if (prevlayer != (*it)->layer) {
+                for (int i = 0; i < m_nbins; ++i) {
+                    if (subtract && -layerCounts[i] >= static_cast<int>(m_histo[i]))
+                        m_histo[i] = 0;
+                    else
+                        m_histo[i] += layerCounts[i];
+                    // if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << std::endl;
+                    layerCounts[i] = 0;  // reset bin
+                }
+                prevlayer = (*it)->layer;
+            }
+
+            // get bin range
+            std::pair<int, int> minMax = range((*it)->r, (*it)->phimin, (*it)->phimax);
+            int binmin = minMax.first;
+            int binmax = minMax.second;
+
+            // check wether we are within the Hough space
+            if (binmin >= m_nbins) continue;
+            if (binmax < 0) continue;
+
+            // adjust boundaries if needed
+            if (binmin < 0) binmin = 0;
+            if (binmax >= m_nbins) binmax = m_nbins - 1;
+
+            // output hit for debug purposes
+            if (m_debug) {
+                std::cout << " filling hit " << (*it)->layer << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax << " weight "
+                          << (*it)->w << " binmin " << binmin << " max " << binmax;
+                if ((*it)->debugInfo()) {
+                    const HitDebugInfo* db1 = (*it)->debugInfo();
+                    std::cout << " sec " << db1->sector << " r " << db1->region << " type " << db1->type << " lay " << db1->layer << " bc "
+                              << db1->barcode << std::endl;
+                } else
+                    std::cout << std::endl;
+            }
+            int weight = sign * (*it)->w;
+            // set bits to true
+            for (; binmin <= binmax; ++binmin) layerCounts[binmin] = weight;
+        }
+        // if the last set of hits was not filled, fill them now
+        for (int i = 0; i < m_nbins; ++i) {
+            if (subtract && -layerCounts[i] >= static_cast<int>(m_histo[i]))
+                m_histo[i] = 0;
+            else
+                m_histo[i] += layerCounts[i];
+            // if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << std::endl;
+        }
+    }
 
-  std::vector<TH1*> MuonPhiLayerHough::rootHistos(const std::string& prefix, const float* phimi, const float* phima ) const {
+    void MuonPhiLayerHough::fillLayer(const std::vector<PhiHit*>& hits, bool subtract) const {
+        if (hits.empty()) return;
+        if (m_debug) std::cout << " filling layers, hits " << hits.size() << " subtract " << subtract << std::endl;
+        int prevlayer = -1;
+        int prevbinmin = 10000;
+        int prevbinmax = -1;
+        //  loop over hits
+        std::vector<PhiHit*>::const_iterator it = hits.begin();
+        std::vector<PhiHit*>::const_iterator it_end = hits.end();
+        for (; it != it_end; ++it) {
+            std::pair<int, int> minMax = range((*it)->r, (*it)->phimin, (*it)->phimax);
+            // if( m_debug ) std::cout << " filling: min " << minMax.first << "  max " << minMax.second << std::endl;
+            int binmin = minMax.first;
+            int binmax = minMax.second;
+
+            if (binmin >= m_nbins) continue;
+            if (binmax < 0) continue;
+
+            if (binmin < 0) binmin = 0;
+            if (binmax >= m_nbins) binmax = m_nbins - 1;
+            if (m_debug)
+                std::cout << "  layer " << (*it)->layer << " r " << (*it)->r << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax
+                          << " new min " << binmin << "  " << binmax << std::endl;
+
+            // first hit within range
+            if (prevbinmax == -1) {
+                if (m_debug)
+                    std::cout << " first range " << (*it)->layer << " r " << (*it)->r << " range " << binmin << " " << binmax << " new min "
+                              << binmin << "  " << binmax << std::endl;
+                prevbinmin = binmin;
+                prevbinmax = binmax;
+                prevlayer = (*it)->layer;
+                continue;
+            }
+
+            if (binmin < prevbinmin && prevlayer == (*it)->layer)
+                std::cout << "Error hits are out of order: min " << binmin << " max " << binmax << std::endl;
+
+            // if the max value of the previous hit is smaller than the current minvalue fill the histogram of the previous hit
+            // do the same when reached last hit
+            if (prevbinmax < binmin || prevlayer != (*it)->layer) {
+                if (m_debug)
+                    std::cout << " filling " << (*it)->layer << " r " << (*it)->r << " phimin " << (*it)->phimin << " phimax "
+                              << (*it)->phimax << " range " << prevbinmin << " " << prevbinmax << " new min " << binmin << "  " << binmax
+                              << std::endl;
+                for (int n = prevbinmin; n <= prevbinmax; ++n) {
+                    unsigned int& val = m_histo[n];
+                    int w = 1000 * (*it)->w;
+                    if (subtract) w *= -1;
+                    if (w < 0 && (int)val < -w)
+                        val = 0;
+                    else
+                        val += w;
+                }
+                prevbinmin = binmin;
+                prevbinmax = binmax;
+                prevlayer = (*it)->layer;
+
+            } else {
+                // update the maximum value of the window
+                if (m_debug)
+                    std::cout << " updating range " << (*it)->layer << " r " << (*it)->r << " phimin " << (*it)->phimin << " phimax "
+                              << (*it)->phimax << " range " << prevbinmin << " " << prevbinmax << " new min " << binmin << "  " << binmax
+                              << std::endl;
+                prevbinmax = binmax;
+            }
+        }
+        if (prevbinmax != -1) {
+            if (m_debug)
+                std::cout << " filling " << hits.back()->layer << " r " << hits.back()->r << " phimin " << hits.back()->phimin << " phimax "
+                          << hits.back()->phimax << " range " << prevbinmin << " " << prevbinmax << std::endl;
+            for (int n = prevbinmin; n <= prevbinmax; ++n) {
+                unsigned int& val = m_histo[n];
+                int w = 1000 * hits.back()->w;
+                if (subtract) w *= -1;
+                if (w < 0 && (int)val < -w)
+                    val = 0;
+                else
+                    val += w;
+            }
+        }
+    }
 
-    std::vector<TH1*> hists;
+    std::vector<TH1*> MuonPhiLayerHough::rootHistos(const std::string& prefix, const float* phimi, const float* phima) const {
+        std::vector<TH1*> hists;
 
-    float phimin = phimi ? *phimi : m_rangemin;
-    float phimax = phima ? *phima : m_rangemax;
+        float phimin = phimi ? *phimi : m_rangemin;
+        float phimax = phima ? *phima : m_rangemax;
 
-    TString hname = prefix + "_hist";
-    TH1F* h = new TH1F(hname,hname,m_nbins,phimin,phimax);
-    for( int n=0;n<m_nbins;++n ) h->SetBinContent(n+1,m_histo[n]*0.001);
-    hists.push_back(h);
-    return hists;
-  }
+        TString hname = prefix + "_hist";
+        TH1F* h = new TH1F(hname, hname, m_nbins, phimin, phimax);
+        for (int n = 0; n < m_nbins; ++n) h->SetBinContent(n + 1, m_histo[n] * 0.001);
+        hists.push_back(h);
+        return hists;
+    }
 
+    bool MuonPhiLayerHough::findMaximum(MuonPhiLayerHough::Maximum& maximum, float maxval) const {
+        maximum.max = 0;
+        maximum.pos = 0;
 
-  bool MuonPhiLayerHough::findMaximum( MuonPhiLayerHough::Maximum& maximum, float maxval ) const {
-    maximum.max = 0;
-    maximum.pos = 0;
+        maximum.binpos = -1;
+        maximum.binposmin = -1;
+        maximum.binposmax = -1;
 
-    maximum.binpos = -1;
-    maximum.binposmin = -1;
-    maximum.binposmax = -1;
+        maximum.hits.clear();
+        maximum.hough = this;
 
-    maximum.hits.clear();
-    maximum.hough = this;
+        if (maxval < 0) return false;
 
-    if( maxval < 0 ) return false;
+        unsigned int tmax = 0;
+        int posb = -1;
+        unsigned int imaxval = maxval * 1000;
+        // loop over histograms and find maximum
+        for (int n = 0; n < m_nbins; ++n) {
+            if (m_histo[n] < tmax) continue;
+            tmax = m_histo[n];
+            posb = n;
+        }
+        if (posb == -1) return false;
+        if (tmax < imaxval) return false;
+
+        maximum.max = tmax / 1000.;
+        maximum.pos = m_rangemin + m_binsize * posb;
+        maximum.binpos = posb;
+        maximum.binposmin = posb;
+        maximum.binposmax = posb;
+        if (maximum.max > 100) {
+            std::cout << " too large maximum: " << maximum.max << " tmax " << tmax << std::endl;
+            for (int n = 0; n < m_nbins; ++n) std::cout << "  " << m_histo[n] << std::endl;
+        }
 
-    unsigned int tmax = 0;
-    int posb = -1;
-    unsigned int imaxval = maxval*1000;
-    // loop over histograms and find maximum
-    for( int n=0;n<m_nbins;++n ) {
-      if( m_histo[n] < tmax ) continue;
-      tmax = m_histo[n];
-      posb = n;
-    }
-    if( posb == -1 )     return false;
-    if( tmax < imaxval ) return false;
-
-    maximum.max   = tmax/1000.;
-    maximum.pos   = m_rangemin + m_binsize*posb;
-    maximum.binpos    = posb;
-    maximum.binposmin = posb;
-    maximum.binposmax = posb;
-    if( maximum.max > 100 ){
-      std::cout << " too large maximum: " << maximum.max << " tmax " << tmax << std::endl;
-      for( int n=0;n<m_nbins;++n ) 
-	std::cout << "  " << m_histo[n] << std::endl;
+        // determin width of maximum
+        unsigned int imax = m_histo[posb];
+        unsigned int sidemax = 0.7 * imax;
+        // loop down, catch case the maximum is in the first bin
+        for (int n = posb != 0 ? posb - 1 : posb; n >= 0; --n) {
+            if (m_histo[n] > sidemax) {
+                maximum.binposmin = n;
+            } else {
+                break;
+            }
+        }
+        for (int n = posb + 1; n < m_nbins; ++n) {
+            if (m_histo[n] > sidemax) {
+                maximum.binposmax = n;
+            } else {
+                break;
+            }
+        }
+        return true;
     }
 
-    
-    // determin width of maximum
-    unsigned int imax = m_histo[posb];
-    unsigned int sidemax = 0.7*imax;
-    // loop down, catch case the maximum is in the first bin
-    for( int n=posb != 0 ? posb-1 : posb;n>=0;--n ) {
-      if( m_histo[n] > sidemax ) {
-	maximum.binposmin = n;
-      }else{
-	break;
-      }
-    }
-    for( int n=posb+1;n<m_nbins;++n ) {
-      if( m_histo[n] > sidemax ) {
-	maximum.binposmax = n;
-      }else{
-	break;
-      }
-    }
-    return true;
-  }
-
-  void MuonPhiLayerHough::associateHitsToMaximum( MuonPhiLayerHough::Maximum& maximum, const std::vector<PhiHit*>& hits ) const {
-    if( maximum.binposmax == -1 || maximum.binposmin == -1 ) return;
-    // loop over hits and find those that are compatible with the maximum
-    std::vector<PhiHit*>::const_iterator it = hits.begin();
-    std::vector<PhiHit*>::const_iterator it_end = hits.end();
-    for( ;it!=it_end;++it ){
-      // calculate the bins associated with the hit and check whether any of they are part of the maximum
-      std::pair<int,int> minMax = range((*it)->r,(*it)->phimin,(*it)->phimax);
-      if( m_debug ) std::cout << " hit: r " << (*it)->r << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax 
-			      << " range " << minMax.first << " " << minMax.second
-			      << "  maximum range " <<  maximum.binposmin << " " << maximum.binposmax << std::endl;
-      if( minMax.first  > maximum.binposmax ) continue; // minimum bin large than the maximum, drop
-      if( minMax.second < maximum.binposmin ) continue; // maximum bin smaller than the minimum, drop
-      // keep everything else
-      maximum.hits.push_back(*it);
+    void MuonPhiLayerHough::associateHitsToMaximum(MuonPhiLayerHough::Maximum& maximum, const std::vector<PhiHit*>& hits) const {
+        if (maximum.binposmax == -1 || maximum.binposmin == -1) return;
+        // loop over hits and find those that are compatible with the maximum
+        std::vector<PhiHit*>::const_iterator it = hits.begin();
+        std::vector<PhiHit*>::const_iterator it_end = hits.end();
+        for (; it != it_end; ++it) {
+            // calculate the bins associated with the hit and check whether any of they are part of the maximum
+            std::pair<int, int> minMax = range((*it)->r, (*it)->phimin, (*it)->phimax);
+            if (m_debug)
+                std::cout << " hit: r " << (*it)->r << " phimin " << (*it)->phimin << " phimax " << (*it)->phimax << " range "
+                          << minMax.first << " " << minMax.second << "  maximum range " << maximum.binposmin << " " << maximum.binposmax
+                          << std::endl;
+            if (minMax.first > maximum.binposmax) continue;   // minimum bin large than the maximum, drop
+            if (minMax.second < maximum.binposmin) continue;  // maximum bin smaller than the minimum, drop
+            // keep everything else
+            maximum.hits.push_back(*it);
+        }
     }
-  }
 
-}
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonRegionHough.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonRegionHough.cxx
index b84675e0d080a1c606ff83bf046d74f7bcdbc2e7..3ba4757d0726067730cda36816a34496d4deacd7 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonRegionHough.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonRegionHough.cxx
@@ -6,136 +6,147 @@
 
 namespace MuonHough {
 
-  MuonSectorHough::MuonSectorHough( int sector, const MuonDetectorDescription& regionDescriptions ) {
-    m_transforms.resize(Muon::MuonStationIndex::sectorLayerHashMax(),nullptr);
-    
-    // loop over regions and layers of the detector and build the transforms
-    for( int reg = 0; reg < Muon::MuonStationIndex::DetectorRegionIndexMax; ++reg ){
-      Muon::MuonStationIndex::DetectorRegionIndex region = static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(reg);
-      for( int lay = 0; lay < Muon::MuonStationIndex::LayerIndexMax; ++lay ){
-        Muon::MuonStationIndex::LayerIndex layer = static_cast<Muon::MuonStationIndex::LayerIndex>(lay);
-
-        // skip the few empty slots in the hash
-        RegionDescriptor descriptor = regionDescriptions.getDescriptor( sector, region, layer );
-        if( descriptor.chIndex == Muon::MuonStationIndex::ChUnknown ) continue;
-
-        int index = Muon::MuonStationIndex::sectorLayerHash(region,layer);
-        // std::cout << " creating transform: sector " << sector << " " << Muon::MuonStationIndex::regionName(region)
-        //           << " " << Muon::MuonStationIndex::layerName(layer) 
-        //           << " " << Muon::MuonStationIndex::stName(Muon::MuonStationIndex::toStationIndex(region,layer)) 
-        //           << " " << Muon::MuonStationIndex::chName(descriptor.chIndex)
-        //           << " index " << index << " max " << m_transforms.size() << std::endl;
-        // if( index >= m_transforms.size() ) std::cout << " index out of bound creating hough  " << Muon::MuonStationIndex::regionName(region)
-        //                                              << " " << Muon::MuonStationIndex::layerName(layer) << std::endl;
-        m_transforms[index] = new MuonLayerHough(descriptor);
-      }
+    MuonSectorHough::MuonSectorHough(int sector, const MuonDetectorDescription& regionDescriptions) {
+        m_transforms.resize(Muon::MuonStationIndex::sectorLayerHashMax(), nullptr);
+
+        // loop over regions and layers of the detector and build the transforms
+        for (int reg = 0; reg < Muon::MuonStationIndex::DetectorRegionIndexMax; ++reg) {
+            Muon::MuonStationIndex::DetectorRegionIndex region = static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(reg);
+            for (int lay = 0; lay < Muon::MuonStationIndex::LayerIndexMax; ++lay) {
+                Muon::MuonStationIndex::LayerIndex layer = static_cast<Muon::MuonStationIndex::LayerIndex>(lay);
+
+                // skip the few empty slots in the hash
+                RegionDescriptor descriptor = regionDescriptions.getDescriptor(sector, region, layer);
+                if (descriptor.chIndex == Muon::MuonStationIndex::ChUnknown) continue;
+
+                int index = Muon::MuonStationIndex::sectorLayerHash(region, layer);
+                // std::cout << " creating transform: sector " << sector << " " << Muon::MuonStationIndex::regionName(region)
+                //           << " " << Muon::MuonStationIndex::layerName(layer)
+                //           << " " << Muon::MuonStationIndex::stName(Muon::MuonStationIndex::toStationIndex(region,layer))
+                //           << " " << Muon::MuonStationIndex::chName(descriptor.chIndex)
+                //           << " index " << index << " max " << m_transforms.size() << std::endl;
+                // if( index >= m_transforms.size() ) std::cout << " index out of bound creating hough  " <<
+                // Muon::MuonStationIndex::regionName(region)
+                //                                              << " " << Muon::MuonStationIndex::layerName(layer) << std::endl;
+                m_transforms[index] = new MuonLayerHough(descriptor);
+            }
+        }
     }
-  }
-    
-  MuonSectorHough::~MuonSectorHough() {
-    for( auto& transform : m_transforms ) delete transform;
-  }
-
-  void MuonSectorHough::reset() {
-    for( auto& transform : m_transforms ) {
-      if( transform ) transform->reset();
+
+    MuonSectorHough::~MuonSectorHough() {
+        for (auto& transform : m_transforms) delete transform;
+    }
+
+    void MuonSectorHough::reset() {
+        for (auto& transform : m_transforms) {
+            if (transform) transform->reset();
+        }
     }
-  }
 
-  void MuonDetectorHough::reset() {
-    for( auto& sector : m_sectors ) sector->reset();
-    for( auto& transform : m_phiTransforms ) transform->reset();
-  }
+    void MuonDetectorHough::reset() {
+        for (auto& sector : m_sectors) sector->reset();
+        for (auto& transform : m_phiTransforms) transform->reset();
+    }
 
-  MuonDetectorHough::MuonDetectorHough() {
-    init();
-  }
+    MuonDetectorHough::MuonDetectorHough() { init(); }
 
     /// destructor
-  MuonDetectorHough::~MuonDetectorHough() {
-    for( auto& sector : m_sectors ) delete sector;
-    for( auto& transform : m_phiTransforms ) delete transform;
-  }
-
-  void MuonDetectorHough::init() {
-    MuonDetectorDescription detectorDescription;//initialize all the regions
-    for(unsigned int i=1;i<=16;++i ){
-      m_sectors.push_back( new MuonSectorHough(i,detectorDescription) );
-    }
-    for( unsigned int i=0;i<Muon::MuonStationIndex::DetectorRegionIndexMax;++i ) {
-      m_phiTransforms.push_back( new MuonPhiLayerHough(60, -M_PI, M_PI, static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(i)) );
-    }
-  }
-
-  MuonDetectorDescription::MuonDetectorDescription() {
-    initDefaultRegions();
-  }
-
-  RegionDescriptor MuonDetectorDescription::getDescriptor( int sector, Muon::MuonStationIndex::DetectorRegionIndex region, Muon::MuonStationIndex::LayerIndex layer ) const {
-    bool isSmall = (sector%2==0);
-    Muon::MuonStationIndex::ChIndex chIndex = Muon::MuonStationIndex::toChamberIndex(region,layer,isSmall);
-    //std::cout << "chamberIndex " << chIndex << " region " << region << " layer " << layer << " isSmall " << isSmall << std::endl ;
-    // if (region%2 != 1 && layer == 4 && !isSmall){//fix bee chamber in the endcap, add them back in for larger chambers//possible bug in chamber to index
-    //   chIndex = Muon::MuonStationIndex::BEE;
-    // }
-
-    if( chIndex < 0 || chIndex >= Muon::MuonStationIndex::ChIndexMax ) {
-      RegionDescriptor descriptor;
-      return descriptor;
+    MuonDetectorHough::~MuonDetectorHough() {
+        for (auto& sector : m_sectors) delete sector;
+        for (auto& transform : m_phiTransforms) delete transform;
     }
 
-    RegionDescriptor descriptor = m_regionDescriptions[chIndex];
-    descriptor.sector = sector;
-    // exceptions for a few barrel regions
-    if( region == Muon::MuonStationIndex::Barrel ){
-      if( (sector == 10 || sector == 14 ) && layer == Muon::MuonStationIndex::Inner )     descriptor.referencePosition = 5400.;
-      else if( (sector == 11 || sector == 13) && layer == Muon::MuonStationIndex::Outer ) descriptor.referencePosition = 10650.;
+    void MuonDetectorHough::init() {
+        MuonDetectorDescription detectorDescription;  // initialize all the regions
+        for (unsigned int i = 1; i <= 16; ++i) { m_sectors.push_back(new MuonSectorHough(i, detectorDescription)); }
+        for (unsigned int i = 0; i < Muon::MuonStationIndex::DetectorRegionIndexMax; ++i) {
+            m_phiTransforms.push_back(new MuonPhiLayerHough(60, -M_PI, M_PI, static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(i)));
+        }
     }
-    else if( region == Muon::MuonStationIndex::EndcapC ) { // multiply reference position by -1 for C side
-      descriptor.region = region;
-      if( layer ==  Muon::MuonStationIndex::BarrelExtended ){
-        descriptor.yMinRange *= -1;
-        descriptor.yMaxRange *= -1;
-        std::swap(descriptor.yMinRange,descriptor.yMaxRange);
-      }
-      else{
-        descriptor.referencePosition *= -1;
-      }
+
+    MuonDetectorDescription::MuonDetectorDescription() { initDefaultRegions(); }
+
+    RegionDescriptor MuonDetectorDescription::getDescriptor(int sector, Muon::MuonStationIndex::DetectorRegionIndex region,
+                                                            Muon::MuonStationIndex::LayerIndex layer) const {
+        bool isSmall = (sector % 2 == 0);
+        Muon::MuonStationIndex::ChIndex chIndex = Muon::MuonStationIndex::toChamberIndex(region, layer, isSmall);
+        // std::cout << "chamberIndex " << chIndex << " region " << region << " layer " << layer << " isSmall " << isSmall << std::endl ;
+        // if (region%2 != 1 && layer == 4 && !isSmall){//fix bee chamber in the endcap, add them back in for larger chambers//possible bug
+        // in chamber to index
+        //   chIndex = Muon::MuonStationIndex::BEE;
+        // }
+
+        if (chIndex < 0 || chIndex >= Muon::MuonStationIndex::ChIndexMax) {
+            RegionDescriptor descriptor;
+            return descriptor;
+        }
+
+        RegionDescriptor descriptor = m_regionDescriptions[chIndex];
+        descriptor.sector = sector;
+        // exceptions for a few barrel regions
+        if (region == Muon::MuonStationIndex::Barrel) {
+            if ((sector == 10 || sector == 14) && layer == Muon::MuonStationIndex::Inner)
+                descriptor.referencePosition = 5400.;
+            else if ((sector == 11 || sector == 13) && layer == Muon::MuonStationIndex::Outer)
+                descriptor.referencePosition = 10650.;
+        } else if (region == Muon::MuonStationIndex::EndcapC) {  // multiply reference position by -1 for C side
+            descriptor.region = region;
+            if (layer == Muon::MuonStationIndex::BarrelExtended) {
+                descriptor.yMinRange *= -1;
+                descriptor.yMaxRange *= -1;
+                std::swap(descriptor.yMinRange, descriptor.yMaxRange);
+            } else {
+                descriptor.referencePosition *= -1;
+            }
+        }
+
+        if (descriptor.chIndex < 0 || descriptor.chIndex >= Muon::MuonStationIndex::ChIndexMax) {
+            std::cout << " bad descriptor!!!! " << Muon::MuonStationIndex::regionName(region) << " "
+                      << Muon::MuonStationIndex::layerName(layer) << " " << isSmall << " " << chIndex << std::endl;
+        }
+        return descriptor;
     }
 
-    if( descriptor.chIndex < 0 || descriptor.chIndex >= Muon::MuonStationIndex::ChIndexMax ) {
-      std::cout << " bad descriptor!!!! " << Muon::MuonStationIndex::regionName(region) << " " << Muon::MuonStationIndex::layerName(layer) << " " << isSmall << " " << chIndex << std::endl;
+    void MuonDetectorDescription::initDefaultRegions() {
+        double scalefactor = 1.0;               // can be used to tune the steps in theta variation!
+        int inner_step = 3;                     // default is 3
+        int middle_step = 5 * scalefactor;      // default is 5--range is 0.25
+        int outer_step = 7 * scalefactor;       // default is 7--range is 0.35
+        double inner_gap = 0.05;                // default is 0.05
+        double middle_gap = 0.1 / scalefactor;  // default is 0.1
+        double outer_gap = 0.1 / scalefactor;   // default is 0.1
+        int ystep = 30;                         // default is 30
+        m_regionDescriptions.resize(Muon::MuonStationIndex::CSS);
+        m_regionDescriptions[Muon::MuonStationIndex::BIS] = RegionDescriptor(1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BIS,
+                                                                             4560, -7500, 7500, ystep, middle_gap, inner_step);
+        m_regionDescriptions[Muon::MuonStationIndex::BIL] = RegionDescriptor(1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BIL,
+                                                                             4950, -7000, 7000, ystep, middle_gap, inner_step);
+        m_regionDescriptions[Muon::MuonStationIndex::BMS] = RegionDescriptor(1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BMS,
+                                                                             8096, -9500, 9500, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::BML] = RegionDescriptor(1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BML,
+                                                                             7153, -9500, 9500, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::BOS] = RegionDescriptor(1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BOS,
+                                                                             10570, -13500, 13500, ystep, outer_gap, outer_step);
+        m_regionDescriptions[Muon::MuonStationIndex::BOL] = RegionDescriptor(1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BOL,
+                                                                             9500, -13500, 13500, ystep, outer_gap, outer_step);
+        m_regionDescriptions[Muon::MuonStationIndex::BEE] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::BEE, 4415, 7500, 13000, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EIS] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EIS, 7270, 1000, 7000, ystep, inner_gap, inner_step);  // 7
+        m_regionDescriptions[Muon::MuonStationIndex::EIL] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EIL, 7675, 1000, 8000, ystep, inner_gap, inner_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EES] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EES, 10800, 4000, 10000, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EEL] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EEL, 11330, 4000, 10000, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EMS] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EMS, 13872, 1500, 13000, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EML] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EML, 14310, 1500, 13000, ystep, middle_gap, middle_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EOS] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EOS, 21841, 2000, 13500, ystep, outer_gap, outer_step);
+        m_regionDescriptions[Muon::MuonStationIndex::EOL] = RegionDescriptor(
+            1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EOL, 21421, 2000, 13500, ystep, outer_gap, outer_step);
     }
-    return descriptor;
-  }
-    
-
-
-  void MuonDetectorDescription::initDefaultRegions() {
-    double scalefactor = 1.0;//can be used to tune the steps in theta variation!
-    int inner_step = 3;//default is 3
-    int middle_step = 5*scalefactor;//default is 5--range is 0.25
-    int outer_step = 7*scalefactor;//default is 7--range is 0.35
-    double inner_gap = 0.05;//default is 0.05
-    double middle_gap = 0.1/scalefactor;//default is 0.1
-    double outer_gap = 0.1/scalefactor;//default is 0.1
-    int ystep = 30; //default is 30
-    m_regionDescriptions.resize(Muon::MuonStationIndex::CSS);
-    m_regionDescriptions[Muon::MuonStationIndex::BIS] = RegionDescriptor(  1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BIS,  4560,  -7500,  7500, ystep, middle_gap, inner_step );
-    m_regionDescriptions[Muon::MuonStationIndex::BIL] = RegionDescriptor(  1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BIL,  4950,  -7000,  7000, ystep, middle_gap, inner_step );
-    m_regionDescriptions[Muon::MuonStationIndex::BMS] = RegionDescriptor(  1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BMS,  8096,  -9500,  9500, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::BML] = RegionDescriptor(  1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BML,  7153,  -9500,  9500, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::BOS] = RegionDescriptor(  1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BOS, 10570, -13500, 13500, ystep, outer_gap, outer_step );
-    m_regionDescriptions[Muon::MuonStationIndex::BOL] = RegionDescriptor(  1, Muon::MuonStationIndex::Barrel, Muon::MuonStationIndex::BOL,  9500, -13500, 13500, ystep, outer_gap, outer_step );
-    m_regionDescriptions[Muon::MuonStationIndex::BEE] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::BEE,  4415,  7500, 13000, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EIS] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EIS,  7270,  1000,  7000, ystep, inner_gap, inner_step );//7
-    m_regionDescriptions[Muon::MuonStationIndex::EIL] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EIL,  7675,  1000,  8000, ystep, inner_gap, inner_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EES] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EES, 10800,  4000, 10000, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EEL] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EEL, 11330,  4000, 10000, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EMS] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EMS, 13872,  1500, 13000, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EML] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EML, 14310,  1500, 13000, ystep, middle_gap, middle_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EOS] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EOS, 21841,  2000, 13500, ystep, outer_gap, outer_step );
-    m_regionDescriptions[Muon::MuonStationIndex::EOL] = RegionDescriptor(  1, Muon::MuonStationIndex::EndcapA, Muon::MuonStationIndex::EOL, 21421,  2000, 13500, ystep, outer_gap, outer_step );
-  }
-
-}
+
+}  // namespace MuonHough
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerAlgs/MuonSegmentTrackMaker/python/MuonTrackMakerAlgsMonitoring.py b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerAlgs/MuonSegmentTrackMaker/python/MuonTrackMakerAlgsMonitoring.py
index 26509dcf6881cde333c25814feb66c0639ad6acf..a3bd031edd415881008d1794a322eafcdc323af9 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerAlgs/MuonSegmentTrackMaker/python/MuonTrackMakerAlgsMonitoring.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerAlgs/MuonSegmentTrackMaker/python/MuonTrackMakerAlgsMonitoring.py
@@ -1,20 +1,21 @@
-# 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: Laurynas Mince
 # Created on 15.10.2019
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class MuPatTrackBuilderMonitoring(GenericMonitoringTool):
-    def __init__ (self, name="MuPatTrackBuilderMonitoring"):
-        super(MuPatTrackBuilderMonitoring, self).__init__(name)
+def MuPatTrackBuilderMonitoring(name = "MuPatTrackBuilderMonitoring"):
 
-        self.HistPath = name
-        self.defineHistogram("mstrks_n", type="TH1F", path="EXPERT", title="MS track n; N of tracks", xbins=50, xmin=0, xmax=50)
-        self.defineHistogram("mstrks_pt", type="TH1F", path="EXPERT", title="MS track pT; pT", xbins=100, xmin=0, xmax=300)
-        self.defineHistogram("mstrks_eta", type="TH1F", path="EXPERT", title="MS track eta; #eta", xbins=50, xmin=-5, xmax=5)
-        self.defineHistogram("mstrks_phi", type="TH1F", path="EXPERT", title="MS track phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
-        self.defineHistogram("mstrks_eta,mstrks_phi", type="TH2F", path="EXPERT", title="MS track #eta vs. #phi; #eta; #phi", xbins=50, xmin=-5, xmax=5, ybins=40, ymin=-3.2, ymax=3.2)
+    montool = GenericMonitoringTool(name, HistPath = name)
 
-        self.defineHistogram("mssegs_n", type="TH1F", path="EXPERT", title="MS segment n; N of segments", xbins=50, xmin=0, xmax=50)
-        self.defineHistogram("mssegs_eta", type="TH1F", path="EXPERT", title="MS segment eta; #eta", xbins=50, xmin=-5, xmax=5)
-        self.defineHistogram("mssegs_phi", type="TH1F", path="EXPERT", title="MS segment phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+    montool.defineHistogram("mstrks_n", type="TH1F", path="EXPERT", title="MS track n; N of tracks", xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram("mstrks_pt", type="TH1F", path="EXPERT", title="MS track pT; pT", xbins=100, xmin=0, xmax=300)
+    montool.defineHistogram("mstrks_eta", type="TH1F", path="EXPERT", title="MS track eta; #eta", xbins=50, xmin=-5, xmax=5)
+    montool.defineHistogram("mstrks_phi", type="TH1F", path="EXPERT", title="MS track phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+    montool.defineHistogram("mstrks_eta,mstrks_phi", type="TH2F", path="EXPERT", title="MS track #eta vs. #phi; #eta; #phi", xbins=50, xmin=-5, xmax=5, ybins=40, ymin=-3.2, ymax=3.2)
+
+    montool.defineHistogram("mssegs_n", type="TH1F", path="EXPERT", title="MS segment n; N of segments", xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram("mssegs_eta", type="TH1F", path="EXPERT", title="MS segment eta; #eta", xbins=50, xmin=-5, xmax=5)
+    montool.defineHistogram("mssegs_phi", type="TH1F", path="EXPERT", title="MS segment phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+
+    return montool
diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTRTStandaloneTrackAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTRTStandaloneTrackAlg.cxx
index a06a58bb1e40c52c5e7c23d1f3f59aec8bacab1e..fcf97442f4343caf43bba5921c35ff113357c692 100644
--- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTRTStandaloneTrackAlg.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTRTStandaloneTrackAlg.cxx
@@ -9,21 +9,22 @@
 /**
  * @brief Gaudi initialize method.
  */
-StatusCode ThinTRTStandaloneTrackAlg::initialize()
+StatusCode
+ThinTRTStandaloneTrackAlg::initialize()
 {
-  ATH_CHECK( m_InDetTrackParticlesKey.initialize(m_streamName) );
-  
-  if ( m_doElectron ) {
-    ATH_CHECK( m_InputElectronContainerKey.initialize() );
+  ATH_CHECK(m_InDetTrackParticlesKey.initialize(m_streamName));
+
+  if (m_doElectron) {
+    ATH_CHECK(m_InputElectronContainerKey.initialize());
   }
-  if ( m_doPhoton ) {
-    ATH_CHECK( m_InputPhotonContainerKey.initialize() );
+  if (m_doPhoton) {
+    ATH_CHECK(m_InputPhotonContainerKey.initialize());
   }
-  if ( m_doTau ) {
-    ATH_CHECK( m_InputTauJetContainerKey.initialize() );
+  if (m_doTau) {
+    ATH_CHECK(m_InputTauJetContainerKey.initialize());
   }
   if (m_doMuon) {
-     ATH_CHECK(m_inputMuonContainerKey.initialize() );
+    ATH_CHECK(m_inputMuonContainerKey.initialize());
   }
   return StatusCode::SUCCESS;
 }
@@ -32,119 +33,134 @@ StatusCode ThinTRTStandaloneTrackAlg::initialize()
  * @brief Execute the algorithm.
  * @param ctx Current event context.
  */
-StatusCode ThinTRTStandaloneTrackAlg::execute (const EventContext& ctx) const
+StatusCode
+ThinTRTStandaloneTrackAlg::execute(const EventContext& ctx) const
 {
   // Retrieve InDet TrackParticles
-  SG::ThinningHandle<xAOD::TrackParticleContainer> indetTrackPC(m_InDetTrackParticlesKey, ctx);
-  if ( !indetTrackPC.isValid() ) {
-    ATH_MSG_FATAL("Failed to retrieve "<< m_InDetTrackParticlesKey.key());
+  SG::ThinningHandle<xAOD::TrackParticleContainer> indetTrackPC(
+    m_InDetTrackParticlesKey, ctx);
+
+  if (!indetTrackPC.isValid()) {
+    ATH_MSG_FATAL("Failed to retrieve " << m_InDetTrackParticlesKey.key());
     return StatusCode::FAILURE;
   }
-  ATH_MSG_DEBUG("Number of InDet TrackParticles "<< indetTrackPC->size());
+  ATH_MSG_DEBUG("Number of InDet TrackParticles " << indetTrackPC->size());
 
   // We set to false ONLY the TRT standalone track particles
-  // We then reset to true whatever is kept by e/gamma and taus
+  // We then reset to true whatever is to be kept
+  // from the domains
   std::vector<bool> keptInDetTrackParticles;
-  keptInDetTrackParticles.resize( indetTrackPC->size(), true );
-
-  for (const auto *trkIt : *indetTrackPC) {
-    if ( xAOD::EgammaHelpers::numberOfSiHits(trkIt) < 4 ) {
-      keptInDetTrackParticles[trkIt->index()] = false;
+  keptInDetTrackParticles.resize(indetTrackPC->size(), true);
+  for (const auto* track : *indetTrackPC) {
+    if (track->patternRecoInfo().test(xAOD::TRTStandalone)) {
+      keptInDetTrackParticles[track->index()] = false;
     }
   }
 
-  if ( m_doElectron ) {
+  if (m_doElectron) {
     // Retrieve electrons
-    SG::ReadHandle<xAOD::ElectronContainer> electrons(m_InputElectronContainerKey, ctx);
-    if ( !electrons.isValid() ) {
-      ATH_MSG_FATAL("Failed to retrieve "<< m_InputElectronContainerKey.key());
+    SG::ReadHandle<xAOD::ElectronContainer> electrons(
+      m_InputElectronContainerKey, ctx);
+    if (!electrons.isValid()) {
+      ATH_MSG_FATAL("Failed to retrieve " << m_InputElectronContainerKey.key());
       return StatusCode::FAILURE;
     }
-    
+
     // Loop over electrons
     for (const xAOD::Electron* electron : *electrons) {
       auto trackParticleLinks = electron->trackParticleLinks();
-      for (const auto& link :  trackParticleLinks) {
-	if ( !link.isValid() ) {
-	  continue;
-	}
-	ATH_MSG_DEBUG("Electons : Keeping InDet Track Particle with index : "
-		      << (xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))->index());
-	keptInDetTrackParticles[ (xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))->index() ] = true;
+      for (const auto& link : trackParticleLinks) {
+        if (!link.isValid()) {
+          continue;
+        }
+        ATH_MSG_DEBUG(
+          "Electons : Keeping InDet Track Particle with index : "
+          << (xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))
+               ->index());
+        keptInDetTrackParticles
+          [(xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))
+             ->index()] = true;
       }
     }
   }
 
-  if ( m_doPhoton ) {
+  if (m_doPhoton) {
     // Retrieve photons
-    SG::ReadHandle<xAOD::PhotonContainer> photons(m_InputPhotonContainerKey, ctx);
-    if ( !photons.isValid() ) {
-      ATH_MSG_FATAL("Failed to retrieve "<< m_InputPhotonContainerKey.key());
+    SG::ReadHandle<xAOD::PhotonContainer> photons(m_InputPhotonContainerKey,
+                                                  ctx);
+    if (!photons.isValid()) {
+      ATH_MSG_FATAL("Failed to retrieve " << m_InputPhotonContainerKey.key());
       return StatusCode::FAILURE;
     }
-    
+
     // Loop over photons
     for (const xAOD::Photon* photon : *photons) {
       auto vertexLinks = photon->vertexLinks();
       for (const auto& vxlink : vertexLinks) {
-	if ( !vxlink.isValid() ) {
-	  continue;
-	}
-	const xAOD::Vertex* vx = *(vxlink);
-	if ( !vx ) {
-	  continue;
-	}
-	auto trackParticleLinks = vx->trackParticleLinks();
-	for (const auto& link :  trackParticleLinks) {
-	  if( !link.isValid() ) {
-	    continue;
-	  }
-	  ATH_MSG_DEBUG("Photons : Keeping InDet Track Particle with index : "
-			<< (xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))->index());
-	  keptInDetTrackParticles[ (xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))->index()] = true;
-	}
+        if (!vxlink.isValid()) {
+          continue;
+        }
+        const xAOD::Vertex* vx = *(vxlink);
+        if (!vx) {
+          continue;
+        }
+        auto trackParticleLinks = vx->trackParticleLinks();
+        for (const auto& link : trackParticleLinks) {
+          if (!link.isValid()) {
+            continue;
+          }
+          ATH_MSG_DEBUG(
+            "Photons : Keeping InDet Track Particle with index : "
+            << (xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))
+                 ->index());
+          keptInDetTrackParticles
+            [(xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(*link))
+               ->index()] = true;
+        }
       }
     }
   }
 
-  if ( m_doTau ) {
+  if (m_doTau) {
     // Retrieve taus
     SG::ReadHandle<xAOD::TauJetContainer> taus(m_InputTauJetContainerKey, ctx);
-    if( !taus.isValid() ) {
-      ATH_MSG_FATAL("Failed to retrieve "<< m_InputTauJetContainerKey.key());
+    if (!taus.isValid()) {
+      ATH_MSG_FATAL("Failed to retrieve " << m_InputTauJetContainerKey.key());
       return StatusCode::FAILURE;
     }
-    static const SG::AuxElement::ConstAccessor<char> acc_passThinning("passThinning");
-    
+    static const SG::AuxElement::ConstAccessor<char> acc_passThinning(
+      "passThinning");
+
     // Loop over taus
     for (const xAOD::TauJet* tau : *taus) {
-      if ( !acc_passThinning(*tau) ) {
-	continue;
+      if (!acc_passThinning(*tau)) {
+        continue;
       }
       for (const xAOD::TauTrack* track : tau->allTracks()) {
-	// LRTs are not in the InDetTrackParticles container, so skip them
-	if ( !track->flag(xAOD::TauJetParameters::TauTrackFlag::LargeRadiusTrack) ) {
-	  keptInDetTrackParticles[track->track()->index()] = true;
-	}
+        // LRTs are not in the InDetTrackParticles container, so skip them
+        if (!track->flag(
+              xAOD::TauJetParameters::TauTrackFlag::LargeRadiusTrack)) {
+          keptInDetTrackParticles[track->track()->index()] = true;
+        }
       }
     }
   }
-   if (m_doMuon){
-     SG::ReadHandle<xAOD::MuonContainer> muons(m_inputMuonContainerKey, ctx);
-     if( !muons.isValid() ) {
-        ATH_MSG_FATAL("Failed to retrieve "<< m_inputMuonContainerKey.key());
-       return StatusCode::FAILURE;
-     }
-     for (const xAOD::Muon* muon : *muons){
-        const xAOD::TrackParticle* trk = muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
-        if (trk) keptInDetTrackParticles[trk->index()] = true;
-     }
-   
-   
-   }
+  if (m_doMuon) {
+    SG::ReadHandle<xAOD::MuonContainer> muons(m_inputMuonContainerKey, ctx);
+    if (!muons.isValid()) {
+      ATH_MSG_FATAL("Failed to retrieve " << m_inputMuonContainerKey.key());
+      return StatusCode::FAILURE;
+    }
+    for (const xAOD::Muon* muon : *muons) {
+      const xAOD::TrackParticle* trk =
+        muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
+      if (trk)
+        keptInDetTrackParticles[trk->index()] = true;
+    }
+  }
 
   // Do the thinning
-  indetTrackPC.keep (keptInDetTrackParticles);
+  indetTrackPC.keep(keptInDetTrackParticles);
 
   return StatusCode::SUCCESS;
 }
diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index d34a6e890db090c645d880c3df0c93b81a55f2bd..9a4dd9d20375c613b49112cba4d72f4752dcfbd8 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.118
+AnalysisBaseExternalsVersion = 2.0.119
diff --git a/Projects/AthAnalysis/build_externals.sh b/Projects/AthAnalysis/build_externals.sh
index 4635b9f10d7b70d382915724c047eba25b8bf0d3..fc75f7c6529a19ce40613e7d4ea4254ee9ad3ee4 100755
--- a/Projects/AthAnalysis/build_externals.sh
+++ b/Projects/AthAnalysis/build_externals.sh
@@ -10,7 +10,7 @@ ATLAS_PROJECT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
 ATLAS_EXT_PROJECT_NAME="AthAnalysisExternals"
 ATLAS_BUILDTYPE="RelWithDebInfo"
 ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=101
-                        -DLCG_VERSION_POSTFIX="_ATLAS_2"
+                        -DLCG_VERSION_POSTFIX="_ATLAS_4"
                         -DATLAS_GAUDI_TAG="v36r2.000"
                         -DATLAS_COOL_TAG="COOL_3_3_9")
 ATLAS_EXTRA_MAKE_ARGS=()
diff --git a/Projects/AthAnalysis/externals.txt b/Projects/AthAnalysis/externals.txt
index 7b05eeaa9a4bec0d874898dbc6a63c94deae987c..8c0f4e8f1fab16ef1dcc15d4ff18eb8d942624f7 100644
--- a/Projects/AthAnalysis/externals.txt
+++ b/Projects/AthAnalysis/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthAnalysisExternalsVersion = 2.0.118
+AthAnalysisExternalsVersion = 2.0.119
diff --git a/Projects/AthDataQuality/CMakeLists.txt b/Projects/AthDataQuality/CMakeLists.txt
index fc97980e4ca18771882af3f54406d84c46fc2679..0bdada9ccd3b8f622872932929c5b0aacf2cfc4e 100644
--- a/Projects/AthDataQuality/CMakeLists.txt
+++ b/Projects/AthDataQuality/CMakeLists.txt
@@ -18,7 +18,7 @@ set( TDAQ-COMMON_ATROOT
 find_package( AtlasCMake REQUIRED )
 
 # Build the project against LCG:
-set( LCG_VERSION_POSTFIX "_ATLAS_2"
+set( LCG_VERSION_POSTFIX "_ATLAS_4"
    CACHE STRING "Version postfix for the LCG release to use" )
 set( LCG_VERSION_NUMBER 101
    CACHE STRING "Version number for the LCG release to use" )
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index b779041d2cfbf64973a9b6efc3d8bfc26b3f70de..834a3f216e756e2a7dd3e9b27bf90eba40810cb5 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.118
+AtlasExternalsVersion = 2.0.119
diff --git a/Projects/AthGeneration/build_externals.sh b/Projects/AthGeneration/build_externals.sh
index 4afeb46cef2c5c5c9a5258bd220fb82a80092592..7fb9208a28a4180a878a6095fed6ce7d10eda299 100755
--- a/Projects/AthGeneration/build_externals.sh
+++ b/Projects/AthGeneration/build_externals.sh
@@ -10,7 +10,7 @@ ATLAS_PROJECT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
 ATLAS_EXT_PROJECT_NAME="AthGenerationExternals"
 ATLAS_BUILDTYPE="RelWithDebInfo"
 ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=101
-                        -DLCG_VERSION_POSTFIX="_ATLAS_2"
+                        -DLCG_VERSION_POSTFIX="_ATLAS_4"
                         -DATLAS_GAUDI_TAG="v36r2.000"
                         -DATLAS_COOL_TAG="COOL_3_3_9")
 ATLAS_EXTRA_MAKE_ARGS=()
diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt
index c52bce29a0ea0ec90f8897f6fa6d6f26d227d9da..dd7a35839f2b8be3341b5f5cd4ab4cbcd2c580da 100644
--- a/Projects/AthGeneration/externals.txt
+++ b/Projects/AthGeneration/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthGenerationExternalsVersion = 2.0.118
+AthGenerationExternalsVersion = 2.0.119
diff --git a/Projects/AthSimulation/build_externals.sh b/Projects/AthSimulation/build_externals.sh
index 884fc658c265f4f5c88ab07fbc0c5f3fa8cbf50c..962447eb3dd755d1732ca40b8d54f2ca1b377d6f 100755
--- a/Projects/AthSimulation/build_externals.sh
+++ b/Projects/AthSimulation/build_externals.sh
@@ -10,7 +10,7 @@ ATLAS_PROJECT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
 ATLAS_EXT_PROJECT_NAME="AthSimulationExternals"
 ATLAS_BUILDTYPE="RelWithDebInfo"
 ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=101
-                        -DLCG_VERSION_POSTFIX="_ATLAS_2"
+                        -DLCG_VERSION_POSTFIX="_ATLAS_4"
                         -DATLAS_GAUDI_TAG="v36r2.000"
                         -DATLAS_COOL_TAG="COOL_3_3_9")
 ATLAS_EXTRA_MAKE_ARGS=()
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 0e3335f18543093436d6a1ecb119f738b3722777..ccbd6a80a649a98cdcc88f29d1e8b0742b1d3368 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.118
+AthSimulationExternalsVersion = 2.0.119
diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh
index 3f5ba1bca28e65e3edb34dd410f818eb78df609d..81360f19769d4651db3ec490dfe7cc51e176b382 100755
--- a/Projects/Athena/build_externals.sh
+++ b/Projects/Athena/build_externals.sh
@@ -10,9 +10,8 @@ ATLAS_PROJECT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
 ATLAS_EXT_PROJECT_NAME="AthenaExternals"
 ATLAS_BUILDTYPE="RelWithDebInfo"
 ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=101
-                        -DLCG_VERSION_POSTFIX="_ATLAS_2"
-                        -DATLAS_GAUDI_TAG="v36r2.000"
-                        -DATLAS_COOL_TAG="COOL_3_3_9")
+                        -DLCG_VERSION_POSTFIX="_ATLAS_4"
+                        -DATLAS_GAUDI_TAG="v36r2.000")
 ATLAS_EXTRA_MAKE_ARGS=()
 
 # Let "the common script" do all the heavy lifting.
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index 6b0b5704816334245b44b415e3ef9b4e9c628dd8..c1cccab65a4e3938b9abecac1ed55f990ec69ca5 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.118
+AthenaExternalsVersion = 2.0.119
diff --git a/Projects/DetCommon/externals.txt b/Projects/DetCommon/externals.txt
index 188b6d228061a8f0fbdd839d5eb084253615e354..b5496f110df93e98158e3a9fac9ccef0fb296269 100644
--- a/Projects/DetCommon/externals.txt
+++ b/Projects/DetCommon/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AtlasExternalsVersion = 2.0.118
+AtlasExternalsVersion = 2.0.119
diff --git a/Projects/VP1Light/build_externals.sh b/Projects/VP1Light/build_externals.sh
index d597001546d0f330d35727d8f8cfbcbcf352cd75..01abad981be70d6b2156e9a67f0fa06103a4c3c9 100755
--- a/Projects/VP1Light/build_externals.sh
+++ b/Projects/VP1Light/build_externals.sh
@@ -10,7 +10,7 @@ ATLAS_PROJECT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
 ATLAS_EXT_PROJECT_NAME="VP1LightExternals"
 ATLAS_BUILDTYPE="RelWithDebInfo"
 ATLAS_EXTRA_CMAKE_ARGS=(-DLCG_VERSION_NUMBER=101
-                        -DLCG_VERSION_POSTFIX="_ATLAS_2")
+                        -DLCG_VERSION_POSTFIX="_ATLAS_4")
 ATLAS_EXTRA_MAKE_ARGS=()
 
 # Let "the common script" do all the heavy lifting.
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index f4a243fc51f66f960ea9c043805c54fb4439e87d..6d578f1ba133413b848d4e9fb3a2eede42618a7f 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.118
+VP1LightExternalsVersion = 2.0.119
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/python/MuonCombinedAlgsMonitoring.py b/Reconstruction/MuonIdentification/MuonCombinedAlgs/python/MuonCombinedAlgsMonitoring.py
index 44151e83ee653a8577729c435bb17bb7917b49ba..922ffb420008849484e73674e6a21a47bb5e00e5 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/python/MuonCombinedAlgsMonitoring.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/python/MuonCombinedAlgsMonitoring.py
@@ -1,34 +1,35 @@
-# 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: Laurynas Mince
 # Created on 26.07.2019
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class MuonCreatorAlgMonitoring(GenericMonitoringTool):
-    def __init__ (self, name="MuonCreatorAlgMonitoring"):
-        super(MuonCreatorAlgMonitoring, self).__init__(name)
-
-        self.HistPath = name
-        self.defineHistogram( "muon_n", type="TH1F", path="EXPERT", title="Number of muons; N of muons", xbins=50, xmin=0, xmax=50)
-        self.defineHistogram( "muon_pt", type="TH1F", path="EXPERT", title="Muon pT; p_T", xbins=100, xmin=0, xmax=300)
-        self.defineHistogram( "muon_eta", type="TH1F", path="EXPERT", title="Muon eta; #eta", xbins=40, xmin=-3, xmax=3)
-        self.defineHistogram( "muon_phi", type="TH1F", path="EXPERT", title="Muon phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
-
-        # Turn-off SA track histograms for inside-out muon reconstruction
-        if not ("InsideOut" in name or "Late" in name):
-            self.defineHistogram( "satrks_n", type="TH1F", path="EXPERT", title="Number of SA tracks; N of tracks", xbins=50, xmin=0, xmax=50)
-            self.defineHistogram( "satrks_pt", type="TH1F", path="EXPERT", title="Extrapolated Trk pT; p_T", xbins=100, xmin=0, xmax=300)
-            self.defineHistogram( "satrks_eta", type="TH1F", path="EXPERT", title="Extrapolated Trk eta; #eta", xbins=40, xmin=-3, xmax=3)
-            self.defineHistogram( "satrks_phi", type="TH1F", path="EXPERT", title="Extrapolated Trk phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
-
-        if "CB" in name or "Late" in name or "InsideOut" in name:
-            self.defineHistogram( "cbtrks_n", type="TH1F", path="EXPERT", title="Number of CB tracks; N of tracks", xbins=50, xmin=0, xmax=50)
-            self.defineHistogram( "cbtrks_pt", type="TH1F", path="EXPERT", title="Combined Trk pT; p_T", xbins=100, xmin=0, xmax=300)
-            self.defineHistogram( "cbtrks_eta", type="TH1F", path="EXPERT", title="Combined Trk eta; #eta", xbins=40, xmin=-3, xmax=3)
-            self.defineHistogram( "cbtrks_phi", type="TH1F", path="EXPERT", title="Combined Trk phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
-            
-            self.defineHistogram( "idtrks_n", type="TH1F", path="EXPERT", title="Number of ID tracks; N of tracks", xbins=50, xmin=0, xmax=50)
-            self.defineHistogram( "idtrks_pt", type="TH1F", path="EXPERT", title="ID tracks pT; p_T", xbins=100, xmin=0, xmax=300)
-            self.defineHistogram( "idtrks_eta", type="TH1F", path="EXPERT", title="ID tracks eta; #eta", xbins=40, xmin=-3, xmax=3)
-            self.defineHistogram( "idtrks_phi", type="TH1F", path="EXPERT", title="ID tracks phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
-            self.defineHistogram( "idtrks_pt,idtrks_eta", type="TH2F", path="EXPERT", title="ID tracks pT vs. #eta; p_T; #eta", xbins=100, xmin=0, xmax=300, ybins=50, ymin=-5, ymax=5)
+def MuonCreatorAlgMonitoring(name="MuonCreatorAlgMonitoring"):
+
+    montool = GenericMonitoringTool(name, HistPath = name)
+
+    montool.defineHistogram( "muon_n", type="TH1F", path="EXPERT", title="Number of muons; N of muons", xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram( "muon_pt", type="TH1F", path="EXPERT", title="Muon pT; p_T", xbins=100, xmin=0, xmax=300)
+    montool.defineHistogram( "muon_eta", type="TH1F", path="EXPERT", title="Muon eta; #eta", xbins=40, xmin=-3, xmax=3)
+    montool.defineHistogram( "muon_phi", type="TH1F", path="EXPERT", title="Muon phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+
+    # Turn-off SA track histograms for inside-out muon reconstruction
+    if not ("InsideOut" in name or "Late" in name):
+        montool.defineHistogram( "satrks_n", type="TH1F", path="EXPERT", title="Number of SA tracks; N of tracks", xbins=50, xmin=0, xmax=50)
+        montool.defineHistogram( "satrks_pt", type="TH1F", path="EXPERT", title="Extrapolated Trk pT; p_T", xbins=100, xmin=0, xmax=300)
+        montool.defineHistogram( "satrks_eta", type="TH1F", path="EXPERT", title="Extrapolated Trk eta; #eta", xbins=40, xmin=-3, xmax=3)
+        montool.defineHistogram( "satrks_phi", type="TH1F", path="EXPERT", title="Extrapolated Trk phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+
+    if "CB" in name or "Late" in name or "InsideOut" in name:
+        montool.defineHistogram( "cbtrks_n", type="TH1F", path="EXPERT", title="Number of CB tracks; N of tracks", xbins=50, xmin=0, xmax=50)
+        montool.defineHistogram( "cbtrks_pt", type="TH1F", path="EXPERT", title="Combined Trk pT; p_T", xbins=100, xmin=0, xmax=300)
+        montool.defineHistogram( "cbtrks_eta", type="TH1F", path="EXPERT", title="Combined Trk eta; #eta", xbins=40, xmin=-3, xmax=3)
+        montool.defineHistogram( "cbtrks_phi", type="TH1F", path="EXPERT", title="Combined Trk phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+
+        montool.defineHistogram( "idtrks_n", type="TH1F", path="EXPERT", title="Number of ID tracks; N of tracks", xbins=50, xmin=0, xmax=50)
+        montool.defineHistogram( "idtrks_pt", type="TH1F", path="EXPERT", title="ID tracks pT; p_T", xbins=100, xmin=0, xmax=300)
+        montool.defineHistogram( "idtrks_eta", type="TH1F", path="EXPERT", title="ID tracks eta; #eta", xbins=40, xmin=-3, xmax=3)
+        montool.defineHistogram( "idtrks_phi", type="TH1F", path="EXPERT", title="ID tracks phi; #phi", xbins=40, xmin=-3.2, xmax=3.2)
+        montool.defineHistogram( "idtrks_pt,idtrks_eta", type="TH2F", path="EXPERT", title="ID tracks pT vs. #eta; p_T; #eta", xbins=100, xmin=0, xmax=300, ybins=50, ymin=-5, ymax=5)
+
+    return montool
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py
index 99260cf0c1b689d814b225288e27d430a33d98e0..bd05220139b1ca8b2e7ab01cdd1e284bb74acf60 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py
@@ -220,18 +220,21 @@ def MuidSegmentRegionRecoveryTool( name ='MuidSegmentRegionRecoveryTool', **kwar
 
     return CfgMgr.Muon__MuonSegmentRegionRecoveryTool(name,**kwargs)
 
-
-def MuonMaterialProviderTool( name = "MuonMaterialProviderTool"):
-    from TrackToCalo.TrackToCaloConf import Rec__MuonCaloEnergyTool, Rec__ParticleCaloCellAssociationTool
-    caloCellAssociationTool = Rec__ParticleCaloCellAssociationTool(ParticleCaloExtensionTool = getPublicTool("MuonParticleCaloExtensionTool"))
-    from AthenaCommon.AppMgr import ToolSvc
-    ToolSvc += caloCellAssociationTool
-  
-    muonCaloEnergyTool = Rec__MuonCaloEnergyTool(ParticleCaloExtensionTool = getPublicTool("MuonParticleCaloExtensionTool"),
-                                                 ParticleCaloCellAssociationTool = caloCellAssociationTool)
-
-    ToolSvc += muonCaloEnergyTool
-    materialProviderTool = TrackingCommon.getTrkMaterialProviderTool( name = "MuonTrkMaterialProviderTool", MuonCaloEnergyTool = muonCaloEnergyTool)
+def MuonCaloEnergyTool(name = "MuonCaloEnergyTool", **kwargs):
+    from TrackToCalo.TrackToCaloConf import Rec__MuonCaloEnergyTool
+    kwargs.setdefault("ParticleCaloExtensionTool" , getPublicTool("MuonParticleCaloExtensionTool"))
+    kwargs.setdefault("ParticleCaloCellAssociationTool", getPublicTool("MuonCaloCellAssociationTool"))
+    kwargs.setdefault("TrackParticleCreator", getPublicTool("MuonCaloParticleCreator"))
+    return Rec__MuonCaloEnergyTool(name, **kwargs)
+
+def ParticleCaloCellAssociationTool(name="MuonCaloCellAssociationTool", **kwargs):
+    from TrackToCalo.TrackToCaloConf import  Rec__ParticleCaloCellAssociationTool
+    kwargs.setdefault("ParticleCaloExtensionTool", getPublicTool("MuonParticleCaloExtensionTool"))
+    return Rec__ParticleCaloCellAssociationTool("MuonCaloCellAssociationTool", **kwargs)
+
+def MuonMaterialProviderTool( name = "MuonTrkMaterialProviderTool"):
+    materialProviderTool = TrackingCommon.getTrkMaterialProviderTool( name = name, 
+                                                                    MuonCaloEnergyTool = getPublicTool("MuonCaloEnergyTool"))
     if ConfigFlags.Muon.MuonTrigger:
         materialProviderTool.UseCaloEnergyMeasurement = False
     return materialProviderTool
@@ -256,7 +259,7 @@ def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ):
     kwargs.setdefault("MdtRotCreator"                 , getPublicTool("MdtDriftCircleOnTrackCreator") )
     kwargs.setdefault("AlignmentUncertToolPhi"        , getPublicTool("MuonAlignmentUncertToolPhi") )
     kwargs.setdefault("AlignmentUncertToolTheta"      , getPublicTool("MuonAlignmentUncertToolTheta") )
-    
+    kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonTrkMaterialProviderTool"))
     kwargs.setdefault("CleanCombined"                 , True )
     kwargs.setdefault("CleanStandalone"               , True )
     kwargs.setdefault("BadFitChi2"                    , 2.5 )
@@ -270,7 +273,7 @@ def CombinedMuonTrackBuilderFit( name='CombinedMuonTrackBuilderFit', **kwargs ):
     kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
     kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
     kwargs.setdefault("UseCaloTG"                     , False )
-    kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonMaterialProviderTool"))
+    #kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonMaterialProviderTool"))
     kwargs.setdefault("TrackQuery"                    , getPrivateTool("MuonTrackQuery") )
 
 
@@ -349,7 +352,7 @@ def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
     kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
     kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
     kwargs.setdefault("UseCaloTG"                     , True ) #
-    kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonMaterialProviderTool"))
+    kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonTrkMaterialProviderTool"))
     kwargs.setdefault("TrackQuery"                    , getPrivateTool("MuonTrackQuery") )
 
     if ConfigFlags.Muon.MuonTrigger:
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
index 7f5b72b9bbc9c6c3b6d5eb100ca1ff051a4e1ffd..f1b5e492fecf9683708167f87fda3332fb7ad56f 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedRecExampleConfigDb.py
@@ -3,6 +3,11 @@
 from AthenaCommon.CfgGetter import addTool, addAlgorithm
 
 # combined tools
+
+addTool("MuonCombinedRecExample.MuonCombinedFitTools.ParticleCaloCellAssociationTool","MuonCaloCellAssociationTool")
+addTool("MuonCombinedRecExample.MuonCombinedFitTools.MuonCaloEnergyTool","MuonCaloEnergyTool")
+addTool("MuonCombinedRecExample.MuonCombinedFitTools.MuonMaterialProviderTool","MuonTrkMaterialProviderTool")
+
 addTool("MuonCombinedRecExample.MuonCombinedTools.MuonCombinedTool","MuonCombinedTool")
 
 addTool("MuonCombinedRecExample.MuGirlTagTool.MuonInsideOutRecoTool","MuonInsideOutRecoTool")
@@ -27,7 +32,8 @@ addTool("MuonCombinedRecExample.MuonCaloTagTool.MuonCaloTagTool","MuonCaloTagToo
 addTool("Rec::MuonMomentumBalanceSignificanceTool","MuonMomentumBalanceSignificanceTool")
 addTool("Rec::MuonScatteringAngleSignificanceTool","MuonScatteringAngleSignificanceTool")
 addTool( "Muon::MuonSystemExtensionTool", "MuonSystemExtensionTool", ParticleCaloExtensionTool = "MuonParticleCaloExtensionTool", Extrapolator = "AtlasExtrapolator")
-addTool("MuonCombinedRecExample.MuonCombinedFitTools.MuonMaterialProviderTool","MuonMaterialProviderTool")
+
+
 
 
 addAlgorithm("MuonCombinedRecExample.MuonCombinedAlgs.MuonCaloTagAlg","MuonCaloTagAlg")
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
index a9211d73e136bd32c71df65fd3848fc959b7a44c..022ab67a975561fc545f9cec375d141e2413088f 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
@@ -104,7 +104,7 @@ def MuonPrintingTool(name="MuonPrintingTool",**kwargs ):
     return CfgMgr.Rec__MuonPrintingTool(name,**kwargs)
 
 def MuonCreatorTool(name="MuonCreatorTool",**kwargs):
-    kwargs.setdefault("CaloMaterialProvider", getPublicTool("MuonMaterialProviderTool"))
+    kwargs.setdefault("CaloMaterialProvider", getPublicTool("MuonTrkMaterialProviderTool"))
     if ConfigFlags.Muon.MuonTrigger:
         kwargs.setdefault('MakeTrackAtMSLink',True)
         kwargs.setdefault("FillTimingInformation",False)
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h
index 363971c42cf68d4b1e08b5ca8ee7c7200781ba7e..ac821b4bc9bec111faec397b787146b52746e33e 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h
+++ b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h
@@ -5,8 +5,6 @@
 /***************************************************************************
 MuonCaloEnergyTool.h  -  Description
 -------------------
-begin   : Summer 2014
-authors : Niels van Eldik (CERN PH-ATC)
 ***************************************************************************/
 #ifndef MUONCALOENERGYTOOL_H
 #define MUONCALOENERGYTOOL_H
@@ -50,9 +48,9 @@ namespace Rec {
                                    std::vector<double>* E_exp_cell = 0) const override;
 
     private:
-        ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtensionTool {this, "ParticleCaloExtensionTool", "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", "Tool to make the step-wise extrapolation"};
-        ToolHandle<Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool {this, "ParticleCaloCellAssociationTool", "Rec::ParticleCaloCellAssociationTool/ParticleCaloCellAssociationTool", "Tool to make the cell association"}; 
-        ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreator {this,"TrackParticleCreator",  "Trk::TrackParticleCreatorTool/MuonCaloParticleCreator", "The CB Particle Creator Tool"};
+        ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtensionTool {this, "ParticleCaloExtensionTool", "", "Tool to make the step-wise extrapolation"};
+        ToolHandle<Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool {this, "ParticleCaloCellAssociationTool", "", "Tool to make the cell association"}; 
+        ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreator {this,"TrackParticleCreator",  "", "The CB Particle Creator Tool"};
 
         SG::ReadCondHandleKey<CaloNoise> m_caloNoiseCDOKey{this, "CaloNoiseKey", "totalNoise", "SG Key of CaloNoise data object"};
 
diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
index e5546e0b9c1b173525ccbd281d12677ddf66aa59..5d11f6ee703db0c23eb9a90b5886a1412d9f5f11 100644
--- a/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
@@ -1,6 +1,25 @@
+Mon Nov  1 22:34:52 CET 2021
+Preloading tcmalloc_minimal.so
+Py:Athena            INFO including file "AthenaCommon/Preparation.py"
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
+Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
+Py:Athena            INFO including file "AthenaCommon/Execution.py"
+Py:Athena            INFO including file "TileRecUtils/TileCellBuilderFromHit_test.py"
+Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
+Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
+Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
+Py:TileConditions_jobOptions.py    INFO Forcing RUN2 (2014-2017) cabling for run 284500 with geometry ATLAS-R2-2016-01-00-01
 Py:TileConditions_jobOptions.py    INFO Adjusting TileInfo for 7 samples
 Py:TileConditions_jobOptions.py    INFO setting up COOL for TileCal conditions data
 Py:TileInfoConf.     INFO Changing default TileBadChanTool configuration to COOL source
@@ -10,16 +29,104 @@ Py:TileInfoConf.     INFO Changing default TileCondToolTiming configuration to C
 Py:TileConditions_jobOptions.py    INFO Adjusting TileInfo to return cell noise for Opt.Filter without iterations
 Py:TileConditions_jobOptions.py    INFO Setting 10-bit ADC configuration
 Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
+Py:Athena            INFO including file "AthenaCommon/runbatch.py"
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
+====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
+ClassIDSvc           INFO getRegistryEntries: read 6623 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
+PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
+PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
+PoolSvc              INFO Frontier compression level set to 5
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+PoolSvc              INFO Successfully setup replica sorting algorithm
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
+PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
+PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
+IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
+IOVDbSvc             INFO Cache alignment will be done in 3 slices
+IOVDbSvc             INFO Global tag: OFLCOND-RUN12-SDR-35 set from joboptions
 IOVDbFolder          INFO Read from meta data only for folder /TagInfo
+IOVDbSvc             INFO Initialised with 3 connections and 14 folders
+IOVDbSvc             INFO Service IOVDbSvc initialised successfully
+IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
+TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
+ClassIDSvc           INFO getRegistryEntries: read 1513 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
+IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_TILE/OFLP200
+IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
+IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
+IOVDbSvc             INFO Added taginfo remove for /LAR/Align
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/CES
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/CIS/FIT/LIN
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/CIS/FIT/NLN
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/EMS
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/LAS/FIBER
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/LAS/LIN
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/CALIB/LAS/NLN
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/NOISE/SAMPLE
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/STATUS/ADC
+IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
+IOVDbSvc             INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
+IOVDbSvc             INFO Added taginfo remove for /LAR/LArCellPositionShift
+ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
 DetDescrCnvSvc       INFO Found DetectorStore service
 DetDescrCnvSvc       INFO  filling proxies for detector managers 
+DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TRT_ID with CLID 2518 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for HGTD_ID with CLID 79264207 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for SiliconID with CLID 129452393 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileID with CLID 2901 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileHWID with CLID 2902 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TileTBID with CLID 2903 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for ZdcID with CLID 190591643 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for JTower_ID with CLID 218674799 and storage type 68 to detector store 
+DetDescrCnvSvc       INFO  filling address for GTower_ID with CLID 49678914 and storage type 68 to detector store 
 GeoModelSvc::RD...WARNING  Getting PixTBMatComponents with default tag
 GeoModelSvc::RD...WARNING  Getting PixTBMaterials with default tag
 GeoModelSvc::RD...WARNING  Getting InDetMatComponents with default tag
@@ -59,11 +166,13 @@ LArHVLineID          INFO setDictVersion of LArHighVoltage is OK
 LArHVLineID          INFO [initLevelsFromDict] m_dict OK ... 
 LArHVLineID          INFO [initialize_from_dictionary] >  HV line range -> 11/1/48:79/0:15 | 11/1/148:179/0:15 | 11/1/80:93/0:7 | 11/1/180:193/0:7 | 11/1/200:231/0:15 | 11/1/232:263/0:15 | 11/1/296,297,306,307/0:15 | 11/1/299,304,305,308,309/0:15 | 11/1/264:279/0:15 | 11/1/280:295/0:15 | 11/1/0:47/0:15 | 11/1/320:322/0:15 | 11/1/100:147/0:15 | 11/1/324,325/0:15 | 11/1/312:315/0:15 | 11/1/316:319/0:15 | 11/1/300:303/0:15 | 11/1/310,311/0:15 | 11/1/323/0:15 | 11/1/326,327/0:15 | 11/1/94:99/0:15 | 11/1/194:199/0:15
 LArHVLineID          INFO [init_hashes()] > Hvline_size= 5008
+BarrelConstruction   INFO Getting primary numbers for ATLAS, ATLAS-R2-2016-01-00-01
 BarrelConstruction   INFO   Makes detailed absorber sandwich  ? 1 1
 BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
+ClassIDSvc           INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -72,6 +181,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
+TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
 TileDddbManager      INFO n_timod = 320
 TileDddbManager      INFO n_cuts = 9
@@ -80,9 +190,11 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
+ClassIDSvc           INFO getRegistryEntries: read 55 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_ID helper object in the detector store
 CaloIDHelper_ID...   INFO in createObj: creating a LArEM_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -90,19 +202,72 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
+TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
+TileInfoLoader       INFO Changing TTL1 noise sigma from 2.5 to 2.8
 CaloIDHelper_ID...   INFO in createObj: creating a CaloLVL1_ID helper object in the detector store
 CaloLVL1_ID          INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileCablingSvc       INFO RUN2 ATLAS geometry flag detected for geometry: ATLAS-R2-2016-01-00-01
 TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions 
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
+ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
+CondInputLoader      INFO Initializing CondInputLoader...
+ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
+  +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' )   -> no bases
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CES' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/EMS' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/FIBER' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/LIN' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/NLN' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/NOISE/SAMPLE' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/STATUS/ADC' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' )   ->
+  +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' )   ->
+  +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' )   ->
 CondInputLoader      INFO Will create WriteCondHandle dependencies for the following DataObjects:
+    +  ( 'CaloRec::CaloCellPositionShift' , 'ConditionStore+LArCellPositionShift' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CES' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/EMS' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/FIBER' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/LIN' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/CALIB/LAS/NLN' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/NOISE/SAMPLE' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/STATUS/ADC' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
+    +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
+    +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -123,8 +288,14 @@ TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.Tile
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 tilecellbuilder...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
 tilecellbuilder...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
+ClassIDSvc           INFO getRegistryEntries: read 452 CLIDRegistry entries for module ALL
+xAODMaker::Even...   INFO Initializing xAODMaker::EventInfoCnvAlg
+ClassIDSvc           INFO getRegistryEntries: read 271 CLIDRegistry entries for module ALL
+xAODMaker::Even...   INFO Beam conditions service not available
+xAODMaker::Even...   INFO Will not fill beam spot information into xAOD::EventInfo
 PyComponentMgr       INFO Initializing PyComponentMgr...
 testalg1             INFO Initializing testalg1...
+ClassIDSvc           INFO getRegistryEntries: read 5996 CLIDRegistry entries for module ALL
 ToolSvc.tool1        INFO Storing MBTS cells in MBTSContainer
 ToolSvc.tool1        INFO Noise Sigma 0 MeV is selected!
 AthRNGSvc            INFO Creating engine ToolSvc.tool1
@@ -133,6 +304,7 @@ ToolSvc.tool1        INFO min time thr  -25 ns
 ToolSvc.tool1        INFO taking hits from 'TileHitCnt'
 ToolSvc.tool1        INFO Storing E4'  cells in E4prContainer
 ToolSvc.tool1        INFO TileCellBuilderFromHit initialization completed
+ClassIDSvc           INFO getRegistryEntries: read 270 CLIDRegistry entries for module ALL
 ToolSvc.tool2        INFO Storing MBTS cells in MBTSContainer
 ToolSvc.tool2        INFO Noise Sigma 0 MeV is selected!
 AthRNGSvc            INFO Creating engine ToolSvc.tool2
@@ -150,31 +322,50 @@ ToolSvc.tool3        INFO taking hits from 'TileHitCnt'
 ToolSvc.tool3        INFO Storing E4'  cells in E4prContainer
 ToolSvc.tool3        INFO TileCellBuilderFromHit initialization completed
 ApplicationMgr       INFO Application Manager Initialized successfully
+CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/NLN'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/EMS'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/LAS/FIBER'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/LAS/LIN'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/LAS/NLN'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/NOISE/SAMPLE'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/STATUS/ADC'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
+CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
+CondInputLoader      INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
 ApplicationMgr       INFO Application Manager Started successfully
 AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to LARAlign-IOVDEP-00 for folder /LAR/Align
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift
+IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
+IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] EACFEBD4-9BD2-E211-848A-02163E006B20
+Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root
+RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
+Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
+RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events processed so far  <<<===
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
+IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_TILE/OFLP200
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibCes-SIM-06 for folder /TILE/OFL02/CALIB/CES
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibCisFitLin-COM-00 for folder /TILE/OFL02/CALIB/CIS/FIT/LIN
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02CalibCisFitNln-COM-00 for folder /TILE/OFL02/CALIB/CIS/FIT/NLN
@@ -185,8 +376,10 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Cali
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02NoiseSample-TwoGauss-19 for folder /TILE/OFL02/NOISE/SAMPLE
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02StatusAdc-IOVDEP-03 for folder /TILE/OFL02/STATUS/ADC
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -198,6 +391,8 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
 tilecellbuilder...   INFO No TileBchStatus::isBad() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoisy() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -209,6 +404,8 @@ tilecellbuilder...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 tilecellbuilder...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 tilecellbuilder...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 tilecellbuilder...   INFO No drawer trips probabilities found in DB
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/build1/tsulaia/athena-loc/build/TileCalorimeter/TileRecUtils/CMakeFiles/unitTestRun/tilecellbuilder_bct2.bch"
 tilecellbuilder...   INFO No TileBchStatus::isBad() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoisy() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -220,18 +417,53 @@ tilecellbuilder...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 tilecellbuilder...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 tilecellbuilder...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 tilecellbuilder...   INFO No drawer trips probabilities found in DB
+ClassIDSvc           INFO getRegistryEntries: read 648 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 125 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 49 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
+/cvmfs/atlas-co...   INFO Database being retired...
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] EACFEBD4-9BD2-E211-848A-02163E006B20
+/cvmfs/atlas-co...   INFO Database being retired...
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 1 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 2 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 2 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 3 events processed so far  <<<===
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
+CondInputLoader      INFO Finalizing CondInputLoader...
+testalg1             INFO Finalizing testalg1...
+PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.04 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.07 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 ((     0.04 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/97884 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.05 ))s
+IOVDbSvc             INFO  bytes in ((      0.41 ))s
+IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.08 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.33 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
+ToolSvc.tool3        INFO Finalizing
+ToolSvc.tool2        INFO Finalizing
+ToolSvc.tool1        INFO Finalizing
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
+cObjR_ALL            INFO Time User   : Tot=  110 [ms] Ave/Min/Max=    27.5(+-    42.1)/       0/     100 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  140 [ms] Ave/Min/Max=    9.33(+-      30)/       0/     120 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 26.4  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
index 0e83aa8c7662923ae7ed35721b419e5608a4ddea..4b8d83f1b6449031c794f42335172c2e4ad83e8c 100644
--- a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:19:19 CEST 2021
+Mon Nov  1 22:34:52 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileRecUtils/TileCellBuilder_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:19:25 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6623 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -167,7 +172,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3295 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -185,7 +190,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -197,15 +202,15 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 TileDetDescrMan...   INFO Entering create_elements()
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
 TileInfoLoader       INFO Changing TTL1 noise sigma from 2.5 to 2.8
 CaloIDHelper_ID...   INFO in createObj: creating a CaloLVL1_ID helper object in the detector store
@@ -216,6 +221,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -246,6 +252,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -267,7 +289,7 @@ TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondP
 tilecellbuilder...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
 tilecellbuilder...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
 ClassIDSvc           INFO getRegistryEntries: read 452 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 4963 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4979 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing xAODMaker::EventInfoCnvAlg
 xAODMaker::Even...   INFO Beam conditions service not available
 xAODMaker::Even...   INFO Will not fill beam spot information into xAOD::EventInfo
@@ -357,27 +379,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -400,6 +408,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -411,8 +420,8 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/home/solodkov/git/r22.0.tile/build/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
-tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/home/solodkov/git/r22.0.tile/build/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct1Cond.tilecellbuilder_bct1_ofl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
 tilecellbuilder...   INFO No TileBchStatus::isBad() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoisy() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -424,8 +433,8 @@ tilecellbuilder...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 tilecellbuilder...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 tilecellbuilder...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 tilecellbuilder...   INFO No drawer trips probabilities found in DB
-tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/home/solodkov/git/r22.0.tile/build/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
-tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/home/solodkov/git/r22.0.tile/build/TileCalorimeter/TileRecUtils/CMakeFiles/unitTestRun/tilecellbuilder_bct2.bch"
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_onl) for ASCII file name: "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNoBad.oflBch"
+tilecellbuilder...   INFO Creating TileCondProxyFile(tilecellbuilder_bct2Cond.tilecellbuilder_bct2_ofl) for ASCII file name: "/build1/tsulaia/athena-loc/build/TileCalorimeter/TileRecUtils/CMakeFiles/unitTestRun/tilecellbuilder_bct2.bch"
 tilecellbuilder...   INFO No TileBchStatus::isBad() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoisy() definition found in DB, using defaults
 tilecellbuilder...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -437,7 +446,7 @@ tilecellbuilder...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 tilecellbuilder...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 tilecellbuilder...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 tilecellbuilder...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 649 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 648 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 117 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 49 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
@@ -476,23 +485,23 @@ prepalg1             INFO Finalizing prepalg1...
 testalg1             INFO Finalizing testalg1...
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.03 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.05 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.03 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 ((     0.03 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/97884 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
-IOVDbSvc             INFO  bytes in ((      0.25 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
+IOVDbSvc             INFO  bytes in ((      0.28 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.04 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.21 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.05 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.23 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.tool11       INFO Finalizing
@@ -508,8 +517,8 @@ ToolSvc.tool1        INFO Finalizing
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
 cObjR_ALL            INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      25(+-    37.7)/       0/      90 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  120 [ms] Ave/Min/Max=       8(+-    24.8)/       0/     100 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 25.2  [s]  #=  1
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-    27.5)/       0/     110 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 27.8  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref b/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
index 113fbde39579010e5ad411f7be266876ed9f739a..d3c563a46ff5c9484a3b39fbddd2b6989120303f 100644
--- a/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:20:58 CEST 2021
+Mon Nov  1 22:34:52 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileRecUtils/TileDQstatusAlg_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:21:04 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6623 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -173,7 +178,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3295 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -182,7 +187,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.32S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.43S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -193,7 +198,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -205,9 +210,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -244,8 +249,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.09S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.13S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -258,6 +263,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -288,6 +294,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -306,7 +328,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4980 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4996 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 record1              INFO Initializing record1...
 ClassIDSvc           INFO getRegistryEntries: read 108 CLIDRegistry entries for module ALL
@@ -340,27 +362,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -383,6 +391,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -394,7 +403,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 649 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 648 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 1287 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 3 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
@@ -412,31 +421,31 @@ record1              INFO Finalizing record1...
 check1               INFO Finalizing check1...
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.03 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.05 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 ((     0.03 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/97884 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
 IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
-IOVDbSvc             INFO  bytes in ((      0.35 ))s
+IOVDbSvc             INFO  bytes in ((      0.27 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.05 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.30 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.08 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.20 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   80 [ms] Ave/Min/Max=      20(+-    34.6)/       0/      80 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  110 [ms] Ave/Min/Max=    7.33(+-    24.9)/       0/     100 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 23.6  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      30(+-    46.4)/       0/     110 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  150 [ms] Ave/Min/Max=      10(+-    32.5)/       0/     130 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 26.1  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref b/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
index b9220e152fc5fa53cf8c98534d4228cf0bcf736c..5a1a77409edb420f593c5044afa6e0c697cd45d4 100644
--- a/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:21:30 CEST 2021
+Mon Nov  1 22:34:52 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileRecUtils/TileDQstatusTool_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:21:36 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6623 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -173,7 +178,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3295 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -182,7 +187,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.35S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.46S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -193,7 +198,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -205,9 +210,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -244,8 +249,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.09S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.11S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -258,6 +263,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -288,6 +294,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -308,7 +330,7 @@ TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.Tile
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 PyComponentMgr       INFO Initializing PyComponentMgr...
 test1                INFO Initializing test1...
-ClassIDSvc           INFO getRegistryEntries: read 8172 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 8188 CLIDRegistry entries for module ALL
 ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 270 CLIDRegistry entries for module ALL
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
@@ -339,27 +361,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -382,6 +390,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -394,7 +403,7 @@ TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
 *** Starting test1
-ClassIDSvc           INFO getRegistryEntries: read 649 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 648 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 106 CLIDRegistry entries for module ALL
 *** Starting test2
 *** Starting test3
@@ -416,31 +425,31 @@ CondInputLoader      INFO Finalizing CondInputLoader...
 test1                INFO Finalizing test1...
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.01 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.01 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/97884 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
-IOVDbSvc             INFO  bytes in ((      0.22 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
+IOVDbSvc             INFO  bytes in ((      0.23 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.06 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.16 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.19 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   80 [ms] Ave/Min/Max=      20(+-    34.6)/       0/      80 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  100 [ms] Ave/Min/Max=    6.67(+-    22.4)/       0/      90 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 24.7  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      25(+-    37.7)/       0/      90 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-    25.5)/       0/     100 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 27.9  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
index 68d3dbcb2386f3897dad03e1e153c10d65607361..e83f57bf7e5ebe53cfa1fe506c28dd8a3baae6bb 100644
--- a/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:20:26 CEST 2021
+Mon Nov  1 22:34:52 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileRecUtils/TileRawChannelBuilder_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:20:32 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:35:14 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6623 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -173,7 +178,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3295 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -182,7 +187,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24124Kb 	 Time = 0.32S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.48S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -193,7 +198,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -205,9 +210,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -244,8 +249,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.1S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.1S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -258,6 +263,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -288,6 +294,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -307,7 +329,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ClassIDSvc           INFO getRegistryEntries: read 452 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 4963 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4979 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing xAODMaker::EventInfoCnvAlg
 xAODMaker::Even...   INFO Beam conditions service not available
 xAODMaker::Even...   INFO Will not fill beam spot information into xAOD::EventInfo
@@ -348,27 +370,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000057.gen.COND/cond09_mc.000057.gen.COND._0001.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -391,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -402,7 +411,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 649 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 648 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 84 CLIDRegistry entries for module ALL
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
 /cvmfs/atlas-co...   INFO Database being retired...
@@ -424,11 +433,11 @@ testalg1             INFO Finalizing testalg1...
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
 IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.03 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.04 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641476 ((     0.03 ))s
@@ -436,10 +445,10 @@ IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1
 IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
 IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
-IOVDbSvc             INFO  bytes in ((      0.22 ))s
+IOVDbSvc             INFO  bytes in ((      0.26 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
 IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.04 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.18 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.21 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.tool2        INFO Finalizing
@@ -447,9 +456,9 @@ ToolSvc.tool1        INFO Finalizing
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   70 [ms] Ave/Min/Max=    17.5(+-    30.3)/       0/      70 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  100 [ms] Ave/Min/Max=    6.67(+-    20.2)/       0/      80 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 23.9  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      25(+-    43.3)/       0/     100 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-    29.9)/       0/     120 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 26.5  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
index 632a76b268bec587ab5c57062427abf183ff28c9..7d50372182089d7c50eae0968ba8f7eec6e24ed2 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:23:44 CEST 2021
+Mon Nov  1 22:42:55 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileBeamElemContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:23:49 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:17 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -63,7 +68,7 @@ IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
 ByteStreamAddre...   INFO Initializing
 ByteStreamAddre...   INFO -- Will fill Store with id =  0
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -85,7 +90,7 @@ IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/STATUS/ADC
 IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
 IOVDbSvc             INFO Added taginfo remove for /LAR/LArCellPositionShift
-ClassIDSvc           INFO getRegistryEntries: read 1844 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 1848 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
 DetDescrCnvSvc       INFO Found DetectorStore service
@@ -179,7 +184,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -188,7 +193,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24124Kb 	 Time = 0.35S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.48S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -199,7 +204,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -211,9 +216,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -250,8 +255,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.1S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.13S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -264,6 +269,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -294,6 +300,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -312,7 +334,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4121 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4138 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 Finalizer            INFO Initializing Finalizer...
 ByteStreamInputSvc   INFO Initializing
@@ -321,10 +343,10 @@ ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments
 ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector        INFO reinitialization...
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 379 CLIDRegistry entries for module ALL
 ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
@@ -357,27 +379,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -400,6 +408,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -411,7 +420,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 2258 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2257 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD...   INFO TileL2Builder initialization completed
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1129572, run #204073 1 events processed so far  <<<===
@@ -629,19 +638,19 @@ IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/byte
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.06 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.03 ))s
 IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
 IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
-IOVDbSvc             INFO  bytes in ((      0.24 ))s
+IOVDbSvc             INFO  bytes in ((      0.32 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
 IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.06 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.18 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.26 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.TileROD...   INFO Finalizing
@@ -649,18 +658,18 @@ ToolSvc.ByteStr...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   90 [ms] Ave/Min/Max=    22.5(+-    33.4)/       0/      80 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  120 [ms] Ave/Min/Max=       8(+-    25.1)/       0/     100 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 5.46  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      30(+-      52)/       0/     120 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  150 [ms] Ave/Min/Max=      10(+-    32.5)/       0/     130 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 5.94  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
 Py:Athena            INFO leaving with code 0: "successful run"
-Mon Sep  6 17:23:57 CEST 2021
+Mon Nov  1 22:43:31 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
@@ -669,9 +678,14 @@ Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileBeamElemContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -689,21 +703,21 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:24:03 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:52 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc                                                  INFO in initialize...
 AthDictLoaderSvc                                                  INFO acquired Dso-registry
-ClassIDSvc                                                        INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc                                                       INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc                                                       INFO Initializing MetaDataSvc
 PoolSvc                                                           INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc                                                           INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc                                                           INFO Frontier compression level set to 5
 DBReplicaSvc                                                      INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc                                                      INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc                                                      INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc                                                           INFO Successfully setup replica sorting algorithm
 PoolSvc                                                           INFO Setting up APR FileCatalog and Streams
 PoolSvc                                                           INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -725,7 +739,7 @@ IOVDbSvc                                                          INFO   AlgTool
 ByteStreamAddressProviderSvc                                      INFO Initializing
 ByteStreamAddressProviderSvc                                      INFO -- Will fill Store with id =  0
 TagInfoMgr                                                        INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc                                                        INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc                                                          INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc                                                        INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -747,7 +761,7 @@ IOVDbSvc                                                          INFO Added tag
 IOVDbSvc                                                          INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc                                                          INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
 IOVDbSvc                                                          INFO Added taginfo remove for /LAR/LArCellPositionShift
-ClassIDSvc                                                        INFO getRegistryEntries: read 1844 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 1848 CLIDRegistry entries for module ALL
 ClassIDSvc                                                        INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc                                                    INFO  initializing 
 DetDescrCnvSvc                                                    INFO Found DetectorStore service
@@ -841,7 +855,7 @@ BarrelConstruction                                                INFO   Use sag
 EMECConstruction                                                  INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc                                                        INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -850,7 +864,7 @@ EMECConstruction                                                  INFO multi-lay
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstruction                                              INFO Start building EC electronics geometry
-GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.31S
+GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.44S
 GeoModelSvc.TileDetectorTool                                      INFO  Entering TileDetectorTool::create()
 TileDddbManager                                                   INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager                                                   INFO n_tiglob = 5
@@ -861,7 +875,7 @@ TileDddbManager                                                   INFO n_tilb =
 TileDddbManager                                                   INFO n_tileSwitches = 1
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDescrCnv                                               INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -873,9 +887,9 @@ CaloIDHelper_IDDetDescrCnv                                        INFO in create
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID                                                    INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -912,8 +926,8 @@ GeoModelSvc.TileDetectorTool                                      INFO  Global p
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrManager                                               INFO Entering create_elements()
-GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.1S
-ClassIDSvc                                                        INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.14S
+ClassIDSvc                                                        INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader                                                    INFO Changing TTL1 calib from 4.1 to 6.9
@@ -925,10 +939,11 @@ TileCablingSvc                                                    INFO RUN2 ATLA
 TileCablingSvc                                                    INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions 
 TileCablingSvc                                                    INFO Setting Cabling type to 4
 AthenaHiveEventLoopMgr                                            INFO Initializing AthenaHiveEventLoopMgr
-ClassIDSvc                                                   0    INFO getRegistryEntries: read 4391 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 4408 CLIDRegistry entries for module ALL
 PyComponentMgr                                               0    INFO Initializing PyComponentMgr...
 Finalizer                                                    0    INFO Initializing Finalizer...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 553 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Initializing CondInputLoader...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Adding base classes:
@@ -959,6 +974,22 @@ CondInputLoader                                              0    INFO Will crea
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+TileNeighbour                                                0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloSuperCellAlignCondAlg.CaloSuperCellIDTool                0    INFO Done with initIDMap
 TileBadChannelsCondAlg.TileCondProxyCool_OnlBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannelsCondAlg.TileCondProxyCool_OflBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannelsCondAlg                                       0    INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -979,7 +1010,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  ( 'TileBeamElemContainer' , 'StoreGateSvc+TileBeamElemCnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileBeamElemCntDumper
@@ -999,6 +1030,7 @@ ROBDataProviderSvc                                           0    INFO  ---> Fil
 ROBDataProviderSvc                                           0    INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc                                           0    INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector                                                0    INFO reinitialization...
+ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 AthenaHiveEventLoopMgr                                       0    INFO Setup EventSelector service EventSelector
 ApplicationMgr                                               0    INFO Application Manager Initialized successfully
 PoolSvc                                                      0    INFO Enabled implicit multithreading in ROOT via PersistencySvc to: 3
@@ -1015,7 +1047,6 @@ CondInputLoader                                              0    INFO created C
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
 CondInputLoader                                              0    INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
-ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 ApplicationMgr                                               0    INFO Application Manager Started successfully
 AthenaHiveEventLoopMgr                                       0    INFO Starting loop on events
 EventPersistencySvc                                    0     0    INFO Added successfully Conversion service:AthenaPoolCnvSvc
@@ -1036,34 +1067,20 @@ Domain[ROOT_All]                                       0     0    INFO
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv                                     0     0    INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDescrCnv                                   0     0    INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID                                              0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID                                             0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-TileNeighbour                                          0     0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIdMgrDetDescrCnv                                   0     0    INFO  Finished 
 CaloIdMgrDetDescrCnv                                   0     0    INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]                                       0     0    INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]                                       0     0    INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaHiveEventLoopMgr                                 0     0    INFO   ===>>>  start processing event #1129572, run #204073 on slot 0,  0 events processed so far  <<<===
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 495 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 494 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 1763 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD_Decoder.TileL2Builder                  0     0    INFO TileL2Builder initialization completed
@@ -1271,7 +1288,7 @@ AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>
 AthenaHiveEventLoopMgr                                97     2    INFO   ===>>>  done processing event #1148893, run #204073 on slot 2,  98 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                98     0    INFO   ===>>>  done processing event #1156938, run #204073 on slot 0,  99 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  done processing event #1156351, run #204073 on slot 1,  100 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 3.74352
+AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 3.30858
 Domain[ROOT_All]                                                  INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr                                                    INFO Application Manager Stopped successfully
 SGInputLoader                                                     INFO Finalizing SGInputLoader...
@@ -1307,9 +1324,9 @@ ToolSvc.ByteStreamMetadataTool                                    INFO in finali
 *****Chrono*****                                                  INFO WARNING: MT job; statistics are unreliable
 *****Chrono*****                                                  INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                                  INFO ****************************************************************************************************
-cObjR_ALL                                                         INFO Time User   : Tot=   70 [ms] Ave/Min/Max=      35(+-      35)/       0/      70 [ms] #=  2
-cObj_ALL                                                          INFO Time User   : Tot=   90 [ms] Ave/Min/Max=      45(+-      35)/      10/      80 [ms] #=  2
-ChronoStatSvc                                                     INFO Time User   : Tot= 5.54  [s]  #=  1
+cObjR_ALL                                                         INFO Time User   : Tot=  110 [ms] Ave/Min/Max=      55(+-      45)/      10/     100 [ms] #=  2
+cObj_ALL                                                          INFO Time User   : Tot=  140 [ms] Ave/Min/Max=      70(+-      50)/      20/     120 [ms] #=  2
+ChronoStatSvc                                                     INFO Time User   : Tot= 5.36  [s]  #=  1
 *****Chrono*****                                                  INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                                          INFO  Service finalized successfully 
 ApplicationMgr                                                    INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
index 85f2dcf4eaaa6ba057267363aec8f304972ce43e..2762e2981a9d0046d0358f8bd9bee6ac15e35e9f 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:22:39 CEST 2021
+Mon Nov  1 22:42:55 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileDigitsContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:22:44 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:17 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -63,11 +68,11 @@ IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
 ByteStreamAddre...   INFO Initializing
 ByteStreamAddre...   INFO -- Will fill Store with id =  0
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 1844 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 1848 CLIDRegistry entries for module ALL
 IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
 IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_TILE/OFLP200
@@ -179,7 +184,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -188,7 +193,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24124Kb 	 Time = 0.4S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.45S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -199,7 +204,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -211,9 +216,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -250,8 +255,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.1S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.14S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -264,6 +269,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -294,6 +300,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -312,7 +334,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4121 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4138 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 Finalizer            INFO Initializing Finalizer...
 ByteStreamInputSvc   INFO Initializing
@@ -321,10 +343,10 @@ ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments
 ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector        INFO reinitialization...
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 379 CLIDRegistry entries for module ALL
 ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
@@ -357,27 +379,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -400,6 +408,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -411,7 +420,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 2258 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2257 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD...   INFO TileL2Builder initialization completed
 ToolSvc.TileDig...   INFO Initializing TileDigitsContByteStreamTool
@@ -626,23 +635,23 @@ Finalizer            INFO Finalizing Finalizer...
 Finalize: compared 20 dumps
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.05 ))s
-IOVDbSvc             INFO  bytes in ((      0.39 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.04 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
+IOVDbSvc             INFO  bytes in ((      0.22 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.08 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.30 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.05 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.17 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.TileDig...   INFO Finalizing TileDigitsContByteStreamTool successfuly
@@ -651,18 +660,18 @@ ToolSvc.ByteStr...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  110 [ms] Ave/Min/Max=    27.5(+-    36.3)/       0/      90 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-      25)/       0/     100 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot=  6.9  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    32.5(+-    50.7)/       0/     120 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  160 [ms] Ave/Min/Max=    10.7(+-    34.9)/       0/     140 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 7.54  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
 Py:Athena            INFO leaving with code 0: "successful run"
-Mon Sep  6 17:22:54 CEST 2021
+Mon Nov  1 22:43:35 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
@@ -671,9 +680,14 @@ Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileDigitsContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -691,21 +705,21 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:23:00 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:55 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc                                                  INFO in initialize...
 AthDictLoaderSvc                                                  INFO acquired Dso-registry
-ClassIDSvc                                                        INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc                                                       INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc                                                       INFO Initializing MetaDataSvc
 PoolSvc                                                           INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc                                                           INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc                                                           INFO Frontier compression level set to 5
 DBReplicaSvc                                                      INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc                                                      INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc                                                      INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc                                                           INFO Successfully setup replica sorting algorithm
 PoolSvc                                                           INFO Setting up APR FileCatalog and Streams
 PoolSvc                                                           INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -727,11 +741,11 @@ IOVDbSvc                                                          INFO   AlgTool
 ByteStreamAddressProviderSvc                                      INFO Initializing
 ByteStreamAddressProviderSvc                                      INFO -- Will fill Store with id =  0
 TagInfoMgr                                                        INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc                                                        INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc                                                          INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc                                                        INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
-ClassIDSvc                                                        INFO getRegistryEntries: read 1844 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 1848 CLIDRegistry entries for module ALL
 IOVSvc                                                            INFO No IOVSvcTool associated with store "StoreGateSvc"
 IOVSvc.IOVSvcTool                                                 INFO IOVRanges will be checked at every Event
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_TILE/OFLP200
@@ -843,7 +857,7 @@ BarrelConstruction                                                INFO   Use sag
 EMECConstruction                                                  INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc                                                        INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -852,7 +866,7 @@ EMECConstruction                                                  INFO multi-lay
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstruction                                              INFO Start building EC electronics geometry
-GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.35S
+GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.37S
 GeoModelSvc.TileDetectorTool                                      INFO  Entering TileDetectorTool::create()
 TileDddbManager                                                   INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager                                                   INFO n_tiglob = 5
@@ -863,7 +877,7 @@ TileDddbManager                                                   INFO n_tilb =
 TileDddbManager                                                   INFO n_tileSwitches = 1
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDescrCnv                                               INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -875,9 +889,9 @@ CaloIDHelper_IDDetDescrCnv                                        INFO in create
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID                                                    INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -914,8 +928,8 @@ GeoModelSvc.TileDetectorTool                                      INFO  Global p
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrManager                                               INFO Entering create_elements()
-GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.09S
-ClassIDSvc                                                        INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.11S
+ClassIDSvc                                                        INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader                                                    INFO Changing TTL1 calib from 4.1 to 6.9
@@ -927,10 +941,11 @@ TileCablingSvc                                                    INFO RUN2 ATLA
 TileCablingSvc                                                    INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions 
 TileCablingSvc                                                    INFO Setting Cabling type to 4
 AthenaHiveEventLoopMgr                                            INFO Initializing AthenaHiveEventLoopMgr
-ClassIDSvc                                                   0    INFO getRegistryEntries: read 4391 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 4408 CLIDRegistry entries for module ALL
 PyComponentMgr                                               0    INFO Initializing PyComponentMgr...
 Finalizer                                                    0    INFO Initializing Finalizer...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 553 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Initializing CondInputLoader...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Adding base classes:
@@ -961,6 +976,22 @@ CondInputLoader                                              0    INFO Will crea
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+TileNeighbour                                                0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloSuperCellAlignCondAlg.CaloSuperCellIDTool                0    INFO Done with initIDMap
 TileBadChannelsCondAlg.TileCondProxyCool_OnlBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannelsCondAlg.TileCondProxyCool_OflBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannelsCondAlg                                       0    INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -981,7 +1012,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 17 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 18 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
@@ -1003,6 +1034,7 @@ ROBDataProviderSvc                                           0    INFO  ---> Fil
 ROBDataProviderSvc                                           0    INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc                                           0    INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector                                                0    INFO reinitialization...
+ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 AthenaHiveEventLoopMgr                                       0    INFO Setup EventSelector service EventSelector
 ApplicationMgr                                               0    INFO Application Manager Initialized successfully
 PoolSvc                                                      0    INFO Enabled implicit multithreading in ROOT via PersistencySvc to: 3
@@ -1019,7 +1051,6 @@ CondInputLoader                                              0    INFO created C
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
 CondInputLoader                                              0    INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
-ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 ApplicationMgr                                               0    INFO Application Manager Started successfully
 AthenaHiveEventLoopMgr                                       0    INFO Starting loop on events
 EventPersistencySvc                                    0     0    INFO Added successfully Conversion service:AthenaPoolCnvSvc
@@ -1040,34 +1071,20 @@ Domain[ROOT_All]                                       0     0    INFO
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv                                     0     0    INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDescrCnv                                   0     0    INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID                                              0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID                                             0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-TileNeighbour                                          0     0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIdMgrDetDescrCnv                                   0     0    INFO  Finished 
 CaloIdMgrDetDescrCnv                                   0     0    INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]                                       0     0    INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]                                       0     0    INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaHiveEventLoopMgr                                 0     0    INFO   ===>>>  start processing event #1129572, run #204073 on slot 0,  0 events processed so far  <<<===
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 495 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 494 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 1763 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD_Decoder.TileL2Builder                  0     0    INFO TileL2Builder initialization completed
@@ -1276,7 +1293,7 @@ AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>
 AthenaHiveEventLoopMgr                                97     2    INFO   ===>>>  done processing event #1148893, run #204073 on slot 2,  98 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                98     0    INFO   ===>>>  done processing event #1156938, run #204073 on slot 0,  99 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  done processing event #1156351, run #204073 on slot 1,  100 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 3.99471
+AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 3.26441
 Domain[ROOT_All]                                                  INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr                                                    INFO Application Manager Stopped successfully
 SGInputLoader                                                     INFO Finalizing SGInputLoader...
@@ -1300,9 +1317,9 @@ IOVDbFolder                                                       INFO Folder /T
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.01 ))s
-IOVDbSvc                                                          INFO  bytes in ((      0.04 ))s
+IOVDbSvc                                                          INFO  bytes in ((      0.03 ))s
 IOVDbSvc                                                          INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.04 ))s
+IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.03 ))s
 IOVDbSvc                                                          INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 1 nFolders: 11 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc                                                  INFO in finalize...
 ToolSvc                                                           INFO Removing all tools created by ToolSvc
@@ -1313,9 +1330,9 @@ ToolSvc.ByteStreamMetadataTool                                    INFO in finali
 *****Chrono*****                                                  INFO WARNING: MT job; statistics are unreliable
 *****Chrono*****                                                  INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                                  INFO ****************************************************************************************************
-cObjR_ALL                                                         INFO Time User   : Tot=   80 [ms] Ave/Min/Max=      40(+-      30)/      10/      70 [ms] #=  2
-cObj_ALL                                                          INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      50(+-      30)/      20/      80 [ms] #=  2
-ChronoStatSvc                                                     INFO Time User   : Tot= 7.28  [s]  #=  1
+cObjR_ALL                                                         INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      50(+-      50)/       0/     100 [ms] #=  2
+cObj_ALL                                                          INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      60(+-      50)/      10/     110 [ms] #=  2
+ChronoStatSvc                                                     INFO Time User   : Tot= 6.69  [s]  #=  1
 *****Chrono*****                                                  INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                                          INFO  Service finalized successfully 
 ApplicationMgr                                                    INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
index d8b3323ad507b455205efe76f074ab78960e386b..0289b211ec9578b3f263179ad514774ca7b422b1 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:24:12 CEST 2021
+Mon Nov  1 22:42:55 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileL2ContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:24:17 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:17 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -63,7 +68,7 @@ IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
 ByteStreamAddre...   INFO Initializing
 ByteStreamAddre...   INFO -- Will fill Store with id =  0
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -85,7 +90,7 @@ IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/STATUS/ADC
 IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
 IOVDbSvc             INFO Added taginfo remove for /LAR/LArCellPositionShift
-ClassIDSvc           INFO getRegistryEntries: read 1854 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 1858 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
 DetDescrCnvSvc       INFO Found DetectorStore service
@@ -179,7 +184,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -188,7 +193,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.33S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.45S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -199,7 +204,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -211,9 +216,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -250,8 +255,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.1S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.11S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -264,6 +269,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -294,6 +300,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -312,7 +334,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4121 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4138 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 Finalizer            INFO Initializing Finalizer...
 ByteStreamInputSvc   INFO Initializing
@@ -321,10 +343,10 @@ ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments
 ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector        INFO reinitialization...
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 379 CLIDRegistry entries for module ALL
 ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
@@ -357,27 +379,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -400,6 +408,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -411,7 +420,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 2258 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2257 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD...   INFO TileL2Builder initialization completed
 ToolSvc.TileL2C...   INFO Initializing TileL2ContByteStreamTool
@@ -626,23 +635,23 @@ Finalizer            INFO Finalizing Finalizer...
 Finalize: compared 10 dumps
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.02 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.03 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
-IOVDbSvc             INFO  bytes in ((      0.30 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
+IOVDbSvc             INFO  bytes in ((      0.21 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.06 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.24 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.17 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.TileROD...   INFO Finalizing
@@ -650,18 +659,18 @@ ToolSvc.ByteStr...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   80 [ms] Ave/Min/Max=      20(+-    29.2)/       0/      70 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  110 [ms] Ave/Min/Max=    7.33(+-    22.6)/       0/      90 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 5.98  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      25(+-    43.3)/       0/     100 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-    27.5)/       0/     110 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot=  6.3  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
 Py:Athena            INFO leaving with code 0: "successful run"
-Mon Sep  6 17:24:25 CEST 2021
+Mon Nov  1 22:43:31 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
@@ -670,9 +679,14 @@ Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileL2ContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -690,21 +704,21 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:24:31 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:52 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc                                                  INFO in initialize...
 AthDictLoaderSvc                                                  INFO acquired Dso-registry
-ClassIDSvc                                                        INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc                                                       INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc                                                       INFO Initializing MetaDataSvc
 PoolSvc                                                           INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc                                                           INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc                                                           INFO Frontier compression level set to 5
 DBReplicaSvc                                                      INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc                                                      INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc                                                      INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc                                                           INFO Successfully setup replica sorting algorithm
 PoolSvc                                                           INFO Setting up APR FileCatalog and Streams
 PoolSvc                                                           INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -726,7 +740,7 @@ IOVDbSvc                                                          INFO   AlgTool
 ByteStreamAddressProviderSvc                                      INFO Initializing
 ByteStreamAddressProviderSvc                                      INFO -- Will fill Store with id =  0
 TagInfoMgr                                                        INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc                                                        INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc                                                          INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc                                                        INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -748,7 +762,7 @@ IOVDbSvc                                                          INFO Added tag
 IOVDbSvc                                                          INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc                                                          INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
 IOVDbSvc                                                          INFO Added taginfo remove for /LAR/LArCellPositionShift
-ClassIDSvc                                                        INFO getRegistryEntries: read 1854 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 1858 CLIDRegistry entries for module ALL
 ClassIDSvc                                                        INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc                                                    INFO  initializing 
 DetDescrCnvSvc                                                    INFO Found DetectorStore service
@@ -842,7 +856,7 @@ BarrelConstruction                                                INFO   Use sag
 EMECConstruction                                                  INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc                                                        INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -851,7 +865,7 @@ EMECConstruction                                                  INFO multi-lay
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstruction                                              INFO Start building EC electronics geometry
-GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.33S
+GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24052Kb 	 Time = 0.4S
 GeoModelSvc.TileDetectorTool                                      INFO  Entering TileDetectorTool::create()
 TileDddbManager                                                   INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager                                                   INFO n_tiglob = 5
@@ -862,7 +876,7 @@ TileDddbManager                                                   INFO n_tilb =
 TileDddbManager                                                   INFO n_tileSwitches = 1
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDescrCnv                                               INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -874,9 +888,9 @@ CaloIDHelper_IDDetDescrCnv                                        INFO in create
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID                                                    INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -913,8 +927,8 @@ GeoModelSvc.TileDetectorTool                                      INFO  Global p
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrManager                                               INFO Entering create_elements()
-GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.09S
-ClassIDSvc                                                        INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.13S
+ClassIDSvc                                                        INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader                                                    INFO Changing TTL1 calib from 4.1 to 6.9
@@ -926,10 +940,11 @@ TileCablingSvc                                                    INFO RUN2 ATLA
 TileCablingSvc                                                    INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions 
 TileCablingSvc                                                    INFO Setting Cabling type to 4
 AthenaHiveEventLoopMgr                                            INFO Initializing AthenaHiveEventLoopMgr
-ClassIDSvc                                                   0    INFO getRegistryEntries: read 4391 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 4408 CLIDRegistry entries for module ALL
 PyComponentMgr                                               0    INFO Initializing PyComponentMgr...
 Finalizer                                                    0    INFO Initializing Finalizer...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 553 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Initializing CondInputLoader...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Adding base classes:
@@ -960,6 +975,22 @@ CondInputLoader                                              0    INFO Will crea
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+TileNeighbour                                                0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloSuperCellAlignCondAlg.CaloSuperCellIDTool                0    INFO Done with initIDMap
 TileBadChannelsCondAlg.TileCondProxyCool_OnlBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannelsCondAlg.TileCondProxyCool_OflBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannelsCondAlg                                       0    INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -980,7 +1011,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  ( 'TileL2Container' , 'StoreGateSvc+TileL2Cnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileL2CntDumper
@@ -1000,6 +1031,7 @@ ROBDataProviderSvc                                           0    INFO  ---> Fil
 ROBDataProviderSvc                                           0    INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc                                           0    INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector                                                0    INFO reinitialization...
+ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 AthenaHiveEventLoopMgr                                       0    INFO Setup EventSelector service EventSelector
 ApplicationMgr                                               0    INFO Application Manager Initialized successfully
 PoolSvc                                                      0    INFO Enabled implicit multithreading in ROOT via PersistencySvc to: 3
@@ -1016,7 +1048,6 @@ CondInputLoader                                              0    INFO created C
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
 CondInputLoader                                              0    INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
-ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 ApplicationMgr                                               0    INFO Application Manager Started successfully
 AthenaHiveEventLoopMgr                                       0    INFO Starting loop on events
 EventPersistencySvc                                    0     0    INFO Added successfully Conversion service:AthenaPoolCnvSvc
@@ -1037,34 +1068,20 @@ Domain[ROOT_All]                                       0     0    INFO
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv                                     0     0    INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDescrCnv                                   0     0    INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID                                              0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID                                             0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-TileNeighbour                                          0     0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIdMgrDetDescrCnv                                   0     0    INFO  Finished 
 CaloIdMgrDetDescrCnv                                   0     0    INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]                                       0     0    INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]                                       0     0    INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaHiveEventLoopMgr                                 0     0    INFO   ===>>>  start processing event #1129572, run #204073 on slot 0,  0 events processed so far  <<<===
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 495 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 494 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 1763 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD_Decoder.TileL2Builder                  0     0    INFO TileL2Builder initialization completed
@@ -1273,7 +1290,7 @@ AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>
 AthenaHiveEventLoopMgr                                97     2    INFO   ===>>>  done processing event #1148893, run #204073 on slot 2,  98 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                98     0    INFO   ===>>>  done processing event #1156938, run #204073 on slot 0,  99 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  done processing event #1156351, run #204073 on slot 1,  100 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 3.81328
+AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 3.38631
 Domain[ROOT_All]                                                  INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr                                                    INFO Application Manager Stopped successfully
 SGInputLoader                                                     INFO Finalizing SGInputLoader...
@@ -1284,7 +1301,7 @@ AvalancheSchedulerSvc                                             INFO Joining S
 PyComponentMgr                                                    INFO Finalizing PyComponentMgr...
 EventDataSvc                                                      INFO Finalizing EventDataSvc
 IdDictDetDescrCnv                                                 INFO in finalize
-IOVDbFolder                                                       INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.04 ))s
+IOVDbFolder                                                       INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 ((     0.02 ))s
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
@@ -1297,9 +1314,9 @@ IOVDbFolder                                                       INFO Folder /T
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.01 ))s
-IOVDbSvc                                                          INFO  bytes in ((      0.05 ))s
+IOVDbSvc                                                          INFO  bytes in ((      0.03 ))s
 IOVDbSvc                                                          INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.05 ))s
+IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.03 ))s
 IOVDbSvc                                                          INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 1 nFolders: 11 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc                                                  INFO in finalize...
 ToolSvc                                                           INFO Removing all tools created by ToolSvc
@@ -1309,9 +1326,9 @@ ToolSvc.ByteStreamMetadataTool                                    INFO in finali
 *****Chrono*****                                                  INFO WARNING: MT job; statistics are unreliable
 *****Chrono*****                                                  INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                                  INFO ****************************************************************************************************
-cObjR_ALL                                                         INFO Time User   : Tot=   70 [ms] Ave/Min/Max=      35(+-      35)/       0/      70 [ms] #=  2
-cObj_ALL                                                          INFO Time User   : Tot=   90 [ms] Ave/Min/Max=      45(+-      35)/      10/      80 [ms] #=  2
-ChronoStatSvc                                                     INFO Time User   : Tot= 6.15  [s]  #=  1
+cObjR_ALL                                                         INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      50(+-      50)/       0/     100 [ms] #=  2
+cObj_ALL                                                          INFO Time User   : Tot=  130 [ms] Ave/Min/Max=      65(+-      45)/      20/     110 [ms] #=  2
+ChronoStatSvc                                                     INFO Time User   : Tot= 6.07  [s]  #=  1
 *****Chrono*****                                                  INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                                          INFO  Service finalized successfully 
 ApplicationMgr                                                    INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
index 26b40af40449cdf3528791eaa5f3f8f5895c2a85..3f12590b6d78afd32cc13a908fdc78bfd8fd8dd6 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:24:40 CEST 2021
+Mon Nov  1 22:42:55 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileLaserObjByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:24:46 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:17 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -63,7 +68,7 @@ IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
 ByteStreamAddre...   INFO Initializing
 ByteStreamAddre...   INFO -- Will fill Store with id =  0
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -178,7 +183,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3295 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -187,7 +192,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24124Kb 	 Time = 0.35S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.38S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -198,7 +203,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -210,9 +215,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -249,8 +254,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.13S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 2504Kb 	 Time = 0.11S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -263,6 +268,7 @@ TileCablingSvc       INFO Cabling for RUN2a (2018) ATLAS geometry is set via job
 TileCablingSvc       INFO Setting Cabling type to 5
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -293,6 +299,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -311,7 +333,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4709 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4730 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 Finalizer            INFO Initializing Finalizer...
 ByteStreamInputSvc   INFO Initializing
@@ -320,10 +342,10 @@ ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments
 ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector        INFO reinitialization...
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 379 CLIDRegistry entries for module ALL
 ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileByteStream/TileByteStream-02-00-00/data18_tilecomm.00363899.calibration_tile.daq.RAW._lb0000._TileREB-ROS._0005-200ev.data
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
@@ -356,27 +378,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -399,6 +407,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -410,7 +419,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 2258 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2257 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD...   INFO TileL2Builder initialization completed
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18124, run #363899 1 events processed so far  <<<===
@@ -624,23 +633,23 @@ Finalizer            INFO Finalizing Finalizer...
 Finalize: compared 10 dumps
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/104912 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.05 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641536 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/43176 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.03 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/104912 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641536 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/43176 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
-IOVDbSvc             INFO  bytes in ((      0.43 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
+IOVDbSvc             INFO  bytes in ((      0.22 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.07 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.36 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.05 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.18 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.TileROD...   INFO Finalizing
@@ -648,18 +657,18 @@ ToolSvc.ByteStr...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      25(+-    43.3)/       0/     100 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-    29.9)/       0/     120 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 2.38  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    32.5(+-    50.7)/       0/     120 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  150 [ms] Ave/Min/Max=      10(+-    32.5)/       0/     130 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 2.75  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
 Py:Athena            INFO leaving with code 0: "successful run"
-Mon Sep  6 17:24:50 CEST 2021
+Mon Nov  1 22:43:27 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
@@ -668,9 +677,14 @@ Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileLaserObjByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -688,21 +702,21 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:24:56 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:48 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc                                                  INFO in initialize...
 AthDictLoaderSvc                                                  INFO acquired Dso-registry
-ClassIDSvc                                                        INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc                                                       INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc                                                       INFO Initializing MetaDataSvc
 PoolSvc                                                           INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc                                                           INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc                                                           INFO Frontier compression level set to 5
 DBReplicaSvc                                                      INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc                                                      INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc                                                      INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc                                                           INFO Successfully setup replica sorting algorithm
 PoolSvc                                                           INFO Setting up APR FileCatalog and Streams
 PoolSvc                                                           INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -724,7 +738,7 @@ IOVDbSvc                                                          INFO   AlgTool
 ByteStreamAddressProviderSvc                                      INFO Initializing
 ByteStreamAddressProviderSvc                                      INFO -- Will fill Store with id =  0
 TagInfoMgr                                                        INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc                                                        INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc                                                          INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc                                                        INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -839,7 +853,7 @@ BarrelConstruction                                                INFO   Use sag
 EMECConstruction                                                  INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc                                                        INFO getRegistryEntries: read 3295 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 3226 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -848,7 +862,7 @@ EMECConstruction                                                  INFO multi-lay
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstruction                                              INFO Start building EC electronics geometry
-GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.38S
+GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.45S
 GeoModelSvc.TileDetectorTool                                      INFO  Entering TileDetectorTool::create()
 TileDddbManager                                                   INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager                                                   INFO n_tiglob = 5
@@ -859,7 +873,7 @@ TileDddbManager                                                   INFO n_tilb =
 TileDddbManager                                                   INFO n_tileSwitches = 1
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDescrCnv                                               INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -871,9 +885,9 @@ CaloIDHelper_IDDetDescrCnv                                        INFO in create
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID                                                    INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -910,8 +924,8 @@ GeoModelSvc.TileDetectorTool                                      INFO  Global p
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrManager                                               INFO Entering create_elements()
-GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.1S
-ClassIDSvc                                                        INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.14S
+ClassIDSvc                                                        INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader                                                    INFO Changing TTL1 calib from 4.1 to 6.9
@@ -923,10 +937,11 @@ TileCablingSvc                                                    INFO RUN2 ATLA
 TileCablingSvc                                                    INFO Cabling for RUN2a (2018) ATLAS geometry is set via jobOptions 
 TileCablingSvc                                                    INFO Setting Cabling type to 5
 AthenaHiveEventLoopMgr                                            INFO Initializing AthenaHiveEventLoopMgr
-ClassIDSvc                                                   0    INFO getRegistryEntries: read 4979 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 5000 CLIDRegistry entries for module ALL
 PyComponentMgr                                               0    INFO Initializing PyComponentMgr...
 Finalizer                                                    0    INFO Initializing Finalizer...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 553 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Initializing CondInputLoader...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Adding base classes:
@@ -957,6 +972,22 @@ CondInputLoader                                              0    INFO Will crea
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+TileNeighbour                                                0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloSuperCellAlignCondAlg.CaloSuperCellIDTool                0    INFO Done with initIDMap
 TileBadChannelsCondAlg.TileCondProxyCool_OnlBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannelsCondAlg.TileCondProxyCool_OflBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannelsCondAlg                                       0    INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -977,7 +1008,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  ( 'TileLaserObject' , 'StoreGateSvc+TileLaserObj' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileLaserObjectDumper
@@ -997,6 +1028,7 @@ ROBDataProviderSvc                                           0    INFO  ---> Fil
 ROBDataProviderSvc                                           0    INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc                                           0    INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector                                                0    INFO reinitialization...
+ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileByteStream/TileByteStream-02-00-00/data18_tilecomm.00363899.calibration_tile.daq.RAW._lb0000._TileREB-ROS._0005-200ev.data
 AthenaHiveEventLoopMgr                                       0    INFO Setup EventSelector service EventSelector
 ApplicationMgr                                               0    INFO Application Manager Initialized successfully
 PoolSvc                                                      0    INFO Enabled implicit multithreading in ROOT via PersistencySvc to: 3
@@ -1013,7 +1045,6 @@ CondInputLoader                                              0    INFO created C
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
 CondInputLoader                                              0    INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
-ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileByteStream/TileByteStream-02-00-00/data18_tilecomm.00363899.calibration_tile.daq.RAW._lb0000._TileREB-ROS._0005-200ev.data
 ApplicationMgr                                               0    INFO Application Manager Started successfully
 AthenaHiveEventLoopMgr                                       0    INFO Starting loop on events
 EventPersistencySvc                                    0     0    INFO Added successfully Conversion service:AthenaPoolCnvSvc
@@ -1034,34 +1065,20 @@ Domain[ROOT_All]                                       0     0    INFO
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv                                     0     0    INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDescrCnv                                   0     0    INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID                                              0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID                                             0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-TileNeighbour                                          0     0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIdMgrDetDescrCnv                                   0     0    INFO  Finished 
 CaloIdMgrDetDescrCnv                                   0     0    INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]                                       0     0    INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]                                       0     0    INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaHiveEventLoopMgr                                 0     0    INFO   ===>>>  start processing event #18124, run #363899 on slot 0,  0 events processed so far  <<<===
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 495 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 494 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 1763 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD_Decoder.TileL2Builder                  0     0    INFO TileL2Builder initialization completed
@@ -1075,201 +1092,201 @@ AthenaHiveEventLoopMgr                                 1     0    INFO   ===>>>
 AthenaHiveEventLoopMgr                                 2     1    INFO   ===>>>  start processing event #18126, run #363899 on slot 1,  1 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  start processing event #18127, run #363899 on slot 2,  1 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  start processing event #18128, run #363899 on slot 3,  1 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 1     0    INFO   ===>>>  done processing event #18125, run #363899 on slot 0,  2 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>  start processing event #18129, run #363899 on slot 0,  2 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  done processing event #18128, run #363899 on slot 3,  3 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 6     3    INFO   ===>>>  start processing event #18130, run #363899 on slot 3,  3 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>  done processing event #18129, run #363899 on slot 0,  4 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 7     0    INFO   ===>>>  start processing event #18131, run #363899 on slot 0,  4 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 2     1    INFO   ===>>>  done processing event #18126, run #363899 on slot 1,  5 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 8     1    INFO   ===>>>  start processing event #18132, run #363899 on slot 1,  5 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 6     3    INFO   ===>>>  done processing event #18130, run #363899 on slot 3,  6 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 9     3    INFO   ===>>>  start processing event #18133, run #363899 on slot 3,  6 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  done processing event #18127, run #363899 on slot 2,  7 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 7     0    INFO   ===>>>  done processing event #18131, run #363899 on slot 0,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                10     0    INFO   ===>>>  start processing event #18134, run #363899 on slot 0,  8 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 2     1    INFO   ===>>>  done processing event #18126, run #363899 on slot 1,  2 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 5     1    INFO   ===>>>  start processing event #18129, run #363899 on slot 1,  2 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  done processing event #18127, run #363899 on slot 2,  3 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 1     0    INFO   ===>>>  done processing event #18125, run #363899 on slot 0,  4 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 6     0    INFO   ===>>>  start processing event #18130, run #363899 on slot 0,  4 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 7     2    INFO   ===>>>  start processing event #18131, run #363899 on slot 2,  4 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  done processing event #18128, run #363899 on slot 3,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 8     3    INFO   ===>>>  start processing event #18132, run #363899 on slot 3,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 6     0    INFO   ===>>>  done processing event #18130, run #363899 on slot 0,  6 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 9     0    INFO   ===>>>  start processing event #18133, run #363899 on slot 0,  6 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 5     1    INFO   ===>>>  done processing event #18129, run #363899 on slot 1,  7 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 7     2    INFO   ===>>>  done processing event #18131, run #363899 on slot 2,  8 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                10     1    INFO   ===>>>  start processing event #18134, run #363899 on slot 1,  8 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                11     2    INFO   ===>>>  start processing event #18135, run #363899 on slot 2,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 8     1    INFO   ===>>>  done processing event #18132, run #363899 on slot 1,  9 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                12     1    INFO   ===>>>  start processing event #18136, run #363899 on slot 1,  9 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 9     3    INFO   ===>>>  done processing event #18133, run #363899 on slot 3,  10 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 8     3    INFO   ===>>>  done processing event #18132, run #363899 on slot 3,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 9     0    INFO   ===>>>  done processing event #18133, run #363899 on slot 0,  10 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                12     0    INFO   ===>>>  start processing event #18136, run #363899 on slot 0,  10 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                13     3    INFO   ===>>>  start processing event #18137, run #363899 on slot 3,  10 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                10     0    INFO   ===>>>  done processing event #18134, run #363899 on slot 0,  11 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                10     1    INFO   ===>>>  done processing event #18134, run #363899 on slot 1,  11 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                14     1    INFO   ===>>>  start processing event #18138, run #363899 on slot 1,  11 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                11     2    INFO   ===>>>  done processing event #18135, run #363899 on slot 2,  12 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                14     0    INFO   ===>>>  start processing event #18138, run #363899 on slot 0,  12 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                15     2    INFO   ===>>>  start processing event #18139, run #363899 on slot 2,  12 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                12     1    INFO   ===>>>  done processing event #18136, run #363899 on slot 1,  13 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                12     0    INFO   ===>>>  done processing event #18136, run #363899 on slot 0,  13 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                13     3    INFO   ===>>>  done processing event #18137, run #363899 on slot 3,  14 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                16     1    INFO   ===>>>  start processing event #18140, run #363899 on slot 1,  14 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                16     0    INFO   ===>>>  start processing event #18140, run #363899 on slot 0,  14 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                17     3    INFO   ===>>>  start processing event #18141, run #363899 on slot 3,  14 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                14     0    INFO   ===>>>  done processing event #18138, run #363899 on slot 0,  15 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                18     0    INFO   ===>>>  start processing event #18142, run #363899 on slot 0,  15 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                14     1    INFO   ===>>>  done processing event #18138, run #363899 on slot 1,  15 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                15     2    INFO   ===>>>  done processing event #18139, run #363899 on slot 2,  16 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                16     1    INFO   ===>>>  done processing event #18140, run #363899 on slot 1,  17 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                19     1    INFO   ===>>>  start processing event #18143, run #363899 on slot 1,  17 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                20     2    INFO   ===>>>  start processing event #18144, run #363899 on slot 2,  17 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                18     1    INFO   ===>>>  start processing event #18142, run #363899 on slot 1,  16 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                19     2    INFO   ===>>>  start processing event #18143, run #363899 on slot 2,  16 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                16     0    INFO   ===>>>  done processing event #18140, run #363899 on slot 0,  17 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                17     3    INFO   ===>>>  done processing event #18141, run #363899 on slot 3,  18 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                20     0    INFO   ===>>>  start processing event #18144, run #363899 on slot 0,  18 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                21     3    INFO   ===>>>  start processing event #18145, run #363899 on slot 3,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                18     0    INFO   ===>>>  done processing event #18142, run #363899 on slot 0,  19 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                19     1    INFO   ===>>>  done processing event #18143, run #363899 on slot 1,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                22     0    INFO   ===>>>  start processing event #18146, run #363899 on slot 0,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                23     1    INFO   ===>>>  start processing event #18147, run #363899 on slot 1,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                20     2    INFO   ===>>>  done processing event #18144, run #363899 on slot 2,  21 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                18     1    INFO   ===>>>  done processing event #18142, run #363899 on slot 1,  19 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                19     2    INFO   ===>>>  done processing event #18143, run #363899 on slot 2,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                22     1    INFO   ===>>>  start processing event #18146, run #363899 on slot 1,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                23     2    INFO   ===>>>  start processing event #18147, run #363899 on slot 2,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                20     0    INFO   ===>>>  done processing event #18144, run #363899 on slot 0,  21 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                21     3    INFO   ===>>>  done processing event #18145, run #363899 on slot 3,  22 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                24     2    INFO   ===>>>  start processing event #18148, run #363899 on slot 2,  22 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                24     0    INFO   ===>>>  start processing event #18148, run #363899 on slot 0,  22 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                25     3    INFO   ===>>>  start processing event #18149, run #363899 on slot 3,  22 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                22     0    INFO   ===>>>  done processing event #18146, run #363899 on slot 0,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                26     0    INFO   ===>>>  start processing event #18150, run #363899 on slot 0,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                24     2    INFO   ===>>>  done processing event #18148, run #363899 on slot 2,  24 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                22     1    INFO   ===>>>  done processing event #18146, run #363899 on slot 1,  23 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                23     2    INFO   ===>>>  done processing event #18147, run #363899 on slot 2,  24 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                26     1    INFO   ===>>>  start processing event #18150, run #363899 on slot 1,  24 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                27     2    INFO   ===>>>  start processing event #18151, run #363899 on slot 2,  24 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                25     3    INFO   ===>>>  done processing event #18149, run #363899 on slot 3,  25 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                23     1    INFO   ===>>>  done processing event #18147, run #363899 on slot 1,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                28     1    INFO   ===>>>  start processing event #18152, run #363899 on slot 1,  26 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                24     0    INFO   ===>>>  done processing event #18148, run #363899 on slot 0,  25 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                25     3    INFO   ===>>>  done processing event #18149, run #363899 on slot 3,  26 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                28     0    INFO   ===>>>  start processing event #18152, run #363899 on slot 0,  26 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                29     3    INFO   ===>>>  start processing event #18153, run #363899 on slot 3,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                26     0    INFO   ===>>>  done processing event #18150, run #363899 on slot 0,  27 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                30     0    INFO   ===>>>  start processing event #18154, run #363899 on slot 0,  27 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                26     1    INFO   ===>>>  done processing event #18150, run #363899 on slot 1,  27 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                27     2    INFO   ===>>>  done processing event #18151, run #363899 on slot 2,  28 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                30     1    INFO   ===>>>  start processing event #18154, run #363899 on slot 1,  28 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                31     2    INFO   ===>>>  start processing event #18155, run #363899 on slot 2,  28 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                28     1    INFO   ===>>>  done processing event #18152, run #363899 on slot 1,  29 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                28     0    INFO   ===>>>  done processing event #18152, run #363899 on slot 0,  29 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                29     3    INFO   ===>>>  done processing event #18153, run #363899 on slot 3,  30 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                32     1    INFO   ===>>>  start processing event #18156, run #363899 on slot 1,  30 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                32     0    INFO   ===>>>  start processing event #18156, run #363899 on slot 0,  30 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                33     3    INFO   ===>>>  start processing event #18157, run #363899 on slot 3,  30 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                30     0    INFO   ===>>>  done processing event #18154, run #363899 on slot 0,  31 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                34     0    INFO   ===>>>  start processing event #18158, run #363899 on slot 0,  31 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                30     1    INFO   ===>>>  done processing event #18154, run #363899 on slot 1,  31 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                31     2    INFO   ===>>>  done processing event #18155, run #363899 on slot 2,  32 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                32     1    INFO   ===>>>  done processing event #18156, run #363899 on slot 1,  33 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                35     1    INFO   ===>>>  start processing event #18159, run #363899 on slot 1,  33 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                36     2    INFO   ===>>>  start processing event #18160, run #363899 on slot 2,  33 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                34     1    INFO   ===>>>  start processing event #18158, run #363899 on slot 1,  32 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                35     2    INFO   ===>>>  start processing event #18159, run #363899 on slot 2,  32 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                32     0    INFO   ===>>>  done processing event #18156, run #363899 on slot 0,  33 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                33     3    INFO   ===>>>  done processing event #18157, run #363899 on slot 3,  34 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                36     0    INFO   ===>>>  start processing event #18160, run #363899 on slot 0,  34 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                37     3    INFO   ===>>>  start processing event #18161, run #363899 on slot 3,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                34     0    INFO   ===>>>  done processing event #18158, run #363899 on slot 0,  35 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                38     0    INFO   ===>>>  start processing event #18162, run #363899 on slot 0,  35 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                35     1    INFO   ===>>>  done processing event #18159, run #363899 on slot 1,  36 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                39     1    INFO   ===>>>  start processing event #18163, run #363899 on slot 1,  36 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                36     2    INFO   ===>>>  done processing event #18160, run #363899 on slot 2,  37 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                40     2    INFO   ===>>>  start processing event #18164, run #363899 on slot 2,  37 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                34     1    INFO   ===>>>  done processing event #18158, run #363899 on slot 1,  35 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                35     2    INFO   ===>>>  done processing event #18159, run #363899 on slot 2,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                38     1    INFO   ===>>>  start processing event #18162, run #363899 on slot 1,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                39     2    INFO   ===>>>  start processing event #18163, run #363899 on slot 2,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                36     0    INFO   ===>>>  done processing event #18160, run #363899 on slot 0,  37 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                37     3    INFO   ===>>>  done processing event #18161, run #363899 on slot 3,  38 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                40     0    INFO   ===>>>  start processing event #18164, run #363899 on slot 0,  38 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                41     3    INFO   ===>>>  start processing event #18165, run #363899 on slot 3,  38 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                38     0    INFO   ===>>>  done processing event #18162, run #363899 on slot 0,  39 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                39     1    INFO   ===>>>  done processing event #18163, run #363899 on slot 1,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                42     0    INFO   ===>>>  start processing event #18166, run #363899 on slot 0,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                43     1    INFO   ===>>>  start processing event #18167, run #363899 on slot 1,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                40     2    INFO   ===>>>  done processing event #18164, run #363899 on slot 2,  41 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                44     2    INFO   ===>>>  start processing event #18168, run #363899 on slot 2,  41 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                38     1    INFO   ===>>>  done processing event #18162, run #363899 on slot 1,  39 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                39     2    INFO   ===>>>  done processing event #18163, run #363899 on slot 2,  40 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                42     1    INFO   ===>>>  start processing event #18166, run #363899 on slot 1,  40 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                43     2    INFO   ===>>>  start processing event #18167, run #363899 on slot 2,  40 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                40     0    INFO   ===>>>  done processing event #18164, run #363899 on slot 0,  41 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                41     3    INFO   ===>>>  done processing event #18165, run #363899 on slot 3,  42 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  start processing event #18168, run #363899 on slot 0,  42 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                45     3    INFO   ===>>>  start processing event #18169, run #363899 on slot 3,  42 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                42     0    INFO   ===>>>  done processing event #18166, run #363899 on slot 0,  43 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                46     0    INFO   ===>>>  start processing event #18170, run #363899 on slot 0,  43 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                43     1    INFO   ===>>>  done processing event #18167, run #363899 on slot 1,  44 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                44     2    INFO   ===>>>  done processing event #18168, run #363899 on slot 2,  45 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                47     1    INFO   ===>>>  start processing event #18171, run #363899 on slot 1,  45 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                48     2    INFO   ===>>>  start processing event #18172, run #363899 on slot 2,  45 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                42     1    INFO   ===>>>  done processing event #18166, run #363899 on slot 1,  43 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                43     2    INFO   ===>>>  done processing event #18167, run #363899 on slot 2,  44 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                46     1    INFO   ===>>>  start processing event #18170, run #363899 on slot 1,  44 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                47     2    INFO   ===>>>  start processing event #18171, run #363899 on slot 2,  44 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  done processing event #18168, run #363899 on slot 0,  45 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                45     3    INFO   ===>>>  done processing event #18169, run #363899 on slot 3,  46 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                48     0    INFO   ===>>>  start processing event #18172, run #363899 on slot 0,  46 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                49     3    INFO   ===>>>  start processing event #18173, run #363899 on slot 3,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                46     0    INFO   ===>>>  done processing event #18170, run #363899 on slot 0,  47 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                50     0    INFO   ===>>>  start processing event #18174, run #363899 on slot 0,  47 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                47     1    INFO   ===>>>  done processing event #18171, run #363899 on slot 1,  48 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                51     1    INFO   ===>>>  start processing event #18175, run #363899 on slot 1,  48 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                48     2    INFO   ===>>>  done processing event #18172, run #363899 on slot 2,  49 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                46     1    INFO   ===>>>  done processing event #18170, run #363899 on slot 1,  47 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                47     2    INFO   ===>>>  done processing event #18171, run #363899 on slot 2,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                50     1    INFO   ===>>>  start processing event #18174, run #363899 on slot 1,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                51     2    INFO   ===>>>  start processing event #18175, run #363899 on slot 2,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                48     0    INFO   ===>>>  done processing event #18172, run #363899 on slot 0,  49 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                49     3    INFO   ===>>>  done processing event #18173, run #363899 on slot 3,  50 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                52     2    INFO   ===>>>  start processing event #18176, run #363899 on slot 2,  50 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                52     0    INFO   ===>>>  start processing event #18176, run #363899 on slot 0,  50 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  start processing event #18177, run #363899 on slot 3,  50 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                50     0    INFO   ===>>>  done processing event #18174, run #363899 on slot 0,  51 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                54     0    INFO   ===>>>  start processing event #18178, run #363899 on slot 0,  51 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                51     1    INFO   ===>>>  done processing event #18175, run #363899 on slot 1,  52 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                55     1    INFO   ===>>>  start processing event #18179, run #363899 on slot 1,  52 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                52     2    INFO   ===>>>  done processing event #18176, run #363899 on slot 2,  53 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                56     2    INFO   ===>>>  start processing event #18180, run #363899 on slot 2,  53 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                54     0    INFO   ===>>>  done processing event #18178, run #363899 on slot 0,  54 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  done processing event #18177, run #363899 on slot 3,  55 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                57     0    INFO   ===>>>  start processing event #18181, run #363899 on slot 0,  55 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                58     3    INFO   ===>>>  start processing event #18182, run #363899 on slot 3,  55 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                55     1    INFO   ===>>>  done processing event #18179, run #363899 on slot 1,  56 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                59     1    INFO   ===>>>  start processing event #18183, run #363899 on slot 1,  56 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                56     2    INFO   ===>>>  done processing event #18180, run #363899 on slot 2,  57 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                57     0    INFO   ===>>>  done processing event #18181, run #363899 on slot 0,  58 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                50     1    INFO   ===>>>  done processing event #18174, run #363899 on slot 1,  51 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                51     2    INFO   ===>>>  done processing event #18175, run #363899 on slot 2,  52 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                54     1    INFO   ===>>>  start processing event #18178, run #363899 on slot 1,  52 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                55     2    INFO   ===>>>  start processing event #18179, run #363899 on slot 2,  52 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                52     0    INFO   ===>>>  done processing event #18176, run #363899 on slot 0,  53 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  done processing event #18177, run #363899 on slot 3,  54 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                56     0    INFO   ===>>>  start processing event #18180, run #363899 on slot 0,  54 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                57     3    INFO   ===>>>  start processing event #18181, run #363899 on slot 3,  54 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                54     1    INFO   ===>>>  done processing event #18178, run #363899 on slot 1,  55 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                55     2    INFO   ===>>>  done processing event #18179, run #363899 on slot 2,  56 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                58     1    INFO   ===>>>  start processing event #18182, run #363899 on slot 1,  56 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  start processing event #18183, run #363899 on slot 2,  56 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                56     0    INFO   ===>>>  done processing event #18180, run #363899 on slot 0,  57 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                57     3    INFO   ===>>>  done processing event #18181, run #363899 on slot 3,  58 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                60     0    INFO   ===>>>  start processing event #18184, run #363899 on slot 0,  58 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                61     2    INFO   ===>>>  start processing event #18185, run #363899 on slot 2,  58 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                58     3    INFO   ===>>>  done processing event #18182, run #363899 on slot 3,  59 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                62     3    INFO   ===>>>  start processing event #18186, run #363899 on slot 3,  59 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                59     1    INFO   ===>>>  done processing event #18183, run #363899 on slot 1,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                61     3    INFO   ===>>>  start processing event #18185, run #363899 on slot 3,  58 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                58     1    INFO   ===>>>  done processing event #18182, run #363899 on slot 1,  59 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  done processing event #18183, run #363899 on slot 2,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                62     1    INFO   ===>>>  start processing event #18186, run #363899 on slot 1,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                63     2    INFO   ===>>>  start processing event #18187, run #363899 on slot 2,  60 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                60     0    INFO   ===>>>  done processing event #18184, run #363899 on slot 0,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                63     0    INFO   ===>>>  start processing event #18187, run #363899 on slot 0,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                64     1    INFO   ===>>>  start processing event #18188, run #363899 on slot 1,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                61     2    INFO   ===>>>  done processing event #18185, run #363899 on slot 2,  62 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                65     2    INFO   ===>>>  start processing event #18189, run #363899 on slot 2,  62 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                62     3    INFO   ===>>>  done processing event #18186, run #363899 on slot 3,  63 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                66     3    INFO   ===>>>  start processing event #18190, run #363899 on slot 3,  63 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                63     0    INFO   ===>>>  done processing event #18187, run #363899 on slot 0,  64 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                67     0    INFO   ===>>>  start processing event #18191, run #363899 on slot 0,  64 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                64     1    INFO   ===>>>  done processing event #18188, run #363899 on slot 1,  65 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                65     2    INFO   ===>>>  done processing event #18189, run #363899 on slot 2,  66 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                68     1    INFO   ===>>>  start processing event #18192, run #363899 on slot 1,  66 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                69     2    INFO   ===>>>  start processing event #18193, run #363899 on slot 2,  66 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                66     3    INFO   ===>>>  done processing event #18190, run #363899 on slot 3,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                67     0    INFO   ===>>>  done processing event #18191, run #363899 on slot 0,  68 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                70     0    INFO   ===>>>  start processing event #18194, run #363899 on slot 0,  68 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                71     3    INFO   ===>>>  start processing event #18195, run #363899 on slot 3,  68 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                68     1    INFO   ===>>>  done processing event #18192, run #363899 on slot 1,  69 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                69     2    INFO   ===>>>  done processing event #18193, run #363899 on slot 2,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                72     1    INFO   ===>>>  start processing event #18196, run #363899 on slot 1,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                73     2    INFO   ===>>>  start processing event #18197, run #363899 on slot 2,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                70     0    INFO   ===>>>  done processing event #18194, run #363899 on slot 0,  71 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                74     0    INFO   ===>>>  start processing event #18198, run #363899 on slot 0,  71 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                71     3    INFO   ===>>>  done processing event #18195, run #363899 on slot 3,  72 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                75     3    INFO   ===>>>  start processing event #18199, run #363899 on slot 3,  72 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                72     1    INFO   ===>>>  done processing event #18196, run #363899 on slot 1,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                76     1    INFO   ===>>>  start processing event #18200, run #363899 on slot 1,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                73     2    INFO   ===>>>  done processing event #18197, run #363899 on slot 2,  74 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                77     2    INFO   ===>>>  start processing event #18201, run #363899 on slot 2,  74 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                74     0    INFO   ===>>>  done processing event #18198, run #363899 on slot 0,  75 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                75     3    INFO   ===>>>  done processing event #18199, run #363899 on slot 3,  76 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                78     0    INFO   ===>>>  start processing event #18202, run #363899 on slot 0,  76 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                79     3    INFO   ===>>>  start processing event #18203, run #363899 on slot 3,  76 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                76     1    INFO   ===>>>  done processing event #18200, run #363899 on slot 1,  77 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                80     1    INFO   ===>>>  start processing event #18204, run #363899 on slot 1,  77 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                77     2    INFO   ===>>>  done processing event #18201, run #363899 on slot 2,  78 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                81     2    INFO   ===>>>  start processing event #18205, run #363899 on slot 2,  78 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                78     0    INFO   ===>>>  done processing event #18202, run #363899 on slot 0,  79 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                82     0    INFO   ===>>>  start processing event #18206, run #363899 on slot 0,  79 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                79     3    INFO   ===>>>  done processing event #18203, run #363899 on slot 3,  80 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                83     3    INFO   ===>>>  start processing event #18207, run #363899 on slot 3,  80 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                80     1    INFO   ===>>>  done processing event #18204, run #363899 on slot 1,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                84     1    INFO   ===>>>  start processing event #18208, run #363899 on slot 1,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                81     2    INFO   ===>>>  done processing event #18205, run #363899 on slot 2,  82 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                85     2    INFO   ===>>>  start processing event #18209, run #363899 on slot 2,  82 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                82     0    INFO   ===>>>  done processing event #18206, run #363899 on slot 0,  83 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                86     0    INFO   ===>>>  start processing event #18210, run #363899 on slot 0,  83 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                84     1    INFO   ===>>>  done processing event #18208, run #363899 on slot 1,  84 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                83     3    INFO   ===>>>  done processing event #18207, run #363899 on slot 3,  85 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                87     1    INFO   ===>>>  start processing event #18211, run #363899 on slot 1,  85 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                88     3    INFO   ===>>>  start processing event #18212, run #363899 on slot 3,  85 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                85     2    INFO   ===>>>  done processing event #18209, run #363899 on slot 2,  86 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                89     2    INFO   ===>>>  start processing event #18213, run #363899 on slot 2,  86 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                86     0    INFO   ===>>>  done processing event #18210, run #363899 on slot 0,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                90     0    INFO   ===>>>  start processing event #18214, run #363899 on slot 0,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                87     1    INFO   ===>>>  done processing event #18211, run #363899 on slot 1,  88 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                91     1    INFO   ===>>>  start processing event #18215, run #363899 on slot 1,  88 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                88     3    INFO   ===>>>  done processing event #18212, run #363899 on slot 3,  89 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                89     2    INFO   ===>>>  done processing event #18213, run #363899 on slot 2,  90 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                92     2    INFO   ===>>>  start processing event #18216, run #363899 on slot 2,  90 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                61     3    INFO   ===>>>  done processing event #18185, run #363899 on slot 3,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                64     0    INFO   ===>>>  start processing event #18188, run #363899 on slot 0,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                65     3    INFO   ===>>>  start processing event #18189, run #363899 on slot 3,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                62     1    INFO   ===>>>  done processing event #18186, run #363899 on slot 1,  63 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                63     2    INFO   ===>>>  done processing event #18187, run #363899 on slot 2,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                66     1    INFO   ===>>>  start processing event #18190, run #363899 on slot 1,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                67     2    INFO   ===>>>  start processing event #18191, run #363899 on slot 2,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                64     0    INFO   ===>>>  done processing event #18188, run #363899 on slot 0,  65 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                65     3    INFO   ===>>>  done processing event #18189, run #363899 on slot 3,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  start processing event #18192, run #363899 on slot 0,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                69     3    INFO   ===>>>  start processing event #18193, run #363899 on slot 3,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                66     1    INFO   ===>>>  done processing event #18190, run #363899 on slot 1,  67 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                67     2    INFO   ===>>>  done processing event #18191, run #363899 on slot 2,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                70     1    INFO   ===>>>  start processing event #18194, run #363899 on slot 1,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                71     2    INFO   ===>>>  start processing event #18195, run #363899 on slot 2,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  done processing event #18192, run #363899 on slot 0,  69 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                69     3    INFO   ===>>>  done processing event #18193, run #363899 on slot 3,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                72     0    INFO   ===>>>  start processing event #18196, run #363899 on slot 0,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                73     3    INFO   ===>>>  start processing event #18197, run #363899 on slot 3,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                70     1    INFO   ===>>>  done processing event #18194, run #363899 on slot 1,  71 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                71     2    INFO   ===>>>  done processing event #18195, run #363899 on slot 2,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                74     1    INFO   ===>>>  start processing event #18198, run #363899 on slot 1,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                75     2    INFO   ===>>>  start processing event #18199, run #363899 on slot 2,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                72     0    INFO   ===>>>  done processing event #18196, run #363899 on slot 0,  73 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                73     3    INFO   ===>>>  done processing event #18197, run #363899 on slot 3,  74 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                76     0    INFO   ===>>>  start processing event #18200, run #363899 on slot 0,  74 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                77     3    INFO   ===>>>  start processing event #18201, run #363899 on slot 3,  74 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                74     1    INFO   ===>>>  done processing event #18198, run #363899 on slot 1,  75 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                75     2    INFO   ===>>>  done processing event #18199, run #363899 on slot 2,  76 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                78     1    INFO   ===>>>  start processing event #18202, run #363899 on slot 1,  76 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                79     2    INFO   ===>>>  start processing event #18203, run #363899 on slot 2,  76 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                76     0    INFO   ===>>>  done processing event #18200, run #363899 on slot 0,  77 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                77     3    INFO   ===>>>  done processing event #18201, run #363899 on slot 3,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                80     0    INFO   ===>>>  start processing event #18204, run #363899 on slot 0,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                81     3    INFO   ===>>>  start processing event #18205, run #363899 on slot 3,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                78     1    INFO   ===>>>  done processing event #18202, run #363899 on slot 1,  79 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                79     2    INFO   ===>>>  done processing event #18203, run #363899 on slot 2,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                82     1    INFO   ===>>>  start processing event #18206, run #363899 on slot 1,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                83     2    INFO   ===>>>  start processing event #18207, run #363899 on slot 2,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                80     0    INFO   ===>>>  done processing event #18204, run #363899 on slot 0,  81 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                81     3    INFO   ===>>>  done processing event #18205, run #363899 on slot 3,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                84     0    INFO   ===>>>  start processing event #18208, run #363899 on slot 0,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                85     3    INFO   ===>>>  start processing event #18209, run #363899 on slot 3,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                82     1    INFO   ===>>>  done processing event #18206, run #363899 on slot 1,  83 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                83     2    INFO   ===>>>  done processing event #18207, run #363899 on slot 2,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                86     1    INFO   ===>>>  start processing event #18210, run #363899 on slot 1,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                87     2    INFO   ===>>>  start processing event #18211, run #363899 on slot 2,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                84     0    INFO   ===>>>  done processing event #18208, run #363899 on slot 0,  85 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                85     3    INFO   ===>>>  done processing event #18209, run #363899 on slot 3,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                88     0    INFO   ===>>>  start processing event #18212, run #363899 on slot 0,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                89     3    INFO   ===>>>  start processing event #18213, run #363899 on slot 3,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                86     1    INFO   ===>>>  done processing event #18210, run #363899 on slot 1,  87 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                87     2    INFO   ===>>>  done processing event #18211, run #363899 on slot 2,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                90     1    INFO   ===>>>  start processing event #18214, run #363899 on slot 1,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                91     2    INFO   ===>>>  start processing event #18215, run #363899 on slot 2,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                88     0    INFO   ===>>>  done processing event #18212, run #363899 on slot 0,  89 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                89     3    INFO   ===>>>  done processing event #18213, run #363899 on slot 3,  90 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                92     0    INFO   ===>>>  start processing event #18216, run #363899 on slot 0,  90 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                93     3    INFO   ===>>>  start processing event #18217, run #363899 on slot 3,  90 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                90     0    INFO   ===>>>  done processing event #18214, run #363899 on slot 0,  91 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                94     0    INFO   ===>>>  start processing event #18218, run #363899 on slot 0,  91 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                91     1    INFO   ===>>>  done processing event #18215, run #363899 on slot 1,  92 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                95     1    INFO   ===>>>  start processing event #18219, run #363899 on slot 1,  92 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                92     2    INFO   ===>>>  done processing event #18216, run #363899 on slot 2,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                96     2    INFO   ===>>>  start processing event #18220, run #363899 on slot 2,  93 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                90     1    INFO   ===>>>  done processing event #18214, run #363899 on slot 1,  91 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                91     2    INFO   ===>>>  done processing event #18215, run #363899 on slot 2,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                94     1    INFO   ===>>>  start processing event #18218, run #363899 on slot 1,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                95     2    INFO   ===>>>  start processing event #18219, run #363899 on slot 2,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                92     0    INFO   ===>>>  done processing event #18216, run #363899 on slot 0,  93 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                96     0    INFO   ===>>>  start processing event #18220, run #363899 on slot 0,  93 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                93     3    INFO   ===>>>  done processing event #18217, run #363899 on slot 3,  94 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                97     3    INFO   ===>>>  start processing event #18221, run #363899 on slot 3,  94 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                94     0    INFO   ===>>>  done processing event #18218, run #363899 on slot 0,  95 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                98     0    INFO   ===>>>  start processing event #18222, run #363899 on slot 0,  95 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                95     1    INFO   ===>>>  done processing event #18219, run #363899 on slot 1,  96 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  start processing event #18223, run #363899 on slot 1,  96 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                96     2    INFO   ===>>>  done processing event #18220, run #363899 on slot 2,  97 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                94     1    INFO   ===>>>  done processing event #18218, run #363899 on slot 1,  95 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                95     2    INFO   ===>>>  done processing event #18219, run #363899 on slot 2,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                98     1    INFO   ===>>>  start processing event #18222, run #363899 on slot 1,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     2    INFO   ===>>>  start processing event #18223, run #363899 on slot 2,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                96     0    INFO   ===>>>  done processing event #18220, run #363899 on slot 0,  97 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                97     3    INFO   ===>>>  done processing event #18221, run #363899 on slot 3,  98 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                98     0    INFO   ===>>>  done processing event #18222, run #363899 on slot 0,  99 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  done processing event #18223, run #363899 on slot 1,  100 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 0.449268
+AthenaHiveEventLoopMgr                                98     1    INFO   ===>>>  done processing event #18222, run #363899 on slot 1,  99 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     2    INFO   ===>>>  done processing event #18223, run #363899 on slot 2,  100 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     2    INFO ---> Loop Finished (seconds): 0.657828
 Domain[ROOT_All]                                                  INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr                                                    INFO Application Manager Stopped successfully
 SGInputLoader                                                     INFO Finalizing SGInputLoader...
@@ -1293,9 +1310,9 @@ IOVDbFolder                                                       INFO Folder /T
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.01 ))s
-IOVDbSvc                                                          INFO  bytes in ((      0.03 ))s
+IOVDbSvc                                                          INFO  bytes in ((      0.04 ))s
 IOVDbSvc                                                          INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.03 ))s
+IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.04 ))s
 IOVDbSvc                                                          INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 1 nFolders: 11 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc                                                  INFO in finalize...
 ToolSvc                                                           INFO Removing all tools created by ToolSvc
@@ -1305,9 +1322,9 @@ ToolSvc.ByteStreamMetadataTool                                    INFO in finali
 *****Chrono*****                                                  INFO WARNING: MT job; statistics are unreliable
 *****Chrono*****                                                  INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                                  INFO ****************************************************************************************************
-cObjR_ALL                                                         INFO Time User   : Tot=   90 [ms] Ave/Min/Max=      45(+-      45)/       0/      90 [ms] #=  2
-cObj_ALL                                                          INFO Time User   : Tot=  110 [ms] Ave/Min/Max=      55(+-      45)/      10/     100 [ms] #=  2
-ChronoStatSvc                                                     INFO Time User   : Tot= 2.18  [s]  #=  1
+cObjR_ALL                                                         INFO Time User   : Tot=   90 [ms] Ave/Min/Max=      45(+-      35)/      10/      80 [ms] #=  2
+cObj_ALL                                                          INFO Time User   : Tot=  110 [ms] Ave/Min/Max=      55(+-      35)/      20/      90 [ms] #=  2
+ChronoStatSvc                                                     INFO Time User   : Tot= 2.73  [s]  #=  1
 *****Chrono*****                                                  INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                                          INFO  Service finalized successfully 
 ApplicationMgr                                                    INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
index dcccc5fd1675269b2cb8c165dc5ede5075ed36ae..d600545a3e0c65562748af8d5780302c952b0450 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:25:02 CEST 2021
+Mon Nov  1 22:42:55 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileMuRcvContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:25:07 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:17 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -63,7 +68,7 @@ IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
 ByteStreamAddre...   INFO Initializing
 ByteStreamAddre...   INFO -- Will fill Store with id =  0
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -85,7 +90,7 @@ IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/STATUS/ADC
 IOVDbSvc             INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
 IOVDbSvc             INFO Added taginfo remove for /LAR/LArCellPositionShift
-ClassIDSvc           INFO getRegistryEntries: read 1854 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 1858 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc       INFO  initializing 
 DetDescrCnvSvc       INFO Found DetectorStore service
@@ -179,7 +184,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -188,7 +193,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.36S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.43S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -199,7 +204,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -211,9 +216,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -250,8 +255,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.13S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.12S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -264,6 +269,7 @@ TileCablingSvc       INFO Cabling for RUN2a (2018) ATLAS geometry is set via job
 TileCablingSvc       INFO Setting Cabling type to 5
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -294,6 +300,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -312,7 +334,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4121 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4138 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 Finalizer            INFO Initializing Finalizer...
 ByteStreamInputSvc   INFO Initializing
@@ -321,10 +343,10 @@ ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments
 ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector        INFO reinitialization...
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 379 CLIDRegistry entries for module ALL
 ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileByteStream/TileByteStream-02-00-00/data18_tilecomm.00363899.calibration_tile.daq.RAW._lb0000._TileREB-ROS._0005-200ev.data
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
@@ -357,27 +379,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -400,6 +408,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -411,7 +420,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 2258 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2257 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD...   INFO TileL2Builder initialization completed
 ToolSvc.TileMuR...   INFO Initializing TileMuRcvContByteStreamTool
@@ -626,23 +635,23 @@ Finalizer            INFO Finalizing Finalizer...
 Finalize: compared 10 dumps
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/104912 ((     0.04 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/104912 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641536 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/43176 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641536 ((     0.04 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/43176 ((     0.07 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.05 ))s
 IOVDbSvc             INFO  bytes in ((      0.33 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.05 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.28 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.08 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.25 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.TileMuR...   INFO Finalizing TileMuRcvContByteStreamTool successfuly
@@ -651,18 +660,18 @@ ToolSvc.ByteStr...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   70 [ms] Ave/Min/Max=    17.5(+-    30.3)/       0/      70 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=   90 [ms] Ave/Min/Max=       6(+-    19.9)/       0/      80 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 2.27  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      30(+-    46.4)/       0/     110 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  140 [ms] Ave/Min/Max=    9.33(+-      30)/       0/     120 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 3.08  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
 Py:Athena            INFO leaving with code 0: "successful run"
-Mon Sep  6 17:25:12 CEST 2021
+Mon Nov  1 22:43:28 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
@@ -671,9 +680,14 @@ Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileMuRcvContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -691,21 +705,21 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:25:17 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:48 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc                                                  INFO in initialize...
 AthDictLoaderSvc                                                  INFO acquired Dso-registry
-ClassIDSvc                                                        INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc                                                       INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc                                                       INFO Initializing MetaDataSvc
 PoolSvc                                                           INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc                                                           INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc                                                           INFO Frontier compression level set to 5
 DBReplicaSvc                                                      INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc                                                      INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc                                                      INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc                                                           INFO Successfully setup replica sorting algorithm
 PoolSvc                                                           INFO Setting up APR FileCatalog and Streams
 PoolSvc                                                           INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -727,7 +741,7 @@ IOVDbSvc                                                          INFO   AlgTool
 ByteStreamAddressProviderSvc                                      INFO Initializing
 ByteStreamAddressProviderSvc                                      INFO -- Will fill Store with id =  0
 TagInfoMgr                                                        INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc                                                        INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc                                                          INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc                                                        INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
@@ -749,7 +763,7 @@ IOVDbSvc                                                          INFO Added tag
 IOVDbSvc                                                          INFO Added taginfo remove for /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc                                                          INFO Added taginfo remove for /TILE/ONL01/STATUS/ADC
 IOVDbSvc                                                          INFO Added taginfo remove for /LAR/LArCellPositionShift
-ClassIDSvc                                                        INFO getRegistryEntries: read 1854 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 1858 CLIDRegistry entries for module ALL
 ClassIDSvc                                                        INFO getRegistryEntries: read 23 CLIDRegistry entries for module ALL
 DetDescrCnvSvc                                                    INFO  initializing 
 DetDescrCnvSvc                                                    INFO Found DetectorStore service
@@ -843,7 +857,7 @@ BarrelConstruction                                                INFO   Use sag
 EMECConstruction                                                  INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc                                                        INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -852,7 +866,7 @@ EMECConstruction                                                  INFO multi-lay
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstruction                                              INFO Start building EC electronics geometry
-GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.36S
+GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.57S
 GeoModelSvc.TileDetectorTool                                      INFO  Entering TileDetectorTool::create()
 TileDddbManager                                                   INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager                                                   INFO n_tiglob = 5
@@ -863,7 +877,7 @@ TileDddbManager                                                   INFO n_tilb =
 TileDddbManager                                                   INFO n_tileSwitches = 1
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDescrCnv                                               INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -875,9 +889,9 @@ CaloIDHelper_IDDetDescrCnv                                        INFO in create
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID                                                    INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -914,8 +928,8 @@ GeoModelSvc.TileDetectorTool                                      INFO  Global p
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrManager                                               INFO Entering create_elements()
-GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.11S
-ClassIDSvc                                                        INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.16S
+ClassIDSvc                                                        INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader                                                    INFO Changing TTL1 calib from 4.1 to 6.9
@@ -927,10 +941,11 @@ TileCablingSvc                                                    INFO RUN2 ATLA
 TileCablingSvc                                                    INFO Cabling for RUN2a (2018) ATLAS geometry is set via jobOptions 
 TileCablingSvc                                                    INFO Setting Cabling type to 5
 AthenaHiveEventLoopMgr                                            INFO Initializing AthenaHiveEventLoopMgr
-ClassIDSvc                                                   0    INFO getRegistryEntries: read 4391 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 4408 CLIDRegistry entries for module ALL
 PyComponentMgr                                               0    INFO Initializing PyComponentMgr...
 Finalizer                                                    0    INFO Initializing Finalizer...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 553 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Initializing CondInputLoader...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Adding base classes:
@@ -961,6 +976,22 @@ CondInputLoader                                              0    INFO Will crea
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+TileNeighbour                                                0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloSuperCellAlignCondAlg.CaloSuperCellIDTool                0    INFO Done with initIDMap
 TileBadChannelsCondAlg.TileCondProxyCool_OnlBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannelsCondAlg.TileCondProxyCool_OflBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannelsCondAlg                                       0    INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -981,7 +1012,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  ( 'TileMuonReceiverContainer' , 'StoreGateSvc+TileMuRcvCnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileMuonReceiverDumper
@@ -1001,6 +1032,7 @@ ROBDataProviderSvc                                           0    INFO  ---> Fil
 ROBDataProviderSvc                                           0    INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc                                           0    INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector                                                0    INFO reinitialization...
+ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileByteStream/TileByteStream-02-00-00/data18_tilecomm.00363899.calibration_tile.daq.RAW._lb0000._TileREB-ROS._0005-200ev.data
 AthenaHiveEventLoopMgr                                       0    INFO Setup EventSelector service EventSelector
 ApplicationMgr                                               0    INFO Application Manager Initialized successfully
 PoolSvc                                                      0    INFO Enabled implicit multithreading in ROOT via PersistencySvc to: 3
@@ -1017,7 +1049,6 @@ CondInputLoader                                              0    INFO created C
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
 CondInputLoader                                              0    INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
-ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileByteStream/TileByteStream-02-00-00/data18_tilecomm.00363899.calibration_tile.daq.RAW._lb0000._TileREB-ROS._0005-200ev.data
 ApplicationMgr                                               0    INFO Application Manager Started successfully
 AthenaHiveEventLoopMgr                                       0    INFO Starting loop on events
 EventPersistencySvc                                    0     0    INFO Added successfully Conversion service:AthenaPoolCnvSvc
@@ -1038,34 +1069,20 @@ Domain[ROOT_All]                                       0     0    INFO
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv                                     0     0    INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDescrCnv                                   0     0    INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID                                              0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID                                             0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-TileNeighbour                                          0     0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIdMgrDetDescrCnv                                   0     0    INFO  Finished 
 CaloIdMgrDetDescrCnv                                   0     0    INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]                                       0     0    INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]                                       0     0    INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaHiveEventLoopMgr                                 0     0    INFO   ===>>>  start processing event #18124, run #363899 on slot 0,  0 events processed so far  <<<===
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 495 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 494 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 1763 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD_Decoder.TileL2Builder                  0     0    INFO TileL2Builder initialization completed
@@ -1080,201 +1097,201 @@ AthenaHiveEventLoopMgr                                 1     0    INFO   ===>>>
 AthenaHiveEventLoopMgr                                 2     1    INFO   ===>>>  start processing event #18126, run #363899 on slot 1,  1 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  start processing event #18127, run #363899 on slot 2,  1 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  start processing event #18128, run #363899 on slot 3,  1 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  done processing event #18128, run #363899 on slot 3,  2 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 1     0    INFO   ===>>>  done processing event #18125, run #363899 on slot 0,  3 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>  start processing event #18129, run #363899 on slot 0,  3 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 6     3    INFO   ===>>>  start processing event #18130, run #363899 on slot 3,  3 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  done processing event #18127, run #363899 on slot 2,  4 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 7     2    INFO   ===>>>  start processing event #18131, run #363899 on slot 2,  4 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 2     1    INFO   ===>>>  done processing event #18126, run #363899 on slot 1,  5 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 8     1    INFO   ===>>>  start processing event #18132, run #363899 on slot 1,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 1     0    INFO   ===>>>  done processing event #18125, run #363899 on slot 0,  2 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>  start processing event #18129, run #363899 on slot 0,  2 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  done processing event #18127, run #363899 on slot 2,  3 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 6     2    INFO   ===>>>  start processing event #18130, run #363899 on slot 2,  3 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 2     1    INFO   ===>>>  done processing event #18126, run #363899 on slot 1,  4 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  done processing event #18128, run #363899 on slot 3,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 7     1    INFO   ===>>>  start processing event #18131, run #363899 on slot 1,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 8     3    INFO   ===>>>  start processing event #18132, run #363899 on slot 3,  5 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>  done processing event #18129, run #363899 on slot 0,  6 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 9     0    INFO   ===>>>  start processing event #18133, run #363899 on slot 0,  6 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 7     2    INFO   ===>>>  done processing event #18131, run #363899 on slot 2,  7 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 6     3    INFO   ===>>>  done processing event #18130, run #363899 on slot 3,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                10     2    INFO   ===>>>  start processing event #18134, run #363899 on slot 2,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                11     3    INFO   ===>>>  start processing event #18135, run #363899 on slot 3,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 8     1    INFO   ===>>>  done processing event #18132, run #363899 on slot 1,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 7     1    INFO   ===>>>  done processing event #18131, run #363899 on slot 1,  7 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 6     2    INFO   ===>>>  done processing event #18130, run #363899 on slot 2,  8 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 8     3    INFO   ===>>>  done processing event #18132, run #363899 on slot 3,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                10     1    INFO   ===>>>  start processing event #18134, run #363899 on slot 1,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                11     2    INFO   ===>>>  start processing event #18135, run #363899 on slot 2,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                12     3    INFO   ===>>>  start processing event #18136, run #363899 on slot 3,  9 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 9     0    INFO   ===>>>  done processing event #18133, run #363899 on slot 0,  10 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                12     0    INFO   ===>>>  start processing event #18136, run #363899 on slot 0,  10 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                13     1    INFO   ===>>>  start processing event #18137, run #363899 on slot 1,  10 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                10     2    INFO   ===>>>  done processing event #18134, run #363899 on slot 2,  11 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                14     2    INFO   ===>>>  start processing event #18138, run #363899 on slot 2,  11 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                11     3    INFO   ===>>>  done processing event #18135, run #363899 on slot 3,  12 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                15     3    INFO   ===>>>  start processing event #18139, run #363899 on slot 3,  12 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                12     0    INFO   ===>>>  done processing event #18136, run #363899 on slot 0,  13 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                16     0    INFO   ===>>>  start processing event #18140, run #363899 on slot 0,  13 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                13     1    INFO   ===>>>  done processing event #18137, run #363899 on slot 1,  14 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                17     1    INFO   ===>>>  start processing event #18141, run #363899 on slot 1,  14 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                14     2    INFO   ===>>>  done processing event #18138, run #363899 on slot 2,  15 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                18     2    INFO   ===>>>  start processing event #18142, run #363899 on slot 2,  15 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                16     0    INFO   ===>>>  done processing event #18140, run #363899 on slot 0,  16 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                15     3    INFO   ===>>>  done processing event #18139, run #363899 on slot 3,  17 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                19     0    INFO   ===>>>  start processing event #18143, run #363899 on slot 0,  17 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                20     3    INFO   ===>>>  start processing event #18144, run #363899 on slot 3,  17 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                17     1    INFO   ===>>>  done processing event #18141, run #363899 on slot 1,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                21     1    INFO   ===>>>  start processing event #18145, run #363899 on slot 1,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                18     2    INFO   ===>>>  done processing event #18142, run #363899 on slot 2,  19 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                22     2    INFO   ===>>>  start processing event #18146, run #363899 on slot 2,  19 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                19     0    INFO   ===>>>  done processing event #18143, run #363899 on slot 0,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                23     0    INFO   ===>>>  start processing event #18147, run #363899 on slot 0,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                20     3    INFO   ===>>>  done processing event #18144, run #363899 on slot 3,  21 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                24     3    INFO   ===>>>  start processing event #18148, run #363899 on slot 3,  21 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                21     1    INFO   ===>>>  done processing event #18145, run #363899 on slot 1,  22 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                25     1    INFO   ===>>>  start processing event #18149, run #363899 on slot 1,  22 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                22     2    INFO   ===>>>  done processing event #18146, run #363899 on slot 2,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                23     0    INFO   ===>>>  done processing event #18147, run #363899 on slot 0,  24 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                26     0    INFO   ===>>>  start processing event #18150, run #363899 on slot 0,  24 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                13     0    INFO   ===>>>  start processing event #18137, run #363899 on slot 0,  10 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                10     1    INFO   ===>>>  done processing event #18134, run #363899 on slot 1,  11 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                11     2    INFO   ===>>>  done processing event #18135, run #363899 on slot 2,  12 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                14     1    INFO   ===>>>  start processing event #18138, run #363899 on slot 1,  12 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                15     2    INFO   ===>>>  start processing event #18139, run #363899 on slot 2,  12 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                12     3    INFO   ===>>>  done processing event #18136, run #363899 on slot 3,  13 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                13     0    INFO   ===>>>  done processing event #18137, run #363899 on slot 0,  14 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                16     0    INFO   ===>>>  start processing event #18140, run #363899 on slot 0,  14 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                17     3    INFO   ===>>>  start processing event #18141, run #363899 on slot 3,  14 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                14     1    INFO   ===>>>  done processing event #18138, run #363899 on slot 1,  15 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                15     2    INFO   ===>>>  done processing event #18139, run #363899 on slot 2,  16 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                18     1    INFO   ===>>>  start processing event #18142, run #363899 on slot 1,  16 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                19     2    INFO   ===>>>  start processing event #18143, run #363899 on slot 2,  16 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                16     0    INFO   ===>>>  done processing event #18140, run #363899 on slot 0,  17 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                17     3    INFO   ===>>>  done processing event #18141, run #363899 on slot 3,  18 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                20     0    INFO   ===>>>  start processing event #18144, run #363899 on slot 0,  18 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                21     3    INFO   ===>>>  start processing event #18145, run #363899 on slot 3,  18 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                18     1    INFO   ===>>>  done processing event #18142, run #363899 on slot 1,  19 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                19     2    INFO   ===>>>  done processing event #18143, run #363899 on slot 2,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                22     1    INFO   ===>>>  start processing event #18146, run #363899 on slot 1,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                23     2    INFO   ===>>>  start processing event #18147, run #363899 on slot 2,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                20     0    INFO   ===>>>  done processing event #18144, run #363899 on slot 0,  21 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                21     3    INFO   ===>>>  done processing event #18145, run #363899 on slot 3,  22 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                24     0    INFO   ===>>>  start processing event #18148, run #363899 on slot 0,  22 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                25     3    INFO   ===>>>  start processing event #18149, run #363899 on slot 3,  22 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                22     1    INFO   ===>>>  done processing event #18146, run #363899 on slot 1,  23 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                23     2    INFO   ===>>>  done processing event #18147, run #363899 on slot 2,  24 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                26     1    INFO   ===>>>  start processing event #18150, run #363899 on slot 1,  24 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                27     2    INFO   ===>>>  start processing event #18151, run #363899 on slot 2,  24 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                24     3    INFO   ===>>>  done processing event #18148, run #363899 on slot 3,  25 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                28     3    INFO   ===>>>  start processing event #18152, run #363899 on slot 3,  25 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                25     1    INFO   ===>>>  done processing event #18149, run #363899 on slot 1,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                29     1    INFO   ===>>>  start processing event #18153, run #363899 on slot 1,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                26     0    INFO   ===>>>  done processing event #18150, run #363899 on slot 0,  27 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                30     0    INFO   ===>>>  start processing event #18154, run #363899 on slot 0,  27 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                24     0    INFO   ===>>>  done processing event #18148, run #363899 on slot 0,  25 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                25     3    INFO   ===>>>  done processing event #18149, run #363899 on slot 3,  26 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                28     0    INFO   ===>>>  start processing event #18152, run #363899 on slot 0,  26 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                29     3    INFO   ===>>>  start processing event #18153, run #363899 on slot 3,  26 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                26     1    INFO   ===>>>  done processing event #18150, run #363899 on slot 1,  27 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                27     2    INFO   ===>>>  done processing event #18151, run #363899 on slot 2,  28 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                30     1    INFO   ===>>>  start processing event #18154, run #363899 on slot 1,  28 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                31     2    INFO   ===>>>  start processing event #18155, run #363899 on slot 2,  28 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                28     3    INFO   ===>>>  done processing event #18152, run #363899 on slot 3,  29 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                32     3    INFO   ===>>>  start processing event #18156, run #363899 on slot 3,  29 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                29     1    INFO   ===>>>  done processing event #18153, run #363899 on slot 1,  30 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                33     1    INFO   ===>>>  start processing event #18157, run #363899 on slot 1,  30 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                30     0    INFO   ===>>>  done processing event #18154, run #363899 on slot 0,  31 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                34     0    INFO   ===>>>  start processing event #18158, run #363899 on slot 0,  31 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                28     0    INFO   ===>>>  done processing event #18152, run #363899 on slot 0,  29 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                29     3    INFO   ===>>>  done processing event #18153, run #363899 on slot 3,  30 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                32     0    INFO   ===>>>  start processing event #18156, run #363899 on slot 0,  30 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                33     3    INFO   ===>>>  start processing event #18157, run #363899 on slot 3,  30 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                30     1    INFO   ===>>>  done processing event #18154, run #363899 on slot 1,  31 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                31     2    INFO   ===>>>  done processing event #18155, run #363899 on slot 2,  32 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                34     1    INFO   ===>>>  start processing event #18158, run #363899 on slot 1,  32 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                35     2    INFO   ===>>>  start processing event #18159, run #363899 on slot 2,  32 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                32     3    INFO   ===>>>  done processing event #18156, run #363899 on slot 3,  33 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                36     3    INFO   ===>>>  start processing event #18160, run #363899 on slot 3,  33 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                33     1    INFO   ===>>>  done processing event #18157, run #363899 on slot 1,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                37     1    INFO   ===>>>  start processing event #18161, run #363899 on slot 1,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                34     0    INFO   ===>>>  done processing event #18158, run #363899 on slot 0,  35 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                32     0    INFO   ===>>>  done processing event #18156, run #363899 on slot 0,  33 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                33     3    INFO   ===>>>  done processing event #18157, run #363899 on slot 3,  34 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                36     0    INFO   ===>>>  start processing event #18160, run #363899 on slot 0,  34 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                37     3    INFO   ===>>>  start processing event #18161, run #363899 on slot 3,  34 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                34     1    INFO   ===>>>  done processing event #18158, run #363899 on slot 1,  35 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                35     2    INFO   ===>>>  done processing event #18159, run #363899 on slot 2,  36 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                38     0    INFO   ===>>>  start processing event #18162, run #363899 on slot 0,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                38     1    INFO   ===>>>  start processing event #18162, run #363899 on slot 1,  36 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                39     2    INFO   ===>>>  start processing event #18163, run #363899 on slot 2,  36 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                37     1    INFO   ===>>>  done processing event #18161, run #363899 on slot 1,  37 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                36     3    INFO   ===>>>  done processing event #18160, run #363899 on slot 3,  38 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                40     1    INFO   ===>>>  start processing event #18164, run #363899 on slot 1,  38 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                36     0    INFO   ===>>>  done processing event #18160, run #363899 on slot 0,  37 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                37     3    INFO   ===>>>  done processing event #18161, run #363899 on slot 3,  38 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                40     0    INFO   ===>>>  start processing event #18164, run #363899 on slot 0,  38 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                41     3    INFO   ===>>>  start processing event #18165, run #363899 on slot 3,  38 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                38     0    INFO   ===>>>  done processing event #18162, run #363899 on slot 0,  39 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                38     1    INFO   ===>>>  done processing event #18162, run #363899 on slot 1,  39 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                39     2    INFO   ===>>>  done processing event #18163, run #363899 on slot 2,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                42     0    INFO   ===>>>  start processing event #18166, run #363899 on slot 0,  40 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                42     1    INFO   ===>>>  start processing event #18166, run #363899 on slot 1,  40 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                43     2    INFO   ===>>>  start processing event #18167, run #363899 on slot 2,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                40     1    INFO   ===>>>  done processing event #18164, run #363899 on slot 1,  41 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                44     1    INFO   ===>>>  start processing event #18168, run #363899 on slot 1,  41 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                40     0    INFO   ===>>>  done processing event #18164, run #363899 on slot 0,  41 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                41     3    INFO   ===>>>  done processing event #18165, run #363899 on slot 3,  42 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  start processing event #18168, run #363899 on slot 0,  42 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                45     3    INFO   ===>>>  start processing event #18169, run #363899 on slot 3,  42 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                42     0    INFO   ===>>>  done processing event #18166, run #363899 on slot 0,  43 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                46     0    INFO   ===>>>  start processing event #18170, run #363899 on slot 0,  43 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                42     1    INFO   ===>>>  done processing event #18166, run #363899 on slot 1,  43 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                43     2    INFO   ===>>>  done processing event #18167, run #363899 on slot 2,  44 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                46     1    INFO   ===>>>  start processing event #18170, run #363899 on slot 1,  44 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                47     2    INFO   ===>>>  start processing event #18171, run #363899 on slot 2,  44 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                44     1    INFO   ===>>>  done processing event #18168, run #363899 on slot 1,  45 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  done processing event #18168, run #363899 on slot 0,  45 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                45     3    INFO   ===>>>  done processing event #18169, run #363899 on slot 3,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                48     1    INFO   ===>>>  start processing event #18172, run #363899 on slot 1,  46 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                48     0    INFO   ===>>>  start processing event #18172, run #363899 on slot 0,  46 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                49     3    INFO   ===>>>  start processing event #18173, run #363899 on slot 3,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                46     0    INFO   ===>>>  done processing event #18170, run #363899 on slot 0,  47 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                50     0    INFO   ===>>>  start processing event #18174, run #363899 on slot 0,  47 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                46     1    INFO   ===>>>  done processing event #18170, run #363899 on slot 1,  47 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                47     2    INFO   ===>>>  done processing event #18171, run #363899 on slot 2,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                50     1    INFO   ===>>>  start processing event #18174, run #363899 on slot 1,  48 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                51     2    INFO   ===>>>  start processing event #18175, run #363899 on slot 2,  48 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                48     1    INFO   ===>>>  done processing event #18172, run #363899 on slot 1,  49 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                48     0    INFO   ===>>>  done processing event #18172, run #363899 on slot 0,  49 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                49     3    INFO   ===>>>  done processing event #18173, run #363899 on slot 3,  50 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                52     1    INFO   ===>>>  start processing event #18176, run #363899 on slot 1,  50 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                52     0    INFO   ===>>>  start processing event #18176, run #363899 on slot 0,  50 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  start processing event #18177, run #363899 on slot 3,  50 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                50     0    INFO   ===>>>  done processing event #18174, run #363899 on slot 0,  51 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                50     1    INFO   ===>>>  done processing event #18174, run #363899 on slot 1,  51 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                51     2    INFO   ===>>>  done processing event #18175, run #363899 on slot 2,  52 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                54     0    INFO   ===>>>  start processing event #18178, run #363899 on slot 0,  52 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                54     1    INFO   ===>>>  start processing event #18178, run #363899 on slot 1,  52 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                55     2    INFO   ===>>>  start processing event #18179, run #363899 on slot 2,  52 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                52     1    INFO   ===>>>  done processing event #18176, run #363899 on slot 1,  53 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                56     1    INFO   ===>>>  start processing event #18180, run #363899 on slot 1,  53 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                52     0    INFO   ===>>>  done processing event #18176, run #363899 on slot 0,  53 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  done processing event #18177, run #363899 on slot 3,  54 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                56     0    INFO   ===>>>  start processing event #18180, run #363899 on slot 0,  54 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                57     3    INFO   ===>>>  start processing event #18181, run #363899 on slot 3,  54 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                54     0    INFO   ===>>>  done processing event #18178, run #363899 on slot 0,  55 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                54     1    INFO   ===>>>  done processing event #18178, run #363899 on slot 1,  55 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                55     2    INFO   ===>>>  done processing event #18179, run #363899 on slot 2,  56 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                58     0    INFO   ===>>>  start processing event #18182, run #363899 on slot 0,  56 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                58     1    INFO   ===>>>  start processing event #18182, run #363899 on slot 1,  56 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  start processing event #18183, run #363899 on slot 2,  56 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                56     1    INFO   ===>>>  done processing event #18180, run #363899 on slot 1,  57 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                60     1    INFO   ===>>>  start processing event #18184, run #363899 on slot 1,  57 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                56     0    INFO   ===>>>  done processing event #18180, run #363899 on slot 0,  57 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                57     3    INFO   ===>>>  done processing event #18181, run #363899 on slot 3,  58 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                60     0    INFO   ===>>>  start processing event #18184, run #363899 on slot 0,  58 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                61     3    INFO   ===>>>  start processing event #18185, run #363899 on slot 3,  58 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  done processing event #18183, run #363899 on slot 2,  59 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                58     0    INFO   ===>>>  done processing event #18182, run #363899 on slot 0,  60 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                62     0    INFO   ===>>>  start processing event #18186, run #363899 on slot 0,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                58     1    INFO   ===>>>  done processing event #18182, run #363899 on slot 1,  59 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  done processing event #18183, run #363899 on slot 2,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                62     1    INFO   ===>>>  start processing event #18186, run #363899 on slot 1,  60 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                63     2    INFO   ===>>>  start processing event #18187, run #363899 on slot 2,  60 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                60     1    INFO   ===>>>  done processing event #18184, run #363899 on slot 1,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                64     1    INFO   ===>>>  start processing event #18188, run #363899 on slot 1,  61 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                60     0    INFO   ===>>>  done processing event #18184, run #363899 on slot 0,  61 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                61     3    INFO   ===>>>  done processing event #18185, run #363899 on slot 3,  62 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                62     0    INFO   ===>>>  done processing event #18186, run #363899 on slot 0,  63 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                65     0    INFO   ===>>>  start processing event #18189, run #363899 on slot 0,  63 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                66     3    INFO   ===>>>  start processing event #18190, run #363899 on slot 3,  63 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                64     0    INFO   ===>>>  start processing event #18188, run #363899 on slot 0,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                65     3    INFO   ===>>>  start processing event #18189, run #363899 on slot 3,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                62     1    INFO   ===>>>  done processing event #18186, run #363899 on slot 1,  63 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                63     2    INFO   ===>>>  done processing event #18187, run #363899 on slot 2,  64 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                64     1    INFO   ===>>>  done processing event #18188, run #363899 on slot 1,  65 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                67     1    INFO   ===>>>  start processing event #18191, run #363899 on slot 1,  65 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                68     2    INFO   ===>>>  start processing event #18192, run #363899 on slot 2,  65 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                65     0    INFO   ===>>>  done processing event #18189, run #363899 on slot 0,  66 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                69     0    INFO   ===>>>  start processing event #18193, run #363899 on slot 0,  66 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                66     3    INFO   ===>>>  done processing event #18190, run #363899 on slot 3,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                70     3    INFO   ===>>>  start processing event #18194, run #363899 on slot 3,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                67     1    INFO   ===>>>  done processing event #18191, run #363899 on slot 1,  68 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                68     2    INFO   ===>>>  done processing event #18192, run #363899 on slot 2,  69 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                71     1    INFO   ===>>>  start processing event #18195, run #363899 on slot 1,  69 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                72     2    INFO   ===>>>  start processing event #18196, run #363899 on slot 2,  69 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                69     0    INFO   ===>>>  done processing event #18193, run #363899 on slot 0,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                70     3    INFO   ===>>>  done processing event #18194, run #363899 on slot 3,  71 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                73     0    INFO   ===>>>  start processing event #18197, run #363899 on slot 0,  71 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                74     3    INFO   ===>>>  start processing event #18198, run #363899 on slot 3,  71 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                71     1    INFO   ===>>>  done processing event #18195, run #363899 on slot 1,  72 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                72     2    INFO   ===>>>  done processing event #18196, run #363899 on slot 2,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                75     1    INFO   ===>>>  start processing event #18199, run #363899 on slot 1,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                76     2    INFO   ===>>>  start processing event #18200, run #363899 on slot 2,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                73     0    INFO   ===>>>  done processing event #18197, run #363899 on slot 0,  74 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                74     3    INFO   ===>>>  done processing event #18198, run #363899 on slot 3,  75 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                77     0    INFO   ===>>>  start processing event #18201, run #363899 on slot 0,  75 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                66     1    INFO   ===>>>  start processing event #18190, run #363899 on slot 1,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                67     2    INFO   ===>>>  start processing event #18191, run #363899 on slot 2,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                64     0    INFO   ===>>>  done processing event #18188, run #363899 on slot 0,  65 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                65     3    INFO   ===>>>  done processing event #18189, run #363899 on slot 3,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  start processing event #18192, run #363899 on slot 0,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                69     3    INFO   ===>>>  start processing event #18193, run #363899 on slot 3,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                66     1    INFO   ===>>>  done processing event #18190, run #363899 on slot 1,  67 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                67     2    INFO   ===>>>  done processing event #18191, run #363899 on slot 2,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                70     1    INFO   ===>>>  start processing event #18194, run #363899 on slot 1,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                71     2    INFO   ===>>>  start processing event #18195, run #363899 on slot 2,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  done processing event #18192, run #363899 on slot 0,  69 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                69     3    INFO   ===>>>  done processing event #18193, run #363899 on slot 3,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                72     0    INFO   ===>>>  start processing event #18196, run #363899 on slot 0,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                73     3    INFO   ===>>>  start processing event #18197, run #363899 on slot 3,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                70     1    INFO   ===>>>  done processing event #18194, run #363899 on slot 1,  71 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                71     2    INFO   ===>>>  done processing event #18195, run #363899 on slot 2,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                74     1    INFO   ===>>>  start processing event #18198, run #363899 on slot 1,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                75     2    INFO   ===>>>  start processing event #18199, run #363899 on slot 2,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                72     0    INFO   ===>>>  done processing event #18196, run #363899 on slot 0,  73 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                76     0    INFO   ===>>>  start processing event #18200, run #363899 on slot 0,  73 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                73     3    INFO   ===>>>  done processing event #18197, run #363899 on slot 3,  74 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                74     1    INFO   ===>>>  done processing event #18198, run #363899 on slot 1,  75 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                77     1    INFO   ===>>>  start processing event #18201, run #363899 on slot 1,  75 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                78     3    INFO   ===>>>  start processing event #18202, run #363899 on slot 3,  75 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                75     1    INFO   ===>>>  done processing event #18199, run #363899 on slot 1,  76 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                76     2    INFO   ===>>>  done processing event #18200, run #363899 on slot 2,  77 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                79     1    INFO   ===>>>  start processing event #18203, run #363899 on slot 1,  77 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                75     2    INFO   ===>>>  done processing event #18199, run #363899 on slot 2,  76 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                76     0    INFO   ===>>>  done processing event #18200, run #363899 on slot 0,  77 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                79     0    INFO   ===>>>  start processing event #18203, run #363899 on slot 0,  77 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                80     2    INFO   ===>>>  start processing event #18204, run #363899 on slot 2,  77 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                77     0    INFO   ===>>>  done processing event #18201, run #363899 on slot 0,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                77     1    INFO   ===>>>  done processing event #18201, run #363899 on slot 1,  78 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                78     3    INFO   ===>>>  done processing event #18202, run #363899 on slot 3,  79 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                81     0    INFO   ===>>>  start processing event #18205, run #363899 on slot 0,  79 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                81     1    INFO   ===>>>  start processing event #18205, run #363899 on slot 1,  79 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                82     3    INFO   ===>>>  start processing event #18206, run #363899 on slot 3,  79 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                79     1    INFO   ===>>>  done processing event #18203, run #363899 on slot 1,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                79     0    INFO   ===>>>  done processing event #18203, run #363899 on slot 0,  80 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                80     2    INFO   ===>>>  done processing event #18204, run #363899 on slot 2,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                83     1    INFO   ===>>>  start processing event #18207, run #363899 on slot 1,  81 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                83     0    INFO   ===>>>  start processing event #18207, run #363899 on slot 0,  81 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                84     2    INFO   ===>>>  start processing event #18208, run #363899 on slot 2,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                81     0    INFO   ===>>>  done processing event #18205, run #363899 on slot 0,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                81     1    INFO   ===>>>  done processing event #18205, run #363899 on slot 1,  82 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                82     3    INFO   ===>>>  done processing event #18206, run #363899 on slot 3,  83 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                85     0    INFO   ===>>>  start processing event #18209, run #363899 on slot 0,  83 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                85     1    INFO   ===>>>  start processing event #18209, run #363899 on slot 1,  83 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                86     3    INFO   ===>>>  start processing event #18210, run #363899 on slot 3,  83 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                83     1    INFO   ===>>>  done processing event #18207, run #363899 on slot 1,  84 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                87     1    INFO   ===>>>  start processing event #18211, run #363899 on slot 1,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                83     0    INFO   ===>>>  done processing event #18207, run #363899 on slot 0,  84 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                84     2    INFO   ===>>>  done processing event #18208, run #363899 on slot 2,  85 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                87     0    INFO   ===>>>  start processing event #18211, run #363899 on slot 0,  85 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                88     2    INFO   ===>>>  start processing event #18212, run #363899 on slot 2,  85 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                85     0    INFO   ===>>>  done processing event #18209, run #363899 on slot 0,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                85     1    INFO   ===>>>  done processing event #18209, run #363899 on slot 1,  86 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                86     3    INFO   ===>>>  done processing event #18210, run #363899 on slot 3,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                89     0    INFO   ===>>>  start processing event #18213, run #363899 on slot 0,  87 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                89     1    INFO   ===>>>  start processing event #18213, run #363899 on slot 1,  87 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                90     3    INFO   ===>>>  start processing event #18214, run #363899 on slot 3,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                87     1    INFO   ===>>>  done processing event #18211, run #363899 on slot 1,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                87     0    INFO   ===>>>  done processing event #18211, run #363899 on slot 0,  88 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                88     2    INFO   ===>>>  done processing event #18212, run #363899 on slot 2,  89 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                91     1    INFO   ===>>>  start processing event #18215, run #363899 on slot 1,  89 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                91     0    INFO   ===>>>  start processing event #18215, run #363899 on slot 0,  89 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                92     2    INFO   ===>>>  start processing event #18216, run #363899 on slot 2,  89 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                89     0    INFO   ===>>>  done processing event #18213, run #363899 on slot 0,  90 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                89     1    INFO   ===>>>  done processing event #18213, run #363899 on slot 1,  90 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                90     3    INFO   ===>>>  done processing event #18214, run #363899 on slot 3,  91 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                93     0    INFO   ===>>>  start processing event #18217, run #363899 on slot 0,  91 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                93     1    INFO   ===>>>  start processing event #18217, run #363899 on slot 1,  91 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                94     3    INFO   ===>>>  start processing event #18218, run #363899 on slot 3,  91 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                91     1    INFO   ===>>>  done processing event #18215, run #363899 on slot 1,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                91     0    INFO   ===>>>  done processing event #18215, run #363899 on slot 0,  92 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                92     2    INFO   ===>>>  done processing event #18216, run #363899 on slot 2,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                95     1    INFO   ===>>>  start processing event #18219, run #363899 on slot 1,  93 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                95     0    INFO   ===>>>  start processing event #18219, run #363899 on slot 0,  93 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                96     2    INFO   ===>>>  start processing event #18220, run #363899 on slot 2,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                93     0    INFO   ===>>>  done processing event #18217, run #363899 on slot 0,  94 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                93     1    INFO   ===>>>  done processing event #18217, run #363899 on slot 1,  94 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                94     3    INFO   ===>>>  done processing event #18218, run #363899 on slot 3,  95 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                97     0    INFO   ===>>>  start processing event #18221, run #363899 on slot 0,  95 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                98     3    INFO   ===>>>  start processing event #18222, run #363899 on slot 3,  95 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                95     1    INFO   ===>>>  done processing event #18219, run #363899 on slot 1,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                95     0    INFO   ===>>>  done processing event #18219, run #363899 on slot 0,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                97     0    INFO   ===>>>  start processing event #18221, run #363899 on slot 0,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                98     1    INFO   ===>>>  start processing event #18222, run #363899 on slot 1,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     3    INFO   ===>>>  start processing event #18223, run #363899 on slot 3,  96 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                96     2    INFO   ===>>>  done processing event #18220, run #363899 on slot 2,  97 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  start processing event #18223, run #363899 on slot 1,  97 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                97     0    INFO   ===>>>  done processing event #18221, run #363899 on slot 0,  98 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                98     3    INFO   ===>>>  done processing event #18222, run #363899 on slot 3,  99 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO   ===>>>  done processing event #18223, run #363899 on slot 1,  100 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     1    INFO ---> Loop Finished (seconds): 0.44851
+AthenaHiveEventLoopMgr                                98     1    INFO   ===>>>  done processing event #18222, run #363899 on slot 1,  99 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     3    INFO   ===>>>  done processing event #18223, run #363899 on slot 3,  100 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     3    INFO ---> Loop Finished (seconds): 0.560263
 Domain[ROOT_All]                                                  INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr                                                    INFO Application Manager Stopped successfully
 SGInputLoader                                                     INFO Finalizing SGInputLoader...
@@ -1298,9 +1315,9 @@ IOVDbFolder                                                       INFO Folder /T
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.01 ))s
-IOVDbSvc                                                          INFO  bytes in ((      0.04 ))s
+IOVDbSvc                                                          INFO  bytes in ((      0.03 ))s
 IOVDbSvc                                                          INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.04 ))s
+IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.03 ))s
 IOVDbSvc                                                          INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 1 nFolders: 11 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc                                                  INFO in finalize...
 ToolSvc                                                           INFO Removing all tools created by ToolSvc
@@ -1312,8 +1329,8 @@ ToolSvc.ByteStreamMetadataTool                                    INFO in finali
 *****Chrono*****                                                  INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                                  INFO ****************************************************************************************************
 cObjR_ALL                                                         INFO Time User   : Tot=   90 [ms] Ave/Min/Max=      45(+-      35)/      10/      80 [ms] #=  2
-cObj_ALL                                                          INFO Time User   : Tot=  110 [ms] Ave/Min/Max=      55(+-      35)/      20/      90 [ms] #=  2
-ChronoStatSvc                                                     INFO Time User   : Tot=  2.2  [s]  #=  1
+cObj_ALL                                                          INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      60(+-      40)/      20/     100 [ms] #=  2
+ChronoStatSvc                                                     INFO Time User   : Tot=  2.8  [s]  #=  1
 *****Chrono*****                                                  INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                                          INFO  Service finalized successfully 
 ApplicationMgr                                                    INFO Application Manager Finalized successfully
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
index eca4e071e70ac65295dff43419801dd5a273973b..75759a2b79a2142b7124a9e48532be081b2e33fb 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
@@ -1,16 +1,21 @@
-Mon Sep  6 17:23:09 CEST 2021
+Mon Nov  1 22:42:55 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileRawChannelContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -27,21 +32,21 @@ Py:TileInfoConf.     INFO Setting 10-bit Tile ADC
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:23:15 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:17 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
-ClassIDSvc           INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc          INFO Initializing MetaDataSvc
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc              INFO Frontier compression level set to 5
 DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -63,11 +68,11 @@ IOVDbSvc             INFO   AlgTool: ToolSvc.IOVDbMetaDataTool
 ByteStreamAddre...   INFO Initializing
 ByteStreamAddre...   INFO -- Will fill Store with id =  0
 TagInfoMgr           INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc           INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc             INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc           INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO getRegistryEntries: read 1844 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 1848 CLIDRegistry entries for module ALL
 IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
 IOVSvc.IOVSvcTool    INFO IOVRanges will be checked at every Event
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_TILE/OFLP200
@@ -179,7 +184,7 @@ BarrelConstruction   INFO   Use sagging in geometry  ? 0
 EMECConstruction     INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction     INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc           INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -188,7 +193,7 @@ EMECConstruction     INFO multi-layered version of absorbers activated, paramete
 EMECConstruction     INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction     INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstru...   INFO Start building EC electronics geometry
-GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 24124Kb 	 Time = 0.36S
+GeoModelSvc          INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.49S
 GeoModelSvc.Til...   INFO  Entering TileDetectorTool::create()
 TileDddbManager      INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager      INFO n_tiglob = 5
@@ -199,7 +204,7 @@ TileDddbManager      INFO n_tilb = 21
 TileDddbManager      INFO n_tileSwitches = 1
 CaloIDHelper_ID...   INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDesc...   INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID             INFO initialize_from_dictionary 
 AtlasDetectorID      INFO initialize_from_dictionary - OK
@@ -211,9 +216,9 @@ CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_ID helper object in th
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_ID...   INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID       INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -250,8 +255,8 @@ GeoModelSvc.Til...   INFO  Global positioning of barrel with rotation (0,0,0)) a
 GeoModelSvc.Til...   INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.Til...   INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrMan...   INFO Entering create_elements()
-GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.09S
-ClassIDSvc           INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc          INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.14S
+ClassIDSvc           INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc          INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader       INFO Changing TTL1 calib from 4.1 to 6.9
@@ -264,6 +269,7 @@ TileCablingSvc       INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via
 TileCablingSvc       INFO Setting Cabling type to 4
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr
 ClassIDSvc           INFO getRegistryEntries: read 444 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Initializing CondInputLoader...
 ClassIDSvc           INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader      INFO Adding base classes:
@@ -294,6 +300,22 @@ CondInputLoader      INFO Will create WriteCondHandle dependencies for the follo
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc           INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID      INFO initialize_from_dictionary - OK
+CaloSuperCellAl...   INFO Done with initIDMap
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannels...   INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannels...   INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -312,7 +334,7 @@ TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCond
 TileEMScaleCond...   INFO Creating TileCondProxyCool(TileEMScaleCondAlg.TileCondProxyCool_OnlEms) for folder: "/TILE/OFL02/CALIB/EMS"
 TileSampleNoise...   INFO Creating TileCondProxyCool(TileSampleNoiseCondAlg.TileCondProxyCool_NoiseSample) for folder: "/TILE/OFL02/NOISE/SAMPLE"
 TileTimingCondA...   INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
-ClassIDSvc           INFO getRegistryEntries: read 4121 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 4138 CLIDRegistry entries for module ALL
 PyComponentMgr       INFO Initializing PyComponentMgr...
 Finalizer            INFO Initializing Finalizer...
 ByteStreamInputSvc   INFO Initializing
@@ -321,10 +343,10 @@ ROBDataProviderSvc   INFO  ---> Filter out empty ROB fragments
 ROBDataProviderSvc   INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc   INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector        INFO reinitialization...
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
 ClassIDSvc           INFO getRegistryEntries: read 379 CLIDRegistry entries for module ALL
 ByteStreamInputSvc   INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
+AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
+ApplicationMgr       INFO Application Manager Initialized successfully
 CondInputLoader      INFO created CondCont<CaloRec::CaloCellPositionShift> with key 'ConditionStore+LArCellPositionShift'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CES'
 CondInputLoader      INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/CALIB/CIS/FIT/LIN'
@@ -357,27 +379,13 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv   INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_ID...   INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID            INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIDHelper_ID...   INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID           INFO initialize_from_dictionary
 AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_ID...   INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-CaloIDHelper_ID...   INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_ID...   INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID      INFO initialize_from_dictionary - OK
-TileNeighbour        INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
@@ -400,6 +408,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Time
 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]}
+CaloSuperCellAl...   INFO recorded new CaloSuperCellDetDescr Manager condition object with key CaloSuperCellDetDescrManager 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
@@ -411,7 +420,7 @@ TileBadChannels...   INFO TileBchStatus::isNoGainL1() is defined by: ADC dead; N
 TileBadChannels...   INFO TileBchStatus::isBadTiming() is defined by: Bad timing; Online bad timing; 
 TileBadChannels...   INFO TileBchStatus::isWrongBCID() is defined by: Wrong BCID; Online wrong BCID; 
 TileBadChannels...   INFO No drawer trips probabilities found in DB
-ClassIDSvc           INFO getRegistryEntries: read 2258 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO getRegistryEntries: read 2257 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD...   INFO TileL2Builder initialization completed
 ToolSvc.TileRaw...   INFO Initializing TileRawChannelContByteStreamTool
@@ -626,23 +635,23 @@ Finalizer            INFO Finalizing Finalizer...
 Finalize: compared 20 dumps
 PyComponentMgr       INFO Finalizing PyComponentMgr...
 IdDictDetDescrCnv    INFO in finalize
-IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.04 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.03 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.05 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/2 objs/chan/bytes 1/1/170 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CES (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/103344 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/CIS/FIT/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/80 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/EMS (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/92 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/FIBER (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/940 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/LIN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/72 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/CALIB/LAS/NLN (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.01 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/NOISE/SAMPLE (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/641504 ((     0.02 ))s
 IOVDbFolder          INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/93060 ((     0.02 ))s
-IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.02 ))s
+IOVDbFolder          INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/96 ((     0.01 ))s
 IOVDbFolder          INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 1/1 objs/chan/bytes 277/277/76 ((     0.00 ))s
-IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.03 ))s
-IOVDbSvc             INFO  bytes in ((      0.36 ))s
+IOVDbFolder          INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 2/2 objs/chan/bytes 2/1/390 ((     0.02 ))s
+IOVDbSvc             INFO  bytes in ((      0.21 ))s
 IOVDbSvc             INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.06 ))s
-IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.29 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 3 nFolders: 2 ReadTime: ((     0.04 ))s
+IOVDbSvc             INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 2 nFolders: 11 ReadTime: ((     0.17 ))s
 AthDictLoaderSvc     INFO in finalize...
 ToolSvc              INFO Removing all tools created by ToolSvc
 ToolSvc.TileRaw...   INFO Finalizing TileRawChannelContByteStreamTool successfuly
@@ -651,18 +660,18 @@ ToolSvc.ByteStr...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=   90 [ms] Ave/Min/Max=    22.5(+-    33.4)/       0/      80 [ms] #=  4
-cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max=    8.67(+-    27.5)/       0/     110 [ms] #= 15
-ChronoStatSvc        INFO Time User   : Tot= 8.81  [s]  #=  1
+cObjR_ALL            INFO Time User   : Tot=  120 [ms] Ave/Min/Max=      30(+-    46.4)/       0/     110 [ms] #=  4
+cObj_ALL             INFO Time User   : Tot=  150 [ms] Ave/Min/Max=      10(+-    32.5)/       0/     130 [ms] #= 15
+ChronoStatSvc        INFO Time User   : Tot= 10.1  [s]  #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
 ApplicationMgr       INFO Application Manager Terminated successfully
 Py:Athena            INFO leaving with code 0: "successful run"
-Mon Sep  6 17:23:28 CEST 2021
+Mon Nov  1 22:43:38 CET 2021
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.43] [x86_64-centos7-gcc8-opt] [tilecal-for-22.0/e2f7b1f] -- built on [2021-09-06T1700]
+Py:Athena            INFO using release [WorkDir-22.0.47] [x86_64-centos7-gcc8-opt] [master-calosupercell-align/480d0db4e38] -- built on [2021-11-01T2206]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [4] concurrent threads and [4] concurrent events
@@ -671,9 +680,14 @@ Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "TileByteStream/TileRawChannelContByteStreamCnv_test.py"
 Py:Athena            INFO SetGeometryVersion.py obtained major release version 22
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5076 configurables from 16 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.43
+Py:ConfigurableDb    INFO Read module info for 5092 configurables from 18 genConfDb files
+Py:ConfigurableDb WARNING Found 2 duplicates among the 18 genConfDb files :
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -<component name>: <module> - [ <duplicates> ]
+Py:ConfigurableDb WARNING --------------------------------------------------
+Py:ConfigurableDb WARNING   -CaloAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+Py:ConfigurableDb WARNING   -CaloSuperCellAlignTool: CaloAlignmentTools.CaloAlignmentToolsConf - ['CaloDetDescr.CaloDetDescrConf']
+EventInfoMgtInit: Got release version  Athena-22.0.47
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "TileConditions/TileConditions_jobOptions.py"
 Py:TileInfoConf.     INFO Adding TileCablingSvc to ServiceMgr
@@ -691,21 +705,21 @@ Py:Athena            INFO including file "AthenaCommon/runbatch.py"
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r0)
-                                          running on pcatl03.cern.ch on Mon Sep  6 17:23:34 2021
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v36r2)
+                                          running on aiatlasbm004.cern.ch on Mon Nov  1 22:43:57 2021
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 AthDictLoaderSvc                                                  INFO in initialize...
 AthDictLoaderSvc                                                  INFO acquired Dso-registry
-ClassIDSvc                                                        INFO getRegistryEntries: read 6689 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 6505 CLIDRegistry entries for module ALL
 CoreDumpSvc                                                       INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) 
 MetaDataSvc                                                       INFO Initializing MetaDataSvc
 PoolSvc                                                           INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 PoolSvc                                                           INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
 PoolSvc                                                           INFO Frontier compression level set to 5
 DBReplicaSvc                                                      INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc                                                      INFO Total of 10 servers found for host pcatl03.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc                                                      INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc                                                      INFO Total of 10 servers found for host aiatlasbm004.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
 PoolSvc                                                           INFO Successfully setup replica sorting algorithm
 PoolSvc                                                           INFO Setting up APR FileCatalog and Streams
 PoolSvc                                                           INFO Unable find catalog apcfile:poolcond/PoolCat_oflcond.xml in $ATLAS_POOLCOND_PATH and $DATAPATH
@@ -727,11 +741,11 @@ IOVDbSvc                                                          INFO   AlgTool
 ByteStreamAddressProviderSvc                                      INFO Initializing
 ByteStreamAddressProviderSvc                                      INFO -- Will fill Store with id =  0
 TagInfoMgr                                                        INFO   AlgTool: TagInfoMgr.IOVDbMetaDataTool
-ClassIDSvc                                                        INFO getRegistryEntries: read 2810 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 2821 CLIDRegistry entries for module ALL
 IOVDbSvc                                                          INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found.
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 ClassIDSvc                                                        INFO getRegistryEntries: read 273 CLIDRegistry entries for module ALL
-ClassIDSvc                                                        INFO getRegistryEntries: read 1844 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 1848 CLIDRegistry entries for module ALL
 IOVSvc                                                            INFO No IOVSvcTool associated with store "StoreGateSvc"
 IOVSvc.IOVSvcTool                                                 INFO IOVRanges will be checked at every Event
 IOVDbSvc                                                          INFO Opening COOL connection for COOLOFL_TILE/OFLP200
@@ -843,7 +857,7 @@ BarrelConstruction                                                INFO   Use sag
 EMECConstruction                                                  INFO multi-layered version of absorbers activated, parameter value is 1
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Pos::OuterWheel
-ClassIDSvc                                                        INFO getRegistryEntries: read 3249 CLIDRegistry entries for module ALL
+ClassIDSvc                                                        INFO getRegistryEntries: read 3180 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileTBID helper object in the detector store
 TileTBID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -852,7 +866,7 @@ EMECConstruction                                                  INFO multi-lay
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::InnerWheel
 EMECConstruction                                                  INFO activating LAr::EMEC::Neg::OuterWheel
 EndcapDMConstruction                                              INFO Start building EC electronics geometry
-GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25148Kb 	 Time = 0.33S
+GeoModelSvc                                                       INFO GeoModelSvc.LArDetectorToolNV	 SZ= 25076Kb 	 Time = 0.41S
 GeoModelSvc.TileDetectorTool                                      INFO  Entering TileDetectorTool::create()
 TileDddbManager                                                   INFO m_tag = ATLAS-R2-2016-01-00-01
 TileDddbManager                                                   INFO n_tiglob = 5
@@ -863,7 +877,7 @@ TileDddbManager                                                   INFO n_tilb =
 TileDddbManager                                                   INFO n_tileSwitches = 1
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a TileID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour                                                     INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt
 TileHWIDDetDescrCnv                                               INFO in createObj: creating a TileHWID helper object in the detector store
 TileHWID                                                          INFO initialize_from_dictionary 
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
@@ -875,9 +889,9 @@ CaloIDHelper_IDDetDescrCnv                                        INFO in create
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID                                                   INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
 CaloIDHelper_IDDetDescrCnv                                        INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store
 AtlasDetectorID                                                   INFO initialize_from_dictionary - OK
 LArMiniFCAL_ID                                                    INFO  initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID.
@@ -914,8 +928,8 @@ GeoModelSvc.TileDetectorTool                                      INFO  Global p
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of positive ext.barrel with rotation (0,0,0)) and translation (0,0,0) Gaudi::Units::cm
 GeoModelSvc.TileDetectorTool                                      INFO  Global positioning of negative ext.barrel with rotation (0,0,0)) and translation (0,0,1) Gaudi::Units::cm
 TileDetDescrManager                                               INFO Entering create_elements()
-GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 3528Kb 	 Time = 0.1S
-ClassIDSvc                                                        INFO getRegistryEntries: read 71 CLIDRegistry entries for module ALL
+GeoModelSvc                                                       INFO GeoModelSvc.TileDetectorTool	 SZ= 4552Kb 	 Time = 0.11S
+ClassIDSvc                                                        INFO getRegistryEntries: read 324 CLIDRegistry entries for module ALL
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.LArDetectorToolNV
 GeoModelSvc                                                       INFO   AlgTool: GeoModelSvc.TileDetectorTool
 TileInfoLoader                                                    INFO Changing TTL1 calib from 4.1 to 6.9
@@ -927,10 +941,11 @@ TileCablingSvc                                                    INFO RUN2 ATLA
 TileCablingSvc                                                    INFO Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions 
 TileCablingSvc                                                    INFO Setting Cabling type to 4
 AthenaHiveEventLoopMgr                                            INFO Initializing AthenaHiveEventLoopMgr
-ClassIDSvc                                                   0    INFO getRegistryEntries: read 4391 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 4408 CLIDRegistry entries for module ALL
 PyComponentMgr                                               0    INFO Initializing PyComponentMgr...
 Finalizer                                                    0    INFO Initializing Finalizer...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 553 CLIDRegistry entries for module ALL
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 222 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Initializing CondInputLoader...
 ClassIDSvc                                                   0    INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL
 CondInputLoader                                              0    INFO Adding base classes:
@@ -961,6 +976,22 @@ CondInputLoader                                              0    INFO Will crea
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) 
     +  ( 'CondAttrListCollection' , 'ConditionStore+/TILE/ONL01/STATUS/ADC' ) 
     +  ( 'DetCondKeyTrans' , 'ConditionStore+/LAR/Align' ) 
+ClassIDSvc                                                   0    INFO getRegistryEntries: read 73 CLIDRegistry entries for module ALL
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID                                              0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+CaloIDHelper_IDDetDescrCnv                                   0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+TileNeighbour                                                0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-10-31T2101/Athena/22.0.47/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
+AtlasDetectorID                                              0    INFO initialize_from_dictionary - OK
+CaloSuperCellAlignCondAlg.CaloSuperCellIDTool                0    INFO Done with initIDMap
 TileBadChannelsCondAlg.TileCondProxyCool_OnlBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OnlBch) for folder: "/TILE/ONL01/STATUS/ADC"
 TileBadChannelsCondAlg.TileCondProxyCool_OflBch              0    INFO Creating TileCondProxyCool(TileBadChannelsCondAlg.TileCondProxyCool_OflBch) for folder: "/TILE/OFL02/STATUS/ADC"
 TileBadChannelsCondAlg                                       0    INFO ProxyOnlBch and ProxyOflBch will be used for bad channel status
@@ -981,7 +1012,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 17 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 18 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
@@ -1003,6 +1034,7 @@ ROBDataProviderSvc                                           0    INFO  ---> Fil
 ROBDataProviderSvc                                           0    INFO  ---> Filter out specific ROBs by Status Code: # ROBs = 0
 ROBDataProviderSvc                                           0    INFO  ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0
 EventSelector                                                0    INFO reinitialization...
+ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 AthenaHiveEventLoopMgr                                       0    INFO Setup EventSelector service EventSelector
 ApplicationMgr                                               0    INFO Application Manager Initialized successfully
 PoolSvc                                                      0    INFO Enabled implicit multithreading in ROOT via PersistencySvc to: 3
@@ -1019,7 +1051,6 @@ CondInputLoader                                              0    INFO created C
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/OFL02/TIME/CHANNELOFFSET/PHY'
 CondInputLoader                                              0    INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/TILE/ONL01/STATUS/ADC'
 CondInputLoader                                              0    INFO created CondCont<DetCondKeyTrans> with key 'ConditionStore+/LAR/Align'
-ByteStreamInputSvc                                           0    INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1
 ApplicationMgr                                               0    INFO Application Manager Started successfully
 AthenaHiveEventLoopMgr                                       0    INFO Starting loop on events
 EventPersistencySvc                                    0     0    INFO Added successfully Conversion service:AthenaPoolCnvSvc
@@ -1040,34 +1071,20 @@ Domain[ROOT_All]                                       0     0    INFO
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 CaloMgrDetDescrCnv                                     0     0    INFO in createObj: creating a Calo Detector Manager object in the detector store
 CaloIdMgrDetDescrCnv                                   0     0    INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 272 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 188 CLIDRegistry entries for module ALL
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloDM_ID helper object in the detector store
 CaloDM_ID                                              0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a TTOnlineID helper object in the detector store
 TTOnlineID                                             0     0    INFO initialize_from_dictionary
 AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a CaloCell_SuperCell_ID helper object in the detector store
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArEM_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArHEC_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID                                        0     0    INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
-CaloIDHelper_IDDetDescrCnv                             0     0    INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
-TileNeighbour                                          0     0    INFO Reading file  /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-09-05T2101/Athena/22.0.43/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt
-AtlasDetectorID                                        0     0    INFO initialize_from_dictionary - OK
 CaloIdMgrDetDescrCnv                                   0     0    INFO  Finished 
 CaloIdMgrDetDescrCnv                                   0     0    INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
 Domain[ROOT_All]                                       0     0    INFO ->  Access   DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]                                       0     0    INFO                           /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
 RootDatabase.open                                      0     0    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaHiveEventLoopMgr                                 0     0    INFO   ===>>>  start processing event #1129572, run #204073 on slot 0,  0 events processed so far  <<<===
-ClassIDSvc                                             0     0    INFO getRegistryEntries: read 495 CLIDRegistry entries for module ALL
+ClassIDSvc                                             0     0    INFO getRegistryEntries: read 494 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 1763 CLIDRegistry entries for module ALL
 ClassIDSvc                                             0     0    INFO getRegistryEntries: read 92 CLIDRegistry entries for module ALL
 ToolSvc.TileROD_Decoder.TileL2Builder                  0     0    INFO TileL2Builder initialization completed
@@ -1088,195 +1105,195 @@ AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>
 AthenaHiveEventLoopMgr                                 6     1    INFO   ===>>>  start processing event #1130716, run #204073 on slot 1,  3 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 3     2    INFO   ===>>>  done processing event #1131086, run #204073 on slot 2,  4 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 4     3    INFO   ===>>>  done processing event #1130272, run #204073 on slot 3,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 7     2    INFO   ===>>>  start processing event #1132019, run #204073 on slot 2,  5 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 8     3    INFO   ===>>>  start processing event #1132092, run #204073 on slot 3,  5 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 5     0    INFO   ===>>>  done processing event #1131269, run #204073 on slot 0,  6 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 7     0    INFO   ===>>>  start processing event #1132019, run #204073 on slot 0,  6 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 8     2    INFO   ===>>>  start processing event #1132092, run #204073 on slot 2,  6 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 9     3    INFO   ===>>>  start processing event #1130238, run #204073 on slot 3,  6 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                 6     1    INFO   ===>>>  done processing event #1130716, run #204073 on slot 1,  7 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 7     0    INFO   ===>>>  done processing event #1132019, run #204073 on slot 0,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                10     0    INFO   ===>>>  start processing event #1134553, run #204073 on slot 0,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                11     1    INFO   ===>>>  start processing event #1130999, run #204073 on slot 1,  8 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 8     2    INFO   ===>>>  done processing event #1132092, run #204073 on slot 2,  9 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                 9     3    INFO   ===>>>  done processing event #1130238, run #204073 on slot 3,  10 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                10     0    INFO   ===>>>  done processing event #1134553, run #204073 on slot 0,  11 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                12     0    INFO   ===>>>  start processing event #1133461, run #204073 on slot 0,  11 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                13     2    INFO   ===>>>  start processing event #1131152, run #204073 on slot 2,  11 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                14     3    INFO   ===>>>  start processing event #1130142, run #204073 on slot 3,  11 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                11     1    INFO   ===>>>  done processing event #1130999, run #204073 on slot 1,  12 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                12     0    INFO   ===>>>  done processing event #1133461, run #204073 on slot 0,  13 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                15     0    INFO   ===>>>  start processing event #1132770, run #204073 on slot 0,  13 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                16     1    INFO   ===>>>  start processing event #1132365, run #204073 on slot 1,  13 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                13     2    INFO   ===>>>  done processing event #1131152, run #204073 on slot 2,  14 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                14     3    INFO   ===>>>  done processing event #1130142, run #204073 on slot 3,  15 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                17     2    INFO   ===>>>  start processing event #1136791, run #204073 on slot 2,  15 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                18     3    INFO   ===>>>  start processing event #1133781, run #204073 on slot 3,  15 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                15     0    INFO   ===>>>  done processing event #1132770, run #204073 on slot 0,  16 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                16     1    INFO   ===>>>  done processing event #1132365, run #204073 on slot 1,  17 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                17     2    INFO   ===>>>  done processing event #1136791, run #204073 on slot 2,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                19     0    INFO   ===>>>  start processing event #1132067, run #204073 on slot 0,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                20     1    INFO   ===>>>  start processing event #1138637, run #204073 on slot 1,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                21     2    INFO   ===>>>  start processing event #1139495, run #204073 on slot 2,  18 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                18     3    INFO   ===>>>  done processing event #1133781, run #204073 on slot 3,  19 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                19     0    INFO   ===>>>  done processing event #1132067, run #204073 on slot 0,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                22     0    INFO   ===>>>  start processing event #1140193, run #204073 on slot 0,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                23     3    INFO   ===>>>  start processing event #1142953, run #204073 on slot 3,  20 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                20     1    INFO   ===>>>  done processing event #1138637, run #204073 on slot 1,  21 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                21     2    INFO   ===>>>  done processing event #1139495, run #204073 on slot 2,  22 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                22     0    INFO   ===>>>  done processing event #1140193, run #204073 on slot 0,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                24     0    INFO   ===>>>  start processing event #1139127, run #204073 on slot 0,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                25     1    INFO   ===>>>  start processing event #1141272, run #204073 on slot 1,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                26     2    INFO   ===>>>  start processing event #1137117, run #204073 on slot 2,  23 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                23     3    INFO   ===>>>  done processing event #1142953, run #204073 on slot 3,  24 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                24     0    INFO   ===>>>  done processing event #1139127, run #204073 on slot 0,  25 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                25     1    INFO   ===>>>  done processing event #1141272, run #204073 on slot 1,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                27     0    INFO   ===>>>  start processing event #1139599, run #204073 on slot 0,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                28     1    INFO   ===>>>  start processing event #1140314, run #204073 on slot 1,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                29     3    INFO   ===>>>  start processing event #1133685, run #204073 on slot 3,  26 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                26     2    INFO   ===>>>  done processing event #1137117, run #204073 on slot 2,  27 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                27     0    INFO   ===>>>  done processing event #1139599, run #204073 on slot 0,  28 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                28     1    INFO   ===>>>  done processing event #1140314, run #204073 on slot 1,  29 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                30     0    INFO   ===>>>  start processing event #1143279, run #204073 on slot 0,  29 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                31     1    INFO   ===>>>  start processing event #1137563, run #204073 on slot 1,  29 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                32     2    INFO   ===>>>  start processing event #1139927, run #204073 on slot 2,  29 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                29     3    INFO   ===>>>  done processing event #1133685, run #204073 on slot 3,  30 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                30     0    INFO   ===>>>  done processing event #1143279, run #204073 on slot 0,  31 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                33     0    INFO   ===>>>  start processing event #1141197, run #204073 on slot 0,  31 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                34     3    INFO   ===>>>  start processing event #1140039, run #204073 on slot 3,  31 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                31     1    INFO   ===>>>  done processing event #1137563, run #204073 on slot 1,  32 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                32     2    INFO   ===>>>  done processing event #1139927, run #204073 on slot 2,  33 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 9     0    INFO   ===>>>  start processing event #1130238, run #204073 on slot 0,  7 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                10     1    INFO   ===>>>  start processing event #1134553, run #204073 on slot 1,  7 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 7     2    INFO   ===>>>  done processing event #1132019, run #204073 on slot 2,  8 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 8     3    INFO   ===>>>  done processing event #1132092, run #204073 on slot 3,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                11     2    INFO   ===>>>  start processing event #1130999, run #204073 on slot 2,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                12     3    INFO   ===>>>  start processing event #1133461, run #204073 on slot 3,  9 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                 9     0    INFO   ===>>>  done processing event #1130238, run #204073 on slot 0,  10 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                10     1    INFO   ===>>>  done processing event #1134553, run #204073 on slot 1,  11 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                13     0    INFO   ===>>>  start processing event #1131152, run #204073 on slot 0,  11 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                14     1    INFO   ===>>>  start processing event #1130142, run #204073 on slot 1,  11 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                11     2    INFO   ===>>>  done processing event #1130999, run #204073 on slot 2,  12 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                12     3    INFO   ===>>>  done processing event #1133461, run #204073 on slot 3,  13 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                15     2    INFO   ===>>>  start processing event #1132770, run #204073 on slot 2,  13 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                16     3    INFO   ===>>>  start processing event #1132365, run #204073 on slot 3,  13 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                13     0    INFO   ===>>>  done processing event #1131152, run #204073 on slot 0,  14 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                14     1    INFO   ===>>>  done processing event #1130142, run #204073 on slot 1,  15 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                17     0    INFO   ===>>>  start processing event #1136791, run #204073 on slot 0,  15 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                18     1    INFO   ===>>>  start processing event #1133781, run #204073 on slot 1,  15 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                15     2    INFO   ===>>>  done processing event #1132770, run #204073 on slot 2,  16 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                16     3    INFO   ===>>>  done processing event #1132365, run #204073 on slot 3,  17 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                19     2    INFO   ===>>>  start processing event #1132067, run #204073 on slot 2,  17 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                20     3    INFO   ===>>>  start processing event #1138637, run #204073 on slot 3,  17 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                17     0    INFO   ===>>>  done processing event #1136791, run #204073 on slot 0,  18 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                18     1    INFO   ===>>>  done processing event #1133781, run #204073 on slot 1,  19 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                21     0    INFO   ===>>>  start processing event #1139495, run #204073 on slot 0,  19 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                22     1    INFO   ===>>>  start processing event #1140193, run #204073 on slot 1,  19 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                19     2    INFO   ===>>>  done processing event #1132067, run #204073 on slot 2,  20 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                20     3    INFO   ===>>>  done processing event #1138637, run #204073 on slot 3,  21 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                23     2    INFO   ===>>>  start processing event #1142953, run #204073 on slot 2,  21 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                24     3    INFO   ===>>>  start processing event #1139127, run #204073 on slot 3,  21 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                21     0    INFO   ===>>>  done processing event #1139495, run #204073 on slot 0,  22 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                22     1    INFO   ===>>>  done processing event #1140193, run #204073 on slot 1,  23 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                25     0    INFO   ===>>>  start processing event #1141272, run #204073 on slot 0,  23 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                26     1    INFO   ===>>>  start processing event #1137117, run #204073 on slot 1,  23 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                23     2    INFO   ===>>>  done processing event #1142953, run #204073 on slot 2,  24 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                24     3    INFO   ===>>>  done processing event #1139127, run #204073 on slot 3,  25 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                27     2    INFO   ===>>>  start processing event #1139599, run #204073 on slot 2,  25 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                28     3    INFO   ===>>>  start processing event #1140314, run #204073 on slot 3,  25 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                25     0    INFO   ===>>>  done processing event #1141272, run #204073 on slot 0,  26 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                26     1    INFO   ===>>>  done processing event #1137117, run #204073 on slot 1,  27 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                29     0    INFO   ===>>>  start processing event #1133685, run #204073 on slot 0,  27 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                30     1    INFO   ===>>>  start processing event #1143279, run #204073 on slot 1,  27 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                27     2    INFO   ===>>>  done processing event #1139599, run #204073 on slot 2,  28 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                28     3    INFO   ===>>>  done processing event #1140314, run #204073 on slot 3,  29 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                31     2    INFO   ===>>>  start processing event #1137563, run #204073 on slot 2,  29 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                32     3    INFO   ===>>>  start processing event #1139927, run #204073 on slot 3,  29 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                29     0    INFO   ===>>>  done processing event #1133685, run #204073 on slot 0,  30 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                33     0    INFO   ===>>>  start processing event #1141197, run #204073 on slot 0,  30 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                30     1    INFO   ===>>>  done processing event #1143279, run #204073 on slot 1,  31 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                31     2    INFO   ===>>>  done processing event #1137563, run #204073 on slot 2,  32 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                34     1    INFO   ===>>>  start processing event #1140039, run #204073 on slot 1,  32 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                35     2    INFO   ===>>>  start processing event #1142531, run #204073 on slot 2,  32 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                32     3    INFO   ===>>>  done processing event #1139927, run #204073 on slot 3,  33 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                33     0    INFO   ===>>>  done processing event #1141197, run #204073 on slot 0,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                35     0    INFO   ===>>>  start processing event #1142531, run #204073 on slot 0,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                36     1    INFO   ===>>>  start processing event #1139475, run #204073 on slot 1,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                37     2    INFO   ===>>>  start processing event #1139958, run #204073 on slot 2,  34 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                34     3    INFO   ===>>>  done processing event #1140039, run #204073 on slot 3,  35 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                35     0    INFO   ===>>>  done processing event #1142531, run #204073 on slot 0,  36 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                36     1    INFO   ===>>>  done processing event #1139475, run #204073 on slot 1,  37 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                38     0    INFO   ===>>>  start processing event #1143765, run #204073 on slot 0,  37 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                39     1    INFO   ===>>>  start processing event #1143097, run #204073 on slot 1,  37 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                40     3    INFO   ===>>>  start processing event #1134147, run #204073 on slot 3,  37 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                37     2    INFO   ===>>>  done processing event #1139958, run #204073 on slot 2,  38 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                38     0    INFO   ===>>>  done processing event #1143765, run #204073 on slot 0,  39 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                39     1    INFO   ===>>>  done processing event #1143097, run #204073 on slot 1,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                41     0    INFO   ===>>>  start processing event #1137156, run #204073 on slot 0,  40 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                36     0    INFO   ===>>>  start processing event #1139475, run #204073 on slot 0,  34 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                37     3    INFO   ===>>>  start processing event #1139958, run #204073 on slot 3,  34 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                34     1    INFO   ===>>>  done processing event #1140039, run #204073 on slot 1,  35 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                35     2    INFO   ===>>>  done processing event #1142531, run #204073 on slot 2,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                38     1    INFO   ===>>>  start processing event #1143765, run #204073 on slot 1,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                39     2    INFO   ===>>>  start processing event #1143097, run #204073 on slot 2,  36 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                36     0    INFO   ===>>>  done processing event #1139475, run #204073 on slot 0,  37 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                37     3    INFO   ===>>>  done processing event #1139958, run #204073 on slot 3,  38 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                40     0    INFO   ===>>>  start processing event #1134147, run #204073 on slot 0,  38 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                41     3    INFO   ===>>>  start processing event #1137156, run #204073 on slot 3,  38 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                38     1    INFO   ===>>>  done processing event #1143765, run #204073 on slot 1,  39 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                39     2    INFO   ===>>>  done processing event #1143097, run #204073 on slot 2,  40 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                42     1    INFO   ===>>>  start processing event #1136377, run #204073 on slot 1,  40 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                43     2    INFO   ===>>>  start processing event #1137842, run #204073 on slot 2,  40 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                40     3    INFO   ===>>>  done processing event #1134147, run #204073 on slot 3,  41 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                41     0    INFO   ===>>>  done processing event #1137156, run #204073 on slot 0,  42 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                40     0    INFO   ===>>>  done processing event #1134147, run #204073 on slot 0,  41 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                41     3    INFO   ===>>>  done processing event #1137156, run #204073 on slot 3,  42 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  start processing event #1141705, run #204073 on slot 0,  42 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                45     3    INFO   ===>>>  start processing event #1143410, run #204073 on slot 3,  42 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                42     1    INFO   ===>>>  done processing event #1136377, run #204073 on slot 1,  43 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  start processing event #1141705, run #204073 on slot 0,  43 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                45     1    INFO   ===>>>  start processing event #1143410, run #204073 on slot 1,  43 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                46     3    INFO   ===>>>  start processing event #1144170, run #204073 on slot 3,  43 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                43     2    INFO   ===>>>  done processing event #1137842, run #204073 on slot 2,  44 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                46     1    INFO   ===>>>  start processing event #1144170, run #204073 on slot 1,  44 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                47     2    INFO   ===>>>  start processing event #1145987, run #204073 on slot 2,  44 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                44     0    INFO   ===>>>  done processing event #1141705, run #204073 on slot 0,  45 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                45     1    INFO   ===>>>  done processing event #1143410, run #204073 on slot 1,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                47     0    INFO   ===>>>  start processing event #1145987, run #204073 on slot 0,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                48     1    INFO   ===>>>  start processing event #1145633, run #204073 on slot 1,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                49     2    INFO   ===>>>  start processing event #1135005, run #204073 on slot 2,  46 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                46     3    INFO   ===>>>  done processing event #1144170, run #204073 on slot 3,  47 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                47     0    INFO   ===>>>  done processing event #1145987, run #204073 on slot 0,  48 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                48     1    INFO   ===>>>  done processing event #1145633, run #204073 on slot 1,  49 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                50     0    INFO   ===>>>  start processing event #1142167, run #204073 on slot 0,  49 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                51     1    INFO   ===>>>  start processing event #1144646, run #204073 on slot 1,  49 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                52     3    INFO   ===>>>  start processing event #1145027, run #204073 on slot 3,  49 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                49     2    INFO   ===>>>  done processing event #1135005, run #204073 on slot 2,  50 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                50     0    INFO   ===>>>  done processing event #1142167, run #204073 on slot 0,  51 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                51     1    INFO   ===>>>  done processing event #1144646, run #204073 on slot 1,  52 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                53     0    INFO   ===>>>  start processing event #1144112, run #204073 on slot 0,  52 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                45     3    INFO   ===>>>  done processing event #1143410, run #204073 on slot 3,  46 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                48     0    INFO   ===>>>  start processing event #1145633, run #204073 on slot 0,  46 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                49     3    INFO   ===>>>  start processing event #1135005, run #204073 on slot 3,  46 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                46     1    INFO   ===>>>  done processing event #1144170, run #204073 on slot 1,  47 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                47     2    INFO   ===>>>  done processing event #1145987, run #204073 on slot 2,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                50     1    INFO   ===>>>  start processing event #1142167, run #204073 on slot 1,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                51     2    INFO   ===>>>  start processing event #1144646, run #204073 on slot 2,  48 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                48     0    INFO   ===>>>  done processing event #1145633, run #204073 on slot 0,  49 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                49     3    INFO   ===>>>  done processing event #1135005, run #204073 on slot 3,  50 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                52     0    INFO   ===>>>  start processing event #1145027, run #204073 on slot 0,  50 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  start processing event #1144112, run #204073 on slot 3,  50 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                50     1    INFO   ===>>>  done processing event #1142167, run #204073 on slot 1,  51 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                51     2    INFO   ===>>>  done processing event #1144646, run #204073 on slot 2,  52 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                54     1    INFO   ===>>>  start processing event #1138485, run #204073 on slot 1,  52 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                55     2    INFO   ===>>>  start processing event #1144565, run #204073 on slot 2,  52 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                52     3    INFO   ===>>>  done processing event #1145027, run #204073 on slot 3,  53 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                53     0    INFO   ===>>>  done processing event #1144112, run #204073 on slot 0,  54 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                52     0    INFO   ===>>>  done processing event #1145027, run #204073 on slot 0,  53 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                53     3    INFO   ===>>>  done processing event #1144112, run #204073 on slot 3,  54 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                56     0    INFO   ===>>>  start processing event #1139498, run #204073 on slot 0,  54 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                57     3    INFO   ===>>>  start processing event #1136546, run #204073 on slot 3,  54 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                54     1    INFO   ===>>>  done processing event #1138485, run #204073 on slot 1,  55 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                58     1    INFO   ===>>>  start processing event #1143799, run #204073 on slot 1,  55 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                55     2    INFO   ===>>>  done processing event #1144565, run #204073 on slot 2,  56 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  start processing event #1142877, run #204073 on slot 2,  56 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                56     0    INFO   ===>>>  done processing event #1139498, run #204073 on slot 0,  57 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                58     0    INFO   ===>>>  start processing event #1143799, run #204073 on slot 0,  57 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                59     1    INFO   ===>>>  start processing event #1142877, run #204073 on slot 1,  57 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                60     2    INFO   ===>>>  start processing event #1149894, run #204073 on slot 2,  57 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                57     3    INFO   ===>>>  done processing event #1136546, run #204073 on slot 3,  58 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                58     0    INFO   ===>>>  done processing event #1143799, run #204073 on slot 0,  59 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                61     0    INFO   ===>>>  start processing event #1145364, run #204073 on slot 0,  59 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                62     3    INFO   ===>>>  start processing event #1143770, run #204073 on slot 3,  59 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                59     1    INFO   ===>>>  done processing event #1142877, run #204073 on slot 1,  60 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                60     2    INFO   ===>>>  done processing event #1149894, run #204073 on slot 2,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                63     1    INFO   ===>>>  start processing event #1148361, run #204073 on slot 1,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                64     2    INFO   ===>>>  start processing event #1148167, run #204073 on slot 2,  61 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                61     0    INFO   ===>>>  done processing event #1145364, run #204073 on slot 0,  62 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                62     3    INFO   ===>>>  done processing event #1143770, run #204073 on slot 3,  63 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                63     1    INFO   ===>>>  done processing event #1148361, run #204073 on slot 1,  64 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                65     0    INFO   ===>>>  start processing event #1138948, run #204073 on slot 0,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                60     0    INFO   ===>>>  start processing event #1149894, run #204073 on slot 0,  58 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                61     3    INFO   ===>>>  start processing event #1145364, run #204073 on slot 3,  58 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                58     1    INFO   ===>>>  done processing event #1143799, run #204073 on slot 1,  59 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                59     2    INFO   ===>>>  done processing event #1142877, run #204073 on slot 2,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                62     1    INFO   ===>>>  start processing event #1143770, run #204073 on slot 1,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                63     2    INFO   ===>>>  start processing event #1148361, run #204073 on slot 2,  60 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                60     0    INFO   ===>>>  done processing event #1149894, run #204073 on slot 0,  61 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                61     3    INFO   ===>>>  done processing event #1145364, run #204073 on slot 3,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                64     0    INFO   ===>>>  start processing event #1148167, run #204073 on slot 0,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                65     3    INFO   ===>>>  start processing event #1138948, run #204073 on slot 3,  62 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                62     1    INFO   ===>>>  done processing event #1143770, run #204073 on slot 1,  63 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                63     2    INFO   ===>>>  done processing event #1148361, run #204073 on slot 2,  64 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                66     1    INFO   ===>>>  start processing event #1144808, run #204073 on slot 1,  64 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                67     3    INFO   ===>>>  start processing event #1145832, run #204073 on slot 3,  64 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                64     2    INFO   ===>>>  done processing event #1148167, run #204073 on slot 2,  65 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                65     0    INFO   ===>>>  done processing event #1138948, run #204073 on slot 0,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                67     2    INFO   ===>>>  start processing event #1145832, run #204073 on slot 2,  64 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                64     0    INFO   ===>>>  done processing event #1148167, run #204073 on slot 0,  65 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                65     3    INFO   ===>>>  done processing event #1138948, run #204073 on slot 3,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  start processing event #1153100, run #204073 on slot 0,  66 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                69     3    INFO   ===>>>  start processing event #1142524, run #204073 on slot 3,  66 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                66     1    INFO   ===>>>  done processing event #1144808, run #204073 on slot 1,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  start processing event #1153100, run #204073 on slot 0,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                69     1    INFO   ===>>>  start processing event #1142524, run #204073 on slot 1,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                70     2    INFO   ===>>>  start processing event #1138294, run #204073 on slot 2,  67 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                67     3    INFO   ===>>>  done processing event #1145832, run #204073 on slot 3,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                67     2    INFO   ===>>>  done processing event #1145832, run #204073 on slot 2,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                70     1    INFO   ===>>>  start processing event #1138294, run #204073 on slot 1,  68 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                71     2    INFO   ===>>>  start processing event #1138350, run #204073 on slot 2,  68 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                68     0    INFO   ===>>>  done processing event #1153100, run #204073 on slot 0,  69 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                69     1    INFO   ===>>>  done processing event #1142524, run #204073 on slot 1,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                71     0    INFO   ===>>>  start processing event #1138350, run #204073 on slot 0,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                72     1    INFO   ===>>>  start processing event #1149424, run #204073 on slot 1,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                69     3    INFO   ===>>>  done processing event #1142524, run #204073 on slot 3,  70 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                72     0    INFO   ===>>>  start processing event #1149424, run #204073 on slot 0,  70 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                73     3    INFO   ===>>>  start processing event #1151102, run #204073 on slot 3,  70 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                70     2    INFO   ===>>>  done processing event #1138294, run #204073 on slot 2,  71 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                71     0    INFO   ===>>>  done processing event #1138350, run #204073 on slot 0,  72 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                72     1    INFO   ===>>>  done processing event #1149424, run #204073 on slot 1,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                74     0    INFO   ===>>>  start processing event #1152242, run #204073 on slot 0,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                75     1    INFO   ===>>>  start processing event #1148416, run #204073 on slot 1,  73 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                76     2    INFO   ===>>>  start processing event #1142753, run #204073 on slot 2,  73 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                70     1    INFO   ===>>>  done processing event #1138294, run #204073 on slot 1,  71 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                71     2    INFO   ===>>>  done processing event #1138350, run #204073 on slot 2,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                74     1    INFO   ===>>>  start processing event #1152242, run #204073 on slot 1,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                75     2    INFO   ===>>>  start processing event #1148416, run #204073 on slot 2,  72 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                72     0    INFO   ===>>>  done processing event #1149424, run #204073 on slot 0,  73 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                76     0    INFO   ===>>>  start processing event #1142753, run #204073 on slot 0,  73 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                73     3    INFO   ===>>>  done processing event #1151102, run #204073 on slot 3,  74 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                74     0    INFO   ===>>>  done processing event #1152242, run #204073 on slot 0,  75 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                77     0    INFO   ===>>>  start processing event #1149997, run #204073 on slot 0,  75 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                74     1    INFO   ===>>>  done processing event #1152242, run #204073 on slot 1,  75 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                77     1    INFO   ===>>>  start processing event #1149997, run #204073 on slot 1,  75 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                78     3    INFO   ===>>>  start processing event #1151617, run #204073 on slot 3,  75 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                75     1    INFO   ===>>>  done processing event #1148416, run #204073 on slot 1,  76 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                76     2    INFO   ===>>>  done processing event #1142753, run #204073 on slot 2,  77 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                77     0    INFO   ===>>>  done processing event #1149997, run #204073 on slot 0,  78 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                79     0    INFO   ===>>>  start processing event #1149794, run #204073 on slot 0,  78 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                80     1    INFO   ===>>>  start processing event #1152504, run #204073 on slot 1,  78 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                81     2    INFO   ===>>>  start processing event #1142485, run #204073 on slot 2,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                75     2    INFO   ===>>>  done processing event #1148416, run #204073 on slot 2,  76 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                79     2    INFO   ===>>>  start processing event #1149794, run #204073 on slot 2,  76 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                76     0    INFO   ===>>>  done processing event #1142753, run #204073 on slot 0,  77 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                77     1    INFO   ===>>>  done processing event #1149997, run #204073 on slot 1,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                80     0    INFO   ===>>>  start processing event #1152504, run #204073 on slot 0,  78 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                81     1    INFO   ===>>>  start processing event #1142485, run #204073 on slot 1,  78 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                78     3    INFO   ===>>>  done processing event #1151617, run #204073 on slot 3,  79 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                79     0    INFO   ===>>>  done processing event #1149794, run #204073 on slot 0,  80 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                80     1    INFO   ===>>>  done processing event #1152504, run #204073 on slot 1,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                82     0    INFO   ===>>>  start processing event #1151364, run #204073 on slot 0,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                83     1    INFO   ===>>>  start processing event #1143901, run #204073 on slot 1,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                84     3    INFO   ===>>>  start processing event #1153979, run #204073 on slot 3,  81 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                81     2    INFO   ===>>>  done processing event #1142485, run #204073 on slot 2,  82 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                82     0    INFO   ===>>>  done processing event #1151364, run #204073 on slot 0,  83 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                83     1    INFO   ===>>>  done processing event #1143901, run #204073 on slot 1,  84 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                85     0    INFO   ===>>>  start processing event #1150212, run #204073 on slot 0,  84 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                86     1    INFO   ===>>>  start processing event #1152633, run #204073 on slot 1,  84 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                87     2    INFO   ===>>>  start processing event #1155482, run #204073 on slot 2,  84 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                84     3    INFO   ===>>>  done processing event #1153979, run #204073 on slot 3,  85 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                85     0    INFO   ===>>>  done processing event #1150212, run #204073 on slot 0,  86 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                86     1    INFO   ===>>>  done processing event #1152633, run #204073 on slot 1,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                88     0    INFO   ===>>>  start processing event #1150472, run #204073 on slot 0,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                89     1    INFO   ===>>>  start processing event #1140275, run #204073 on slot 1,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                90     3    INFO   ===>>>  start processing event #1145882, run #204073 on slot 3,  87 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                87     2    INFO   ===>>>  done processing event #1155482, run #204073 on slot 2,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                79     2    INFO   ===>>>  done processing event #1149794, run #204073 on slot 2,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                82     2    INFO   ===>>>  start processing event #1151364, run #204073 on slot 2,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                83     3    INFO   ===>>>  start processing event #1143901, run #204073 on slot 3,  80 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                80     0    INFO   ===>>>  done processing event #1152504, run #204073 on slot 0,  81 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                81     1    INFO   ===>>>  done processing event #1142485, run #204073 on slot 1,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                84     0    INFO   ===>>>  start processing event #1153979, run #204073 on slot 0,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                85     1    INFO   ===>>>  start processing event #1150212, run #204073 on slot 1,  82 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                82     2    INFO   ===>>>  done processing event #1151364, run #204073 on slot 2,  83 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                83     3    INFO   ===>>>  done processing event #1143901, run #204073 on slot 3,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                86     2    INFO   ===>>>  start processing event #1152633, run #204073 on slot 2,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                87     3    INFO   ===>>>  start processing event #1155482, run #204073 on slot 3,  84 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                84     0    INFO   ===>>>  done processing event #1153979, run #204073 on slot 0,  85 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                85     1    INFO   ===>>>  done processing event #1150212, run #204073 on slot 1,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                88     0    INFO   ===>>>  start processing event #1150472, run #204073 on slot 0,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                89     1    INFO   ===>>>  start processing event #1140275, run #204073 on slot 1,  86 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                86     2    INFO   ===>>>  done processing event #1152633, run #204073 on slot 2,  87 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                87     3    INFO   ===>>>  done processing event #1155482, run #204073 on slot 3,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                90     2    INFO   ===>>>  start processing event #1145882, run #204073 on slot 2,  88 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                91     3    INFO   ===>>>  start processing event #1151732, run #204073 on slot 3,  88 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                88     0    INFO   ===>>>  done processing event #1150472, run #204073 on slot 0,  89 events processed so far  <<<===
 AthenaHiveEventLoopMgr                                89     1    INFO   ===>>>  done processing event #1140275, run #204073 on slot 1,  90 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                91     0    INFO   ===>>>  start processing event #1151732, run #204073 on slot 0,  90 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                92     1    INFO   ===>>>  start processing event #1137896, run #204073 on slot 1,  90 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                93     2    INFO   ===>>>  start processing event #1156381, run #204073 on slot 2,  90 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                90     3    INFO   ===>>>  done processing event #1145882, run #204073 on slot 3,  91 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                91     0    INFO   ===>>>  done processing event #1151732, run #204073 on slot 0,  92 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                92     1    INFO   ===>>>  done processing event #1137896, run #204073 on slot 1,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                94     0    INFO   ===>>>  start processing event #1149161, run #204073 on slot 0,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                95     1    INFO   ===>>>  start processing event #1153794, run #204073 on slot 1,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                96     3    INFO   ===>>>  start processing event #1151312, run #204073 on slot 3,  93 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                93     2    INFO   ===>>>  done processing event #1156381, run #204073 on slot 2,  94 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                94     0    INFO   ===>>>  done processing event #1149161, run #204073 on slot 0,  95 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                95     1    INFO   ===>>>  done processing event #1153794, run #204073 on slot 1,  96 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                97     0    INFO   ===>>>  start processing event #1148893, run #204073 on slot 0,  96 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                98     1    INFO   ===>>>  start processing event #1156938, run #204073 on slot 1,  96 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     2    INFO   ===>>>  start processing event #1156351, run #204073 on slot 2,  96 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                96     3    INFO   ===>>>  done processing event #1151312, run #204073 on slot 3,  97 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                97     0    INFO   ===>>>  done processing event #1148893, run #204073 on slot 0,  98 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                98     1    INFO   ===>>>  done processing event #1156938, run #204073 on slot 1,  99 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     2    INFO   ===>>>  done processing event #1156351, run #204073 on slot 2,  100 events processed so far  <<<===
-AthenaHiveEventLoopMgr                                99     2    INFO ---> Loop Finished (seconds): 4.24129
+AthenaHiveEventLoopMgr                                92     0    INFO   ===>>>  start processing event #1137896, run #204073 on slot 0,  90 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                93     1    INFO   ===>>>  start processing event #1156381, run #204073 on slot 1,  90 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                90     2    INFO   ===>>>  done processing event #1145882, run #204073 on slot 2,  91 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                91     3    INFO   ===>>>  done processing event #1151732, run #204073 on slot 3,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                94     2    INFO   ===>>>  start processing event #1149161, run #204073 on slot 2,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                95     3    INFO   ===>>>  start processing event #1153794, run #204073 on slot 3,  92 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                92     0    INFO   ===>>>  done processing event #1137896, run #204073 on slot 0,  93 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                93     1    INFO   ===>>>  done processing event #1156381, run #204073 on slot 1,  94 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                96     0    INFO   ===>>>  start processing event #1151312, run #204073 on slot 0,  94 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                97     1    INFO   ===>>>  start processing event #1148893, run #204073 on slot 1,  94 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                94     2    INFO   ===>>>  done processing event #1149161, run #204073 on slot 2,  95 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                95     3    INFO   ===>>>  done processing event #1153794, run #204073 on slot 3,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                98     2    INFO   ===>>>  start processing event #1156938, run #204073 on slot 2,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     3    INFO   ===>>>  start processing event #1156351, run #204073 on slot 3,  96 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                96     0    INFO   ===>>>  done processing event #1151312, run #204073 on slot 0,  97 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                97     1    INFO   ===>>>  done processing event #1148893, run #204073 on slot 1,  98 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                98     2    INFO   ===>>>  done processing event #1156938, run #204073 on slot 2,  99 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     3    INFO   ===>>>  done processing event #1156351, run #204073 on slot 3,  100 events processed so far  <<<===
+AthenaHiveEventLoopMgr                                99     3    INFO ---> Loop Finished (seconds): 3.26726
 Domain[ROOT_All]                                                  INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr                                                    INFO Application Manager Stopped successfully
 SGInputLoader                                                     INFO Finalizing SGInputLoader...
@@ -1299,10 +1316,10 @@ IOVDbFolder                                                       INFO Folder /T
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/STATUS/ADC (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
 IOVDbFolder                                                       INFO Folder /TILE/ONL01/STATUS/ADC (AttrListColl) db-read 0/0 objs/chan/bytes 0/277/0 ((     0.00 ))s
-IOVDbFolder                                                       INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.02 ))s
-IOVDbSvc                                                          INFO  bytes in ((      0.05 ))s
+IOVDbFolder                                                       INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 ((     0.01 ))s
+IOVDbSvc                                                          INFO  bytes in ((      0.03 ))s
 IOVDbSvc                                                          INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: ((     0.00 ))s
-IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.05 ))s
+IOVDbSvc                                                          INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 2 ReadTime: ((     0.03 ))s
 IOVDbSvc                                                          INFO Connection COOLOFL_TILE/OFLP200 : nConnect: 1 nFolders: 11 ReadTime: ((     0.00 ))s
 AthDictLoaderSvc                                                  INFO in finalize...
 ToolSvc                                                           INFO Removing all tools created by ToolSvc
@@ -1313,9 +1330,9 @@ ToolSvc.ByteStreamMetadataTool                                    INFO in finali
 *****Chrono*****                                                  INFO WARNING: MT job; statistics are unreliable
 *****Chrono*****                                                  INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                                  INFO ****************************************************************************************************
-cObjR_ALL                                                         INFO Time User   : Tot=  100 [ms] Ave/Min/Max=      50(+-      50)/       0/     100 [ms] #=  2
-cObj_ALL                                                          INFO Time User   : Tot=  140 [ms] Ave/Min/Max=      70(+-      60)/      10/     130 [ms] #=  2
-ChronoStatSvc                                                     INFO Time User   : Tot= 9.01  [s]  #=  1
+cObjR_ALL                                                         INFO Time User   : Tot=   90 [ms] Ave/Min/Max=      45(+-      45)/       0/      90 [ms] #=  2
+cObj_ALL                                                          INFO Time User   : Tot=  110 [ms] Ave/Min/Max=      55(+-      45)/      10/     100 [ms] #=  2
+ChronoStatSvc                                                     INFO Time User   : Tot= 10.1  [s]  #=  1
 *****Chrono*****                                                  INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                                          INFO  Service finalized successfully 
 ApplicationMgr                                                    INFO Application Manager Finalized successfully
diff --git a/Tools/WorkflowTestRunner/python/ScriptUtils.py b/Tools/WorkflowTestRunner/python/ScriptUtils.py
index ea4f75bdfa80432023ffbcd4d1d496ed27b04088..f45b2f002eb97759e182d59a00308f985ec0ebd6 100644
--- a/Tools/WorkflowTestRunner/python/ScriptUtils.py
+++ b/Tools/WorkflowTestRunner/python/ScriptUtils.py
@@ -73,6 +73,8 @@ def setup_parser() -> ArgumentParser:
                        help="Run overlay test using Overlay_tf.py")
     tests.add_argument("-p", "--pileup", action="store_true", dest="pileup", default=False,
                        help="Run MC reconstruction chain with pile-up")
+    tests.add_argument("-r", "--reco", action="store_true", dest="reco", default=False,
+                       help="Run MC reconstruction (in case the default execution also runs simulation)")                   
 
     return parser
 
@@ -162,6 +164,7 @@ def parse_test_string(setup: TestSetup, options: Namespace) -> None:
 
     # reco
     if test_string in ['r', 'reco', 'reconstruction', 'Reco_tf', 'Reco_tf.py']:
+        options.reco = True
         return
 
 
@@ -179,7 +182,7 @@ def run_tests(setup: TestSetup, tests: List[WorkflowTest]) -> None:
     if not setup.checks_only:
         threads = {}
         setup.logger.info("------------------ Run Athena workflow test jobs---------------")
-        if setup.parallel_execution:
+        if setup.parallel_execution and not setup.validation_only:
             for test in tests:
                 threads[f"{test.ID}_reference"]   = threading.Thread(target=lambda test=test: test.run_reference())
                 threads[f"{test.ID}_validation"] = threading.Thread(target=lambda test=test: test.run_validation())
@@ -192,9 +195,12 @@ def run_tests(setup: TestSetup, tests: List[WorkflowTest]) -> None:
             for test in tests:
                 threads[f"{test.ID}_validation"] = threading.Thread(target=lambda test=test: test.run_validation())
                 threads[f"{test.ID}_validation"].start()
+                if not setup.parallel_execution:
+                    threads[f"{test.ID}_validation"].join()
 
-            for thread in threads:
-                threads[thread].join()
+            if setup.parallel_execution:
+                for thread in threads:
+                    threads[thread].join()
         else:
             for test in tests:
                 threads[f"{test.ID}_reference"]   = threading.Thread(target=lambda test=test: test.run_reference())
diff --git a/Tools/WorkflowTestRunner/python/StandardTests.py b/Tools/WorkflowTestRunner/python/StandardTests.py
index 029b3c83883b05f2ca16bd8a9ac4ba689aa31bb5..5a5b156563aa9d16de675c1f8ab05fa3d6d3841c 100644
--- a/Tools/WorkflowTestRunner/python/StandardTests.py
+++ b/Tools/WorkflowTestRunner/python/StandardTests.py
@@ -14,7 +14,7 @@ class QTest(WorkflowTest):
 
     def __init__(self, ID: str, run: WorkflowRun, type: WorkflowType, steps: List[str], setup: TestSetup, extra_args: str = '') -> None:
         if "maxEvents" not in extra_args:
-            if type == WorkflowType.MCPileUpReco:
+            if type == WorkflowType.MCPileUpReco or run == WorkflowRun.Run4:
                 extra_args += " --maxEvents 5"
             else:
                 extra_args += " --maxEvents 20"
diff --git a/Tools/WorkflowTestRunner/python/Test.py b/Tools/WorkflowTestRunner/python/Test.py
index 3e02cb0614debe03f9c93bb1f194c8f9d0fc18a5..a5376deb387f516bd5d8959d694da10f90db1d09 100644
--- a/Tools/WorkflowTestRunner/python/Test.py
+++ b/Tools/WorkflowTestRunner/python/Test.py
@@ -26,6 +26,7 @@ class TestSetup:
         self.release_validation = ""
         self.release_ID = environ['AtlasVersion'][0:4]
         self.parallel_execution = False
+        self.disable_output_checks = False
 
     def setup_release(self, reference=None, validation=None) -> None:
         if reference and validation:
@@ -145,8 +146,9 @@ class WorkflowTest:
             return False
 
         # output checks
-        for check in self.output_checks:
-            result = result and check.run(self)
+        if not self.setup.disable_output_checks:
+            for check in self.output_checks:
+                result = result and check.run(self)
 
         if self.setup.validation_only or self.skip_performance_checks:
             return result  # Performance checks against static references not possible
diff --git a/Tools/WorkflowTestRunner/scripts/RunWorkflowTests_Run4.py b/Tools/WorkflowTestRunner/scripts/RunWorkflowTests_Run4.py
new file mode 100755
index 0000000000000000000000000000000000000000..529f5c7670d51ed62abd62e38986e75d68eda0ee
--- /dev/null
+++ b/Tools/WorkflowTestRunner/scripts/RunWorkflowTests_Run4.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from sys import exit
+
+from WorkflowTestRunner.ScriptUtils import setup_logger, setup_parser, get_test_setup, \
+    run_tests, run_checks, run_summary
+from WorkflowTestRunner.StandardTests import QTest, SimulationTest
+from WorkflowTestRunner.Test import WorkflowRun, WorkflowType
+
+
+def main():
+    name = "RunUpgradeTests"
+    run = WorkflowRun.Run4
+
+    # Setup the environment
+    log = setup_logger(name)
+    parser = setup_parser()
+    options = parser.parse_args()
+    setup = get_test_setup(name, options, log)
+    # disable output checks for Run 4
+    setup.disable_output_checks = True
+
+    # Define which tests to run
+    tests_to_run = []
+    if options.simulation:
+        tests_to_run.append(SimulationTest("s3761", run, WorkflowType.FullSim, ["EVNTtoHITS"], setup, options.extra_args))
+    elif options.overlay:
+        log.error("Overlay not supported yet")
+        exit(1)
+    elif options.pileup:
+        log.error("Pile-up not supported yet")
+        exit(1)
+    elif options.reco:
+        tests_to_run.append(QTest("q447", run, WorkflowType.MCReco, ["HITtoRDO", "RAWtoALL"], setup, options.extra_args))
+    else:
+        if setup.parallel_execution:
+            log.error("Parallel execution not supported for the default Phase-II workflow")
+            exit(1)
+        tests_to_run.append(SimulationTest("s3761", run, WorkflowType.FullSim, ["EVNTtoHITS"], setup, options.extra_args))
+        tests_to_run.append(QTest("q447", run, WorkflowType.MCReco, ["HITtoRDO", "RAWtoALL"], setup, f"{options.extra_args} --inputHITSFile ../run_s3761/myHITS.pool.root"))
+
+    # Define which perfomance checks to run
+    # TODO: standard performance checks do not work, disable for now
+    # performance_checks = get_standard_performance_checks(setup)
+    performance_checks = []
+
+    # Define and run jobs
+    run_tests(setup, tests_to_run)
+
+    # Run post-processing checks
+    all_passed = run_checks(setup, tests_to_run, performance_checks)
+
+    # final report
+    run_summary(setup, tests_to_run, all_passed)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
index 9fe15ec868256fc96fa807aa9a02712ad9fdef11..41d6f9bc0fad19533f00bbde68e786e97776b85e 100755
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.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 TrigFastTrackFinder.TrigFastTrackFinderConf import TrigFastTrackFinder
 
@@ -6,189 +6,186 @@ from TrigOnlineSpacePointTool.TrigOnlineSpacePointToolConf import TrigL2LayerNum
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigFastTrackFinderMonitoring(GenericMonitoringTool):
-    def __init__ (self, name, doResMon=False):
-        type = name
-        name = "TrigFastTrackFinder_" + type
-        super(TrigFastTrackFinderMonitoring, self).__init__(name)
-        self.HistPath = name
-        self.addSPHistograms(type)
-        self.addDataErrorHistograms()
-        self.addTimingHistograms(type)
-        self.addTrackHistograms(type)
-        if doResMon:
-            self.addResidualHistograms()
-        if type=='jet':
-            self.addUTTHistograms()
-
-    def addSPHistograms(self, type):
-        if type=='FS' or type=='JetFS' or type=='FullScan' or type=='fullScan' or type=='fullScanUTT' or type=='jet':
-            self.defineHistogram('roi_nSPsPIX', path='EXPERT',type='TH1F',title="Number of Pixel SPs", xbins = 500, xmin=-0.5, xmax=49999.5)
-            self.defineHistogram('roi_nSPsSCT', path='EXPERT',type='TH1F',title="Number of SCT SPs", xbins = 500, xmin=-0.5, xmax=99999.5)
-            self.defineHistogram('roi_phiWidth',path='EXPERT',type='TH1F',title="Phi width of the input RoI",xbins = 100, xmin=0, xmax=6.4)
-            self.defineHistogram('roi_etaWidth',path='EXPERT',type='TH1F',title="Eta width of the input RoI",xbins = 100, xmin=0, xmax=5)
+def TrigFastTrackFinderMonitoring(name, doResMon=False):
+
+    def addSPHistograms(montool, name):
+        if name in ['FS', 'JetFS', 'FullScan', 'fullScan', 'fullScanUTT', 'jet']:
+            montool.defineHistogram('roi_nSPsPIX', path='EXPERT',type='TH1F',title="Number of Pixel SPs", xbins = 500, xmin=-0.5, xmax=49999.5)
+            montool.defineHistogram('roi_nSPsSCT', path='EXPERT',type='TH1F',title="Number of SCT SPs", xbins = 500, xmin=-0.5, xmax=99999.5)
+            montool.defineHistogram('roi_phiWidth',path='EXPERT',type='TH1F',title="Phi width of the input RoI",xbins = 100, xmin=0, xmax=6.4)
+            montool.defineHistogram('roi_etaWidth',path='EXPERT',type='TH1F',title="Eta width of the input RoI",xbins = 100, xmin=0, xmax=5)
         else:
-            self.defineHistogram('roi_nSPsPIX', path='EXPERT',type='TH1F',title="Number of Pixel SPs", xbins = 50, xmin=-0.5, xmax=4999.5)
-            self.defineHistogram('roi_nSPsSCT', path='EXPERT',type='TH1F',title="Number of SCT SPs", xbins = 50, xmin=-0.5, xmax=4999.5)
-            self.defineHistogram('roi_phiWidth',path='EXPERT',type='TH1F',title="Phi width of the input RoI",xbins = 100, xmin=0, xmax=1.0)
-            self.defineHistogram('roi_etaWidth',path='EXPERT',type='TH1F',title="Eta width of the input RoI",xbins = 100, xmin=0, xmax=1.0)
-
-        self.defineHistogram('roi_eta',     path='EXPERT',type='TH1F',title='Eta of the input RoI;;Entries', xbins=100, xmin=-5, xmax=5)
-        self.defineHistogram('roi_phi',     path='EXPERT',type='TH1F',title="Phi of the input RoI",xbins = 100, xmin=-3.2, xmax=3.2)
-        self.defineHistogram('roi_z',       path='EXPERT',type='TH1F',title="z of the input RoI",xbins = 200, xmin=-400, xmax=400)
-        self.defineHistogram('roi_zWidth',  path='EXPERT',type='TH1F',title="z width of the input RoI",xbins = 100, xmin=0, xmax=500)
-
-    def addDataErrorHistograms(self):
-        self.defineHistogram('roi_lastStageExecuted',path='EXPERT',type='TH1F',title="Last Step Successfully Executed", xbins = 8 , xmin=-0.5, xmax=7.5,
+            montool.defineHistogram('roi_nSPsPIX', path='EXPERT',type='TH1F',title="Number of Pixel SPs", xbins = 50, xmin=-0.5, xmax=4999.5)
+            montool.defineHistogram('roi_nSPsSCT', path='EXPERT',type='TH1F',title="Number of SCT SPs", xbins = 50, xmin=-0.5, xmax=4999.5)
+            montool.defineHistogram('roi_phiWidth',path='EXPERT',type='TH1F',title="Phi width of the input RoI",xbins = 100, xmin=0, xmax=1.0)
+            montool.defineHistogram('roi_etaWidth',path='EXPERT',type='TH1F',title="Eta width of the input RoI",xbins = 100, xmin=0, xmax=1.0)
+
+        montool.defineHistogram('roi_eta',     path='EXPERT',type='TH1F',title='Eta of the input RoI;;Entries', xbins=100, xmin=-5, xmax=5)
+        montool.defineHistogram('roi_phi',     path='EXPERT',type='TH1F',title="Phi of the input RoI",xbins = 100, xmin=-3.2, xmax=3.2)
+        montool.defineHistogram('roi_z',       path='EXPERT',type='TH1F',title="z of the input RoI",xbins = 200, xmin=-400, xmax=400)
+        montool.defineHistogram('roi_zWidth',  path='EXPERT',type='TH1F',title="z width of the input RoI",xbins = 100, xmin=0, xmax=500)
+
+    def addDataErrorHistograms(montool):
+        montool.defineHistogram('roi_lastStageExecuted',path='EXPERT',type='TH1F',title="Last Step Successfully Executed", xbins = 8 , xmin=-0.5, xmax=7.5,
                              xlabels=["Start","GetRoI","GetSPs","ZFinder","Triplets","TrackMaker","TrackFitter","TrackConverter"])
 
-    def addTimingHistograms(self, type):
-        if type=='FS' or type=='JetFS' or type=='FullScan' or type=='fullScan' or type=='fullScanUTT' or type=='jet':
-            self.defineHistogram('roi_nSPs, TIME_PattReco',   path='EXPERT',type='TH2F',title="PattReco time; nSPs",    xbins = 200, xmin=0.0, xmax=200000.0, ybins = 100, ymin=0.0, ymax=40000.0)
-            self.defineHistogram('roi_nTracks, TIME_PattReco',path='EXPERT',type='TH2F',title="PattReco time; nTracks", xbins = 50,  xmin=0.0, xmax=10000.0,  ybins = 100, ymin=0.0, ymax=40000.0)
-            self.defineHistogram('TIME_Total',             path='EXPERT',type='TH1F',title="Total time (ms)",           xbins = 200, xmin=0.0, xmax=15000.0)
-            self.defineHistogram('TIME_PattReco',             path='EXPERT',type='TH1F',title="Pure PattReco time (ms)",     xbins = 200, xmin=0.0, xmax=40000.0)
-            self.defineHistogram('TIME_SpacePointConversion', path='EXPERT',type='TH1F',title="SP Conversion time (ms)",     xbins = 200, xmin=0.0, xmax=200.0)
-            self.defineHistogram('TIME_ZFinder',              path='EXPERT',type='TH1F',title="ZFinder time (ms)",           xbins = 200, xmin=0.0, xmax=40000.0)
-            self.defineHistogram('TIME_Triplets',             path='EXPERT',type='TH1F',title="Triplets Making time (ms)",   xbins = 200, xmin=0.0, xmax=40000.0)
-            self.defineHistogram('TIME_CmbTrack',             path='EXPERT',type='TH1F',title="Combined Tracking time (ms)", xbins = 200, xmin=0.0, xmax=40000.0)
-            self.defineHistogram('TIME_TrackFitter',          path='EXPERT',type='TH1F',title="Track Fitter time (ms)",      xbins = 200, xmin=0.0, xmax=2000.0)
-            if type=='jet':
-                self.defineHistogram('TIME_HitDV',            path='EXPERT',type='TH1F',title="Hit-based DV search (ms)",    xbins = 200, xmin=0.0, xmax=200.0)
-                self.defineHistogram('TIME_dEdxTrk',          path='EXPERT',type='TH1F',title="Large dEdx search (ms)",      xbins = 200, xmin=0.0, xmax=20.0)
-        elif type=='fullScanLRT':
-            self.defineHistogram('roi_nSPs, TIME_PattReco',   path='EXPERT',type='TH2F',title="PattReco time; nSPs",    xbins = 200, xmin=0.0, xmax=3000.0, ybins = 100, ymin=0.0, ymax=500.0)
-            self.defineHistogram('roi_nTracks, TIME_PattReco',path='EXPERT',type='TH2F',title="PattReco time; nTracks", xbins = 50,  xmin=0.0, xmax=200.0,  ybins = 100, ymin=0.0, ymax=500.0)
-            self.defineHistogram('TIME_Total',             path='EXPERT',type='TH1F',title="Total time (ms)",           xbins = 200, xmin=0.0, xmax=5000.0)
-            self.defineHistogram('TIME_PattReco',             path='EXPERT',type='TH1F',title="Pure PattReco time (ms)",     xbins = 200, xmin=0.0, xmax=2000.0)
-            self.defineHistogram('TIME_SpacePointConversion', path='EXPERT',type='TH1F',title="SP Conversion time (ms)",     xbins = 200, xmin=0.0, xmax=200.0)
-            self.defineHistogram('TIME_ZFinder',              path='EXPERT',type='TH1F',title="ZFinder time (ms)",           xbins = 200, xmin=0.0, xmax=1000.0)
-            self.defineHistogram('TIME_Triplets',             path='EXPERT',type='TH1F',title="Triplets Making time (ms)",   xbins = 200, xmin=0.0, xmax=400.0)
-            self.defineHistogram('TIME_CmbTrack',             path='EXPERT',type='TH1F',title="Combined Tracking time (ms)", xbins = 200, xmin=0.0, xmax=2000.0)
-            self.defineHistogram('TIME_TrackFitter',          path='EXPERT',type='TH1F',title="Track Fitter time (ms)",      xbins = 200, xmin=0.0, xmax=200.0)
+    def addTimingHistograms(montool, name):
+        if name in ['FS', 'JetFS', 'FullScan', 'fullScan', 'fullScanUTT', 'jet']:
+            montool.defineHistogram('roi_nSPs, TIME_PattReco',   path='EXPERT',type='TH2F',title="PattReco time; nSPs",    xbins = 200, xmin=0.0, xmax=200000.0, ybins = 100, ymin=0.0, ymax=40000.0)
+            montool.defineHistogram('roi_nTracks, TIME_PattReco',path='EXPERT',type='TH2F',title="PattReco time; nTracks", xbins = 50,  xmin=0.0, xmax=10000.0,  ybins = 100, ymin=0.0, ymax=40000.0)
+            montool.defineHistogram('TIME_Total',             path='EXPERT',type='TH1F',title="Total time (ms)",           xbins = 200, xmin=0.0, xmax=15000.0)
+            montool.defineHistogram('TIME_PattReco',             path='EXPERT',type='TH1F',title="Pure PattReco time (ms)",     xbins = 200, xmin=0.0, xmax=40000.0)
+            montool.defineHistogram('TIME_SpacePointConversion', path='EXPERT',type='TH1F',title="SP Conversion time (ms)",     xbins = 200, xmin=0.0, xmax=200.0)
+            montool.defineHistogram('TIME_ZFinder',              path='EXPERT',type='TH1F',title="ZFinder time (ms)",           xbins = 200, xmin=0.0, xmax=40000.0)
+            montool.defineHistogram('TIME_Triplets',             path='EXPERT',type='TH1F',title="Triplets Making time (ms)",   xbins = 200, xmin=0.0, xmax=40000.0)
+            montool.defineHistogram('TIME_CmbTrack',             path='EXPERT',type='TH1F',title="Combined Tracking time (ms)", xbins = 200, xmin=0.0, xmax=40000.0)
+            montool.defineHistogram('TIME_TrackFitter',          path='EXPERT',type='TH1F',title="Track Fitter time (ms)",      xbins = 200, xmin=0.0, xmax=2000.0)
+            if name=='jet':
+                montool.defineHistogram('TIME_HitDV',            path='EXPERT',type='TH1F',title="Hit-based DV search (ms)",    xbins = 200, xmin=0.0, xmax=200.0)
+                montool.defineHistogram('TIME_dEdxTrk',          path='EXPERT',type='TH1F',title="Large dEdx search (ms)",      xbins = 200, xmin=0.0, xmax=20.0)
+        elif name=='fullScanLRT':
+            montool.defineHistogram('roi_nSPs, TIME_PattReco',   path='EXPERT',type='TH2F',title="PattReco time; nSPs",    xbins = 200, xmin=0.0, xmax=3000.0, ybins = 100, ymin=0.0, ymax=500.0)
+            montool.defineHistogram('roi_nTracks, TIME_PattReco',path='EXPERT',type='TH2F',title="PattReco time; nTracks", xbins = 50,  xmin=0.0, xmax=200.0,  ybins = 100, ymin=0.0, ymax=500.0)
+            montool.defineHistogram('TIME_Total',             path='EXPERT',type='TH1F',title="Total time (ms)",           xbins = 200, xmin=0.0, xmax=5000.0)
+            montool.defineHistogram('TIME_PattReco',             path='EXPERT',type='TH1F',title="Pure PattReco time (ms)",     xbins = 200, xmin=0.0, xmax=2000.0)
+            montool.defineHistogram('TIME_SpacePointConversion', path='EXPERT',type='TH1F',title="SP Conversion time (ms)",     xbins = 200, xmin=0.0, xmax=200.0)
+            montool.defineHistogram('TIME_ZFinder',              path='EXPERT',type='TH1F',title="ZFinder time (ms)",           xbins = 200, xmin=0.0, xmax=1000.0)
+            montool.defineHistogram('TIME_Triplets',             path='EXPERT',type='TH1F',title="Triplets Making time (ms)",   xbins = 200, xmin=0.0, xmax=400.0)
+            montool.defineHistogram('TIME_CmbTrack',             path='EXPERT',type='TH1F',title="Combined Tracking time (ms)", xbins = 200, xmin=0.0, xmax=2000.0)
+            montool.defineHistogram('TIME_TrackFitter',          path='EXPERT',type='TH1F',title="Track Fitter time (ms)",      xbins = 200, xmin=0.0, xmax=200.0)
         else:
-            self.defineHistogram('roi_nSPs, TIME_PattReco',   path='EXPERT',type='TH2F',title="PattReco time; nSPs",    xbins = 200, xmin=0.0, xmax=3000.0, ybins = 100, ymin=0.0, ymax=400.0)
-            self.defineHistogram('roi_nTracks, TIME_PattReco',path='EXPERT',type='TH2F',title="PattReco time; nTracks", xbins = 50,  xmin=0.0, xmax=200.0,  ybins = 100, ymin=0.0, ymax=400.0)
-            self.defineHistogram('TIME_Total',             path='EXPERT',type='TH1F',title="Total time (ms)",           xbins = 200, xmin=0.0, xmax=5000.0)
-            self.defineHistogram('TIME_PattReco',             path='EXPERT',type='TH1F',title="Pure PattReco time (ms)",     xbins = 200, xmin=0.0, xmax=400.0)
-            self.defineHistogram('TIME_SpacePointConversion', path='EXPERT',type='TH1F',title="SP Conversion time (ms)",     xbins = 200, xmin=0.0, xmax=20.0)
-            self.defineHistogram('TIME_ZFinder',              path='EXPERT',type='TH1F',title="ZFinder time (ms)",           xbins = 200, xmin=0.0, xmax=1000.0)
-            self.defineHistogram('TIME_Triplets',             path='EXPERT',type='TH1F',title="Triplets Making time (ms)",   xbins = 200, xmin=0.0, xmax=400.0)
-            self.defineHistogram('TIME_CmbTrack',             path='EXPERT',type='TH1F',title="Combined Tracking time (ms)", xbins = 200, xmin=0.0, xmax=400.0)
-            self.defineHistogram('TIME_TrackFitter',          path='EXPERT',type='TH1F',title="Track Fitter time (ms)",      xbins = 200, xmin=0.0, xmax=200.0)
-
-
-
-    def addTrackHistograms(self, type):
-        if type=='FS' or type=='JetFS' or type=='FullScan' or type=='fullScan' or type=='fullScanUTT' or type=='jet':
-            self.defineHistogram('roi_nSeeds',     path='EXPERT',type='TH1F',title="Number of seeds",xbins = 1000, xmin=-0.5, xmax=99999.5)
-            self.defineHistogram('roi_nTracks',    path='EXPERT',type='TH1F',title="Number of Tracks",xbins = 100, xmin=-0.5, xmax=9999.5)
-        elif type=='fullScanLRT':
-            self.defineHistogram('roi_nSeeds',     path='EXPERT',type='TH1F',title="Number of seeds",xbins = 1000, xmin=-0.5, xmax=99999.5)
-            self.defineHistogram('roi_nTracks',    path='EXPERT',type='TH1F',title="Number of Tracks",xbins = 100, xmin=-0.5, xmax=5000.5)
+            montool.defineHistogram('roi_nSPs, TIME_PattReco',   path='EXPERT',type='TH2F',title="PattReco time; nSPs",    xbins = 200, xmin=0.0, xmax=3000.0, ybins = 100, ymin=0.0, ymax=400.0)
+            montool.defineHistogram('roi_nTracks, TIME_PattReco',path='EXPERT',type='TH2F',title="PattReco time; nTracks", xbins = 50,  xmin=0.0, xmax=200.0,  ybins = 100, ymin=0.0, ymax=400.0)
+            montool.defineHistogram('TIME_Total',             path='EXPERT',type='TH1F',title="Total time (ms)",           xbins = 200, xmin=0.0, xmax=5000.0)
+            montool.defineHistogram('TIME_PattReco',             path='EXPERT',type='TH1F',title="Pure PattReco time (ms)",     xbins = 200, xmin=0.0, xmax=400.0)
+            montool.defineHistogram('TIME_SpacePointConversion', path='EXPERT',type='TH1F',title="SP Conversion time (ms)",     xbins = 200, xmin=0.0, xmax=20.0)
+            montool.defineHistogram('TIME_ZFinder',              path='EXPERT',type='TH1F',title="ZFinder time (ms)",           xbins = 200, xmin=0.0, xmax=1000.0)
+            montool.defineHistogram('TIME_Triplets',             path='EXPERT',type='TH1F',title="Triplets Making time (ms)",   xbins = 200, xmin=0.0, xmax=400.0)
+            montool.defineHistogram('TIME_CmbTrack',             path='EXPERT',type='TH1F',title="Combined Tracking time (ms)", xbins = 200, xmin=0.0, xmax=400.0)
+            montool.defineHistogram('TIME_TrackFitter',          path='EXPERT',type='TH1F',title="Track Fitter time (ms)",      xbins = 200, xmin=0.0, xmax=200.0)
+
+
+
+    def addTrackHistograms(montool, name):
+        if name in ['FS', 'JetFS', 'FullScan', 'fullScan', 'fullScanUTT', 'jet']:
+            montool.defineHistogram('roi_nSeeds',     path='EXPERT',type='TH1F',title="Number of seeds",xbins = 1000, xmin=-0.5, xmax=99999.5)
+            montool.defineHistogram('roi_nTracks',    path='EXPERT',type='TH1F',title="Number of Tracks",xbins = 100, xmin=-0.5, xmax=9999.5)
+        elif name=='fullScanLRT':
+            montool.defineHistogram('roi_nSeeds',     path='EXPERT',type='TH1F',title="Number of seeds",xbins = 1000, xmin=-0.5, xmax=99999.5)
+            montool.defineHistogram('roi_nTracks',    path='EXPERT',type='TH1F',title="Number of Tracks",xbins = 100, xmin=-0.5, xmax=5000.5)
         else:
-            self.defineHistogram('roi_nSeeds',     path='EXPERT',type='TH1F',title="Number of seeds",xbins =  100, xmin=-0.5, xmax=4999.5)
-            self.defineHistogram('roi_nTracks',    path='EXPERT',type='TH1F',title="Number of Tracks",xbins =  50, xmin=-0.5, xmax=199.5)
-
-        self.defineHistogram('roi_nZvertices', path='EXPERT',type='TH1F',title="Number of z vertices",xbins = 60 ,  xmin=-0.5, xmax=49.5)
-        self.defineHistogram('roi_zVertices',  path='EXPERT',type='TH1F',title="ZFinder Vertices",xbins = 501, xmin=-250, xmax=250)
-        self.defineHistogram('roi_nTrk_zVtx',  path='EXPERT',type='TH1F',title="Ntrk ZFinder Vertices",xbins = 100, xmin=-0.5, xmax=49.5)
-        self.defineHistogram('trk_nSiHits',    path='EXPERT',type='TH1F',title="Total number of Silicon Hits per Track",xbins = 20, xmin=-0.5, xmax=19.5)
-        self.defineHistogram('trk_nPIXHits',   path='EXPERT',type='TH1F',title="Number of Pixel Hits per Track",xbins = 10, xmin=-0.5, xmax=9.5)
-        self.defineHistogram('trk_nSCTHits',   path='EXPERT',type='TH1F',title="Number of SCT Hits per Track",xbins = 10, xmin=-0.5, xmax=9.5)
-        self.defineHistogram('trk_chi2dof',    path='EXPERT',type='TH1F',title="ChiSqd / nDoF",xbins = 100, xmin=0.0, xmax=5)
-        self.defineHistogram('trk_pt',         path='EXPERT',type='TH1F',title="pt",xbins = 100, xmin=-2.5e5, xmax=2.5e5)
-        self.defineHistogram('trk_phi0',       path='EXPERT',type='TH1F',title="phi",xbins = 100, xmin=-3.2, xmax=3.2)
-        self.defineHistogram('trk_eta',        path='EXPERT',type='TH1F',title="eta",xbins = 100, xmin=-5, xmax=5)
-        self.defineHistogram('trk_dPhi0',      path='EXPERT',type='TH1F',title="dphi",xbins = 160, xmin=-0.8, xmax=0.8)
-        self.defineHistogram('trk_dEta',       path='EXPERT',type='TH1F',title="deta",xbins = 160, xmin=-0.8, xmax=0.8)
-        if type=="Cosmic":
-            self.defineHistogram('trk_a0',     path='EXPERT',type='TH1F',title="a0",xbins = 100, xmin=-300, xmax=300)
-            self.defineHistogram('trk_a0beam', path='EXPERT',type='TH1F',title="a0beam",xbins = 100, xmin=-300, xmax=300)
-            self.defineHistogram('trk_z0',     path='EXPERT',type='TH1F',title="z0",xbins = 100, xmin=-800, xmax=800)
-        elif type=='fullScanLRT':
-            self.defineHistogram('trk_a0',     path='EXPERT',type='TH1F',title="a0",xbins = 100, xmin=-300, xmax=300)
-            self.defineHistogram('trk_a0beam', path='EXPERT',type='TH1F',title="a0beam",xbins = 100, xmin=-300, xmax=300)
-            self.defineHistogram('trk_z0',     path='EXPERT',type='TH1F',title="z0",xbins = 100, xmin=-550, xmax=550)
+            montool.defineHistogram('roi_nSeeds',     path='EXPERT',type='TH1F',title="Number of seeds",xbins =  100, xmin=-0.5, xmax=4999.5)
+            montool.defineHistogram('roi_nTracks',    path='EXPERT',type='TH1F',title="Number of Tracks",xbins =  50, xmin=-0.5, xmax=199.5)
+
+        montool.defineHistogram('roi_nZvertices', path='EXPERT',type='TH1F',title="Number of z vertices",xbins = 60 ,  xmin=-0.5, xmax=49.5)
+        montool.defineHistogram('roi_zVertices',  path='EXPERT',type='TH1F',title="ZFinder Vertices",xbins = 501, xmin=-250, xmax=250)
+        montool.defineHistogram('roi_nTrk_zVtx',  path='EXPERT',type='TH1F',title="Ntrk ZFinder Vertices",xbins = 100, xmin=-0.5, xmax=49.5)
+        montool.defineHistogram('trk_nSiHits',    path='EXPERT',type='TH1F',title="Total number of Silicon Hits per Track",xbins = 20, xmin=-0.5, xmax=19.5)
+        montool.defineHistogram('trk_nPIXHits',   path='EXPERT',type='TH1F',title="Number of Pixel Hits per Track",xbins = 10, xmin=-0.5, xmax=9.5)
+        montool.defineHistogram('trk_nSCTHits',   path='EXPERT',type='TH1F',title="Number of SCT Hits per Track",xbins = 10, xmin=-0.5, xmax=9.5)
+        montool.defineHistogram('trk_chi2dof',    path='EXPERT',type='TH1F',title="ChiSqd / nDoF",xbins = 100, xmin=0.0, xmax=5)
+        montool.defineHistogram('trk_pt',         path='EXPERT',type='TH1F',title="pt",xbins = 100, xmin=-2.5e5, xmax=2.5e5)
+        montool.defineHistogram('trk_phi0',       path='EXPERT',type='TH1F',title="phi",xbins = 100, xmin=-3.2, xmax=3.2)
+        montool.defineHistogram('trk_eta',        path='EXPERT',type='TH1F',title="eta",xbins = 100, xmin=-5, xmax=5)
+        montool.defineHistogram('trk_dPhi0',      path='EXPERT',type='TH1F',title="dphi",xbins = 160, xmin=-0.8, xmax=0.8)
+        montool.defineHistogram('trk_dEta',       path='EXPERT',type='TH1F',title="deta",xbins = 160, xmin=-0.8, xmax=0.8)
+        if name=="Cosmic":
+            montool.defineHistogram('trk_a0',     path='EXPERT',type='TH1F',title="a0",xbins = 100, xmin=-300, xmax=300)
+            montool.defineHistogram('trk_a0beam', path='EXPERT',type='TH1F',title="a0beam",xbins = 100, xmin=-300, xmax=300)
+            montool.defineHistogram('trk_z0',     path='EXPERT',type='TH1F',title="z0",xbins = 100, xmin=-800, xmax=800)
+        elif name=='fullScanLRT':
+            montool.defineHistogram('trk_a0',     path='EXPERT',type='TH1F',title="a0",xbins = 100, xmin=-300, xmax=300)
+            montool.defineHistogram('trk_a0beam', path='EXPERT',type='TH1F',title="a0beam",xbins = 100, xmin=-300, xmax=300)
+            montool.defineHistogram('trk_z0',     path='EXPERT',type='TH1F',title="z0",xbins = 100, xmin=-550, xmax=550)
         else:
-            self.defineHistogram('trk_a0',     path='EXPERT',type='TH1F',title="a0",xbins = 200, xmin=-10, xmax=10)
-            self.defineHistogram('trk_a0beam', path='EXPERT',type='TH1F',title="a0beam",xbins = 200, xmin=-10, xmax=10)
-            self.defineHistogram('trk_z0',     path='EXPERT',type='TH1F',title="z0",xbins = 200, xmin=-400, xmax=400)
+            montool.defineHistogram('trk_a0',     path='EXPERT',type='TH1F',title="a0",xbins = 200, xmin=-10, xmax=10)
+            montool.defineHistogram('trk_a0beam', path='EXPERT',type='TH1F',title="a0beam",xbins = 200, xmin=-10, xmax=10)
+            montool.defineHistogram('trk_z0',     path='EXPERT',type='TH1F',title="z0",xbins = 200, xmin=-400, xmax=400)
 
     def addResidualHistograms(self):
-        self.defineHistogram('layer_IBL',                 path='EXPERT',type='TH1F',title="IBL layer",xbins = 10, xmin=0., xmax=10.)
-        self.defineHistogram('layer_PixB',                path='EXPERT',type='TH1F',title="Pixel Barrel layer",xbins = 10, xmin=0., xmax=10.)
-        self.defineHistogram('layer_PixE',                path='EXPERT',type='TH1F',title="Pixel Endcap layer",xbins = 10, xmin=0., xmax=10.)
-        self.defineHistogram('layer_SCTB',                path='EXPERT',type='TH1F',title="SCT Barrel layer",xbins = 10, xmin=0., xmax=10.)
-        self.defineHistogram('layer_SCTE',                path='EXPERT',type='TH1F',title="SCT Endcap layer",xbins = 10, xmin=0., xmax=10.)
+        montool.defineHistogram('layer_IBL',                 path='EXPERT',type='TH1F',title="IBL layer",xbins = 10, xmin=0., xmax=10.)
+        montool.defineHistogram('layer_PixB',                path='EXPERT',type='TH1F',title="Pixel Barrel layer",xbins = 10, xmin=0., xmax=10.)
+        montool.defineHistogram('layer_PixE',                path='EXPERT',type='TH1F',title="Pixel Endcap layer",xbins = 10, xmin=0., xmax=10.)
+        montool.defineHistogram('layer_SCTB',                path='EXPERT',type='TH1F',title="SCT Barrel layer",xbins = 10, xmin=0., xmax=10.)
+        montool.defineHistogram('layer_SCTE',                path='EXPERT',type='TH1F',title="SCT Endcap layer",xbins = 10, xmin=0., xmax=10.)
         #
-        self.defineHistogram('hit_IBLPhiResidual',        path='EXPERT',type='TH1F',title="IBL hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_IBLEtaResidual',        path='EXPERT',type='TH1F',title="IBL hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_IBLPhiPull',            path='EXPERT',type='TH1F',title="IBL hit-track phi pull",xbins = 100, xmin=-5., xmax=5.)
-        self.defineHistogram('hit_IBLEtaPull',            path='EXPERT',type='TH1F',title="IBL hit-track eta pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_IBLPhiResidual',        path='EXPERT',type='TH1F',title="IBL hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_IBLEtaResidual',        path='EXPERT',type='TH1F',title="IBL hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_IBLPhiPull',            path='EXPERT',type='TH1F',title="IBL hit-track phi pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_IBLEtaPull',            path='EXPERT',type='TH1F',title="IBL hit-track eta pull",xbins = 100, xmin=-5., xmax=5.)
         #
-        self.defineHistogram('hit_PIXBarrelPhiResidual',  path='EXPERT',type='TH1F',title="Pixel Barrel hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXBarrelEtaResidual',  path='EXPERT',type='TH1F',title="Pixel Barrel hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXBarrelL1PhiResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXBarrelL1EtaResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L1 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXBarrelL2PhiResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXBarrelL2EtaResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L2 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXBarrelL3PhiResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXBarrelL3EtaResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L3 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXBarrelPhiPull',      path='EXPERT',type='TH1F',title="Pixel Barrel hit-track phi pull",xbins = 100, xmin=-5., xmax=5.)
-        self.defineHistogram('hit_PIXBarrelEtaPull',      path='EXPERT',type='TH1F',title="Pixel Barrel hit-track eta pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_PIXBarrelPhiResidual',  path='EXPERT',type='TH1F',title="Pixel Barrel hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXBarrelEtaResidual',  path='EXPERT',type='TH1F',title="Pixel Barrel hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXBarrelL1PhiResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXBarrelL1EtaResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L1 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXBarrelL2PhiResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXBarrelL2EtaResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L2 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXBarrelL3PhiResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXBarrelL3EtaResidual',path='EXPERT',type='TH1F',title="Pixel Barrel L3 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXBarrelPhiPull',      path='EXPERT',type='TH1F',title="Pixel Barrel hit-track phi pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_PIXBarrelEtaPull',      path='EXPERT',type='TH1F',title="Pixel Barrel hit-track eta pull",xbins = 100, xmin=-5., xmax=5.)
         #
-        self.defineHistogram('hit_PIXEndcapPhiResidual',  path='EXPERT',type='TH1F',title="Pixel EC hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXEndcapEtaResidual',  path='EXPERT',type='TH1F',title="Pixel EC hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXEndcapL1PhiResidual',path='EXPERT',type='TH1F',title="Pixel EC L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXEndcapL1EtaResidual',path='EXPERT',type='TH1F',title="Pixel EC L1 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXEndcapL2PhiResidual',path='EXPERT',type='TH1F',title="Pixel EC L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXEndcapL2EtaResidual',path='EXPERT',type='TH1F',title="Pixel EC L2 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXEndcapL3PhiResidual',path='EXPERT',type='TH1F',title="Pixel EC L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_PIXEndcapL3EtaResidual',path='EXPERT',type='TH1F',title="Pixel EC L3 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_PIXEndcapPhiPull',      path='EXPERT',type='TH1F',title="Pixel EC hit-track phi pull",xbins = 100, xmin=-5., xmax=5.)
-        self.defineHistogram('hit_PIXEndcapEtaPull',      path='EXPERT',type='TH1F',title="Pixel EC hit-track eta pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_PIXEndcapPhiResidual',  path='EXPERT',type='TH1F',title="Pixel EC hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXEndcapEtaResidual',  path='EXPERT',type='TH1F',title="Pixel EC hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXEndcapL1PhiResidual',path='EXPERT',type='TH1F',title="Pixel EC L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXEndcapL1EtaResidual',path='EXPERT',type='TH1F',title="Pixel EC L1 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXEndcapL2PhiResidual',path='EXPERT',type='TH1F',title="Pixel EC L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXEndcapL2EtaResidual',path='EXPERT',type='TH1F',title="Pixel EC L2 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXEndcapL3PhiResidual',path='EXPERT',type='TH1F',title="Pixel EC L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_PIXEndcapL3EtaResidual',path='EXPERT',type='TH1F',title="Pixel EC L3 hit-track eta residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_PIXEndcapPhiPull',      path='EXPERT',type='TH1F',title="Pixel EC hit-track phi pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_PIXEndcapEtaPull',      path='EXPERT',type='TH1F',title="Pixel EC hit-track eta pull",xbins = 100, xmin=-5., xmax=5.)
         #
-        self.defineHistogram('hit_SCTBarrelResidual',     path='EXPERT',type='TH1F',title="SCT Barrel hit-track residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTBarrelL1PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTBarrelL2PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTBarrelL3PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTBarrelL4PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L4 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTBarrelPull',         path='EXPERT',type='TH1F',title="SCT Barrel hit-track pull",xbins = 100, xmin=-5., xmax=5.)
+        montool.defineHistogram('hit_SCTBarrelResidual',     path='EXPERT',type='TH1F',title="SCT Barrel hit-track residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTBarrelL1PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTBarrelL2PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTBarrelL3PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTBarrelL4PhiResidual',path='EXPERT',type='TH1F',title="SCT Barrel L4 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTBarrelPull',         path='EXPERT',type='TH1F',title="SCT Barrel hit-track pull",xbins = 100, xmin=-5., xmax=5.)
         #
-        self.defineHistogram('hit_SCTEndcapResidual',     path='EXPERT',type='TH1F',title="SCT EC hit-track residual",xbins = 100, xmin=-1.0, xmax=1.0)
-        self.defineHistogram('hit_SCTEndcapL1PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL2PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL3PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL4PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L4 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL5PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L5 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL6PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L6 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL7PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L7 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL8PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L8 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapL9PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L9 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
-        self.defineHistogram('hit_SCTEndcapPull',         path='EXPERT',type='TH1F',title="SCT EC hit-track pull",xbins = 100, xmin=-5., xmax=5.)
-
-    def addUTTHistograms(self):
-        self.defineHistogram('trk_dedx',           path='EXPERT',type='TH1F',title="Track dEdx (pT > 3 GeV)", xbins = 140, xmin=-0.5, xmax=6.5)
-        self.defineHistogram('trk_dedx_nusedhits', path='EXPERT',type='TH1F',title="Nr of used hits for dEdx",xbins =  11, xmin=-0.5, xmax=10.5)
+        montool.defineHistogram('hit_SCTEndcapResidual',     path='EXPERT',type='TH1F',title="SCT EC hit-track residual",xbins = 100, xmin=-1.0, xmax=1.0)
+        montool.defineHistogram('hit_SCTEndcapL1PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L1 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL2PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L2 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL3PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L3 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL4PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L4 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL5PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L5 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL6PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L6 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL7PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L7 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL8PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L8 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapL9PhiResidual',path='EXPERT',type='TH1F',title="SCT Endcap L9 hit-track phi residual",xbins = 100, xmin=-0.5, xmax=0.5)
+        montool.defineHistogram('hit_SCTEndcapPull',         path='EXPERT',type='TH1F',title="SCT EC hit-track pull",xbins = 100, xmin=-5., xmax=5.)
+
+    def addUTTHistograms(montool):
+        montool.defineHistogram('trk_dedx',           path='EXPERT',type='TH1F',title="Track dEdx (pT > 3 GeV)", xbins = 140, xmin=-0.5, xmax=6.5)
+        montool.defineHistogram('trk_dedx_nusedhits', path='EXPERT',type='TH1F',title="Nr of used hits for dEdx",xbins =  11, xmin=-0.5, xmax=10.5)
         #
-        self.defineHistogram('disTrk_nVtx',        path='EXPERT',type='TH1F',title="Nr of Vertex for disTrk",xbins =  11, xmin=-0.5, xmax=10.5)
-        self.defineHistogram('disTrk_xVtx',        path='EXPERT',type='TH1F',title="X position of primary vertex for disTrk", xbins =  50, xmin=-5, xmax=5)
-        self.defineHistogram('disTrk_yVtx',        path='EXPERT',type='TH1F',title="Y position of primary vertex for disTrk", xbins =  50, xmin=-5, xmax=5)
-        self.defineHistogram('disTrk_zVtx',        path='EXPERT',type='TH1F',title="Z position of primary vertex for disTrk", xbins = 150, xmin=-150, xmax=150)
+        montool.defineHistogram('disTrk_nVtx',        path='EXPERT',type='TH1F',title="Nr of Vertex for disTrk",xbins =  11, xmin=-0.5, xmax=10.5)
+        montool.defineHistogram('disTrk_xVtx',        path='EXPERT',type='TH1F',title="X position of primary vertex for disTrk", xbins =  50, xmin=-5, xmax=5)
+        montool.defineHistogram('disTrk_yVtx',        path='EXPERT',type='TH1F',title="Y position of primary vertex for disTrk", xbins =  50, xmin=-5, xmax=5)
+        montool.defineHistogram('disTrk_zVtx',        path='EXPERT',type='TH1F',title="Z position of primary vertex for disTrk", xbins = 150, xmin=-150, xmax=150)
         #
-        self.defineHistogram('disFailTrk_n',       path='EXPERT',type='TH1F',title="Nr of disFailTrk", xbins = 50, xmin=0, xmax=3000)
-        self.defineHistogram('disFailTrk_nclone',  path='EXPERT',type='TH1F',title="Nr of disFailTrk (after clone removal)", xbins = 50, xmin=0, xmax=3000)
-        self.defineHistogram('disFailTrk_ncand',   path='EXPERT',type='TH1F',title="Nr of disFailTrk (after pre-selection)", xbins = 50, xmin=0, xmax=3000)
-        self.defineHistogram('disCombTrk_n',       path='EXPERT',type='TH1F',title="Nr of disCombTrk", xbins = 20, xmin=0, xmax=100)
-        self.defineHistogram('disCombTrk_nclone',  path='EXPERT',type='TH1F',title="Nr of disCombTrk (after clone removal)", xbins = 20, xmin=0, xmax=100)
-        self.defineHistogram('disCombTrk_ncand',   path='EXPERT',type='TH1F',title="Nr of disCombTrk (after pre-selection)", xbins = 20, xmin=0, xmax=100)
+        montool.defineHistogram('disFailTrk_n',       path='EXPERT',type='TH1F',title="Nr of disFailTrk", xbins = 50, xmin=0, xmax=3000)
+        montool.defineHistogram('disFailTrk_nclone',  path='EXPERT',type='TH1F',title="Nr of disFailTrk (after clone removal)", xbins = 50, xmin=0, xmax=3000)
+        montool.defineHistogram('disFailTrk_ncand',   path='EXPERT',type='TH1F',title="Nr of disFailTrk (after pre-selection)", xbins = 50, xmin=0, xmax=3000)
+        montool.defineHistogram('disCombTrk_n',       path='EXPERT',type='TH1F',title="Nr of disCombTrk", xbins = 20, xmin=0, xmax=100)
+        montool.defineHistogram('disCombTrk_nclone',  path='EXPERT',type='TH1F',title="Nr of disCombTrk (after clone removal)", xbins = 20, xmin=0, xmax=100)
+        montool.defineHistogram('disCombTrk_ncand',   path='EXPERT',type='TH1F',title="Nr of disCombTrk (after pre-selection)", xbins = 20, xmin=0, xmax=100)
         #
-        self.defineHistogram('TIME_disTrkZVertex',     path='EXPERT',type='TH1F',title="UTT z-vertexing time (ms)",         xbins = 100, xmin=0.0, xmax= 50.0)
-        self.defineHistogram('TIME_disappearingTrack', path='EXPERT',type='TH1F',title="Disappearing track reco time (ms)", xbins = 150, xmin=0.0, xmax=300.0)
+        montool.defineHistogram('TIME_disTrkZVertex',     path='EXPERT',type='TH1F',title="UTT z-vertexing time (ms)",         xbins = 100, xmin=0.0, xmax= 50.0)
+        montool.defineHistogram('TIME_disappearingTrack', path='EXPERT',type='TH1F',title="Disappearing track reco time (ms)", xbins = 150, xmin=0.0, xmax=300.0)
 
 
+    montool = GenericMonitoringTool(HistPath = f"TrigFastTrackFinder_{name}")
+    addSPHistograms(montool, name)
+    addDataErrorHistograms(montool)
+    addTimingHistograms(montool, name)
+    addTrackHistograms(montool, name)
+    if doResMon:
+        addResidualHistograms(montool)
+    if name=='jet':
+        addUTTHistograms(montool)
 
+    return montool
 
 
 remap  = {
@@ -324,7 +321,7 @@ class TrigFastTrackFinderBase(TrigFastTrackFinder):
             self.doHitDV_Seeding = True
             self.RecJetRoI = "HLT_RecJETRoIs"
             self.HitDVTrk  = "HLT_HitDVTrk" # not 'recordable' due to HLT truncation (ATR-23958)
-            self.HitDVSP   = "HLT_HitDVSP"  # not 'recordable' due to HLT truncation (ATR-23958) 
+            self.HitDVSP   = "HLT_HitDVSP"  # not 'recordable' due to HLT truncation (ATR-23958)
 
         self.doDisappearingTrk = config.doDisappearingTrk
         if config.doDisappearingTrk:
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py
index abb669367c3ef9fefaf976a4011a9dd378ad0837..278b7a3fdb82bb7ae64862419721b61357f1355b 100755
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAMonitoring.py
@@ -1,34 +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
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigL2MuonSAMonitoring(GenericMonitoringTool):
-    def __init__ (self, name = "TrigL2MuonSAMonitoring"):
-        super(TrigL2MuonSAMonitoring, self).__init__( name )
-    
-        self.HistPath = name
-        self.defineHistogram('InnMdtHits',    type='TH1F', path='EXPERT', title="Hit multiplicity in the INNER2 road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5)
-        self.defineHistogram('MidMdtHits',    type='TH1F', path='EXPERT', title="Hit multiplicity in the MIDDLE road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5)
-        self.defineHistogram('OutMdtHits',    type='TH1F', path='EXPERT', title="Hit multiplicity in the OUTER road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5)
-        self.defineHistogram('FitResiduals',  type='TH1F', path='EXPERT', title="Fit Residual; Residuals (cm)", xbins=400, xmin=-0.4, xmax=0.4)
-        self.defineHistogram('Efficiency',    type='TH1F', path='EXPERT', title="Track finding efficiency", xbins=2, xmin=-0.5, xmax=1.5)
-        self.defineHistogram('Address',       type='TH1F', path='EXPERT', title="S_address;S_address", xbins=5, xmin=-1.5, xmax=3.5 )
-        self.defineHistogram('AbsPt',         type='TH1F', path='EXPERT', title="absolute P_{T};P_{T} (GeV)", xbins=100, xmin=0, xmax=100 )
-        self.defineHistogram('TrackPt',       type='TH1F', path='EXPERT', title="P_{T};P_{T} (GeV)", xbins=100, xmin=-100, xmax=100 )
-        self.defineHistogram('AbsPt, SagInv', type='TH2F', path='EXPERT', title="1/s as a function of P_{T}; P_{T} (GeV); 1/s (cm^{-1})", xbins=50, xmin=0, xmax=100, ybins=15, ymin=0, ymax=3 )
-        self.defineHistogram('Sagitta',       type='TH1F', path='EXPERT', title="Reconstructed Sagitta; Sagitta (cm)", xbins=100, xmin=-10., xmax=10.)
-        self.defineHistogram('ResInner',      type='TH1F', path='EXPERT', title="Residual from Trigger track in INNER Station; Residuals (cm)", xbins=100, xmin=-10., xmax=10. )
-        self.defineHistogram('ResMiddle',     type='TH1F', path='EXPERT', title="Residual from Trigger track in MIDDLE Station; Residuals (cm)", xbins=100, xmin=-10., xmax=10. )
-        self.defineHistogram('ResOuter',      type='TH1F', path='EXPERT', title="Residual from Trigger track in OUTER Station; Residuals (cm)", xbins=100, xmin=-10., xmax=10. )
-        self.defineHistogram('TrackEta, TrackPhi',         type='TH2F', path='EXPERT', title="Distribution of reconstructed LVL2 tracks; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 )
-        self.defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', path='EXPERT', title="Location of LVL2 track failure; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 )
-        self.defineHistogram('TIME_Total',                 type='TH1F', path='EXPERT', title="Total processing time (us)", xbins=100, xmin=0, xmax=100000 )
-        self.defineHistogram('TIME_Data_Preparator',       type='TH1F', path='EXPERT', title="Data preparator time (us)", xbins=100, xmin=0, xmax=50000 )
-        self.defineHistogram('TIME_Pattern_Finder',        type='TH1F', path='EXPERT', title="Pattern finder time (us)", xbins=100, xmin=0, xmax=5000 )
-        self.defineHistogram('TIME_Station_Fitter',        type='TH1F', path='EXPERT', title="Station fitter time (us)", xbins=100, xmin=0, xmax=5000 )
-        self.defineHistogram('TIME_Track_Fitter',          type='TH1F', path='EXPERT', title="Track fitter time (us)", xbins=100, xmin=0, xmax=300 )
-        self.defineHistogram('TIME_Track_Extrapolator',    type='TH1F', path='EXPERT', title="Track extrapolator time (us)", xbins=100, xmin=0, xmax=300 )
-        self.defineHistogram('TIME_Calibration_Streamer',  type='TH1F', path='EXPERT', title="Calibration streamer time (us)", xbins=100, xmin=0, xmax=50000 )
-        self.defineHistogram('InvalidRpcRoINumber',        type='TH1F', path='EXPERT', title="RoI Number of Invalid RPC RoI; RoI Number", xbins=150, xmin=-0.5, xmax=150.5)
+def TrigL2MuonSAMonitoring(name = "TrigL2MuonSAMonitoring"):
+
+    montool = GenericMonitoringTool(name, HistPath = name)
+
+    montool.defineHistogram('InnMdtHits',    type='TH1F', path='EXPERT', title="Hit multiplicity in the INNER2 road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5)
+    montool.defineHistogram('MidMdtHits',    type='TH1F', path='EXPERT', title="Hit multiplicity in the MIDDLE road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5)
+    montool.defineHistogram('OutMdtHits',    type='TH1F', path='EXPERT', title="Hit multiplicity in the OUTER road; MDT hits", xbins=50, xmin=-0.5, xmax=50.5)
+    montool.defineHistogram('FitResiduals',  type='TH1F', path='EXPERT', title="Fit Residual; Residuals (cm)", xbins=400, xmin=-0.4, xmax=0.4)
+    montool.defineHistogram('Efficiency',    type='TH1F', path='EXPERT', title="Track finding efficiency", xbins=2, xmin=-0.5, xmax=1.5)
+    montool.defineHistogram('Address',       type='TH1F', path='EXPERT', title="S_address;S_address", xbins=5, xmin=-1.5, xmax=3.5 )
+    montool.defineHistogram('AbsPt',         type='TH1F', path='EXPERT', title="absolute P_{T};P_{T} (GeV)", xbins=100, xmin=0, xmax=100 )
+    montool.defineHistogram('TrackPt',       type='TH1F', path='EXPERT', title="P_{T};P_{T} (GeV)", xbins=100, xmin=-100, xmax=100 )
+    montool.defineHistogram('AbsPt, SagInv', type='TH2F', path='EXPERT', title="1/s as a function of P_{T}; P_{T} (GeV); 1/s (cm^{-1})", xbins=50, xmin=0, xmax=100, ybins=15, ymin=0, ymax=3 )
+    montool.defineHistogram('Sagitta',       type='TH1F', path='EXPERT', title="Reconstructed Sagitta; Sagitta (cm)", xbins=100, xmin=-10., xmax=10.)
+    montool.defineHistogram('ResInner',      type='TH1F', path='EXPERT', title="Residual from Trigger track in INNER Station; Residuals (cm)", xbins=100, xmin=-10., xmax=10. )
+    montool.defineHistogram('ResMiddle',     type='TH1F', path='EXPERT', title="Residual from Trigger track in MIDDLE Station; Residuals (cm)", xbins=100, xmin=-10., xmax=10. )
+    montool.defineHistogram('ResOuter',      type='TH1F', path='EXPERT', title="Residual from Trigger track in OUTER Station; Residuals (cm)", xbins=100, xmin=-10., xmax=10. )
+    montool.defineHistogram('TrackEta, TrackPhi',         type='TH2F', path='EXPERT', title="Distribution of reconstructed LVL2 tracks; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 )
+    montool.defineHistogram('FailedRoIEta, FailedRoIPhi', type='TH2F', path='EXPERT', title="Location of LVL2 track failure; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 )
+    montool.defineHistogram('TIME_Total',                 type='TH1F', path='EXPERT', title="Total processing time (us)", xbins=100, xmin=0, xmax=100000 )
+    montool.defineHistogram('TIME_Data_Preparator',       type='TH1F', path='EXPERT', title="Data preparator time (us)", xbins=100, xmin=0, xmax=50000 )
+    montool.defineHistogram('TIME_Pattern_Finder',        type='TH1F', path='EXPERT', title="Pattern finder time (us)", xbins=100, xmin=0, xmax=5000 )
+    montool.defineHistogram('TIME_Station_Fitter',        type='TH1F', path='EXPERT', title="Station fitter time (us)", xbins=100, xmin=0, xmax=5000 )
+    montool.defineHistogram('TIME_Track_Fitter',          type='TH1F', path='EXPERT', title="Track fitter time (us)", xbins=100, xmin=0, xmax=300 )
+    montool.defineHistogram('TIME_Track_Extrapolator',    type='TH1F', path='EXPERT', title="Track extrapolator time (us)", xbins=100, xmin=0, xmax=300 )
+    montool.defineHistogram('TIME_Calibration_Streamer',  type='TH1F', path='EXPERT', title="Calibration streamer time (us)", xbins=100, xmin=0, xmax=50000 )
+    montool.defineHistogram('InvalidRpcRoINumber',        type='TH1F', path='EXPERT', title="RoI Number of Invalid RPC RoI; RoI Number", xbins=150, xmin=-0.5, xmax=150.5)
 
+    return montool
diff --git a/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombMonitoring.py b/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombMonitoring.py
index 61a4afb7ffe30a7340479892726885d28a47c1f1..25faa7f1cbd39aa2353c5273bda358b12a36614b 100755
--- a/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombMonitoring.py
+++ b/Trigger/TrigAlgorithms/TrigmuComb/python/TrigmuCombMonitoring.py
@@ -1,31 +1,31 @@
-# 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 AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigMuCombMonitoring(GenericMonitoringTool):
-    def __init__ (self, name = "TrigMuCombMonitoring"):
-        super(TrigMuCombMonitoring, self).__init__( name )
+def TrigMuCombMonitoring(name = "TrigMuCombMonitoring"):
 
-        self.HistPath = name
-        self.defineHistogram('Efficiency', path='EXPERT', type='TH1F', title="Monitored Track matching efficiency from #muComb", xbins=3, xmin=-1.5, xmax=1.5) 
-        self.defineHistogram('ErrorFlagMC', path='EXPERT', type='TH1F', title="Error Flags during event processing from #muComb; Error Code", xbins=12, xmin=-1.5, xmax=10.5) 
-        self.defineHistogram('MatchFlagMC', path='EXPERT', type='TH1F', title="Match Flags during matching algo from #muComb; Error Code", xbins=12, xmin=-1.5, xmax=10.5) 
-        self.defineHistogram('StrategyMC', path='EXPERT', type='TH1F', title="Combination Strategy from #muComb; Strategy Code", xbins=12, xmin=-1.5, xmax=10.5) 
-        self.defineHistogram('PtMS', path='EXPERT', type='TH1F', title="p_{T} MS from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.) 
-        self.defineHistogram('PtID', path='EXPERT', type='TH1F', title="p_{T} ID from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.) 
-        self.defineHistogram('PtMC', path='EXPERT', type='TH1F', title="p_{T} Combined from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.) 
-        self.defineHistogram('PtFL', path='EXPERT', type='TH1F', title="MS p_{T} failed matches from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.) 
-        self.defineHistogram('EtaFL', path='EXPERT', type='TH1F', title="MS Eta failed matchs from #muComb; Eta", xbins=108, xmin=-2.7, xmax=2.7) 
-        self.defineHistogram('PhiFL', path='EXPERT', type='TH1F', title="MS Phi failed matches from #muComb; Phi (rad)", xbins=96, xmin=-3.1416, xmax=3.1416) 
-        self.defineHistogram('EtaID', path='EXPERT', type='TH1F', title="Eta ID from #muComb; Eta", xbins=108, xmin=-2.7, xmax=2.7) 
-        self.defineHistogram('ZetaID', path='EXPERT', type='TH1F', title="z0 ID from #muComb; z0 (mm)", xbins=100, xmin=-200., xmax=200.) 
-        self.defineHistogram('EtaMS', path='EXPERT', type='TH1F', title="Eta MS from #muComb; Eta", xbins=108, xmin=-2.7, xmax=2.7) 
-        self.defineHistogram('ZetaMS', path='EXPERT', type='TH1F', title="z0 MS from #muComb; z0 (mm)", xbins=100, xmin=-200., xmax=200.) 
-        self.defineHistogram('DEta', path='EXPERT', type='TH1F', title="Eta difference between muon and matched ID track from #muComb; DeltaEta", xbins=100, xmin=0.0, xmax=0.2) 
-        self.defineHistogram('DPhi', path='EXPERT', type='TH1F', title="Phi difference between muon and matched ID track from #muComb; DeltaPhi (rad)", xbins=100, xmin=0.0, xmax=0.2) 
-        self.defineHistogram('DZeta', path='EXPERT', type='TH1F', title="Zeta difference between muon and matched ID track from #muComb; DeltaZeta (cm)", xbins=100, xmin=-60, xmax=60) 
-        self.defineHistogram('DeltaR', path='EXPERT', type='TH1F', title="DeltaR between muon and matched ID track from #muComb; DeltaR", xbins=100, xmin=0., xmax=0.5) 
-        self.defineHistogram('PtMS, PtID', path='EXPERT', type='TH2F', title="PtID vs PtMS from #muComb", xbins=105, xmin=-105.0, xmax=105.0, ybins=105, ymin=-105.0, ymax=105.0) 
-        self.defineHistogram('EtaMS, DEta', path='EXPERT', type='TH2F', title="Eta diff (MS-ID) vs Eta(MS) from #muComb", xbins=100, xmin=-3, xmax=3, ybins=100, ymin=0.0, ymax=0.2) 
-        self.defineHistogram('EtaMS, DPhi', path='EXPERT', type='TH2F', title="Phi diff (MS-ID) vs Eta(MS) from #muComb", xbins=100, xmin=-3, xmax=3, ybins=100, ymin=0.0, ymax=0.2) 
+    montool = GenericMonitoringTool(name, HistPath = name)
 
+    montool.defineHistogram('Efficiency', path='EXPERT', type='TH1F', title="Monitored Track matching efficiency from #muComb", xbins=3, xmin=-1.5, xmax=1.5)
+    montool.defineHistogram('ErrorFlagMC', path='EXPERT', type='TH1F', title="Error Flags during event processing from #muComb; Error Code", xbins=12, xmin=-1.5, xmax=10.5)
+    montool.defineHistogram('MatchFlagMC', path='EXPERT', type='TH1F', title="Match Flags during matching algo from #muComb; Error Code", xbins=12, xmin=-1.5, xmax=10.5)
+    montool.defineHistogram('StrategyMC', path='EXPERT', type='TH1F', title="Combination Strategy from #muComb; Strategy Code", xbins=12, xmin=-1.5, xmax=10.5)
+    montool.defineHistogram('PtMS', path='EXPERT', type='TH1F', title="p_{T} MS from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.)
+    montool.defineHistogram('PtID', path='EXPERT', type='TH1F', title="p_{T} ID from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.)
+    montool.defineHistogram('PtMC', path='EXPERT', type='TH1F', title="p_{T} Combined from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.)
+    montool.defineHistogram('PtFL', path='EXPERT', type='TH1F', title="MS p_{T} failed matches from #muComb; p_{T} (GeV/c)", xbins=210, xmin=-105., xmax=105.)
+    montool.defineHistogram('EtaFL', path='EXPERT', type='TH1F', title="MS Eta failed matchs from #muComb; Eta", xbins=108, xmin=-2.7, xmax=2.7)
+    montool.defineHistogram('PhiFL', path='EXPERT', type='TH1F', title="MS Phi failed matches from #muComb; Phi (rad)", xbins=96, xmin=-3.1416, xmax=3.1416)
+    montool.defineHistogram('EtaID', path='EXPERT', type='TH1F', title="Eta ID from #muComb; Eta", xbins=108, xmin=-2.7, xmax=2.7)
+    montool.defineHistogram('ZetaID', path='EXPERT', type='TH1F', title="z0 ID from #muComb; z0 (mm)", xbins=100, xmin=-200., xmax=200.)
+    montool.defineHistogram('EtaMS', path='EXPERT', type='TH1F', title="Eta MS from #muComb; Eta", xbins=108, xmin=-2.7, xmax=2.7)
+    montool.defineHistogram('ZetaMS', path='EXPERT', type='TH1F', title="z0 MS from #muComb; z0 (mm)", xbins=100, xmin=-200., xmax=200.)
+    montool.defineHistogram('DEta', path='EXPERT', type='TH1F', title="Eta difference between muon and matched ID track from #muComb; DeltaEta", xbins=100, xmin=0.0, xmax=0.2)
+    montool.defineHistogram('DPhi', path='EXPERT', type='TH1F', title="Phi difference between muon and matched ID track from #muComb; DeltaPhi (rad)", xbins=100, xmin=0.0, xmax=0.2)
+    montool.defineHistogram('DZeta', path='EXPERT', type='TH1F', title="Zeta difference between muon and matched ID track from #muComb; DeltaZeta (cm)", xbins=100, xmin=-60, xmax=60)
+    montool.defineHistogram('DeltaR', path='EXPERT', type='TH1F', title="DeltaR between muon and matched ID track from #muComb; DeltaR", xbins=100, xmin=0., xmax=0.5)
+    montool.defineHistogram('PtMS, PtID', path='EXPERT', type='TH2F', title="PtID vs PtMS from #muComb", xbins=105, xmin=-105.0, xmax=105.0, ybins=105, ymin=-105.0, ymax=105.0)
+    montool.defineHistogram('EtaMS, DEta', path='EXPERT', type='TH2F', title="Eta diff (MS-ID) vs Eta(MS) from #muComb", xbins=100, xmin=-3, xmax=3, ybins=100, ymin=0.0, ymax=0.2)
+    montool.defineHistogram('EtaMS, DPhi', path='EXPERT', type='TH2F', title="Phi diff (MS-ID) vs Eta(MS) from #muComb", xbins=100, xmin=-3, xmax=3, ybins=100, ymin=0.0, ymax=0.2)
+
+    return montool
diff --git a/Trigger/TrigAlgorithms/TrigmuRoI/python/TrigmuRoIMonitoring.py b/Trigger/TrigAlgorithms/TrigmuRoI/python/TrigmuRoIMonitoring.py
index 474561f238d01ace1ecd616f2556171d3dc3decf..3d8cbe6cd782a2a1807cc66d4c60862ba0eb5da4 100755
--- a/Trigger/TrigAlgorithms/TrigmuRoI/python/TrigmuRoIMonitoring.py
+++ b/Trigger/TrigAlgorithms/TrigmuRoI/python/TrigmuRoIMonitoring.py
@@ -2,11 +2,12 @@
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigmuRoIMonitoring(GenericMonitoringTool):
-    def __init__ (self, name = "TrigmuRoIMonitoring"):
-        super(TrigmuRoIMonitoring, self).__init__( name )
-
-        self.HistPath = name
-        self.defineHistogram('RpcOutOfTime', type='TH1F', path='EXPERT', title="Distribution of the BCID difference for the Rpc RoI out of Time; (Muon RoI BCID - Event BCID)",xbins=21, xmin=-10.5, xmax=10.5)
-        self.defineHistogram('TgcOutOfTime', type='TH1F', path='EXPERT', title="Distribution of the BCID difference for the Tgc RoI out of Time; (Muon RoI BCID - Event BCID)",xbins=21, xmin=-10.5, xmax=10.5)
-        self.defineHistogram('EtaOutOfTime, PhiOutOfTime', type='TH2F', path='EXPERT', title="Eta vs Phi of the Mupon RoI out of time; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 )
+def TrigmuRoIMonitoring(name = "TrigmuRoIMonitoring"):
+
+    montool = GenericMonitoringTool(name, HistPath = name)
+
+    montool.defineHistogram('RpcOutOfTime', type='TH1F', path='EXPERT', title="Distribution of the BCID difference for the Rpc RoI out of Time; (Muon RoI BCID - Event BCID)",xbins=21, xmin=-10.5, xmax=10.5)
+    montool.defineHistogram('TgcOutOfTime', type='TH1F', path='EXPERT', title="Distribution of the BCID difference for the Tgc RoI out of Time; (Muon RoI BCID - Event BCID)",xbins=21, xmin=-10.5, xmax=10.5)
+    montool.defineHistogram('EtaOutOfTime, PhiOutOfTime', type='TH2F', path='EXPERT', title="Eta vs Phi of the Mupon RoI out of time; Eta; Phi", xbins=108, xmin=-2.7, xmax=2.7, ybins=96, ymin=-3.1416, ymax=3.1416 )
+
+    return montool
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py
index 044f31f3f398ecb0c31405d881a40862688ccfae..e848cf0a88f2016b4f6af45a6fbf58c6383da3aa 100644
--- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetBtagHypoTool.py
@@ -1,9 +1,9 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
+import re
 from TrigBjetHypo.TrigBjetMonitoringConfig import TrigBjetBtagHypoToolMonitoring
 
 from AthenaCommon.Logging import logging
-
 log = logging.getLogger('TrigBjetBtagHypoTool')
 
 ####################################################################################################
@@ -44,14 +44,7 @@ monitoredChains = {
     }
 
 
-def addMonitoring(tool, monClass, name, thresholdHLT ):
-    try:
-        tool.MonTool = monClass( "MonTool" )
-        tool.MonTool.HistPath = name + "/" + thresholdHLT
-    except AttributeError:
-        log.error('%s Monitoring Tool failed', name)
-
-####################################################################################################  
+####################################################################################################
 def TrigBjetBtagHypoToolFromDict( chainDict ):
 
     chainPart = chainDict['chainParts'][0]
@@ -67,10 +60,9 @@ def TrigBjetBtagHypoToolFromDict( chainDict ):
     
     log.debug("name = %s, tagger = %s, threshold = %s ", name, tool.MethodTag, tool.BTaggingCut)
 
-    import re
     nolegname = re.sub("(^leg.*?_)", "", name)
     if nolegname in monitoredChains :
-        addMonitoring( tool, TrigBjetBtagHypoToolMonitoring,'TrigBjetOnlineMonitoring', nolegname )
+        tool.MonTool = TrigBjetBtagHypoToolMonitoring(f'TrigBjetOnlineMonitoring/{nolegname}')
 
     return tool
 
@@ -90,7 +82,6 @@ def decodeThreshold( threshold_btag ):
 
     log.debug("TrigBjetBtagHypoToolFromName: decoding threshold b%s", threshold_btag)
 
-    import re
     tagger = "offperf" if threshold_btag == "offperf" else re.findall("(.*)[0-9]{2}",threshold_btag)[0]
 
     allowedTaggers = ["offperf","hmv2c10","mv2c10","mv2c20","dl1r"]
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetMonitoringConfig.py b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetMonitoringConfig.py
index 1f9380746edc658811e6fb232940bfaaf4ff12e1..121828fc2b7212f9183f5e25e6e029127fce7b13 100755
--- a/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetMonitoringConfig.py
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/python/TrigBjetMonitoringConfig.py
@@ -1,208 +1,206 @@
-# 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 AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigBjetBtagHypoToolMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigBjetBtagHypoToolMonitoring, self).__init__(name)
-        self.defineHistogram('btag_pb', title=': Probability jets are B-jets', xbins=100, xmin=0, xmax=1, path='EXPERT', type='TH1F' )
-        self.defineHistogram('btag_pc', title=': Probability jets are Charm-jets', xbins=100, xmin=0, xmax=1, path='EXPERT', type='TH1F' )
-        self.defineHistogram('btag_pu', title=': Probability jets are Light-jets', xbins=100, xmin=0, xmax=1, path='EXPERT', type='TH1F' )
-        self.defineHistogram('btag_llr', title=': Log(P_{b}/P_{light}), Likelihood Ratio between the B-jet and Light-flavour Jet Hypotheses', xbins=100, xmin=-10, xmax=50, path='EXPERT', type='TH1F' )
+def TrigBjetBtagHypoToolMonitoring(histPath):
+    montool = GenericMonitoringTool("MonTool", HistPath = histPath)
+    montool.defineHistogram('btag_pb', title=': Probability jets are B-jets', xbins=100, xmin=0, xmax=1, path='EXPERT', type='TH1F' )
+    montool.defineHistogram('btag_pc', title=': Probability jets are Charm-jets', xbins=100, xmin=0, xmax=1, path='EXPERT', type='TH1F' )
+    montool.defineHistogram('btag_pu', title=': Probability jets are Light-jets', xbins=100, xmin=0, xmax=1, path='EXPERT', type='TH1F' )
+    montool.defineHistogram('btag_llr', title=': Log(P_{b}/P_{light}), Likelihood Ratio between the B-jet and Light-flavour Jet Hypotheses', xbins=100, xmin=-10, xmax=50, path='EXPERT', type='TH1F' )
+    return montool
 
-class TrigBjetOnlineMonitoring(GenericMonitoringTool):
-    def make_flavor_hists(self, tagger):
-        self.defineHistogram('btag_'+tagger+'_pb', title=tagger+': Probability jets are B-jets', type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1)
-        self.defineHistogram('btag_'+tagger+'_pc', title=tagger+': Probability jets are Charm-jets', type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1)
-        self.defineHistogram('btag_'+tagger+'_pu', title=tagger+': Probability jets are Light-jets', type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1)
-        self.defineHistogram('btag_'+tagger+'_llr', title=tagger+': Log(P_{b}/P_{light}), Likelihood Ratio between the B-jet and Light-flavour Jet Hypotheses', type='TH1F', path='EXPERT', xbins=100, xmin=-10, xmax=50)
 
+def TrigBjetOnlineMonitoring(name="TrigBjetOnlineMonitoring"):
 
-    def __init__ (self, name="TrigBjetOnlineMonitoring"):
-        super(TrigBjetOnlineMonitoring, self).__init__(name)
-        self.name = "TrigBjetOnlineMonitoring"
-        self.HistPath = self.name
-        default_bin_count = 100
+    def make_flavor_hists(montool, tagger):
+        montool.defineHistogram('btag_'+tagger+'_pb', title=tagger+': Probability jets are B-jets', type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1)
+        montool.defineHistogram('btag_'+tagger+'_pc', title=tagger+': Probability jets are Charm-jets', type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1)
+        montool.defineHistogram('btag_'+tagger+'_pu', title=tagger+': Probability jets are Light-jets', type='TH1F', path='EXPERT', xbins=100, xmin=0, xmax=1)
+        montool.defineHistogram('btag_'+tagger+'_llr', title=tagger+': Log(P_{b}/P_{light}), Likelihood Ratio between the B-jet and Light-flavour Jet Hypotheses', type='TH1F', path='EXPERT', xbins=100, xmin=-10, xmax=50)
 
-        # Event Histograms
-        self.defineHistogram('track_count', title="Number of Tracks per Trigger Decision", xbins = 100, xmin=0, xmax=100, path='EXPERT', type='TH1I')
-        self.defineHistogram('jet_count', title="Number of Jets Considered for B-Tagging", xbins = 20, xmin=0, xmax=20, path='EXPERT', type='TH1I')
-        self.defineHistogram('vertex_count', title="Number of Primary Vertex Candidates per Event", xbins = 200, xmin=0, xmax=200, path='EXPERT', type='TH1I')
-
-        # Primary Vertex Histogram
-        self.defineHistogram('primVtx_x', title="Primary Vertex X", xbins = default_bin_count, xmin=-2, xmax=2, path='EXPERT', type='TH1F')
-        self.defineHistogram('primVtx_y', title="Primary Vertex Y", xbins = default_bin_count, xmin=-2, xmax=2, path='EXPERT', type='TH1F')
-        self.defineHistogram('primVtx_z', title="Primary Vertex Z", xbins = default_bin_count, xmin=-300, xmax=300, path='EXPERT', type='TH1F')
-
-        ## Track Histograms
-        self.defineHistogram('track_Et', title="Track Transverse Energy;E_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=200, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_eta', title="Track #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_phi', title="Track #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_eta,track_phi', path='EXPERT', type='TH2F', title="Track #eta vs #phi;#eta;#phi",
-                             xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
-        self.defineHistogram('track_d0', title="Track d_{0};d_{0} (mm)", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_d0err', title="Track d_{0} Error;d_{0} Error (mm)", xbins = default_bin_count, xmin=0, xmax=10, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_d0sig', title="Track d_{0} Significance;d_{0} #sigma", xbins = default_bin_count, xmin=-100, xmax=100, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_z0', title="Track z_{0};z_{0} (mm)", xbins = default_bin_count, xmin=-200, xmax=200, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_z0err', title="Track z_{0} Error;z_{0} Error (mm)", xbins = default_bin_count, xmin=0, xmax=10, path='EXPERT', type='TH1F')
-        self.defineHistogram('track_z0sig', title="Track z_{0} Significance;z_{0} #sigma", xbins = default_bin_count, xmin=-1000, xmax=1000, path='EXPERT', type='TH1F')
-
-        # Jet Histograms
-        self.defineHistogram('jet_pt', title="Jet Transverse Momentum;p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, path='EXPERT', type='TH1F')
-        self.defineHistogram('jet_eta', title="Jet #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
-        self.defineHistogram('jet_phi', title="Jet #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
-        self.defineHistogram('jet_eta,jet_phi', path='EXPERT', type='TH2F', title="Jet #eta vs #phi;#eta;#phi",
-                             xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
-
-        self.defineHistogram('Bjet_pt', title="B-Tagged Jet Transverse Momentum;p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, path='EXPERT', type='TH1F')
-        self.defineHistogram('Bjet_eta', title="B-Tagged Jet #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
-        self.defineHistogram('Bjet_phi', title="B-Tagged Jet #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
-        self.defineHistogram('Bjet_eta,Bjet_phi', path='EXPERT', type='TH2F', title="B-Tagged Jet #eta vs #phi;#eta;#phi",
-                             xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
-
-        self.defineHistogram('jet_bjet_delta_pt', title="Transverse Momentum Difference Between Jet and B-Tagged Jet;#Delta p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, path='EXPERT', type='TH1F')
-        self.defineHistogram('jet_bjet_delta_eta', title="#eta Difference Between Jet and B-Tagged Jet;#Delta #eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
-        self.defineHistogram('jet_bjet_delta_phi', title="#phi Difference Between Jet and B-Tagged Jet;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
-        self.defineHistogram('jet_bjet_delta_eta,jet_phi', path='EXPERT', type='TH2F', title="#Delta #eta vs #Delta #phi for Jet and B-Tagged Jet;#Delta #eta;#Delta #phi",
-                             xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
-
-
-        # B-Tagging Histograms
-        for tagger in ['IP2D', 'IP3D', 'DL1r', 'rnnip']: self.make_flavor_hists(tagger)
-
-        self.defineHistogram('MV2c10_discriminant', title="MV2c10 Score", xbins = default_bin_count, xmin=-1, xmax=1, path='EXPERT', type='TH1F')
-
-
-        self.defineHistogram('JetFitter_N2Tpair',
-            title='JetFitter: Number of 2-Track Pairs',
-            path='EXPERT', type='TH1I', xbins=100, xmin=0, xmax=100)
-        self.defineHistogram('JetFitter_nVTX',
-            title='JetFitter: Number of Vertices Used',
-            path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
-        self.defineHistogram('JetFitter_nSingleTracks',
-            title='JetFitter: Number of Single Tracks',
-            path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
-        self.defineHistogram('JetFitter_nTracksAtVtx',
-            title='JetFitter: Number of Tracks Associated with Vertex',
-            path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
-        self.defineHistogram('JetFitter_mass',
-            title='JetFitter: Invariant Mass of All Tracks Associated to Vertex',
-            path='EXPERT', type='TH1F', xbins=1000, xmin=0, xmax=20000)
-        self.defineHistogram('JetFitter_energyFraction',
-            title='JetFitter: Fraction of Charged Jet Energy in Secondary Vertices',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1.1)
-        self.defineHistogram('JetFitter_significance3d',
-            title='JetFitter: Significance-3D',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=100)
-        self.defineHistogram('JetFitter_deltaeta',
-            title='JetFitter: #Delta #eta Between Jet and Track Momentum Sum',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
-        self.defineHistogram('JetFitter_deltaphi',
-            title='JetFitter: #Delta #phi Between Jet and Track Momentum Sum',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
-        self.defineHistogram('JetFitter_isDefaults',
-            title='JetFitter: Fraction of Defaulted Jets; 1 -> Jet Has Defaulted, 0 -> Jet is Valid',
-            path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
-        self.defineHistogram('JetFitter_deltaR',
-            title='JetFitter: #Delta R Between Jet and Track Momentum Sum',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
-
-        self.defineHistogram('SV1_NGTinSvx',
-            title='SV1: Number of "Good" Tracks in Vertex',
-            path='EXPERT', type='TH1I', xbins=100, xmin=0, xmax=100)
-        self.defineHistogram('SV1_masssvx',
-            title='SV1: Invariant Mass of All Tracks Associated to Vertex',
-            path='EXPERT', type='TH1F', xbins=1000, xmin=0, xmax=10000)
-        self.defineHistogram('SV1_isDefaults',
-            title='SV1: Fraction of Defaulted Jets; 1 -> Jet Has Defaulted, 0 -> Jet is Valid',
-            path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
-        self.defineHistogram('SV1_N2Tpair',
-            title='SV1: Number of 2-Track Pairs',
-            path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
-        self.defineHistogram('SV1_efracsvx',
-            title='SV1: Ratio of Energy in Vertex Tracks to All Tracks in Jet ',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1.1)
-        self.defineHistogram('SV1_deltaR',
-            title='SV1: #Delta R Between Jet and Track Momentum Sum',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
-        self.defineHistogram('SV1_Lxy',
-            title='SV1: Transverse Distance Between Primary and Secondary Vertices',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=100)
-        self.defineHistogram('SV1_L3d',
-            title='SV1: Total Distance Between Primary and Secondary Vertices',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=100)
-        self.defineHistogram('SV1_significance3d',
-            title='SV1: Significance-3D',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=50)
-
-        self.defineHistogram('IP2D_isDefaults',
-            title='IP2D_isDefaults',
-            path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
-        self.defineHistogram('IP2D_bu',
-            title='IP2D: Log(P_{b}/P_{light}), Likelihood ratio between the b-jet and light-flavour jet hypotheses',
-            path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
-        self.defineHistogram('IP2D_bc',
-            title='IP2D: Log(P_{b}/P_{c}), Likelihood ratio between the b-jet and c-jet hypotheses',
-            path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
-        self.defineHistogram('IP2D_cu',
-            title='IP2D: Log(P_{c}/P_{light}), Likelihood ratio between the c-jet and light-flavour jet hypotheses',
-            path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
-
-        self.defineHistogram('IP3D_isDefaults',
-            title='IP3D_isDefaults',
-            path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
-        self.defineHistogram('IP3D_bu',
-            title='IP3D: Log(P_{b}/P_{light}), Likelihood ratio between the b-jet and light-flavour jet hypotheses',
-            path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
-        self.defineHistogram('IP3D_bc',
-            title='IP3D: Log(P_{b}/P_{c}), Likelihood ratio between the b-jet and c-jet hypotheses',
-            path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
-        self.defineHistogram('IP3D_cu',
-            title='IP3D: Log(P_{c}/P_{light}), Likelihood ratio between the c-jet and light-flavour jet hypotheses',
-            path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
-                  
-        self.defineHistogram('JetFitterSecondaryVertex_nTracks',
-            title='JFSV: Number of Tracks',
-            path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
-        self.defineHistogram('JetFitterSecondaryVertex_isDefaults',
-            title='JFSV: Fraction of Defaulted Jets; 1 -> Jet Has Defaulted, 0 -> Jet is Valid',
-            path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
-        self.defineHistogram('JetFitterSecondaryVertex_mass',
-            title='JFSV: Invariant Mass of All Tracks Associated to Vertex',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1e4)
-        self.defineHistogram('JetFitterSecondaryVertex_energy',
-            title='JFSV: Energy of All Tracks Associated to Vertex',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1e6)
-        self.defineHistogram('JetFitterSecondaryVertex_energyFraction',
-            title='JFSV: Fraction of Charged Jet Energy in Secondary Vertices',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1.1)
-        self.defineHistogram('JetFitterSecondaryVertex_displacement3d',
-            title='JFSV: Total Distance Between Primary and Secondary Vertices',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=500)
-        self.defineHistogram('JetFitterSecondaryVertex_displacement2d',
-            title='JFSV: Transverse Distance Between Primary and Secondary Vertices',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=500)
-        self.defineHistogram('JetFitterSecondaryVertex_maximumTrackRelativeEta',
-            title='JFSV: Max #eta Between Track and Jet for Tracks from the SV',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
-        self.defineHistogram('JetFitterSecondaryVertex_minimumTrackRelativeEta',
-            title='JFSV: Min #eta Between Track and Jet Vector for Tracks from the SV',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
-        self.defineHistogram('JetFitterSecondaryVertex_averageTrackRelativeEta',
-            title='JFSV: Average #eta Between Track and Jet Vector for Tracks from the SV',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
-        self.defineHistogram('JetFitterSecondaryVertex_maximumAllJetTrackRelativeEta',
-            title='JFSV: Maximum #eta Between Track and Jet Vector for All Tracks from the Jet',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
-        self.defineHistogram('JetFitterSecondaryVertex_minimumAllJetTrackRelativeEta',
-            title='JFSV: Minimum #eta Between Track and Jet Vector for All Tracks from the Jet',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
-        self.defineHistogram('JetFitterSecondaryVertex_averageAllJetTrackRelativeEta',
-            title='JFSV: Average #eta Between Track and Jet Vector for All Tracks from the Jet',
-            path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
-
-
-        self.defineHistogram('IP3D_valD0wrtPVofTracks', title="Track d_{0} w/ Respect to PV of Tracks of IP3D;d_{0} (mm)", xmin=-2, xmax=2, xbins = default_bin_count, path='EXPERT', type='TH1F')
-        self.defineHistogram('IP3D_sigD0wrtPVofTracks', title="Track d_{0} Significance w/ Respect to PV of Tracks of IP3D;d_{0} #sigma", xmin=-100, xmax=100, xbins = default_bin_count, path='EXPERT', type='TH1F')
-        self.defineHistogram('IP3D_valZ0wrtPVofTracks', title="Track z_{0} w/ Respect to PV of Tracks of IP3D;z_{0} (mm)", xmin=-2, xmax=2, xbins = default_bin_count, path='EXPERT', type='TH1F')
-        self.defineHistogram('IP3D_sigZ0wrtPVofTracks', title="Track z_{0} Significance w/ Respect to PV of Tracks of IP3D;z_{0} #sigma", xmin=-100, xmax=100, xbins = default_bin_count, path='EXPERT', type='TH1F')
+    montool = GenericMonitoringTool(name, HistPath = name)
+    default_bin_count = 100
 
+        # Event Histograms
+    montool.defineHistogram('track_count', title="Number of Tracks per Trigger Decision", xbins = 100, xmin=0, xmax=100, path='EXPERT', type='TH1I')
+    montool.defineHistogram('jet_count', title="Number of Jets Considered for B-Tagging", xbins = 20, xmin=0, xmax=20, path='EXPERT', type='TH1I')
+    montool.defineHistogram('vertex_count', title="Number of Primary Vertex Candidates per Event", xbins = 200, xmin=0, xmax=200, path='EXPERT', type='TH1I')
+
+    # Primary Vertex Histogram
+    montool.defineHistogram('primVtx_x', title="Primary Vertex X", xbins = default_bin_count, xmin=-2, xmax=2, path='EXPERT', type='TH1F')
+    montool.defineHistogram('primVtx_y', title="Primary Vertex Y", xbins = default_bin_count, xmin=-2, xmax=2, path='EXPERT', type='TH1F')
+    montool.defineHistogram('primVtx_z', title="Primary Vertex Z", xbins = default_bin_count, xmin=-300, xmax=300, path='EXPERT', type='TH1F')
+
+    ## Track Histograms
+    montool.defineHistogram('track_Et', title="Track Transverse Energy;E_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=200, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_eta', title="Track #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_phi', title="Track #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_eta,track_phi', path='EXPERT', type='TH2F', title="Track #eta vs #phi;#eta;#phi",
+                         xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
+    montool.defineHistogram('track_d0', title="Track d_{0};d_{0} (mm)", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_d0err', title="Track d_{0} Error;d_{0} Error (mm)", xbins = default_bin_count, xmin=0, xmax=10, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_d0sig', title="Track d_{0} Significance;d_{0} #sigma", xbins = default_bin_count, xmin=-100, xmax=100, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_z0', title="Track z_{0};z_{0} (mm)", xbins = default_bin_count, xmin=-200, xmax=200, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_z0err', title="Track z_{0} Error;z_{0} Error (mm)", xbins = default_bin_count, xmin=0, xmax=10, path='EXPERT', type='TH1F')
+    montool.defineHistogram('track_z0sig', title="Track z_{0} Significance;z_{0} #sigma", xbins = default_bin_count, xmin=-1000, xmax=1000, path='EXPERT', type='TH1F')
+
+    # Jet Histograms
+    montool.defineHistogram('jet_pt', title="Jet Transverse Momentum;p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, path='EXPERT', type='TH1F')
+    montool.defineHistogram('jet_eta', title="Jet #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('jet_phi', title="Jet #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('jet_eta,jet_phi', path='EXPERT', type='TH2F', title="Jet #eta vs #phi;#eta;#phi",
+                         xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
+
+    montool.defineHistogram('Bjet_pt', title="B-Tagged Jet Transverse Momentum;p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, path='EXPERT', type='TH1F')
+    montool.defineHistogram('Bjet_eta', title="B-Tagged Jet #eta;#eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('Bjet_phi', title="B-Tagged Jet #phi;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('Bjet_eta,Bjet_phi', path='EXPERT', type='TH2F', title="B-Tagged Jet #eta vs #phi;#eta;#phi",
+                         xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
+
+    montool.defineHistogram('jet_bjet_delta_pt', title="Transverse Momentum Difference Between Jet and B-Tagged Jet;#Delta p_{T} (GeV)", xbins = default_bin_count, xmin=0, xmax=1000, path='EXPERT', type='TH1F')
+    montool.defineHistogram('jet_bjet_delta_eta', title="#eta Difference Between Jet and B-Tagged Jet;#Delta #eta", xbins = default_bin_count, xmin=-5, xmax=5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('jet_bjet_delta_phi', title="#phi Difference Between Jet and B-Tagged Jet;#phi", xbins = default_bin_count, xmin=-3.5, xmax=3.5, path='EXPERT', type='TH1F')
+    montool.defineHistogram('jet_bjet_delta_eta,jet_phi', path='EXPERT', type='TH2F', title="#Delta #eta vs #Delta #phi for Jet and B-Tagged Jet;#Delta #eta;#Delta #phi",
+                         xbins = default_bin_count, xmin=-5, xmax=5, ybins = default_bin_count, ymin=-4, ymax=4)
+
+
+    # B-Tagging Histograms
+    for tagger in ['IP2D', 'IP3D', 'DL1r', 'rnnip']: make_flavor_hists(montool, tagger)
+
+    montool.defineHistogram('MV2c10_discriminant', title="MV2c10 Score", xbins = default_bin_count, xmin=-1, xmax=1, path='EXPERT', type='TH1F')
+
+
+    montool.defineHistogram('JetFitter_N2Tpair',
+        title='JetFitter: Number of 2-Track Pairs',
+        path='EXPERT', type='TH1I', xbins=100, xmin=0, xmax=100)
+    montool.defineHistogram('JetFitter_nVTX',
+        title='JetFitter: Number of Vertices Used',
+        path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram('JetFitter_nSingleTracks',
+        title='JetFitter: Number of Single Tracks',
+        path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram('JetFitter_nTracksAtVtx',
+        title='JetFitter: Number of Tracks Associated with Vertex',
+        path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram('JetFitter_mass',
+        title='JetFitter: Invariant Mass of All Tracks Associated to Vertex',
+        path='EXPERT', type='TH1F', xbins=1000, xmin=0, xmax=20000)
+    montool.defineHistogram('JetFitter_energyFraction',
+        title='JetFitter: Fraction of Charged Jet Energy in Secondary Vertices',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1.1)
+    montool.defineHistogram('JetFitter_significance3d',
+        title='JetFitter: Significance-3D',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=100)
+    montool.defineHistogram('JetFitter_deltaeta',
+        title='JetFitter: #Delta #eta Between Jet and Track Momentum Sum',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
+    montool.defineHistogram('JetFitter_deltaphi',
+        title='JetFitter: #Delta #phi Between Jet and Track Momentum Sum',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
+    montool.defineHistogram('JetFitter_isDefaults',
+        title='JetFitter: Fraction of Defaulted Jets; 1 -> Jet Has Defaulted, 0 -> Jet is Valid',
+        path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
+    montool.defineHistogram('JetFitter_deltaR',
+        title='JetFitter: #Delta R Between Jet and Track Momentum Sum',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
+
+    montool.defineHistogram('SV1_NGTinSvx',
+        title='SV1: Number of "Good" Tracks in Vertex',
+        path='EXPERT', type='TH1I', xbins=100, xmin=0, xmax=100)
+    montool.defineHistogram('SV1_masssvx',
+        title='SV1: Invariant Mass of All Tracks Associated to Vertex',
+        path='EXPERT', type='TH1F', xbins=1000, xmin=0, xmax=10000)
+    montool.defineHistogram('SV1_isDefaults',
+        title='SV1: Fraction of Defaulted Jets; 1 -> Jet Has Defaulted, 0 -> Jet is Valid',
+        path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
+    montool.defineHistogram('SV1_N2Tpair',
+        title='SV1: Number of 2-Track Pairs',
+        path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram('SV1_efracsvx',
+        title='SV1: Ratio of Energy in Vertex Tracks to All Tracks in Jet ',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1.1)
+    montool.defineHistogram('SV1_deltaR',
+        title='SV1: #Delta R Between Jet and Track Momentum Sum',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=2)
+    montool.defineHistogram('SV1_Lxy',
+        title='SV1: Transverse Distance Between Primary and Secondary Vertices',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=100)
+    montool.defineHistogram('SV1_L3d',
+        title='SV1: Total Distance Between Primary and Secondary Vertices',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=100)
+    montool.defineHistogram('SV1_significance3d',
+        title='SV1: Significance-3D',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=50)
+
+    montool.defineHistogram('IP2D_isDefaults',
+        title='IP2D_isDefaults',
+        path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
+    montool.defineHistogram('IP2D_bu',
+        title='IP2D: Log(P_{b}/P_{light}), Likelihood ratio between the b-jet and light-flavour jet hypotheses',
+        path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
+    montool.defineHistogram('IP2D_bc',
+        title='IP2D: Log(P_{b}/P_{c}), Likelihood ratio between the b-jet and c-jet hypotheses',
+        path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
+    montool.defineHistogram('IP2D_cu',
+        title='IP2D: Log(P_{c}/P_{light}), Likelihood ratio between the c-jet and light-flavour jet hypotheses',
+        path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
+
+    montool.defineHistogram('IP3D_isDefaults',
+        title='IP3D_isDefaults',
+        path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
+    montool.defineHistogram('IP3D_bu',
+        title='IP3D: Log(P_{b}/P_{light}), Likelihood ratio between the b-jet and light-flavour jet hypotheses',
+        path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
+    montool.defineHistogram('IP3D_bc',
+        title='IP3D: Log(P_{b}/P_{c}), Likelihood ratio between the b-jet and c-jet hypotheses',
+        path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
+    montool.defineHistogram('IP3D_cu',
+        title='IP3D: Log(P_{c}/P_{light}), Likelihood ratio between the c-jet and light-flavour jet hypotheses',
+        path='EXPERT', type='TH1F', xbins=100, xmin=-10, xmax=50)
+
+    montool.defineHistogram('JetFitterSecondaryVertex_nTracks',
+        title='JFSV: Number of Tracks',
+        path='EXPERT', type='TH1I', xbins=50, xmin=0, xmax=50)
+    montool.defineHistogram('JetFitterSecondaryVertex_isDefaults',
+        title='JFSV: Fraction of Defaulted Jets; 1 -> Jet Has Defaulted, 0 -> Jet is Valid',
+        path='EXPERT', type='TH1I', xbins=2, xmin=0, xmax=2)
+    montool.defineHistogram('JetFitterSecondaryVertex_mass',
+        title='JFSV: Invariant Mass of All Tracks Associated to Vertex',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1e4)
+    montool.defineHistogram('JetFitterSecondaryVertex_energy',
+        title='JFSV: Energy of All Tracks Associated to Vertex',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1e6)
+    montool.defineHistogram('JetFitterSecondaryVertex_energyFraction',
+        title='JFSV: Fraction of Charged Jet Energy in Secondary Vertices',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=1.1)
+    montool.defineHistogram('JetFitterSecondaryVertex_displacement3d',
+        title='JFSV: Total Distance Between Primary and Secondary Vertices',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=500)
+    montool.defineHistogram('JetFitterSecondaryVertex_displacement2d',
+        title='JFSV: Transverse Distance Between Primary and Secondary Vertices',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=500)
+    montool.defineHistogram('JetFitterSecondaryVertex_maximumTrackRelativeEta',
+        title='JFSV: Max #eta Between Track and Jet for Tracks from the SV',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
+    montool.defineHistogram('JetFitterSecondaryVertex_minimumTrackRelativeEta',
+        title='JFSV: Min #eta Between Track and Jet Vector for Tracks from the SV',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
+    montool.defineHistogram('JetFitterSecondaryVertex_averageTrackRelativeEta',
+        title='JFSV: Average #eta Between Track and Jet Vector for Tracks from the SV',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
+    montool.defineHistogram('JetFitterSecondaryVertex_maximumAllJetTrackRelativeEta',
+        title='JFSV: Maximum #eta Between Track and Jet Vector for All Tracks from the Jet',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
+    montool.defineHistogram('JetFitterSecondaryVertex_minimumAllJetTrackRelativeEta',
+        title='JFSV: Minimum #eta Between Track and Jet Vector for All Tracks from the Jet',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
+    montool.defineHistogram('JetFitterSecondaryVertex_averageAllJetTrackRelativeEta',
+        title='JFSV: Average #eta Between Track and Jet Vector for All Tracks from the Jet',
+        path='EXPERT', type='TH1F', xbins=100, xmin=0, xmax=8)
+
+    montool.defineHistogram('IP3D_valD0wrtPVofTracks', title="Track d_{0} w/ Respect to PV of Tracks of IP3D;d_{0} (mm)", xmin=-2, xmax=2, xbins = default_bin_count, path='EXPERT', type='TH1F')
+    montool.defineHistogram('IP3D_sigD0wrtPVofTracks', title="Track d_{0} Significance w/ Respect to PV of Tracks of IP3D;d_{0} #sigma", xmin=-100, xmax=100, xbins = default_bin_count, path='EXPERT', type='TH1F')
+    montool.defineHistogram('IP3D_valZ0wrtPVofTracks', title="Track z_{0} w/ Respect to PV of Tracks of IP3D;z_{0} (mm)", xmin=-2, xmax=2, xbins = default_bin_count, path='EXPERT', type='TH1F')
+    montool.defineHistogram('IP3D_sigZ0wrtPVofTracks', title="Track z_{0} Significance w/ Respect to PV of Tracks of IP3D;z_{0} #sigma", xmin=-100, xmax=100, xbins = default_bin_count, path='EXPERT', type='TH1F')
+
+    return montool
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoMonitoringConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoMonitoringConfig.py
index eb7a96b0adf27f26fed707954617161beb06e78e..c5ce71eed8951fc677820c878586097cb4e1eba4 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoMonitoringConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoMonitoringConfig.py
@@ -1,24 +1,24 @@
-# 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 AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
+from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigBmumuxComboHypoMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigBmumuxComboHypoMonitoring, self).__init__(name)
-        self.Histograms = [
-        defineHistogram('nDimuon', type='TH1F', path='EXPERT', title="number of fitted dimuon vertices", xbins=10, xmin=0, xmax=10),
-        defineHistogram('nTrk', type='TH1F', path='EXPERT', title="number of merged tracks in extended RoIs", xbins=200, xmin=0, xmax=200),
-        defineHistogram('nSelectedTrk', type='TH1F', path='EXPERT', title="number of tracks in vicinity of dimuon vertex", xbins=200, xmin=0, xmax=200),
-        defineHistogram('nBPhysObject', type='TH1F', path='EXPERT', title="number of fitted BPhysObjects", xbins=100, xmin=0, xmax=100),
-        ]
+def TrigBmumuxComboHypoMonitoring(name):
+    montool = GenericMonitoringTool(name)
 
-class TrigBmumuxComboHypoToolMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigBmumuxComboHypoToolMonitoring, self).__init__(name)
-        self.Histograms = [
-        defineHistogram('Chi2', type='TH1F', path='EXPERT', title="chi2 of the fitted vertex", xbins=100, xmin=0, xmax=100),
-        defineHistogram('Fitmass', type='TH1F', path='EXPERT', title="mass of BPhys object", xbins=100, xmin=4000, xmax=8000),
-        defineHistogram('Mass', type='TH1F', path='EXPERT', title="mass(BPhys object) - mass(dimuon) + PDG::mJpsi", xbins=100, xmin=4000, xmax=8000),
-        defineHistogram('Pt', type='TH1F', path='EXPERT', title="p_{T} of BPhys object [MeV]", xbins=100, xmin=0, xmax=40000),
-        defineHistogram('Eta', type='TH1F', path='EXPERT', title="#eta_{T} of BPhys object", xbins=100, xmin=-3.15, xmax=3.15)
-        ]
+    montool.defineHistogram('nDimuon', type='TH1F', path='EXPERT', title="number of fitted dimuon vertices", xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('nTrk', type='TH1F', path='EXPERT', title="number of merged tracks in extended RoIs", xbins=200, xmin=0, xmax=200)
+    montool.defineHistogram('nSelectedTrk', type='TH1F', path='EXPERT', title="number of tracks in vicinity of dimuon vertex", xbins=200, xmin=0, xmax=200)
+    montool.defineHistogram('nBPhysObject', type='TH1F', path='EXPERT', title="number of fitted BPhysObjects", xbins=100, xmin=0, xmax=100),
+
+    return montool
+
+def TrigBmumuxComboHypoToolMonitoring(name):
+    montool = GenericMonitoringTool(name)
+
+    montool.defineHistogram('Chi2', type='TH1F', path='EXPERT', title="chi2 of the fitted vertex", xbins=100, xmin=0, xmax=100)
+    montool.defineHistogram('Fitmass', type='TH1F', path='EXPERT', title="mass of BPhys object", xbins=100, xmin=4000, xmax=8000)
+    montool.defineHistogram('Mass', type='TH1F', path='EXPERT', title="mass(BPhys object) - mass(dimuon) + PDG::mJpsi", xbins=100, xmin=4000, xmax=8000)
+    montool.defineHistogram('Pt', type='TH1F', path='EXPERT', title="p_{T} of BPhys object [MeV]", xbins=100, xmin=0, xmax=40000)
+    montool.defineHistogram('Eta', type='TH1F', path='EXPERT', title="#eta_{T} of BPhys object", xbins=100, xmin=-3.15, xmax=3.15)
+
+    return montool
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoMonitoringConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoMonitoringConfig.py
index 8714c396b23c22fc54045152c3b6660118974d94..4a685161fb5c73fb365ea4407547458fcbfe8335 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoMonitoringConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoMonitoringConfig.py
@@ -2,49 +2,56 @@
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
 
-class TrigMultiTrkComboHypoMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigMultiTrkComboHypoMonitoring, self).__init__(name)
-        if 'Streamer' in name:
-            self.Histograms = [
-            defineHistogram('nAcceptedTrk', type='TH1F', path='EXPERT', title="number of selected input tracks", xbins=100, xmin=0, xmax=100),
-            defineHistogram('nVertexFitterCalls', type='TH1F', path='EXPERT', title="number of calls for vertex fit", xbins=200, xmin=0, xmax=200),
-            defineHistogram('acceptance', type='TH1F',path='EXPERT', title="filter acceptance", xbins=2, xmin=0, xmax=2),
-            defineHistogram('TIME_all', type='TH1F', path='EXPERT', title='execution time; [microseconds]', xbins=100, xmin=0, xmax=1000),
-            ]
-        else:
-            self.Histograms = [
-            defineHistogram('nAcceptedTrk', type='TH1F', path='EXPERT', title="number of selected input tracks", xbins=100, xmin=0, xmax=100),
-            defineHistogram('nCombination', type='TH1F',path='EXPERT', title="number of track combinations before mass preselection", xbins=100, xmin=0, xmax=100),
-            defineHistogram('nCombinationBeforeFit', type='TH1F', path='EXPERT', title="number of inputs to the vertex fitter", xbins=100, xmin=0, xmax=100),
-            defineHistogram('nBPhysObject', type='TH1F', path='EXPERT', title="number of fitted BPhysObjects", xbins=100, xmin=0, xmax=100),
-            defineHistogram('trkMassBeforeFit', type='TH1F', path='EXPERT', title="mass of track combinations BEFORE fit [GeV]", xbins=200, xmin=0, xmax=100),
-            defineHistogram('bphysChi2', type='TH1F', path='EXPERT', title="chi2 fit of N tracks; fit chi2 of N selected tracks", xbins=100, xmin=0, xmax=100),
-            defineHistogram('bphysFitMass', type='TH1F', path='EXPERT', title="fit mass of N tracks; fit mass of N selected tracks [GeV]", xbins=100, xmin=0, xmax=20),
-            defineHistogram('bphysMass', type='TH1F', path='EXPERT', title="mass of N tracks; mass of N selected tracks [GeV]", xbins=100, xmin=0, xmax=20),
-            defineHistogram('bphysCharge', type='TH1F', path='EXPERT', title="total charge of N tracks; Total Charge", xbins=20, xmin=-10, xmax=10),
-            defineHistogram('bphysLxy', type='TH1F', path='EXPERT', title="Lxy of Vertex; [mm]", xbins=30, xmin=-10, xmax=20),
-            defineHistogram('TIME_all', type='TH1F', path='EXPERT', title='execution time; [microseconds]', xbins=100, xmin=0, xmax=1000),
-            defineHistogram('bphysd0_trk1', type='TH1F', path='EXPERT', title="d0 of Vertex first track; [mm]", xbins=30, xmin=-10, xmax=10),
-            defineHistogram('bphysd0_trk2', type='TH1F', path='EXPERT', title="d0 of Vertex second track; [mm]", xbins=30, xmin=-10, xmax=10),
-            defineHistogram('bphysPt_trk1', type='TH1F', path='EXPERT', title="p_{T} of Vertex first track; [GeV]", xbins=60, xmin=0, xmax=60),
-            defineHistogram('bphysPt_trk2', type='TH1F', path='EXPERT', title="p_{T} of Vertex second track; [GeV]", xbins=60, xmin=0, xmax=60),
-            defineHistogram('bphysEtatrack1', type='TH1F', path='EXPERT', title="Eta of Vertex first track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
-            defineHistogram('bphysEtatrack2', type='TH1F', path='EXPERT', title="Eta of Vertex second track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
-            ]
-
-class TrigMultiTrkComboHypoToolMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigMultiTrkComboHypoToolMonitoring, self).__init__(name)
-        self.Histograms = [
-        defineHistogram('totalCharge', type='TH1F', path='EXPERT', title="Total Charge of N tracks; total charge", xbins=20, xmin=-10, xmax=10),
-        defineHistogram('chi2', type='TH1F', path='EXPERT', title="chi2 fit of N tracks; vertex chi2", xbins=100, xmin=0, xmax=100),
-        defineHistogram('mass', type='TH1F', path='EXPERT', title="mass of track pairs; m_{#mu#mu} [GeV]", xbins=100, xmin=0, xmax=20),
-        defineHistogram('Lxy', type='TH1F', path='EXPERT', title="Lxy of Vertex; [mm]", xbins=30, xmin=-10, xmax=20),
-        defineHistogram('pT_trk1', type='TH1F', path='EXPERT', title="p_{T} of the first track; p_{T}(#mu_{1}) [GeV]", xbins=100, xmin=0, xmax=40),
-        defineHistogram('pT_trk2', type='TH1F', path='EXPERT', title="p_{T} of the second track; p_{T}(#mu_{2}) [GeV]", xbins=100, xmin=0, xmax=40),
-        defineHistogram('d0_trk1', type='TH1F', path='EXPERT', title="d0 of the first track; d0(#mu_{1}) [mm]", xbins=100, xmin=-10, xmax=10),
-        defineHistogram('d0_trk2', type='TH1F', path='EXPERT', title="d0 of the second track; d0(#mu_{2}) [mm]", xbins=100, xmin=-10, xmax=10),
-        defineHistogram('eta_trk1', type='TH1F', path='EXPERT', title="Eta of Vertex first track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
-        defineHistogram('eta_trk2', type='TH1F', path='EXPERT', title="Eta of Vertex second track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
+def TrigMultiTrkComboHypoMonitoring(name):
+
+    montool = GenericMonitoringTool(name)
+
+    if 'Streamer' in name:
+        montool.Histograms = [
+        defineHistogram('nAcceptedTrk', type='TH1F', path='EXPERT', title="number of selected input tracks", xbins=100, xmin=0, xmax=100),
+        defineHistogram('nVertexFitterCalls', type='TH1F', path='EXPERT', title="number of calls for vertex fit", xbins=200, xmin=0, xmax=200),
+        defineHistogram('acceptance', type='TH1F',path='EXPERT', title="filter acceptance", xbins=2, xmin=0, xmax=2),
+        defineHistogram('TIME_all', type='TH1F', path='EXPERT', title='execution time; [microseconds]', xbins=100, xmin=0, xmax=1000),
+        ]
+    else:
+        montool.Histograms = [
+        defineHistogram('nAcceptedTrk', type='TH1F', path='EXPERT', title="number of selected input tracks", xbins=100, xmin=0, xmax=100),
+        defineHistogram('nCombination', type='TH1F',path='EXPERT', title="number of track combinations before mass preselection", xbins=100, xmin=0, xmax=100),
+        defineHistogram('nCombinationBeforeFit', type='TH1F', path='EXPERT', title="number of inputs to the vertex fitter", xbins=100, xmin=0, xmax=100),
+        defineHistogram('nBPhysObject', type='TH1F', path='EXPERT', title="number of fitted BPhysObjects", xbins=100, xmin=0, xmax=100),
+        defineHistogram('trkMassBeforeFit', type='TH1F', path='EXPERT', title="mass of track combinations BEFORE fit [GeV]", xbins=200, xmin=0, xmax=100),
+        defineHistogram('bphysChi2', type='TH1F', path='EXPERT', title="chi2 fit of N tracks; fit chi2 of N selected tracks", xbins=100, xmin=0, xmax=100),
+        defineHistogram('bphysFitMass', type='TH1F', path='EXPERT', title="fit mass of N tracks; fit mass of N selected tracks [GeV]", xbins=100, xmin=0, xmax=20),
+        defineHistogram('bphysMass', type='TH1F', path='EXPERT', title="mass of N tracks; mass of N selected tracks [GeV]", xbins=100, xmin=0, xmax=20),
+        defineHistogram('bphysCharge', type='TH1F', path='EXPERT', title="total charge of N tracks; Total Charge", xbins=20, xmin=-10, xmax=10),
+        defineHistogram('bphysLxy', type='TH1F', path='EXPERT', title="Lxy of Vertex; [mm]", xbins=30, xmin=-10, xmax=20),
+        defineHistogram('TIME_all', type='TH1F', path='EXPERT', title='execution time; [microseconds]', xbins=100, xmin=0, xmax=1000),
+        defineHistogram('bphysd0_trk1', type='TH1F', path='EXPERT', title="d0 of Vertex first track; [mm]", xbins=30, xmin=-10, xmax=10),
+        defineHistogram('bphysd0_trk2', type='TH1F', path='EXPERT', title="d0 of Vertex second track; [mm]", xbins=30, xmin=-10, xmax=10),
+        defineHistogram('bphysPt_trk1', type='TH1F', path='EXPERT', title="p_{T} of Vertex first track; [GeV]", xbins=60, xmin=0, xmax=60),
+        defineHistogram('bphysPt_trk2', type='TH1F', path='EXPERT', title="p_{T} of Vertex second track; [GeV]", xbins=60, xmin=0, xmax=60),
+        defineHistogram('bphysEtatrack1', type='TH1F', path='EXPERT', title="Eta of Vertex first track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
+        defineHistogram('bphysEtatrack2', type='TH1F', path='EXPERT', title="Eta of Vertex second track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
         ]
+
+    return montool
+
+
+def TrigMultiTrkComboHypoToolMonitoring(name):
+
+    montool = GenericMonitoringTool(name)
+
+    montool.Histograms = [
+    defineHistogram('totalCharge', type='TH1F', path='EXPERT', title="Total Charge of N tracks; total charge", xbins=20, xmin=-10, xmax=10),
+    defineHistogram('chi2', type='TH1F', path='EXPERT', title="chi2 fit of N tracks; vertex chi2", xbins=100, xmin=0, xmax=100),
+    defineHistogram('mass', type='TH1F', path='EXPERT', title="mass of track pairs; m_{#mu#mu} [GeV]", xbins=100, xmin=0, xmax=20),
+    defineHistogram('Lxy', type='TH1F', path='EXPERT', title="Lxy of Vertex; [mm]", xbins=30, xmin=-10, xmax=20),
+    defineHistogram('pT_trk1', type='TH1F', path='EXPERT', title="p_{T} of the first track; p_{T}(#mu_{1}) [GeV]", xbins=100, xmin=0, xmax=40),
+    defineHistogram('pT_trk2', type='TH1F', path='EXPERT', title="p_{T} of the second track; p_{T}(#mu_{2}) [GeV]", xbins=100, xmin=0, xmax=40),
+    defineHistogram('d0_trk1', type='TH1F', path='EXPERT', title="d0 of the first track; d0(#mu_{1}) [mm]", xbins=100, xmin=-10, xmax=10),
+    defineHistogram('d0_trk2', type='TH1F', path='EXPERT', title="d0 of the second track; d0(#mu_{2}) [mm]", xbins=100, xmin=-10, xmax=10),
+    defineHistogram('eta_trk1', type='TH1F', path='EXPERT', title="Eta of Vertex first track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
+    defineHistogram('eta_trk2', type='TH1F', path='EXPERT', title="Eta of Vertex second track; [rad]", xbins=50, xmin=-3.15, xmax=3.15),
+    ]
+
+    return montool
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py
index 2b48cee1f9fc99539b99662d87bcb19b7bbc413c..338d31b1ebb1d5d88d8888c01ae57cd53c016f97 100644
--- a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py
@@ -2,7 +2,7 @@
 
 # import Hypo Algs/Tools
 from AthenaConfiguration.ComponentFactory import CompFactory # tools are imported from the factory, (NewJO)
-from TrigMuonHypo.TrigMuonHypoConf import (  # noqa: F401 (algs not used here)
+from TrigMuonHypo.TrigMuonHypoConf import (  # noqa: F401 (import all into this module)
     TrigMufastHypoAlg, TrigMufastHypoTool,
     TrigmuCombHypoAlg, TrigmuCombHypoTool,
     TrigMuonEFHypoAlg, TrigMuonEFHypoTool,
@@ -11,7 +11,6 @@ from TrigMuonHypo.TrigMuonHypoConf import (  # noqa: F401 (algs not used here)
     TrigMuonLateMuRoIHypoAlg, TrigMuonLateMuRoIHypoTool
 )
 
-
 # import monitoring
 from TrigMuonHypo.TrigMuonHypoMonitoring import (
     TrigMufastHypoMonitoring,
@@ -233,13 +232,6 @@ trigMuonEFInvMassThresholds = {
     'invmDimu'   : [1.5, 14.]
 }
 
-def addMonitoring(tool, monClass, name, thresholdHLT ):
-    try:
-        tool.MonTool = monClass( "MonTool" )
-        tool.MonTool.HistPath = name + "/" + thresholdHLT
-    except AttributeError:
-        log.error('%s Monitoring Tool failed', name)
-
 
 def getThresholdsFromDict( chainDict ):
     cparts = [i for i in chainDict['chainParts'] if i['signature']=='Muon' or i['signature']=='Bphysics']
@@ -251,8 +243,7 @@ def TrigMufastHypoToolFromDict( chainDict ):
     thresholds = getThresholdsFromDict( chainDict )
     config = TrigMufastHypoConfig()
     tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds )
-    # Setup MonTool for monitored variables in AthenaMonitoring package
-    addMonitoring( tool, TrigMufastHypoMonitoring, 'TrigMufastHypoTool', chainDict['chainName'] )
+    tool.MonTool = TrigMufastHypoMonitoring('TrigMufastHypoTool/'+chainDict['chainName'])
 
     return tool
 
@@ -261,7 +252,7 @@ def TrigMufastHypoToolwORFromDict( chainDict ):
     thresholds = getThresholdsFromDict( chainDict )
     config = TrigMufastHypoConfig()
     tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds )
-    # Setup MonTool for monitored variables in AthenaMonitoring package
+    tool.MonTool = TrigL2MuonOverlapRemoverMonitoringMufast('TrigMufastHypoTool/'+chainDict['chainName'])
 
     # Overlap Removal
     tool.ApplyOR = True
@@ -279,7 +270,6 @@ def TrigMufastHypoToolwORFromDict( chainDict ):
     tool.EtaBinsEC       = [0, 1.9, 2.1, 9.9]
     tool.DRThresEC       = [0.06, 0.05, 0.05]
     tool.MassThresEC     = [0.20, 0.15, 0.10]
-    addMonitoring( tool, TrigL2MuonOverlapRemoverMonitoringMufast, 'TrigMufastHypoTool', chainDict['chainName'] )
 
     return tool
 
@@ -397,7 +387,8 @@ def TrigmuCombHypoToolFromDict( chainDict ):
     if chainDict['chainParts'][0]['signature'] == 'Bphysics':
         acceptAll = True
 
-    tool=config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll )
+    tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll )
+    tool.MonTool = TrigmuCombHypoMonitoring("TrigmuCombHypoTool/"+chainDict['chainName'])
 
     d0cut=0.
     if 'd0loose' in chainDict['chainParts'][0]['lrtInfo']:
@@ -408,8 +399,6 @@ def TrigmuCombHypoToolFromDict( chainDict ):
         d0cut=trigMuonLrtd0Cut['d0tight']
     tool.MinimumD0=d0cut  
     
-    addMonitoring( tool, TrigmuCombHypoMonitoring, "TrigmuCombHypoTool", chainDict['chainName'] )
-
     return tool
 
 
@@ -426,7 +415,8 @@ def TrigmuCombHypoToolwORFromDict( chainDict ):
 
     acceptAll = False
 
-    tool=config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll )
+    tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll )
+    tool.MonTool = TrigL2MuonOverlapRemoverMonitoringMucomb("TrigmuCombHypoTool/"+chainDict['chainName'])
 
     # Overlap Removal
     tool.ApplyOR = True
@@ -439,8 +429,6 @@ def TrigmuCombHypoToolwORFromDict( chainDict ):
     tool.MufastDRThres   = [0.4,   0.4,   0.4,   0.4,   0.4]
     tool.MassThres       = [0.004, 0.002, 0.006, 0.006, 0.006]
 
-    addMonitoring( tool, TrigL2MuonOverlapRemoverMonitoringMucomb, "TrigmuCombHypoTool", chainDict['chainName'] )
-
     return tool
 
 
@@ -468,8 +456,6 @@ def Trigl2IOHypoToolwORFromDict( chainDict ):
     tool.MufastDRThres   = [0]
     tool.MassThres       = [0.004, 0.002, 0.006, 0.006, 0.006]
 
-    # addMonitoring( tool, TrigL2MuonOverlapRemoverMonitoringMucomb, "TrigmuCombHypoTool", chainDict['chainName'] )
-
     return tool
 
 
@@ -551,7 +537,7 @@ def TrigMuonEFMSonlyHypoToolFromDict( chainDict ) :
     if 'msonly' in chainDict['chainParts'][0]['msonlyInfo'] and 'noL1' not in chainDict['chainParts'][0]['extra']:
         doOverlap=True
     tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds, doOverlap )
-    addMonitoring( tool, TrigMuonEFHypoMonitoring, "TrigMuonEFMSonlyHypoTool", chainDict['chainName'] )
+    tool.MonTool = TrigMuonEFHypoMonitoring("TrigMuonEFMSonlyHypoTool/"+chainDict['chainName'])
     return tool
 
 def TrigMuonEFMSonlyHypoToolFromName(chainDict):
@@ -578,7 +564,7 @@ def TrigMuonEFMSonlyHypoToolFromName(chainDict):
                 thresholds.append(thr)
     config = TrigMuonEFMSonlyHypoConfig()
     tool = config.ConfigurationHypoTool(chainDict['chainName'], thresholds, False)
-    addMonitoring( tool, TrigMuonEFHypoMonitoring, "TrigMuonEFMSonlyHypoTool", chainDict['chainName'] )
+    tool.MonTool = TrigMuonEFHypoMonitoring("TrigMuonEFMSonlyHypoTool/"+chainDict['chainName'])
     return tool
 
 class TrigMuonEFMSonlyHypoConfig(object):
@@ -645,6 +631,8 @@ def TrigMuonEFCombinerHypoToolFromDict( chainDict ) :
 
     config = TrigMuonEFCombinerHypoConfig()
     tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds , muonquality, narrowscan, overlap)
+    tool.MonTool = TrigMuonEFHypoMonitoring("TrigMuonEFCombinerHypoTool/"+chainDict['chainName'])
+
     d0cut=0.
     if 'd0loose' in chainDict['chainParts'][0]['lrtInfo']:
         d0cut=trigMuonLrtd0Cut['d0loose']
@@ -653,7 +641,7 @@ def TrigMuonEFCombinerHypoToolFromDict( chainDict ) :
     elif 'd0tight' in chainDict['chainParts'][0]['lrtInfo']:
         d0cut=trigMuonLrtd0Cut['d0tight']
     tool.MinimumD0=d0cut  
-    addMonitoring( tool, TrigMuonEFHypoMonitoring, "TrigMuonEFCombinerHypoTool", chainDict['chainName'] )
+
     return tool
 
 def TrigMuonEFCombinerHypoToolFromName(chainDict):
@@ -693,7 +681,7 @@ def TrigMuonEFCombinerHypoToolFromName(chainDict):
     config = TrigMuonEFCombinerHypoConfig()
 
     tool = config.ConfigurationHypoTool(chainDict['chainName'], thresholds, muonquality, narrowscan, False)
-    addMonitoring( tool, TrigMuonEFHypoMonitoring, "TrigMuonEFCombinerHypoTool", chainDict['chainName'] )
+    tool.MonTool = TrigMuonEFHypoMonitoring("TrigMuonEFCombinerHypoTool/"+chainDict['chainName'])
     return tool
 
 class TrigMuonEFCombinerHypoConfig(object):
@@ -794,7 +782,7 @@ def TrigMuonEFInvMassHypoToolFromDict( chainDict ) :
         osCut = False
     config = TrigMuonEFInvMassHypoConfig()
     tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds, osCut )
-    addMonitoring( tool, TrigMuonEFInvMassHypoMonitoring, "TrigMuonEFInvMassHypoTool", chainDict['chainName'] )
+    tool.MonTool = TrigMuonEFInvMassHypoMonitoring("TrigMuonEFInvMassHypoTool/"+chainDict['chainName'])
     return tool
 
 class TrigMuonEFInvMassHypoConfig(object) :
@@ -845,8 +833,6 @@ class TrigMuonLateMuRoIHypoConfig(object) :
 
 
 if __name__ == '__main__':
-    # normaly this tools are private and have no clash in naming, for the test we create them and never assign so they are like public,
-    # in Run3 config this is checked in a different way so having Run 3 JO behaviour solves test issue
     from AthenaCommon.Configurable import Configurable
     Configurable.configurableRun3Behavior=1
 
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py
index c466033b61e7af826724fb6ed49c05a781a98da5..b50c596d45202fc349ce60b9d22777950a3f71fd 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoMonitoring.py
@@ -2,128 +2,123 @@
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
-class TrigMufastHypoMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigMufastHypoMonitoring, self).__init__(name)
-
-        self.defineHistogram('Pt', type='TH1F', path='EXPERT', title="P_{T} reconstruction from #muFast; P_{T} (GeV)",
-                             xbins=200, xmin=-100, xmax=100)
-        self.defineHistogram('PtFL', type='TH1F', path='EXPERT', title="P_{T} of not selected muons from #muFast; p_{T} (GeV)",
-                             xbins=200, xmin=-100, xmax=100)
-        self.defineHistogram('Eta , Phi', type='TH2F', path='EXPERT', title="Eta vs Phi reconstruction of #muFast; Eta; Phi",
-                             xbins=50, xmin=-3.2, xmax=3.2, ybins=25, ymin=-3.15, ymax=3.15)
-        self.defineHistogram('Eta', type='TH1F', path='EXPERT', title="Eta reconstruction from #muFast; Eta",
-                             xbins=100, xmin=-3.2, xmax=3.2)
-        self.defineHistogram('Phi', type='TH1F', path='EXPERT', title="Phi reconstruction from #muFast; Phi",
-                             xbins=100, xmin=-3.15, xmax=3.15)
-        self.defineHistogram('ZatSt, Phi', type='TH2F', path='EXPERT', title="Z vs Phi reconstructed in MIDDLE station; Z (cm); Phi (rad)",
-                             xbins=50, xmin=-1200., xmax=1200., ybins=25, ymin=-3.2, ymax=3.2)
-        self.defineHistogram('XatSt , YatSt', type='TH2F', path='EXPERT', title="Y vs X reconstructed in MIDDLE station; X (cm); Y(cm)",
-                             xbins=50, xmin=-1200., xmax=1200., ybins=50, ymin=-1200., ymax=1200.)
-        self.defineHistogram('ZatBe', type='TH1F', path='EXPERT', title="DCA along Z; Z (cm)",
-                             xbins=100, xmin=-2100, xmax=2100)
-        self.defineHistogram('XatBe', type='TH1F', path='EXPERT', title="DCA along X; X (cm)",
-                             xbins=100, xmin=-1000, xmax=1000)
-
-class TrigL2MuonOverlapRemoverMonitoringMufast(TrigMufastHypoMonitoring):
-    def __init__ (self, name):
-        super(TrigL2MuonOverlapRemoverMonitoringMufast, self).__init__(name)
-
-        self.defineHistogram('MufastError',  type='TH1F', path='EXPERT', title="error in #muFast based overlap removal; error code",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('DR',  type='TH1F', path='EXPERT', title="#muFast objects dR; dR",
-                             xbins=108, xmin=-0.1, xmax=3.5)
-        self.defineHistogram('Mass',type='TH1F', path='EXPERT', title="#muFast objects invMass; Mass (GeV)",
-                             xbins=202, xmin=-1, xmax=100)
-        self.defineHistogram('DRLog10',  type='TH1F', path='EXPERT', title="#muFast objects Log10(dR); Log10(dR)",
-                             xbins=102, xmin=-4.1, xmax=1.0)
-        self.defineHistogram('MassLog10',type='TH1F', path='EXPERT', title="#muFast objects Log10(invMass); Log10(Mass (GeV))",
-                             xbins=142, xmin=-4.1, xmax=3.0)
-        self.defineHistogram('Mass , DR', type='TH2F', path='EXPERT', title="#muFast objects Mass vs DR; Mass; dR",
-                             xbins=54, xmin=-0.1, xmax=3.5, ybins=101, ymin=-1, ymax=100)
-        self.defineHistogram('NrAllEVs',type='TH1F', path='EXPERT', title="nr of all EVs received for #muFast removal; nr",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('NrActiveEVs',type='TH1F', path='EXPERT', title="nr of active EVs after #muFast removal ; nr",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('NrOverlapped',type='TH1F', path='EXPERT', title="nr of #muFast overlapped; nr",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('OverlappedEta , OverlappedPhi', type='TH2F', path='EXPERT', title="#muFast overlapped Eta vs Phi; Eta; Phi",
-                             xbins=50, xmin=-3.2, xmax=3.2, ybins=25, ymin=-3.15, ymax=3.15)
-        self.defineHistogram('OverlappedPt', type='TH1F', path='EXPERT', title="#muFast overlapped P_{T}; P_{T} (GeV)",
-                             xbins=200, xmin=-100, xmax=100)
-
-class TrigmuCombHypoMonitoring(GenericMonitoringTool):
-    def __init__ (self, name):
-        super(TrigmuCombHypoMonitoring, self).__init__(name)
-
-        self.defineHistogram('Pt', type='TH1F', path='EXPERT', title="p_{T} reconstruction from #muComb; p_{T} (GeV)",
-                             xbins=210, xmin=-105, xmax=105)
-        self.defineHistogram('PtFL', type='TH1F', path='EXPERT', title="p_{T} of not selected muons from #muComb; p_{T} (GeV)",
-                             xbins=210, xmin=-105., xmax=105.)
-        self.defineHistogram('StrategyFlag', type='TH1F', path='EXPERT', title="Combination Strategy from #muComb; Strategy Code",
-                             xbins=12, xmin=-1.5, xmax=10.5)
-        self.defineHistogram('Eta', type='TH1F', path='EXPERT', title="Eta reconstruction from #muComb; Eta",
-                             xbins=108, xmin=-2.7, xmax=2.7)
-        self.defineHistogram('Phi', type='TH1F', path='EXPERT', title="Phi reconstruction from #muComb; Phi (rad)",
-                             xbins=96, xmin=-3.1416, xmax=3.1416)
-        self.defineHistogram('Z0', type='TH1F', path='EXPERT', title="PCA along Z from ID track from #muComb; PCA(Z0) (mm)",
-                             xbins=100, xmin=-200, xmax=200)
-        self.defineHistogram('A0', type='TH1F', path='EXPERT', title="PCA along x-y from ID track from #muComb; PCA(A0) (mm)",
-                             xbins=100, xmin=-0.6, xmax=0.6)
-
-class TrigL2MuonOverlapRemoverMonitoringMucomb(TrigmuCombHypoMonitoring):
-    def __init__ (self, name):
-        super(TrigL2MuonOverlapRemoverMonitoringMucomb, self).__init__(name)
-
-        self.defineHistogram('MucombError',  type='TH1F', path='EXPERT', title="error in #muComb based overlap removal; error code",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('DR',  type='TH1F', path='EXPERT', title="#muComb objects dR; dR",
-                             xbins=108, xmin=-0.1, xmax=3.5)
-        self.defineHistogram('Mass',type='TH1F', path='EXPERT', title="#muComb objects invMass; Mass (GeV)",
-                             xbins=202, xmin=-1, xmax=100)
-        self.defineHistogram('DRLog10',  type='TH1F', path='EXPERT', title="#muFast objects Log10(dR); Log10(dR)",
-                             xbins=102, xmin=-4.1, xmax=1.0)
-        self.defineHistogram('MassLog10',type='TH1F', path='EXPERT', title="#muFast objects Log10(invMass); Log10(Mass (GeV))",
-                             xbins=142, xmin=-4.1, xmax=3.0)
-        self.defineHistogram('Mass , DR', type='TH2F', path='EXPERT', title="#muComb objects Mass vs DR; Mass; dR",
-                             xbins=54, xmin=-0.1, xmax=3.5, ybins=101, ymin=-1, ymax=100)
-        self.defineHistogram('NrAllEVs',type='TH1F', path='EXPERT', title="nr of all EVs received for #muComb removal; nr",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('NrActiveEVs',type='TH1F', path='EXPERT', title="nr of active EVs after #muComb removal ; nr",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('NrOverlapped',type='TH1F', path='EXPERT', title="nr of #muComb overlapped; nr",
-                             xbins=10, xmin=0, xmax=10)
-        self.defineHistogram('OverlappedEta , OverlappedPhi', type='TH2F', path='EXPERT', title="#muComb overlapped Eta vs Phi; Eta; Phi",
-                             xbins=50, xmin=-3.2, xmax=3.2, ybins=25, ymin=-3.15, ymax=3.15)
-        self.defineHistogram('OverlappedPt', type='TH1F', path='EXPERT', title="#muComb overlapped P_{T}; P_{T} (GeV)",
-                             xbins=200, xmin=-100, xmax=100)
-
-
-class TrigMuonEFHypoMonitoring(GenericMonitoringTool):
-
-    def __init__ (self, name="TrigMuonEFHypoMonitoring"):
-        super(TrigMuonEFHypoMonitoring, self).__init__(name)
-
-        self.defineHistogram('Pt', type='TH1F', path='EXPERT', title="P_{T} reconstruction from #TrigMuonEFHypo; P_{T} (GeV)",
-                             xbins=200, xmin=-100, xmax=100)
-        self.defineHistogram('Eta', type='TH1F', path='EXPERT', title="Eta reconstruction from #TrigMuonEFHypo; Eta",
-                             xbins=100, xmin=-3.2, xmax=3.2)
-        self.defineHistogram('Phi', type='TH1F', path='EXPERT', title="Phi reconstruction from #TrigMuonEFHypo; Phi",
-                             xbins=100, xmin=-3.15, xmax=3.15)
-        self.defineHistogram('Pt_sel', type='TH1F', path='EXPERT', title="Selected P_{T} reconstruction from #TrigMuonEFHypo; P_{T} (GeV)",
-                             xbins=200, xmin=-100, xmax=100)
-        self.defineHistogram('Eta_sel', type='TH1F', path='EXPERT', title="Selected Eta reconstruction from #TrigMuonEFHypo; Eta",
-                             xbins=100, xmin=-3.2, xmax=3.2)
-        self.defineHistogram('Phi_sel', type='TH1F', path='EXPERT', title="Selected Phi reconstruction from #TrigMuonEFHypo; Phi",
-                             xbins=100, xmin=-3.15, xmax=3.15)
-
-
-class TrigMuonEFInvMassHypoMonitoring(GenericMonitoringTool):
-
-    def __init__ (self, name="TrigMuonEFInvMassHypoMonitoring"):
-        super(TrigMuonEFInvMassHypoMonitoring, self).__init__(name)
-
-        self.defineHistogram('Mass', type='TH1F', path='EXPERT', title="Dimuon mass from #TrigMuonEFInvMHypo; Mass (GeV)",
-                             xbins=200, xmin=0, xmax=200)
-        self.defineHistogram('Mass_sel', type='TH1F', path='EXPERT', title="Dimuon mass for selected events from #TrigMuonEFInvMHypo; Mass (GeV)",
-                             xbins=200, xmin=0, xmax=200)
+def TrigMufastHypoMonitoring(histPath):
+    montool = GenericMonitoringTool(HistPath = histPath)
+    montool.defineHistogram('Pt', type='TH1F', path='EXPERT', title="P_{T} reconstruction from #muFast; P_{T} (GeV)",
+                            xbins=200, xmin=-100, xmax=100)
+    montool.defineHistogram('PtFL', type='TH1F', path='EXPERT', title="P_{T} of not selected muons from #muFast; p_{T} (GeV)",
+                            xbins=200, xmin=-100, xmax=100)
+    montool.defineHistogram('Eta , Phi', type='TH2F', path='EXPERT', title="Eta vs Phi reconstruction of #muFast; Eta; Phi",
+                            xbins=50, xmin=-3.2, xmax=3.2, ybins=25, ymin=-3.15, ymax=3.15)
+    montool.defineHistogram('Eta', type='TH1F', path='EXPERT', title="Eta reconstruction from #muFast; Eta",
+                            xbins=100, xmin=-3.2, xmax=3.2)
+    montool.defineHistogram('Phi', type='TH1F', path='EXPERT', title="Phi reconstruction from #muFast; Phi",
+                            xbins=100, xmin=-3.15, xmax=3.15)
+    montool.defineHistogram('ZatSt, Phi', type='TH2F', path='EXPERT', title="Z vs Phi reconstructed in MIDDLE station; Z (cm); Phi (rad)",
+                            xbins=50, xmin=-1200., xmax=1200., ybins=25, ymin=-3.2, ymax=3.2)
+    montool.defineHistogram('XatSt , YatSt', type='TH2F', path='EXPERT', title="Y vs X reconstructed in MIDDLE station; X (cm); Y(cm)",
+                            xbins=50, xmin=-1200., xmax=1200., ybins=50, ymin=-1200., ymax=1200.)
+    montool.defineHistogram('ZatBe', type='TH1F', path='EXPERT', title="DCA along Z; Z (cm)",
+                            xbins=100, xmin=-2100, xmax=2100)
+    montool.defineHistogram('XatBe', type='TH1F', path='EXPERT', title="DCA along X; X (cm)",
+                            xbins=100, xmin=-1000, xmax=1000)
+    return montool
+
+
+def TrigL2MuonOverlapRemoverMonitoringMufast(histPath):
+    montool = TrigMufastHypoMonitoring(histPath)
+    montool.defineHistogram('MufastError',  type='TH1F', path='EXPERT', title="error in #muFast based overlap removal; error code",
+                         xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('DR',  type='TH1F', path='EXPERT', title="#muFast objects dR; dR",
+                         xbins=108, xmin=-0.1, xmax=3.5)
+    montool.defineHistogram('Mass',type='TH1F', path='EXPERT', title="#muFast objects invMass; Mass (GeV)",
+                         xbins=202, xmin=-1, xmax=100)
+    montool.defineHistogram('DRLog10',  type='TH1F', path='EXPERT', title="#muFast objects Log10(dR); Log10(dR)",
+                         xbins=102, xmin=-4.1, xmax=1.0)
+    montool.defineHistogram('MassLog10',type='TH1F', path='EXPERT', title="#muFast objects Log10(invMass); Log10(Mass (GeV))",
+                         xbins=142, xmin=-4.1, xmax=3.0)
+    montool.defineHistogram('Mass , DR', type='TH2F', path='EXPERT', title="#muFast objects Mass vs DR; Mass; dR",
+                         xbins=54, xmin=-0.1, xmax=3.5, ybins=101, ymin=-1, ymax=100)
+    montool.defineHistogram('NrAllEVs',type='TH1F', path='EXPERT', title="nr of all EVs received for #muFast removal; nr",
+                         xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('NrActiveEVs',type='TH1F', path='EXPERT', title="nr of active EVs after #muFast removal ; nr",
+                         xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('NrOverlapped',type='TH1F', path='EXPERT', title="nr of #muFast overlapped; nr",
+                         xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('OverlappedEta , OverlappedPhi', type='TH2F', path='EXPERT', title="#muFast overlapped Eta vs Phi; Eta; Phi",
+                         xbins=50, xmin=-3.2, xmax=3.2, ybins=25, ymin=-3.15, ymax=3.15)
+    montool.defineHistogram('OverlappedPt', type='TH1F', path='EXPERT', title="#muFast overlapped P_{T}; P_{T} (GeV)",
+                         xbins=200, xmin=-100, xmax=100)
+    return montool
+
+
+def TrigmuCombHypoMonitoring(histPath):
+    montool = GenericMonitoringTool(HistPath = histPath)
+    montool.defineHistogram('Pt', type='TH1F', path='EXPERT', title="p_{T} reconstruction from #muComb; p_{T} (GeV)",
+                            xbins=210, xmin=-105, xmax=105)
+    montool.defineHistogram('PtFL', type='TH1F', path='EXPERT', title="p_{T} of not selected muons from #muComb; p_{T} (GeV)",
+                            xbins=210, xmin=-105., xmax=105.)
+    montool.defineHistogram('StrategyFlag', type='TH1F', path='EXPERT', title="Combination Strategy from #muComb; Strategy Code",
+                            xbins=12, xmin=-1.5, xmax=10.5)
+    montool.defineHistogram('Eta', type='TH1F', path='EXPERT', title="Eta reconstruction from #muComb; Eta",
+                            xbins=108, xmin=-2.7, xmax=2.7)
+    montool.defineHistogram('Phi', type='TH1F', path='EXPERT', title="Phi reconstruction from #muComb; Phi (rad)",
+                            xbins=96, xmin=-3.1416, xmax=3.1416)
+    montool.defineHistogram('Z0', type='TH1F', path='EXPERT', title="PCA along Z from ID track from #muComb; PCA(Z0) (mm)",
+                            xbins=100, xmin=-200, xmax=200)
+    montool.defineHistogram('A0', type='TH1F', path='EXPERT', title="PCA along x-y from ID track from #muComb; PCA(A0) (mm)",
+                            xbins=100, xmin=-0.6, xmax=0.6)
+    return montool
+
+
+def TrigL2MuonOverlapRemoverMonitoringMucomb(histPath):
+    montool = TrigmuCombHypoMonitoring(histPath)
+    montool.defineHistogram('MucombError',  type='TH1F', path='EXPERT', title="error in #muComb based overlap removal; error code",
+                            xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('DR',  type='TH1F', path='EXPERT', title="#muComb objects dR; dR",
+                            xbins=108, xmin=-0.1, xmax=3.5)
+    montool.defineHistogram('Mass',type='TH1F', path='EXPERT', title="#muComb objects invMass; Mass (GeV)",
+                            xbins=202, xmin=-1, xmax=100)
+    montool.defineHistogram('DRLog10',  type='TH1F', path='EXPERT', title="#muFast objects Log10(dR); Log10(dR)",
+                            xbins=102, xmin=-4.1, xmax=1.0)
+    montool.defineHistogram('MassLog10',type='TH1F', path='EXPERT', title="#muFast objects Log10(invMass); Log10(Mass (GeV))",
+                            xbins=142, xmin=-4.1, xmax=3.0)
+    montool.defineHistogram('Mass , DR', type='TH2F', path='EXPERT', title="#muComb objects Mass vs DR; Mass; dR",
+                            xbins=54, xmin=-0.1, xmax=3.5, ybins=101, ymin=-1, ymax=100)
+    montool.defineHistogram('NrAllEVs',type='TH1F', path='EXPERT', title="nr of all EVs received for #muComb removal; nr",
+                            xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('NrActiveEVs',type='TH1F', path='EXPERT', title="nr of active EVs after #muComb removal ; nr",
+                            xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('NrOverlapped',type='TH1F', path='EXPERT', title="nr of #muComb overlapped; nr",
+                            xbins=10, xmin=0, xmax=10)
+    montool.defineHistogram('OverlappedEta , OverlappedPhi', type='TH2F', path='EXPERT', title="#muComb overlapped Eta vs Phi; Eta; Phi",
+                            xbins=50, xmin=-3.2, xmax=3.2, ybins=25, ymin=-3.15, ymax=3.15)
+    montool.defineHistogram('OverlappedPt', type='TH1F', path='EXPERT', title="#muComb overlapped P_{T}; P_{T} (GeV)",
+                            xbins=200, xmin=-100, xmax=100)
+    return montool
+
+
+def TrigMuonEFHypoMonitoring(histPath):
+    montool = GenericMonitoringTool(HistPath = histPath)
+    montool.defineHistogram('Pt', type='TH1F', path='EXPERT', title="P_{T} reconstruction from #TrigMuonEFHypo; P_{T} (GeV)",
+                            xbins=200, xmin=-100, xmax=100)
+    montool.defineHistogram('Eta', type='TH1F', path='EXPERT', title="Eta reconstruction from #TrigMuonEFHypo; Eta",
+                            xbins=100, xmin=-3.2, xmax=3.2)
+    montool.defineHistogram('Phi', type='TH1F', path='EXPERT', title="Phi reconstruction from #TrigMuonEFHypo; Phi",
+                            xbins=100, xmin=-3.15, xmax=3.15)
+    montool.defineHistogram('Pt_sel', type='TH1F', path='EXPERT', title="Selected P_{T} reconstruction from #TrigMuonEFHypo; P_{T} (GeV)",
+                            xbins=200, xmin=-100, xmax=100)
+    montool.defineHistogram('Eta_sel', type='TH1F', path='EXPERT', title="Selected Eta reconstruction from #TrigMuonEFHypo; Eta",
+                            xbins=100, xmin=-3.2, xmax=3.2)
+    montool.defineHistogram('Phi_sel', type='TH1F', path='EXPERT', title="Selected Phi reconstruction from #TrigMuonEFHypo; Phi",
+                            xbins=100, xmin=-3.15, xmax=3.15)
+    return montool
+
+
+def TrigMuonEFInvMassHypoMonitoring(histPath):
+    montool = GenericMonitoringTool(HistPath = histPath)
+    montool.defineHistogram('Mass', type='TH1F', path='EXPERT', title="Dimuon mass from #TrigMuonEFInvMHypo; Mass (GeV)",
+                            xbins=200, xmin=0, xmax=200)
+    montool.defineHistogram('Mass_sel', type='TH1F', path='EXPERT', title="Dimuon mass for selected events from #TrigMuonEFInvMHypo; Mass (GeV)",
+                            xbins=200, xmin=0, xmax=200)
+    return montool
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py
index bb1a41c2ca8c746a834c3545f8120573eb45c298..62f97032c11dd2ab7963a530e6c3b382b4d6bffa 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/python/TrigTauMonitoringConfigMT.py
@@ -152,74 +152,79 @@ class TrigTauMonAlgBuilder:
 
 
   def setDefaultProperties(self):
-    
-    # This will be removed for future.
-    monitoring_tau = [
-    # tau0
-    'HLT_tau0_ptonly_L1TAU8',
-    'HLT_tau0_ptonly_L1TAU60',
-    # tau25
-    'HLT_tau25_ptonly_L1TAU12IM',
-    'HLT_tau25_idperf_tracktwo_L1TAU12IM',
-    'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',
-    'HLT_tau25_idperf_tracktwoMVABDT_L1TAU12IM',
-    'HLT_tau25_perf_tracktwo_L1TAU12IM',
-    'HLT_tau25_perf_tracktwoMVA_L1TAU12IM',
-    'HLT_tau25_perf_tracktwoMVABDT_L1TAU12IM',
-    'HLT_tau25_looseRNN_tracktwoMVA_L1TAU12IM',
-    'HLT_tau25_looseRNN_tracktwoMVABDT_L1TAU12IM',
-    'HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM',
-    'HLT_tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM',
-    'HLT_tau25_tightRNN_tracktwoMVA_L1TAU12IM',
-    'HLT_tau25_tightRNN_tracktwoMVABDT_L1TAU12IM',
-    # tau35
-    'HLT_tau35_ptonly_L1TAU20IM',
-    'HLT_tau35_idperf_tracktwo_L1TAU20IM',
-    'HLT_tau35_idperf_tracktwoMVA_L1TAU20IM',
-    'HLT_tau35_idperf_tracktwoMVABDT_L1TAU20IM',
-    'HLT_tau35_perf_tracktwo_L1TAU20IM',
-    'HLT_tau35_perf_tracktwoMVA_L1TAU20IM',
-    'HLT_tau35_perf_tracktwoMVABDT_L1TAU20IM',
-    'HLT_tau35_looseRNN_tracktwoMVA_L1TAU20IM',
-    'HLT_tau35_looseRNN_tracktwoMVABDT_L1TAU20IM',
-    'HLT_tau35_mediumRNN_tracktwoMVA_L1TAU20IM',
-    'HLT_tau35_mediumRNN_tracktwoMVABDT_L1TAU20IM',
-    'HLT_tau35_tightRNN_tracktwoMVA_L1TAU20IM',
-    'HLT_tau35_tightRNN_tracktwoMVABDT_L1TAU20IM',
-    # tau160
-    'HLT_tau160_ptonly_L1TAU100',
-    'HLT_tau160_idperf_tracktwo_L1TAU100',
-    'HLT_tau160_idperf_tracktwoMVA_L1TAU100',
-    'HLT_tau160_idperf_tracktwoMVABDT_L1TAU100',
-    'HLT_tau160_perf_tracktwo_L1TAU100',
-    'HLT_tau160_perf_tracktwoMVA_L1TAU100',
-    'HLT_tau160_perf_tracktwoMVABDT_L1TAU100',
-    'HLT_tau160_mediumRNN_tracktwoMVA_L1TAU100',
-    'HLT_tau160_mediumRNN_tracktwoMVABDT_L1TAU100',
-    # tau180
-    'HLT_tau180_mediumRNN_tracktwoLLP_L1TAU100',
-    'HLT_tau180_tightRNN_tracktwoLLP_L1TAU100',
-    # tau200
-    'HLT_tau200_ptonly_L1TAU100',
-    'HLT_tau200_mediumRNN_tracktwoMVA_L1TAU100',
-    'HLT_tau200_mediumRNN_tracktwoMVABDT_L1TAU100',
-    'HLT_tau200_mediumRNN_tracktwoLLP_L1TAU100',
-    'HLT_tau200_tightRNN_tracktwoLLP_L1TAU100',
-    # ditau
-    'HLT_tau80_mediumRNN_tracktwoMVA_tau60_mediumRNN_tracktwoMVA_03dRAB_L1TAU60_2TAU40',
-    'HLT_tau80_mediumRNN_tracktwoMVA_tau35_mediumRNN_tracktwoMVA_03dRAB30_L1TAU60_DR-TAU20ITAU12I',
-    'HLT_tau35_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA_L1DR-TAU20ITAU12I-J25',
-    'HLT_tau80_mediumRNN_tracktwoLLP_tau60_mediumRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
-    'HLT_tau80_mediumRNN_tracktwoLLP_tau60_tightRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
-    'HLT_tau80_tightRNN_tracktwoLLP_tau60_tightRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
-    'HLT_tau100_mediumRNN_tracktwoLLP_tau80_mediumRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
-     # Phase-I
-    'HLT_tau25_mediumRNN_tracktwoMVABDT_L1eTAU12',
-    'HLT_tau25_mediumRNN_tracktwoMVABDT_L1eTAU12M',
-    'HLT_tau35_mediumRNN_tracktwoMVABDT_L1eTAU20',
-    'HLT_tau160_mediumRNN_tracktwoMVABDT_L1eTAU100'
- 
-    ]
+
+    ### monitorig groups
+    from TrigConfigSvc.TriggerConfigAccess import getHLTMonitoringAccess
+    moniAccess=getHLTMonitoringAccess(self.helper.inputFlags)
+    monitoring_tau=moniAccess.monitoredChains(signatures="tauMon",monLevels=["shifter","t0","val"])
+  
+    # if mon groups not found fall back to hard-coded trigger monitoring list
+    if len(monitoring_tau) == 0:
+       monitoring_tau = [
+       # tau0
+       'HLT_tau0_ptonly_L1TAU8',
+       'HLT_tau0_ptonly_L1TAU60',
+       # tau25
+       'HLT_tau25_ptonly_L1TAU12IM',
+       'HLT_tau25_idperf_tracktwo_L1TAU12IM',
+       'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',
+       'HLT_tau25_idperf_tracktwoMVABDT_L1TAU12IM',
+       'HLT_tau25_perf_tracktwo_L1TAU12IM',
+       'HLT_tau25_perf_tracktwoMVA_L1TAU12IM',
+       'HLT_tau25_perf_tracktwoMVABDT_L1TAU12IM',
+       'HLT_tau25_looseRNN_tracktwoMVA_L1TAU12IM',
+       'HLT_tau25_looseRNN_tracktwoMVABDT_L1TAU12IM',
+       'HLT_tau25_mediumRNN_tracktwoMVA_L1TAU12IM',
+       'HLT_tau25_mediumRNN_tracktwoMVABDT_L1TAU12IM',
+       'HLT_tau25_tightRNN_tracktwoMVA_L1TAU12IM',
+       'HLT_tau25_tightRNN_tracktwoMVABDT_L1TAU12IM',
+       # tau35
+       'HLT_tau35_ptonly_L1TAU20IM',
+       'HLT_tau35_idperf_tracktwo_L1TAU20IM',
+       'HLT_tau35_idperf_tracktwoMVA_L1TAU20IM',
+       'HLT_tau35_idperf_tracktwoMVABDT_L1TAU20IM',
+       'HLT_tau35_perf_tracktwo_L1TAU20IM',
+       'HLT_tau35_perf_tracktwoMVA_L1TAU20IM',
+       'HLT_tau35_perf_tracktwoMVABDT_L1TAU20IM',
+       'HLT_tau35_looseRNN_tracktwoMVA_L1TAU20IM',
+       'HLT_tau35_looseRNN_tracktwoMVABDT_L1TAU20IM',
+       'HLT_tau35_mediumRNN_tracktwoMVA_L1TAU20IM',
+       'HLT_tau35_mediumRNN_tracktwoMVABDT_L1TAU20IM',
+       'HLT_tau35_tightRNN_tracktwoMVA_L1TAU20IM',
+       'HLT_tau35_tightRNN_tracktwoMVABDT_L1TAU20IM',
+       # tau160
+       'HLT_tau160_ptonly_L1TAU100',
+       'HLT_tau160_idperf_tracktwo_L1TAU100',
+       'HLT_tau160_idperf_tracktwoMVA_L1TAU100',
+       'HLT_tau160_idperf_tracktwoMVABDT_L1TAU100',
+       'HLT_tau160_perf_tracktwo_L1TAU100',
+       'HLT_tau160_perf_tracktwoMVA_L1TAU100',
+       'HLT_tau160_perf_tracktwoMVABDT_L1TAU100',
+       'HLT_tau160_mediumRNN_tracktwoMVA_L1TAU100',
+       'HLT_tau160_mediumRNN_tracktwoMVABDT_L1TAU100',
+       # tau180
+       'HLT_tau180_mediumRNN_tracktwoLLP_L1TAU100',
+       'HLT_tau180_tightRNN_tracktwoLLP_L1TAU100',
+       # tau200
+       'HLT_tau200_ptonly_L1TAU100',
+       'HLT_tau200_mediumRNN_tracktwoMVA_L1TAU100',
+       'HLT_tau200_mediumRNN_tracktwoMVABDT_L1TAU100',
+       'HLT_tau200_mediumRNN_tracktwoLLP_L1TAU100',
+       'HLT_tau200_tightRNN_tracktwoLLP_L1TAU100',
+       # ditau
+       'HLT_tau80_mediumRNN_tracktwoMVA_tau60_mediumRNN_tracktwoMVA_03dRAB_L1TAU60_2TAU40',
+       'HLT_tau80_mediumRNN_tracktwoMVA_tau35_mediumRNN_tracktwoMVA_03dRAB30_L1TAU60_DR-TAU20ITAU12I',
+       'HLT_tau35_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA_L1DR-TAU20ITAU12I-J25',
+       'HLT_tau80_mediumRNN_tracktwoLLP_tau60_mediumRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
+       'HLT_tau80_mediumRNN_tracktwoLLP_tau60_tightRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
+       'HLT_tau80_tightRNN_tracktwoLLP_tau60_tightRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
+       'HLT_tau100_mediumRNN_tracktwoLLP_tau80_mediumRNN_tracktwoLLP_03dRAB_L1TAU60_2TAU40',
+       # Phase-I
+       'HLT_tau25_mediumRNN_tracktwoMVABDT_L1eTAU12',
+       'HLT_tau25_mediumRNN_tracktwoMVABDT_L1eTAU12M',
+       'HLT_tau35_mediumRNN_tracktwoMVABDT_L1eTAU20',
+       'HLT_tau160_mediumRNN_tracktwoMVABDT_L1eTAU100'
+       ]
 
     self.tauList = monitoring_tau
 
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx
index 04ac91cffbc1886460943fbc7d2aaff96803f363..f65fb503f59eefd46038473bd0134b1d5f39cdc5 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/HLTTauMonTool.cxx
@@ -3887,11 +3887,12 @@ StatusCode HLTTauMonTool::getTracks(const xAOD::TauJet *aEFTau, std::vector<cons
   };
   std::sort(tracks.begin(), tracks.end(), cmp_pt);
 
-  // Truncate tracks
+  /* Truncate tracks
   unsigned int max_tracks = 10;
   if (tracks.size() > max_tracks) {
     tracks.resize(max_tracks);
   }
+  */
 
   out = std::move(tracks);
   return StatusCode::SUCCESS;
@@ -3936,11 +3937,13 @@ StatusCode HLTTauMonTool::getClusters(const xAOD::TauJet *aEFTau, std::vector<co
   };
   std::sort(clusters.begin(), clusters.end(), et_cmp);
 
-  // Truncate clusters
+  /* Truncate clusters
   unsigned int max_clusters = 6;
   if (clusters.size() > max_clusters) {
     clusters.resize(max_clusters);
   }
+  */
+
   out = std::move(clusters);
 
   return StatusCode::SUCCESS;
diff --git a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
index 767dd85f50d4079bf901ea0fcac19b2841924753..0527d8490683b0143d3a50730d06b7f2fba40397 100644
--- a/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigTauMonitoring/src/TrigTauMonitorAlgorithm.cxx
@@ -406,15 +406,10 @@ void TrigTauMonitorAlgorithm::fillRNNInputVars(const std::string& trigger, const
                                                     if (tau->detail(xAOD::TauJetParameters::dRmax, detail)){
                                                     } return detail;});
   
-   auto absipSigLeadTrk    = online ?   (Monitored::Collection("absipSigLeadTrk", tau_vec,  [] (const xAOD::TauJet* tau){
-                                                        float detail = -999;
-                                                        if (tau->detail(xAOD::TauJetParameters::etOverPtLeadTrk, detail)){
-                                                            detail = TMath::Log10(std::max(detail, 0.1f));
-                                                        } return detail;})) : 
-                                        (Monitored::Collection("absipSigLeadTrk", tau_vec,  [] (const xAOD::TauJet* tau){
+  auto absipSigLeadTrk    = Monitored::Collection("absipSigLeadTrk", tau_vec,  [] (const xAOD::TauJet* tau){
                                                         float detail = (tau->nTracks()>0) ? std::abs(tau->track(0)->d0SigTJVA()) : 0.;
                                                         detail = std::min(TMath::Abs(detail), 30.0f);
-                                                        return detail;}));
+                                                        return detail;});
    
   auto sumPtTrkFrac       = Monitored::Collection("sumPtTrkFrac", tau_vec,  [] (const xAOD::TauJet* tau){
                                                     float detail = -999;
@@ -481,12 +476,13 @@ void TrigTauMonitorAlgorithm::fillRNNTrack(const std::string& trigger, const std
         return lhs->pt() > rhs->pt();
       };
       std::sort(tracks.begin(), tracks.end(), cmp_pt);
-                                                                                                                                       
+                              
+      /*                                                                                                         
       unsigned int max_tracks = 10;
       if (tracks.size() > max_tracks) {
         tracks.resize(max_tracks);
       }
-
+      */
 
       auto track_pt_log = Monitored::Collection("track_pt_log", tracks, [](const xAOD::TauTrack *track){return TMath::Log10( track->pt()); }); 
   
@@ -579,11 +575,12 @@ void TrigTauMonitorAlgorithm::fillRNNCluster(const std::string& trigger, const s
     };
     std::sort(clusters.begin(), clusters.end(), et_cmp);
 
+    /*
     unsigned int max_clusters = 6;
     if (clusters.size() > max_clusters) {
       clusters.resize(max_clusters);
     }
-
+    */
 
     auto cluster_et_log = Monitored::Collection("cluster_et_log",clusters, [](const xAOD::CaloCluster *cluster){return TMath::Log10( cluster->et()); }); 
     auto cluster_dEta = Monitored::Collection("cluster_dEta", clusters, [&tau](const xAOD::CaloCluster *cluster){auto ddeta=cluster->eta()- tau->eta();return ddeta; });
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
index b8bb2948f170969224f4b32a0de2eb2ca88fdf22..b36d170491db97d306083917744cce881a305b07 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py
@@ -451,9 +451,10 @@ def trtDataPrep(flags, roisKey, signature):
     acc.addPublicTool(InDetTRTRawDataProviderTool)
 
      # load the TRTRawDataProvider
+    from .InDetTrigCollectionKeys import TrigTRTKeys
     TRTRawDataProvider=CompFactory.TRTRawDataProvider
     InDetTRTRawDataProvider = TRTRawDataProvider(name         = "InDetTRTRawDataProvider"+ signature,
-                                                 RDOKey       = "TRT_RDOs",
+                                                 RDOKey       = TrigTRTKeys.RDOs,
                                                  ProviderTool = InDetTRTRawDataProviderTool,
                                                  RegSelTool   = RegSelTool_TRT,
                                                  isRoI_Seeded = True,
@@ -502,6 +503,7 @@ def pixelClusterizationCfg(flags, roisKey, signature):
                                                         RoIs                     = roisKey,
                                                         ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey)
 
+
   acc.addEventAlgo(InDetPixelClusterization)
 
   return acc
@@ -703,13 +705,21 @@ def trigInDetFastTrackingCfg( inflags, roisKey="EMRoIs", signatureName='', in_vi
                                                                     ('PixelRDO_Cache', 'PixRDOCache'),
                                                                     ('InDet::SCT_ClusterContainerCache', 'SCT_ClustersCache'),
                                                                     ('SCT_RDO_Cache', 'SctRDOCache'),
+                                                                    ( 'IDCInDetBSErrContainer_Cache' , InDetCacheNames.PixBSErrCacheKey ),
+                                                                    ( 'IDCInDetBSErrContainer_Cache' , InDetCacheNames.SCTBSErrCacheKey ),
+                                                                    ( 'IDCInDetBSErrContainer_Cache' , InDetCacheNames.SCTFlaggedCondCacheKey ),
                                                                     ('SpacePointCache', 'PixelSpacePointCache'),
                                                                     ('SpacePointCache', 'SctSpacePointCache'),
-                                                                    ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),
-                                                                    ('IDCInDetBSErrContainer_Cache', 'SctFlaggedCondCache'),
                                                                     ('xAOD::EventInfo', 'EventInfo'),
                                                                     ('TrigRoiDescriptorCollection', roisKey),
                                                                     ( 'TagInfo' , 'DetectorStore+ProcessingTags' )] )
+    if flags.Input.isMC:
+        verifier.DataObjects += [( 'PixelRDO_Container' , 'StoreGateSvc+PixelRDOs' ),
+                                  ( 'SCT_RDO_Container' , 'StoreGateSvc+SCT_RDOs' ) ]
+        from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
+        sgil_load = [( 'PixelRDO_Container' , 'StoreGateSvc+PixelRDOs' ),
+                     ( 'SCT_RDO_Container' , 'StoreGateSvc+SCT_RDOs' ) ]
+        acc.merge(SGInputLoaderCfg(flags, Load=sgil_load))
 
     acc.addEventAlgo(verifier)
   #Only add raw data decoders if we're running over raw data
@@ -763,10 +773,14 @@ def TRTDataProviderCfg(flags):
 def TRTRIOMakerCfg(flags):
   acc = ComponentAccumulator()
   from .InDetTrigCollectionKeys import TrigTRTKeys
+  TRT_RDO_Key = "TRT_RDOs"
+  if flags.Input.Format == 'BS':
+        TRT_RDO_Key = TrigTRTKeys.RDOs
+  
   from InDetConfig.TRTPreProcessing import TRT_DriftCircleToolCfg # TODO, offline config used here, threfore the names are different
   alg = CompFactory.InDet.TRT_RIO_Maker( f"{prefix}TRTDriftCircleMaker_{flags.InDet.Tracking.name}",
                                           TRTRIOLocation=TrigTRTKeys.DriftCircles, 
-                                          TRTRDOLocation = TrigTRTKeys.RDOs,
+                                          TRTRDOLocation = TRT_RDO_Key,
                                           isRoI_Seeded = True,
                                           RoIs = flags.InDet.Tracking.roi,
                                           TRT_DriftCircleTool = acc.getPrimaryAndMerge(TRT_DriftCircleToolCfg(flags, useTimeInfo=True, usePhase=False, prefix=prefix+"_", name=f"{prefix}_DriftCircleTool")))
@@ -1011,24 +1025,29 @@ def trigInDetPrecisionTrackingCfg( inflags, signatureName, in_view=True ):
   acc = ComponentAccumulator()
   flags = inflags.cloneAndReplace("InDet.Tracking", "Trigger.InDetTracking."+signatureName)
 
-  from .InDetTrigCollectionKeys import TrigPixelKeys
+  from .InDetTrigCollectionKeys import TrigPixelKeys,TrigTRTKeys
   if in_view:
     #TODO share setup with FTF
+    TRT_RDO_Key = "TRT_RDOs"
+    if flags.Input.Format == 'BS':
+          TRT_RDO_Key = TrigTRTKeys.RDOs
     verifier = CompFactory.AthViews.ViewDataVerifier( name = 'VDVInDetPrecision'+flags.InDet.Tracking.suffix,
                                                       DataObjects= [('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
                                                                     ('InDet::PixelClusterContainerCache', 'PixelTrigClustersCache'),
                                                                     ('PixelRDO_Cache', 'PixRDOCache'),
-                                                                    ('IDCInDetBSErrContainer' , 'PixelByteStreamErrs'),
-                                                                    ('InDet::SCT_ClusterContainerCache', 'SCT_ClustersCache'),
                                                                     ('SCT_RDO_Cache', 'SctRDOCache'),
+                                                                    ( 'TRT_RDO_Container' , TRT_RDO_Key),
                                                                     ('SpacePointCache', 'PixelSpacePointCache'),
                                                                     ('SpacePointCache', 'SctSpacePointCache'),
-                                                                    ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),
-                                                                    ('IDCInDetBSErrContainer_Cache', 'SctFlaggedCondCache'),
                                                                     ('TrigRoiDescriptorCollection', flags.InDet.Tracking.roi),
                                                                     ( 'TagInfo', 'DetectorStore+ProcessingTags' ), 
                                                                     ( 'InDet::PixelGangedClusterAmbiguities' , TrigPixelKeys.PixelClusterAmbiguitiesMap),
                                                                     ( 'TrackCollection', flags.InDet.Tracking.trkTracks_FTF )] )
+
+    if flags.Input.Format == 'BS':
+        verifier.DataObjects += [ ('IDCInDetBSErrContainer' , 'PixelByteStreamErrs'),
+                                  ('IDCInDetBSErrContainer_Cache', 'SctBSErrCache'),
+                                  ('IDCInDetBSErrContainer_Cache', 'SctFlaggedCondCache'), ]
     acc.addEventAlgo(verifier)
 
   acc.merge(ambiguitySolverAlgCfg(flags))
diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py b/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py
index ea520fc015fdbd449b7e2ec0ac1f3b48ce4bf1bd..bce4f65c01f277c012be051e3647fcc0ab7e8bf3 100644
--- a/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py
+++ b/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py
@@ -1,83 +1,73 @@
-# 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 AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
 
  
-class TrigInDetTrackCnvMonitoring(GenericMonitoringTool):
-    def __init__ (self, name="TrigInDetTrackCnvMonitoring"):
-        super(TrigInDetTrackCnvMonitoring, self).__init__(name)
+def TrigInDetTrackCnvMonitoring(name="TrigInDetTrackCnvMonitoring"):
 
-        #Example:
-        #self.defineHistogram('EventStatistics', path='EXPERT', type='TH1F',
-        #                                     title="EventStatistics",
-        #                                     xbins=9, xmin=-0.5, xmax=8.5, opt='kLBN',
-        #                                     #labels='All input : Has input TE : Has ROI : Has tracks : Has seed tracks : Has  enough tracks : Has track Z cluster : Has vertex : Has good vertex' )
-        #                                     xlabels= ['All input', 'Has input TE', 'Has ROI',  'Has tracks', 'Has seed tracks',  'Has  enough tracks', 'Has track Z cluster', 'Has vertex', 'Has good vertex'] )
-      #-------------------------------------------------------------------------------------------------
-      #                             Monitoring track parameters
-
-       #TODO need to revisit binning with higher stats
-
-        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',
-                                             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 [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=64, xmin=-3.2, xmax=3.2)
-        self.defineHistogram('TrackThetaPass', path='EXPERT', type='TH1F',
-                                             title="Acc. Track Theta; #theta; Number of tracks",
-                                             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=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=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.)
-        #self.defineHistogram('TrackD0errPass', path='EXPERT', type='TH1F',
-        #                                     title="Acc. Track D0err; Track d0 error [mm]; Number of tracks",
-        #                                     xbins=100, xmin=0., xmax=5.)
-        #self.defineHistogram('TrackQualPass', path='EXPERT', type='TH1F',
-        #                                     title="Acc. Track Qual; Track #chi^{2}/ndf; Number of tracks",
-        #                                     xbins=50, xmin=0., xmax=10.)
-        self.defineHistogram('TrackNDFPass', path='EXPERT', type='TH1F',
-                                             title="Acc. Track NDF; Track NDF; Number of tracks",
-                                             xbins=10, xmin=-0.5, xmax=9.5)
-        self.defineHistogram('TrackChi2ProbPass', path='EXPERT', type='TH1F',
-                                             title="Acc. Track #chi^{2} probability; Track #chi^{2} probability; Number of tracks",
-                                             xbins=70, xmin=-0.2, xmax=1.2)
-        #Accepted Track hits in ID
-        self.defineHistogram('TrackTRTHitsPass', path='EXPERT', type='TH1I',
-                                             title="Acc. Track TRT hits; N TRT hits; Number of tracks",
-                                             xbins=71, xmin=-0.5, xmax=70.5)
-        self.defineHistogram('TrackPIXHitsPass', path='EXPERT', type='TH1I',
-                                             title="Acc. Track PIX hits; N PIX hits; Number of tracks",
-                                             xbins=13, xmin=-0.5, xmax=12.5)
-        self.defineHistogram('TrackSCTHitsPass', path='EXPERT', type='TH1I',
-                                             title="Acc. Track SCT hits; N SCT hits; Number of tracks",
-                                             xbins=21, xmin=-0.5, xmax=20.5)
-        # Track counting
-        self.defineHistogram('TrackCountingPass', path='EXPERT', type='TH1I',
-                                             title="Track Counting; Number of tracks per event; Count",
-                                             xbins=300, xmin=-0.5, xmax=299.5)
+    montool = GenericMonitoringTool(name)
 
+    #TODO need to revisit binning with higher stats
+    if 'minBias' in name or 'MinBias' in name:
+        montool.defineHistogram('TrackPtPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track Pt; p_{t} [GeV]; Number of tracks",
+                                         xbins=200, xmin=0, xmax=20)
+        montool.defineHistogram('TrackQPtPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track q*Pt; q*pt [GeV]; Number of tracks",
+                                         xbins=400, xmin=-40, xmax=40)
+    else:
+        montool.defineHistogram('TrackPtPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track Pt; p_{t} [GeV]; Number of tracks",
+                                         xbins=200, xmin=0, xmax=1000)
+        montool.defineHistogram('TrackQPtPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track q*Pt; q*pt [GeV]; Number of tracks",
+                                         xbins=400, xmin=-1000, xmax=1000)
+    #
+    montool.defineHistogram('TrackQOverPPass',path='EXPERT', type='TH1F',
+                                         title="Acc. Track q/p; q/p [GeV^{-1}]; Number of tracks",
+                                         xbins=1000, xmin=-10., xmax=10.0)
+    montool.defineHistogram('TrackEtaPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track Eta; #eta; Number of tracks",
+                                         xbins=50, xmin=-2.5, xmax=2.5)
+    montool.defineHistogram('TrackPhiPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track Phi; #phi; Number of tracks",
+                                         xbins=64, xmin=-3.2, xmax=3.2)
+    montool.defineHistogram('TrackThetaPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track Theta; #theta; Number of tracks",
+                                         xbins=64, xmin=0., xmax=3.2)
+    montool.defineHistogram('TrackZ0Pass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track Z0; Track z0 [mm]; Number of tracks",
+                                         xbins=300, xmin=-300.0, xmax=300.0)
+    montool.defineHistogram('TrackD0Pass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track D0; Track d0 [mm]; Number of tracks",
+                                         xbins=300, xmin=-300.0, xmax=300.0)
+    #montool.defineHistogram('TrackZ0errPass', path='EXPERT', type='TH1F',
+    #                                     title="Acc. Track Z0err; Track z0 error [mm]; Number of tracks",
+    #                                     xbins=100, xmin=0., xmax=5.)
+    #montool.defineHistogram('TrackD0errPass', path='EXPERT', type='TH1F',
+    #                                     title="Acc. Track D0err; Track d0 error [mm]; Number of tracks",
+    #                                     xbins=100, xmin=0., xmax=5.)
+    #montool.defineHistogram('TrackQualPass', path='EXPERT', type='TH1F',
+    #                                     title="Acc. Track Qual; Track #chi^{2}/ndf; Number of tracks",
+    #                                     xbins=50, xmin=0., xmax=10.)
+    montool.defineHistogram('TrackNDFPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track NDF; Track NDF; Number of tracks",
+                                         xbins=10, xmin=-0.5, xmax=9.5)
+    montool.defineHistogram('TrackChi2ProbPass', path='EXPERT', type='TH1F',
+                                         title="Acc. Track #chi^{2} probability; Track #chi^{2} probability; Number of tracks",
+                                         xbins=70, xmin=-0.2, xmax=1.2)
+    #Accepted Track hits in ID
+    montool.defineHistogram('TrackTRTHitsPass', path='EXPERT', type='TH1I',
+                                         title="Acc. Track TRT hits; N TRT hits; Number of tracks",
+                                         xbins=71, xmin=-0.5, xmax=70.5)
+    montool.defineHistogram('TrackPIXHitsPass', path='EXPERT', type='TH1I',
+                                         title="Acc. Track PIX hits; N PIX hits; Number of tracks",
+                                         xbins=13, xmin=-0.5, xmax=12.5)
+    montool.defineHistogram('TrackSCTHitsPass', path='EXPERT', type='TH1I',
+                                         title="Acc. Track SCT hits; N SCT hits; Number of tracks",
+                                         xbins=21, xmin=-0.5, xmax=20.5)
+    # Track counting
+    montool.defineHistogram('TrackCountingPass', path='EXPERT', type='TH1I',
+                                         title="Track Counting; Number of tracks per event; Count",
+                                         xbins=300, xmin=-0.5, xmax=299.5)
 
+    return montool
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 61578a95c9cb900d130240fea35cae68d78fc4fa..0094b96bf4359e579fe4cb076ed0653907c5f213 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -9314,6 +9314,24 @@ HLT_mu26_ivarmedium_mu4_probe_L1MU14FCH:
     6: 5
     7: 5
     8: 3
+HLT_mu26_ivarmedium_mu6_msonly_probe_L1MU14FCH:
+  eventCount: 1
+  stepCounts:
+    0: 6
+    1: 4
+    2: 4
+    3: 4
+    4: 4
+    5: 1
+    6: 1
+  stepFeatures:
+    0: 7
+    1: 4
+    2: 4
+    3: 4
+    4: 4
+    5: 5
+    6: 2
 HLT_mu26_ivarmedium_mu6_probe_L1MU14FCH:
   eventCount: 1
   stepCounts:
@@ -9336,6 +9354,24 @@ HLT_mu26_ivarmedium_mu6_probe_L1MU14FCH:
     6: 2
     7: 2
     8: 2
+HLT_mu26_ivarmedium_mu8_msonly_probe_L1MU14FCH:
+  eventCount: 1
+  stepCounts:
+    0: 6
+    1: 4
+    2: 4
+    3: 4
+    4: 4
+    5: 1
+    6: 1
+  stepFeatures:
+    0: 7
+    1: 4
+    2: 4
+    3: 4
+    4: 4
+    5: 5
+    6: 2
 HLT_mu26_ivarmedium_tau100_mediumRNN_tracktwoLLP_03dRAB_L1MU14FCH:
   eventCount: 1
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index c0540895de1adcbc059788c8b19e4908c8fc8e80..cb03e2c6d054d2b7789a67e9cbae3140121d7b71 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -40,8 +40,8 @@ class TrigInDetReco(ExecStep):
         self.preexec_reco =  ';'.join([
             'from RecExConfig.RecFlags import rec',
             'rec.doForwardDet=False',
-            'rec.doEgamma=False',
-            'rec.doMuonCombined=False',
+            'rec.doEgamma=True',
+            'rec.doMuonCombined=True',
             'rec.doJetMissingETTag=False',
             'rec.doTau=False'
         ])
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
index cb7bd9c2f798875d49876a5352f97099ca861500..bd8312e59bae9a548456063f5d462ff5d4068331 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
@@ -144,12 +144,13 @@ if ( True ) :
     #    "HLT_j.*b.*perf_split:key=InDetTrigTrackingxAODCnv_Bjet_IDTrig",
     #    "HLT_j.*b.*perf_split:key=InDetTrigTrackingxAODCnv_Bjet_FTF",
 
-    # "Electrons",
+    "Electrons",
+
+    "Electrons:MediumCB",
+    "Electrons:TightCB",
+    "Electrons:MediumLH",
+    "Electrons:TightLH",
 
-    # "Electrons_MediumCB",
-    # "Electrons_TightCB",
-    # "Electrons_MediumLH",
-    # "Electrons_TightLH",
     # "Taus",
 
     # "Taus_1Prong",
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_cosmic.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_cosmic.py
index b0bc32bac14a19b34582fab3fd41411284a4381d..9605e7ee4330aa77b465f3764878698089fbd8a0 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_cosmic.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_cosmic.py
@@ -43,8 +43,8 @@ Input   = 'mc_cosmics'    # defined in TrigValTools/share/TrigValInputs.json
 Jobs = [ ( "Offline",     " TIDAdata-run3-offline-cosmic.dat      -r Offline -o data-hists-offline.root" ) ]
 
 
-Comp = [ ( "L2cosmic",       "L2cosmic",      "data-hists-offline.root",      " -c TIDAhisto-panel.dat  -d HLTL2-plots-cosmic " ),
-         ( "EFcosmic",       "EFcosmic",      "data-hists-offline.root",   " -c TIDAhisto-panel.dat  -d HLTEF-plots-cosmic " ) ]
+Comp = [ ( "L2cosmic",       "L2cosmic",      "data-hists-offline.root",      " -c TIDAhisto-panel.dat  -d HLTL2-plots " ),
+         ( "EFcosmic",       "EFcosmic",      "data-hists-offline.root",   " -c TIDAhisto-panel.dat  -d HLTEF-plots " ) ]
    
 from AthenaCommon.Include import include 
 include("TrigInDetValidation/TrigInDetValidation_Base.py")
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_elreco.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_elreco.py
new file mode 100755
index 0000000000000000000000000000000000000000..fed8b56c2bcc96e9f00d457564a25363b6745caf
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_elreco.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+# art-description: art job for el_zee_pu40
+# art-type: grid
+# art-include: master/Athena
+# art-input: mc15_13TeV.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.RDO.e3601_s2665_s2183_r7191
+# art-input-nfiles: 8
+# art-athena-mt: 8
+# 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  = ['electron']
+Events  = 16000
+Threads = 8 
+Slots   = 8
+Input   = 'Zee_pu40'    # defined in TrigValTools/share/TrigValInputs.json
+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.dat -r Electrons -o data-hists-offline.root" ) ]
+
+Comp = [ ( "L2eleoffline",       "L2electron",      "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTL2-plots-offline " ),
+         ( "L2eleoffline-lowpt", "L2electronLowpt", "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTL2-plots-lowpt-offline " ),
+         ( "EFeleoffline",       "EFelectron",      "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTEF-plots-offline " ),
+         ( "EFeleoffline-lowpt", "EFelectronLowpt", "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTEF-plots-lowpt-offline " )]
+
+
+
+
+from AthenaCommon.Include import include 
+include("TrigInDetValidation/TrigInDetValidation_Base.py")
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 4c8b450c36d91f8faac05e25f78491a30c399200..9c5e5e12aa0850fe2bee8674269907b6b43b79ff 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -3513,12 +3513,36 @@ HLT_mu26_ivarmedium_mu4_probe_L1MU14FCH:
     0: 1
   stepFeatures:
     0: 1
+HLT_mu26_ivarmedium_mu6_msonly_probe_L1MU14FCH:
+  eventCount: 0
+  stepCounts:
+    0: 1
+  stepFeatures:
+    0: 1
+HLT_mu26_ivarmedium_mu6_msonly_probe_L1MU14FCH:
+  eventCount: 0
+  stepCounts:
+    0: 1
+  stepFeatures:
+    0: 1
 HLT_mu26_ivarmedium_mu6_probe_L1MU14FCH:
   eventCount: 0
   stepCounts:
     0: 1
   stepFeatures:
     0: 1
+HLT_mu26_ivarmedium_mu8_msonly_probe_L1MU14FCH:
+  eventCount: 0
+  stepCounts:
+    0: 1
+  stepFeatures:
+    0: 1
+HLT_mu26_ivarmedium_mu8_msonly_probe_L1MU14FCH:
+  eventCount: 0
+  stepCounts:
+    0: 1
+  stepFeatures:
+    0: 1
 HLT_mu26_ivarmedium_tau100_mediumRNN_tracktwoLLP_03dRAB_L1MU14FCH:
   eventCount: 0
   stepFeatures:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/ElectronChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/ElectronChainConfiguration.py
index 07f354dd15b91368677d75be955eed00d09ffa9f..5143858d2c3d90e51fb2fa4d3fbaf051ea0054f1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/ElectronChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/ElectronChainConfiguration.py
@@ -162,7 +162,6 @@ class ElectronChainConfiguration(ChainConfigurationBase):
         log.debug('electron chain part = %s', self.chainPart)
         key = "nominal"
 
-        
         if self.chainPart['addInfo']:
             if "etcut1step" in self.chainPart['addInfo']:
                 key = "etcut1step"
@@ -185,7 +184,7 @@ class ElectronChainConfiguration(ChainConfigurationBase):
         
         for step in steps:
             log.debug('Adding electron trigger step %s', step)
-            is_probe_leg = self.chainPart['extra']=='probe'
+            is_probe_leg = self.chainPart['tnpInfo']=='probe'
             chainstep = getattr(self, step)(is_probe_leg=is_probe_leg)
             chainSteps+=[chainstep]
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDefInMenu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDefInMenu.py
index 3db84a538a8040bc9530ee7c897134c0d2427f86..c0c032b9825bb7245177e890bcbee0a8371ad671 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDefInMenu.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDefInMenu.py
@@ -26,8 +26,10 @@ class ChainProp:
             actual_type = typing.get_origin(f.type) or f.type
             value = getattr(self, f.name)
             if actual_type == list:
-                if value and not isinstance(value[0], typing.get_args(f.type)):
-                    return f
+                if value:
+                    for el in value:
+                        if not isinstance(el, typing.get_args(f.type)):
+                            return f
             elif not isinstance(value, actual_type):
                 return f
         return None
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 30164624efcd4c264c8bc28e444f26ff77765c14..2f36ea8e43d8d7c0473aa9409911377503937317 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -214,15 +214,14 @@ def analyseChainName(chainName, L1thresholds, L1item):
     
     def buildDict(signature, sigToken ):
         groupdict = {'signature': signature, 'threshold': '', 'multiplicity': '',
-                     'trigType': sigToken, 'extra': ''}
+                     'trigType': sigToken,'tnpInfo': '','extra': ''}
         mdicts.append( groupdict )
 
-       
-    log.debug("chain parts: %s", cparts)
     for cpart in cparts:
 
         log.debug("Looping over chain part: %s", cpart)
         m = pattern.match(cpart)
+
         if m:
             log.debug("Pattern found in this string: %s", cpart)
             groupdict = m.groupdict()
@@ -249,9 +248,13 @@ def analyseChainName(chainName, L1thresholds, L1item):
                 sName = getSignatureNameFromToken(cpart)
             
             groupdict['signature'] = sName
-            groupdict['alignmentGroup'] = getAlignmentGroupFromPattern(sName, groupdict['extra'])
+            log.debug("groupdict['signature']: %s",groupdict['signature'])
             
-            log.debug('groupdictionary groupdict: %s', groupdict)
+            if "tnpInfo" in groupdict.keys() and groupdict['tnpInfo'] != "":
+                groupdict['alignmentGroup'] = getAlignmentGroupFromPattern(sName, groupdict['tnpInfo'])
+            else:
+                groupdict['alignmentGroup'] = getAlignmentGroupFromPattern(sName, groupdict['extra'])
+       
             mdicts.append(groupdict)
 
         elif cpart =='noalg':
@@ -336,7 +339,7 @@ def analyseChainName(chainName, L1thresholds, L1item):
         chainProperties['multiplicity'] = multiplicity
         chainProperties['threshold']=mdicts[chainindex]['threshold']
         chainProperties['signature']=mdicts[chainindex]['signature']
-
+       
         # if we have a L1 topo in a multi-chain then we want to remove it from the chain name
         # but only if it's the same as the L1item_main; otherwise it belongs to chain part and we q
         # have to keep it in the name
@@ -361,9 +364,10 @@ def analyseChainName(chainName, L1thresholds, L1item):
         for t in genchainDict['topo']:
             if (t in AllowedTopos_Bphysics):
                 chainProperties['signature'] = 'Bphysics'
-                chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern('Bphysics', chainProperties['extra'])
-
-
+                if "tnpInfo" in chainProperties.keys() and chainProperties['tnpInfo'] != "":
+                    chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern('Bphysics',chainProperties['tnpInfo'])
+                else:
+                    chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern('Bphysics',chainProperties['extra'])
 
         # ---- import the relevant dictionaries for each part of the chain ----
         from .SignatureDicts import getSignatureInformation
@@ -435,11 +439,15 @@ def analyseChainName(chainName, L1thresholds, L1item):
 
         # ---- set the alignment group here, once we have fully worked out the properties ----
         # ---- this is for the benefit of the probe leg in T&P chains ----
+    
         if 'larnoiseburst' in chainName:
             chainProperties['alignmentGroup'] = 'JetMET'
         else:
-            chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern(mdicts[chainindex]['signature'], chainProperties['extra'])
-
+            if 'tnpInfo' in chainProperties.keys() and chainProperties['tnpInfo'] != "":
+                chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern(mdicts[chainindex]['signature'],chainProperties['tnpInfo'])
+            else:
+                chainProperties['alignmentGroup'] = getAlignmentGroupFromPattern(mdicts[chainindex]['signature'],chainProperties['extra'])
+                
         # ---- the info of the general and the specific chain parts dict ----
         allChainProperties.append(chainProperties)
 
@@ -449,12 +457,15 @@ def analyseChainName(chainName, L1thresholds, L1item):
     for cPart in allChainProperties:
         if cPart['signature'] == 'Jet' and cPart['bTag'] != '':
             cPart['signature'] = 'Bjet'
-            cPart['alignmentGroup'] = getAlignmentGroupFromPattern('Bjet', cPart['extra'])
+            if 'tnpInfo' in cPart.keys() and cPart['tnpInfo'] != "":
+                cPart['alignmentGroup'] = getAlignmentGroupFromPattern('Bjet', cPart['tnpInfo'])
+            else:
+                cPart['alignmentGroup'] = getAlignmentGroupFromPattern('Bjet', cPart['extra'])
         genchainDict['signatures'] += [cPart['signature']]
         genchainDict['alignmentGroups'] += [cPart['alignmentGroup']]
 
     #genchainDict['signature'] = allChainProperties[0]['signature']
-
+   
     return genchainDict
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index bc5a6db1a6dbe4885f4f4de5f1b59f836b2e208a..731a7b6e7b267b565a37bc694a0cf56b27c3bf48 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -172,8 +172,13 @@ def setupMenu():
         ChainProp(name='HLT_mu26_ivarmedium_mu20_ivarloose_probe_L1MU14FCH', l1SeedThresholds=['MU14FCH','PROBEMU14FCH'], groups=SingleMuonGroup+TagAndProbeGroup),
         ChainProp(name='HLT_mu26_ivarmedium_mu20_ivarmedium_probe_L1MU14FCH', l1SeedThresholds=['MU14FCH','PROBEMU14FCH'], groups=SingleMuonGroup+TagAndProbeGroup),
 
+        ## msonlyProbe
+        ChainProp(name='HLT_mu26_ivarmedium_mu6_msonly_probe_L1MU14FCH', l1SeedThresholds=['MU14FCH','PROBEMU5VF'], groups=SingleMuonGroup+TagAndProbeGroup),
+        ChainProp(name='HLT_mu26_ivarmedium_mu8_msonly_probe_L1MU14FCH', l1SeedThresholds=['MU14FCH','PROBEMU5VF'], groups=SingleMuonGroup+TagAndProbeGroup),
+
         #MUON TLA: T&P chain ready to be included when the TLA alignemnt is completed
         ChainProp(name='HLT_mu10_PhysicsTLA_L1MU8F', stream=['TLA'],l1SeedThresholds=['MU8F'], groups=SingleMuonGroup),
+
         #ChainProp(name='HLT_mu10_mu6_probe_PhysicsTLA_L1MU8F', stream=['TLA'],l1SeedThresholds=['MU8F','PROBEMU3V'], groups=MultiMuonGroup),
         
         # ATR-22782
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
index 07d9f36a8affc1c17552de52c50fb8bedae79dc4..d4e36fb57e2d292532dd03d5b5648e7ebf26676d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuAlignmentTools.py
@@ -37,16 +37,18 @@ def get_alignment_group_ordering():
     return [v for v in the_signature_grouping.values() if not (v in seen or seen.add(v))]
 
 def get_alignment_group_from_pattern(signature, extra):
+
     signature_for_alignment = signature + extra
+
     log.debug("[get_alignment_group_from_pattern] Searching for alignment group for %s",signature_for_alignment)
     
     if signature_for_alignment in the_signature_grouping.keys():
         return the_signature_grouping[signature_for_alignment]
     elif signature in the_signature_grouping.keys():
-        log.debug("[get_alignment_group_from_pattern] Falling back to signature alignment grouping for %s (%s)",signature,extra)
+        log.debug("[get_alignment_group_from_pattern] Falling back to signature alignment grouping for %s (%s)",signature, extra)
         return the_signature_grouping[signature]
     else:
-        log.debug("[get_alignment_group_from_pattern] No dedicated alignment grouping for signature %s (%s)",signature,extra)
+        log.debug("[get_alignment_group_from_pattern] No dedicated alignment grouping for signature %s (%s)",signature, extra)
         return signature
 
 def remove_duplicates(config_tuples):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index e0c8454672aee20628c20d0d45c5971066e87286..63e5ae3bd77b619a1430d51e95cfba606bbd008a 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -336,7 +336,8 @@ MuonChainParts = {
     'trigType'       : ['mu'],
     'etaRange'       : ['0eta105'],
     'threshold'      : '',
-    'extra'          : ['noL1', 'lateMu', "muoncalib" ,'noL2Comb','probe'],
+    'tnpInfo'        : ['probe'],
+    'extra'          : ['noL1', 'lateMu', "muoncalib" ,'noL2Comb'],
     'IDinfo'         : [],
     'isoInfo'        : ['ivarloose', 'ivarmedium', 'ivarperf','iloosems'],
     'l2AlgInfo'      : ['l2io','l2mt'],
@@ -359,6 +360,7 @@ MuonChainParts_Default = {
     'trigType'       : ['mu'],
     'etaRange'       : '0eta250',
     'threshold'      : '',
+    'tnpInfo'        : '',
     'extra'          : '',
     'IDinfo'         : '',
     'isoInfo'        : '',
@@ -417,7 +419,8 @@ TauChainParts = {
     'multiplicity'  : '',
     'trigType'      : ['tau'],
     'trkInfo'       : '',
-    'extra'         : ['probe'],
+    'tnpInfo'       : ['probe'],
+    'extra'         : '',
     'recoAlg'       : '',
     'calib'         : '',
     'addInfo'       : ['IdTest'],
@@ -437,6 +440,7 @@ TauChainParts_Default = {
     'multiplicity'  :  '',
     'trigType'      : ['tau'],
     'trkInfo'       : [],
+    'tnpInfo'       : '',
     'extra'         : '',
     'recoAlg'       : '',
     'calib'         : '',
@@ -533,7 +537,8 @@ ElectronChainParts = {
     'alignmentGroup' : ['Electron','Egamma'],
     'chainPartName'  : '',
     'L1threshold'    : '',
-    'extra'          : ['probe','ion'],
+    'tnpInfo'        : ['probe'],
+    'extra'          : ['ion'],
     'multiplicity'   : '',
     'trigType'       : ['e'],
     'threshold'      : '',
@@ -562,6 +567,7 @@ ElectronChainParts_Default = {
     'trigType'       : '',
     'threshold'      : '',
     'etaRange'       : '0eta250',
+    'tnpInfo'        : '',
     'extra'          : '',
     'IDinfoType'     : '',
     'IDinfo'         : '',
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonChainConfiguration.py
index 3b25df64faba9fbae2b3424f68dc3cf065d7930e..04cd94e5560a911edb34d2199f02a388523a2282 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonChainConfiguration.py
@@ -86,13 +86,14 @@ class MuonChainConfiguration(ChainConfigurationBase):
     # ----------------------
     # Assemble the chain depending on information from chainName
     # ----------------------
+    
     def assembleChainImpl(self):                            
         chainSteps = []
 
         stepDictionary = self.getStepDictionary()
 
-        is_probe_leg = self.chainPart['extra']=="probe"
-        key = self.chainPart['extra'] if not is_probe_leg else ""
+        is_probe_leg = self.chainPart['tnpInfo']=="probe"
+        key = self.chainPart['extra']
 
         steps=stepDictionary[key]
 
@@ -109,7 +110,7 @@ class MuonChainConfiguration(ChainConfigurationBase):
     
         myChain = self.buildChain(chainSteps)
         return myChain
-
+     
     def getStepDictionary(self):
 
         # --------------------
@@ -255,4 +256,4 @@ class MuonChainConfiguration(ChainConfigurationBase):
     def getTLAMu(self,is_probe_leg=False): # No T&P support, add if needed
         return self.getStep(5,'muonTLA',[TLAMuonMenuSequenceCfg], is_probe_leg=is_probe_leg)
 
-   
\ No newline at end of file
+   
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
index e8efab4c86ca8fc00beee2b8578a20bb393f3d21..d97a0fc6dab4e7720735cf4ead29e6957db58b29 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
@@ -53,9 +53,13 @@ def EFMuonCBViewDataVerifierCfg(flags, name):
     else:
         EFMuonCBViewDataVerifier.DataObjects += [( 'MuonCandidateCollection' , 'StoreGateSvc+MuonCandidates' ),
                                                  ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+'+flags.Trigger.InDetTracking.Muon.tracks_FTF ),
-                                                 ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData' ),
-                                                 ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+PixelByteStreamErrs' ),
+                                                 ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData' )]
+    if flags.Input.Format == 'BS':
+        EFMuonCBViewDataVerifier.DataObjects += [( 'IDCInDetBSErrContainer' , 'StoreGateSvc+PixelByteStreamErrs' ),
                                                  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' )]
+    if flags.Input.isMC:
+        EFMuonCBViewDataVerifier.DataObjects += [( 'PixelRDO_Container' , 'StoreGateSvc+PixelRDOs' ),
+                                                 ( 'SCT_RDO_Container' , 'StoreGateSvc+SCT_RDOs' ) ]
     result = ComponentAccumulator()
     result.addEventAlgo(EFMuonCBViewDataVerifier)
     return result
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py
index 4a58c2759057cfb94d3bdb77732df1d72136bcf5..fae59788ce577e84bbf37057547535c4fc55f2ce 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Tau/TauChainConfiguration.py
@@ -67,7 +67,7 @@ class TauChainConfiguration(ChainConfigurationBase):
         key = self.chainPart['preselection']
         steps=stepDictionary[key]
         for step in steps:
-            is_probe_leg = self.chainPart['extra']=='probe'
+            is_probe_leg = self.chainPart['tnpInfo']=='probe'
             if 'Empty' in step:
                 chainstep = getattr(self, step)()
             else: