From 5f7ed457c191b9c63b6ceef404fbb842ac399a25 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Wed, 8 Aug 2018 12:01:39 +0000
Subject: [PATCH] Add option to use condition object of
 SiDetectorElementCollection in SCT space point formation (ATLASRECTS-4517)

---
 .../SiTrackerSpacePointFinder.h               | 37 +++++----
 .../src/SiTrackerSpacePointFinder.cxx         | 82 ++++++++++++-------
 .../SiSpacePointTool/SiSpacePointMakerTool.h  | 32 ++++----
 .../src/SiSpacePointMakerTool.cxx             | 28 +++----
 .../SiTrigSpacePointFinder.h                  | 22 +++--
 .../src/SCT_TrigSpacePointTool.cxx            | 45 ++++------
 .../src/SCT_TrigSpacePointTool.h              | 28 +++----
 .../src/SiTrigSpacePointFinder.cxx            | 32 ++++++--
 .../ITrigSCT_SpacePointTool.h                 | 35 ++++----
 9 files changed, 193 insertions(+), 148 deletions(-)

diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h
index 0232444ed29..7b4d96f9f83 100755
--- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h
+++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h
@@ -47,24 +47,26 @@
 #define SiSpacePointFormation_SI_POINT_FINDER_H
 
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
+
 #include "AthContainers/DataVector.h"
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "Identifier/Identifier.h"
-
-#include "SiSpacePointTool/SiSpacePointMakerTool.h"
 #include "InDetPrepRawData/PixelClusterCollection.h"
 #include "InDetPrepRawData/SCT_ClusterCollection.h"
-#include "TrkSpacePoint/SpacePoint.h" 
-#include <string>
+#include "InDetPrepRawData/SCT_ClusterContainer.h"
 #include "InDetPrepRawData/SiClusterContainer.h"
 #include "InDetPrepRawData/PixelClusterContainer.h"
-#include "InDetPrepRawData/SCT_ClusterContainer.h"
+#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
+#include "SiSpacePointFormation/SiElementPropertiesTable.h"
+#include "SiSpacePointTool/SiSpacePointMakerTool.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "TrkSpacePoint/SpacePoint.h"
 #include "TrkSpacePoint/SpacePointContainer.h"
-#include "GeoPrimitives/GeoPrimitives.h"
 
-#include "StoreGate/ReadCondHandleKey.h"
-#include "SiSpacePointFormation/SiElementPropertiesTable.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+
+#include <string>
 
 class Event;
 class SpacePointCollection; 
@@ -78,7 +80,6 @@ class IBeamCondSvc;
 
 namespace InDetDD {
   class SCT_DetectorManager;
-  class PixelDetectorManager;
 }
 
 namespace InDet {
@@ -116,17 +117,22 @@ namespace InDet {
     void addSCT_SpacePoints
       (const SCT_ClusterCollection* next,
        const SiElementPropertiesTable* properties,
+       const InDetDD::SiDetectorElementCollection* elements,
        SpacePointCollection* spacepointCollection, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache&) const; 
 
     void checkForSCT_Points
       (const SCT_ClusterCollection* clusters1,
-       const IdentifierHash id2, double minDiff, double maxDiff,
+       const IdentifierHash id2,
+       const InDetDD::SiDetectorElementCollection* elements,
+       double minDiff, double maxDiff,
        SpacePointCollection* spacepointCollection, bool overlapColl, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache&) const; 
 
     void checkForSCT_Points
       (const SCT_ClusterCollection* clusters1, 
-     const IdentifierHash id2, double min1, double max1,
-     double min2, double max2, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache&) const;
+       const IdentifierHash id2,
+       const InDetDD::SiDetectorElementCollection* elements,
+       double min1, double max1,
+       double min2, double max2, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache&) const;
     
 
     // data members
@@ -160,7 +166,6 @@ namespace InDet {
     mutable std::atomic<int> m_pixCacheHits;
     bool m_cachemode; //used for online MT counters
     const InDetDD::SCT_DetectorManager* m_manager; 
-    // const InDetDD::PixelDetectorManager* m_managerPixel;     // unused
     const SCT_ID* m_idHelper;
     const PixelID* m_idHelperPixel;
     
@@ -171,6 +176,8 @@ namespace InDet {
     SG::UpdateHandleKey<SpacePointCache> m_SpacePointCache_PixKey;
     ToolHandle< SiSpacePointMakerTool > m_SiSpacePointMakerTool;
 
+    BooleanProperty m_useDetectorManager{this, "UseDetectorManager", true/*false*/, "Switch to use SiDetectorElementCollection from SCT_DetectorManager for debugging"};
+    SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
     SG::ReadCondHandleKey<InDet::SiElementPropertiesTable> m_SCTPropertiesKey{this, "SCTPropertiesKey", "SCT_ElementPropertiesTable", "Key of input SiElementPropertiesTable for SCT"};
   };
 
diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
index 9b7180dfcb4..265ff77f966 100755
--- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
+++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
@@ -17,7 +17,6 @@ ATLAS Collaboration
 #include "InDetReadoutGeometry/SiLocalPosition.h"
 #include "InDetReadoutGeometry/SiDetectorDesign.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
-#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 
 // Space point Classes,
 #include "TrkSpacePoint/SpacePoint.h"
@@ -32,6 +31,7 @@ ATLAS Collaboration
 #include "AtlasDetDescr/AtlasDetectorID.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "InDetBeamSpotService/IBeamCondSvc.h"
+#include "StoreGate/ReadCondHandle.h"
 
 namespace InDet {
 
@@ -149,8 +149,9 @@ StatusCode SiTrackerSpacePointFinder::initialize()
     // also need the SCT Manager to get the detectorElementCollection
     ATH_CHECK(detStore()->retrieve(m_manager,"SCT"));
 
-    // Initialize the key of input SiElementPropertiesTable for SCT
+    // Initialize the key of input SiElementPropertiesTable and SiDetectorElementCollection for SCT
     ATH_CHECK(m_SCTPropertiesKey.initialize());
+    ATH_CHECK(m_SCTDetEleCollKey.initialize());
   }
 
   ATH_CHECK(m_SiSpacePointMakerTool.retrieve());
@@ -178,8 +179,18 @@ StatusCode SiTrackerSpacePointFinder::execute_r (const EventContext& ctx) const
 
 
   ++m_numberOfEvents;
+  const InDetDD::SiDetectorElementCollection* elements = nullptr;
   const SiElementPropertiesTable* properties = nullptr;
   if (m_selectSCTs) {
+    SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey, ctx);
+    elements = sctDetEle.retrieve();
+    if (elements==nullptr) {
+      ATH_MSG_FATAL("Pointer of SiDetectorElementCollection (" << m_SCTDetEleCollKey.fullKey() << ") could not be retrieved");
+      return StatusCode::SUCCESS;
+    }
+    if (m_useDetectorManager) {
+      elements = m_manager->getDetectorElementCollection();
+    }
     SG::ReadCondHandle<SiElementPropertiesTable> sctProperties(m_SCTPropertiesKey, ctx);
     properties = sctProperties.retrieve();
     if (properties==nullptr) {
@@ -267,7 +278,7 @@ StatusCode SiTrackerSpacePointFinder::execute_r (const EventContext& ctx) const
       spacepointCollection->setIdentifier(elementID);
 
       if ( colNext->size() != 0){
-        addSCT_SpacePoints(colNext, properties,
+        addSCT_SpacePoints(colNext, properties, elements,
                            spacepointCollection.get(), spacepointoverlapCollection.ptr(), r_cache);
       } else {
         ATH_MSG_DEBUG( "Empty SCT cluster collection" );
@@ -390,6 +401,7 @@ StatusCode SiTrackerSpacePointFinder::finalize()
 void SiTrackerSpacePointFinder::
 addSCT_SpacePoints(const SCT_ClusterCollection* next,
                    const SiElementPropertiesTable* properties,
+                   const InDetDD::SiDetectorElementCollection* elements,
     SpacePointCollection* spacepointCollection, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache &r_cache) const
 {
 
@@ -397,7 +409,7 @@ addSCT_SpacePoints(const SCT_ClusterCollection* next,
   IdentifierHash thisHash(next->identifyHash());
 
   // if it is not the stereo side
-  const InDetDD::SiDetectorElement *element = m_manager->getDetectorElement(thisHash);
+  const InDetDD::SiDetectorElement *element = elements->getDetectorElement(thisHash);
   if (element && !(element->isStereo())){
     //if (m_idHelper->side(thisID)==1){
     // Space points are created from clusters for all possibly
@@ -416,8 +428,9 @@ addSCT_SpacePoints(const SCT_ClusterCollection* next,
     bool overlapColl = false;
     // check opposite wafer
     checkForSCT_Points(next, *otherHash,
-        -m_overlapLimitOpposite, +m_overlapLimitOpposite,
-        spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
+                       elements,
+                       -m_overlapLimitOpposite, +m_overlapLimitOpposite,
+                       spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
 
     if (! m_overlap) return;
 
@@ -429,13 +442,15 @@ addSCT_SpacePoints(const SCT_ClusterCollection* next,
     // half-width of wafer
 
     checkForSCT_Points(next, *otherHash,
-        -hwidth, -hwidth+m_overlapLimitPhi,
-        +hwidth-m_overlapLimitPhi, +hwidth,spacepointOverlapCollection, r_cache);
+                       elements,
+                       -hwidth, -hwidth+m_overlapLimitPhi,
+                       +hwidth-m_overlapLimitPhi, +hwidth,spacepointOverlapCollection, r_cache);
     ++otherHash;
     if (otherHash == others->end() ) return;
     checkForSCT_Points(next, *otherHash,
-        +hwidth-m_overlapLimitPhi, +hwidth,
-        -hwidth, -hwidth+m_overlapLimitPhi,spacepointOverlapCollection, r_cache);
+                       elements,
+                       +hwidth-m_overlapLimitPhi, +hwidth,
+                       -hwidth, -hwidth+m_overlapLimitPhi,spacepointOverlapCollection, r_cache);
 
     // if barrel, check the eta overlaps too.
     // In this case, action depends on whether layer is even or odd
@@ -452,26 +467,34 @@ addSCT_SpacePoints(const SCT_ClusterCollection* next,
       //if (m_idHelper->layer_disk(thisID)==0 || m_idHelper->layer_disk(thisID)==2)
       if (m_idHelper->layer_disk(thisID)%2 == 0)
       {
-        checkForSCT_Points(next, *otherHash, +m_overlapLimitEtaMin, 
-            +m_overlapLimitEtaMax,
-            spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
+        checkForSCT_Points(next, *otherHash,
+                           elements,
+                           +m_overlapLimitEtaMin,
+                           +m_overlapLimitEtaMax,
+                           spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
         ++otherHash;
         if (otherHash == others->end() )  return;
 
-        checkForSCT_Points(next, *otherHash, -m_overlapLimitEtaMax, 
-            -m_overlapLimitEtaMin,
-            spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
+        checkForSCT_Points(next, *otherHash,
+                           elements,
+                           -m_overlapLimitEtaMax,
+                           -m_overlapLimitEtaMin,
+                           spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
       }else{
-        checkForSCT_Points(next, *otherHash, -m_overlapLimitEtaMax, 
-            -m_overlapLimitEtaMin,
-            spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
+        checkForSCT_Points(next, *otherHash,
+                           elements,
+                           -m_overlapLimitEtaMax,
+                           -m_overlapLimitEtaMin,
+                           spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
         ++otherHash;
         if (otherHash == others->end() )  return;
 
 
-        checkForSCT_Points(next, *otherHash, +m_overlapLimitEtaMin,
-            +m_overlapLimitEtaMax,
-            spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
+        checkForSCT_Points(next, *otherHash,
+                           elements,
+                           +m_overlapLimitEtaMin,
+                           +m_overlapLimitEtaMax,
+                           spacepointCollection,overlapColl,spacepointOverlapCollection, r_cache);
       }
     }
   }
@@ -481,8 +504,10 @@ addSCT_SpacePoints(const SCT_ClusterCollection* next,
 
 void SiTrackerSpacePointFinder::
 checkForSCT_Points(const SCT_ClusterCollection* clusters1,
-    const IdentifierHash id2, double min, double max,
-    SpacePointCollection* spacepointCollection, bool overlapColl, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache &r_cache) const
+                   const IdentifierHash id2,
+                   const InDetDD::SiDetectorElementCollection* elements,
+                   double min, double max,
+                   SpacePointCollection* spacepointCollection, bool overlapColl, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache &r_cache) const
 {
 
 
@@ -495,16 +520,17 @@ checkForSCT_Points(const SCT_ClusterCollection* clusters1,
   if (clusters2==nullptr) return;
 
   if (!overlapColl) {
-    m_SiSpacePointMakerTool->fillSCT_SpacePointCollection(clusters1, clusters2, min, max, m_allClusters, r_cache.vertex, m_manager, spacepointCollection);
+    m_SiSpacePointMakerTool->fillSCT_SpacePointCollection(clusters1, clusters2, min, max, m_allClusters, r_cache.vertex, elements, spacepointCollection);
   }
   else {
-    m_SiSpacePointMakerTool->fillSCT_SpacePointEtaOverlapCollection(clusters1, clusters2, min, max, m_allClusters, r_cache.vertex, m_manager, spacepointOverlapCollection);
+    m_SiSpacePointMakerTool->fillSCT_SpacePointEtaOverlapCollection(clusters1, clusters2, min, max, m_allClusters, r_cache.vertex, elements, spacepointOverlapCollection);
   }
 }
 //--------------------------------------------------------------------------
 void SiTrackerSpacePointFinder::
 checkForSCT_Points(const SCT_ClusterCollection* clusters1,
-    const IdentifierHash id2,
+                   const IdentifierHash id2,
+                   const InDetDD::SiDetectorElementCollection* elements,
     double min1, double max1, double min2, double max2, SpacePointOverlapCollection* spacepointOverlapCollection, SPFCache &r_cache) const
 {
 
@@ -514,7 +540,7 @@ checkForSCT_Points(const SCT_ClusterCollection* clusters1,
   const SCT_ClusterCollection * clusters2 (r_cache.SCTCContainer->indexFindPtr(id2));
   if (clusters2==nullptr) return;
 
-  m_SiSpacePointMakerTool->fillSCT_SpacePointPhiOverlapCollection(clusters1, clusters2, min1, max1, min2, max2, m_allClusters, r_cache.vertex, m_manager, spacepointOverlapCollection);
+  m_SiSpacePointMakerTool->fillSCT_SpacePointPhiOverlapCollection(clusters1, clusters2, min1, max1, min2, max2, m_allClusters, r_cache.vertex, elements, spacepointOverlapCollection);
 }
 
 } //namespace
diff --git a/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/SiSpacePointMakerTool.h b/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/SiSpacePointMakerTool.h
index 6925944b410..aff7ae5ab72 100644
--- a/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/SiSpacePointMakerTool.h
+++ b/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/SiSpacePointMakerTool.h
@@ -21,7 +21,7 @@ namespace Trk{
 }
 
 namespace InDetDD{
-  class SCT_DetectorManager;
+  class SiDetectorElementCollection;
   class SiDetectorElement;
 }
 namespace InDet{
@@ -49,24 +49,24 @@ namespace InDet{
 		  const Amg::Vector3D& vertexVec,
 		  const InDetDD::SiDetectorElement *element1, const InDetDD::SiDetectorElement *element2, double stripLengthGapTolerance) const;
 
-		void fillSCT_SpacePointCollection(const InDet::SCT_ClusterCollection* clusters1, 
-		  const InDet::SCT_ClusterCollection* clusters2, double min, double max, bool allClusters, 
-		  const Amg::Vector3D& vertexVec, const InDetDD::SCT_DetectorManager *SCT_Manager, 
-		  SpacePointCollection* spacepointCollection) const;
+                void fillSCT_SpacePointCollection(const InDet::SCT_ClusterCollection* clusters1,
+                                                  const InDet::SCT_ClusterCollection* clusters2, double min, double max, bool allClusters,
+                                                  const Amg::Vector3D& vertexVec, const InDetDD::SiDetectorElementCollection* elements,
+                                                  SpacePointCollection* spacepointCollection) const;
 
-		void fillPixelSpacePointCollection(const InDet::PixelClusterCollection* clusters, 
-		  SpacePointCollection* spacepointCollection) const;
+                void fillPixelSpacePointCollection(const InDet::PixelClusterCollection* clusters,
+                                                   SpacePointCollection* spacepointCollection) const;
 
-		void fillSCT_SpacePointEtaOverlapCollection(const InDet::SCT_ClusterCollection* clusters1, 
-		  const InDet::SCT_ClusterCollection* clusters2, double min, double max, bool allClusters, 
-		  const Amg::Vector3D& vertexVec, const InDetDD::SCT_DetectorManager *SCT_Manager, 
-		  SpacePointOverlapCollection* spacepointOverlapCollection) const;
+                void fillSCT_SpacePointEtaOverlapCollection(const InDet::SCT_ClusterCollection* clusters1,
+                                                            const InDet::SCT_ClusterCollection* clusters2, double min, double max, bool allClusters,
+                                                            const Amg::Vector3D& vertexVec, const InDetDD::SiDetectorElementCollection* elements,
+                                                            SpacePointOverlapCollection* spacepointOverlapCollection) const;
 
-		void fillSCT_SpacePointPhiOverlapCollection(const InDet::SCT_ClusterCollection* clusters1, 
-		  const InDet::SCT_ClusterCollection* clusters2, double min1, double max1, double min2, 
-		  double max2, bool allClusters, const Amg::Vector3D& vertexVec , 
-		  const InDetDD::SCT_DetectorManager *SCT_Manager, 
-		  SpacePointOverlapCollection* spacepointOverlapCollection) const;
+                void fillSCT_SpacePointPhiOverlapCollection(const InDet::SCT_ClusterCollection* clusters1,
+                                                            const InDet::SCT_ClusterCollection* clusters2, double min1, double max1, double min2,
+                                                            double max2, bool allClusters, const Amg::Vector3D& vertexVec ,
+                                                            const InDetDD::SiDetectorElementCollection* elements,
+                                                            SpacePointOverlapCollection* spacepointOverlapCollection) const;
 
 	private:
 		double m_stripLengthTolerance;
diff --git a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx
index 3038003db0f..fd3e94e881c 100644
--- a/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx
+++ b/InnerDetector/InDetRecTools/SiSpacePointTool/src/SiSpacePointMakerTool.cxx
@@ -6,14 +6,14 @@
 #include "SiSpacePointTool/SiSpacePointMakerTool.h"
 // Cluster and space point collections
 
-#include "TrkSpacePoint/SpacePointCollection.h" 
-#include "TrkSpacePoint/SpacePointOverlapCollection.h" 
+#include "TrkSpacePoint/SpacePointCollection.h"
+#include "TrkSpacePoint/SpacePointOverlapCollection.h"
 
 // For processing clusters
-#include "InDetReadoutGeometry/SCT_DetectorManager.h"
 #include "InDetIdentifier/SCT_ID.h"
-#include "InDetReadoutGeometry/SiLocalPosition.h" 
-#include "InDetReadoutGeometry/SiDetectorElement.h" 
+#include "InDetReadoutGeometry/SiLocalPosition.h"
+#include "InDetReadoutGeometry/SiDetectorElement.h"
+#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 
 // Space points
 #include "SiSpacePoint/SCT_SpacePoint.h"
@@ -180,7 +180,7 @@ Trk::SpacePoint* SiSpacePointMakerTool::makeSCT_SpacePoint(const InDet::SiCluste
 //--------------------------------------------------------------------------
 void SiSpacePointMakerTool::fillSCT_SpacePointCollection(const InDet::SCT_ClusterCollection* clusters1, 
   const InDet::SCT_ClusterCollection* clusters2, double min, double max, bool allClusters, 
-  const Amg::Vector3D& vertexVec, const InDetDD::SCT_DetectorManager *SCT_Manager, SpacePointCollection* spacepointCollection) const {
+  const Amg::Vector3D& vertexVec, const InDetDD::SiDetectorElementCollection* elements, SpacePointCollection* spacepointCollection) const {
 
   double stripLengthGapTolerance = 0.; 
 
@@ -194,7 +194,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointCollection(const InDet::SCT_Cluste
   // -ME fixme- get first element
   const InDetDD::SiDetectorElement *element1 =0;
  
-  if ((*clusters1Next) &&(clusters1Next!=clusters1Finish)) element1 = SCT_Manager->getDetectorElement(m_idHelper->wafer_id((*clusters1Next)->identify()));
+  if ((*clusters1Next) &&(clusters1Next!=clusters1Finish)) element1 = elements->getDetectorElement(clusters1->identifyHash());
 
   if (!element1) {
     msg(MSG::ERROR) << "Bad cluster identifier  " << m_idHelper->show_to_string((*clusters1Next)->identify()) <<endmsg;
@@ -213,7 +213,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointCollection(const InDet::SCT_Cluste
     
     // -ME fixme- get first element
     const InDetDD::SiDetectorElement *element2 =0;
-    if (*clusters2Next && (clusters2Next != clusters2Finish)) element2= SCT_Manager->getDetectorElement(m_idHelper->wafer_id((*clusters2Next)->identify()));
+    if (*clusters2Next && (clusters2Next != clusters2Finish)) element2= elements->getDetectorElement(clusters2->identifyHash());
 
     if (!element2) {
       msg(MSG::ERROR) << "Bad cluster identifier  " << m_idHelper->show_to_string((*clusters2Next)->identify()) <<endmsg;
@@ -264,7 +264,7 @@ void SiSpacePointMakerTool::fillPixelSpacePointCollection(const InDet::PixelClus
 //--------------------------------------------------------------------------
 void SiSpacePointMakerTool::fillSCT_SpacePointEtaOverlapCollection(const InDet::SCT_ClusterCollection* clusters1, 
   const InDet::SCT_ClusterCollection* clusters2, double min, double max, bool allClusters, 
-  const Amg::Vector3D& vertexVec, const InDetDD::SCT_DetectorManager *SCT_Manager, 
+  const Amg::Vector3D& vertexVec, const InDetDD::SiDetectorElementCollection* elements,
   SpacePointOverlapCollection* spacepointoverlapCollection) const {
 
   double stripLengthGapTolerance = 0.; 
@@ -279,7 +279,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointEtaOverlapCollection(const InDet::
 
   const InDetDD::SiDetectorElement *element1 =0;
    
-  if ((*clusters1Next) &&(clusters1Next!=clusters1Finish)) element1 = SCT_Manager->getDetectorElement(m_idHelper->wafer_id((*clusters1Next)->identify()));
+  if ((*clusters1Next) &&(clusters1Next!=clusters1Finish)) element1 = elements->getDetectorElement(clusters1->identifyHash());
   if (!element1) {
     msg(MSG::ERROR) << "Bad cluster identifier  " << m_idHelper->show_to_string((*clusters1Next)->identify()) <<endmsg;
     return;
@@ -296,7 +296,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointEtaOverlapCollection(const InDet::
       clusters2Finish=(*clusters2).end();
     
     const InDetDD::SiDetectorElement *element2 =0;
-    if (*clusters2Next && (clusters2Next != clusters2Finish)) element2= SCT_Manager->getDetectorElement(m_idHelper->wafer_id((*clusters2Next)->identify()));
+    if (*clusters2Next && (clusters2Next != clusters2Finish)) element2= elements->getDetectorElement(clusters2->identifyHash());
     if (!element2) {
       msg(MSG::ERROR) << "Bad cluster identifier  " << m_idHelper->show_to_string((*clusters2Next)->identify()) <<endmsg;
       break;
@@ -324,7 +324,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointEtaOverlapCollection(const InDet::
 //--------------------------------------------------------------------------
 void SiSpacePointMakerTool::fillSCT_SpacePointPhiOverlapCollection(const InDet::SCT_ClusterCollection* clusters1, 
   const InDet::SCT_ClusterCollection* clusters2, double min1, double max1, double min2, double max2, 
-  bool allClusters, const Amg::Vector3D& vertexVec, const InDetDD::SCT_DetectorManager *SCT_Manager, 
+  bool allClusters, const Amg::Vector3D& vertexVec, const InDetDD::SiDetectorElementCollection* elements,
   SpacePointOverlapCollection* spacepointoverlapCollection) const {
 
   double stripLengthGapTolerance = 0.; if(m_SCTgapParameter!=0.) {min1-=20.;  max1+=20.;}
@@ -340,7 +340,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointPhiOverlapCollection(const InDet::
     clusters1Finish = clusters1->end();
 
   const InDetDD::SiDetectorElement *element1 =0;
-  if ( (*clusters1Next) && (clusters1Next!=clusters1Finish)) element1= SCT_Manager->getDetectorElement(m_idHelper->wafer_id((*clusters1Next)->identify()));
+  if ( (*clusters1Next) && (clusters1Next!=clusters1Finish)) element1= elements->getDetectorElement(clusters1->identifyHash());
   if (!element1) {
     msg(MSG::ERROR) << "Bad cluster identifier  " << m_idHelper->show_to_string((*clusters1Next)->identify()) <<endmsg;
     return;
@@ -357,7 +357,7 @@ void SiSpacePointMakerTool::fillSCT_SpacePointPhiOverlapCollection(const InDet::
 	clusters2Finish=(*clusters2).end();
       
       const InDetDD::SiDetectorElement *element2 =0;
-      if (*clusters2Next&&(clusters2Next != clusters2Finish)) element2 = SCT_Manager->getDetectorElement(m_idHelper->wafer_id((*clusters2Next)->identify()));
+      if (*clusters2Next&&(clusters2Next != clusters2Finish)) element2 = elements->getDetectorElement(clusters2->identifyHash());
       if (!element2) {
 	msg(MSG::ERROR) << "Bad cluster identifier  " << m_idHelper->show_to_string((*clusters2Next)->identify()) <<endmsg;
 	break;
diff --git a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/SiTrigSpacePointFormation/SiTrigSpacePointFinder.h b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/SiTrigSpacePointFormation/SiTrigSpacePointFinder.h
index 08701da720e..95ad53cd7cb 100755
--- a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/SiTrigSpacePointFormation/SiTrigSpacePointFinder.h
+++ b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/SiTrigSpacePointFormation/SiTrigSpacePointFinder.h
@@ -26,21 +26,20 @@
 #ifndef SiTrigSpacePointFormation_SI_POINT_FINDER_H
 #define SiTrigSpacePointFormation_SI_POINT_FINDER_H
 
-//!< INCLUDES                                                    
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-
+//!<  Trigger includes
+#include "TrigInterfaces/FexAlgo.h"
 
+//!< INCLUDES
 #include "Identifier/IdentifierHash.h"
 // typedef, cannot fwd declare
 #include "InDetPrepRawData/PixelClusterContainer.h"
 #include "InDetPrepRawData/SCT_ClusterContainer.h"
-
-#include "StoreGate/ReadCondHandleKey.h"
+#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "SiSpacePointFormation/SiElementPropertiesTable.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
-//!<  Trigger includes
-#include "TrigInterfaces/FexAlgo.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "GaudiKernel/ServiceHandle.h"
 
 #include <string>
 #include <vector>
@@ -51,9 +50,11 @@ class SpacePointCollection;
 class SpacePointContainer; 
 class SpacePointOverlapCollection;
 class IRegSelSvc;
-class PixelID;
 class TrigTimer;
 
+namespace InDetDD {
+  class SCT_DetectorManager;
+}
 
 namespace InDet{
 
@@ -88,6 +89,7 @@ namespace InDet{
     //    int m_numberOfEvents;
     //    const InDetDD::PixelDetectorManager *m_managerPixel; 
     //    const PixelID* m_idHelperPixel;
+    const InDetDD::SCT_DetectorManager* m_managerSCT;
     IdentifierHash m_maxKey;
     
     const SCT_ClusterContainer *m_sctClusterContainer{};
@@ -97,6 +99,8 @@ namespace InDet{
 
     SpacePointOverlapCollection*    m_spOverlapColl;     
 
+    BooleanProperty m_useDetectorManager{this, "UseDetectorManager", true/*false*/, "Switch to use SiDetectorElementCollection from SCT_DetectorManager for debugging"};
+    SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
     SG::ReadCondHandleKey<InDet::SiElementPropertiesTable> m_SCTPropertiesKey{this, "SCTPropertiesKey",
         "SCT_ElementPropertiesTable", "Key of input SiElementPropertiesTable for SCT"};
 
diff --git a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.cxx b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.cxx
index b29a97ca576..460cc292ae5 100755
--- a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.cxx
@@ -84,15 +84,6 @@ StatusCode SCT_TrigSpacePointTool::initialize()  {
 
   // Make a table of neighbours and widths of side 1 SCT wafers
   
-  InDetDD::SiDetectorElementCollection* elements;
-  elements = const_cast<InDetDD::SiDetectorElementCollection*>
-    (m_manager->getDetectorElementCollection());   
-  
-  if (!elements) {
-    ATH_MSG_FATAL( "Cannot retrieve detector elements" );
-    return StatusCode::FAILURE;
-  } 
-
   ATH_CHECK( toolSvc()->retrieveTool(m_SiSpacePointMakerToolName, 
                                      m_SiSpacePointMakerTool, this) );
 
@@ -110,22 +101,13 @@ StatusCode SCT_TrigSpacePointTool::finalize() {
 }
 
 
-//--------------------------------------------------------------------------
-void SCT_TrigSpacePointTool::
-addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection, 
-                   const SCT_ClusterContainer* clusterContainer,
-                   const SiElementPropertiesTable* properties,
-                   SpacePointCollection* spacepointCollection) {
-
-  addSCT_SpacePoints(clusCollection, clusterContainer, properties, spacepointCollection, 0);
-}
-				
 //--------------------------------------------------------------------------
 
 void SCT_TrigSpacePointTool::
 addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection, 
                    const SCT_ClusterContainer* clusterContainer,
                    const SiElementPropertiesTable* properties,
+                   const InDetDD::SiDetectorElementCollection* elements,
                    SpacePointCollection* spacepointCollection,
                    SpacePointOverlapCollection* overlapColl) {
 
@@ -149,11 +131,12 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
   }
 
   // Do nothing unless this is a side 1 detector (strips of const phi).
+  IdentifierHash thisHash(clusCollection->identifyHash());
   Identifier thisID(clusCollection->identify());
-  
+
   // if it is not the stereo side
   const InDetDD::SiDetectorElement *element = 
-    m_manager->getDetectorElement(m_idHelper->wafer_id(thisID));
+    elements->getDetectorElement(thisHash);
 
   if (element && !(element->isStereo())){
     //if (m_idHelper->side(thisID)==1) {
@@ -165,8 +148,6 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
     // "check1" is used for opposite and eta overlaps.
     // check2 for phi overlaps
 
-    IdentifierHash thisHash = m_idHelper->wafer_hash(thisID);
-
     const std::vector<IdentifierHash>* 
       others(properties->neighbours(thisHash));
     if (others==0 || others->empty() ) return;
@@ -175,6 +156,7 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
     bool doOverlapColl = false;
     // check opposite wafer
     checkForSCT_Points(clusCollection, *otherHash, 
+                       elements,
 		       -m_overlapLimitOpposite, +m_overlapLimitOpposite,
 		       spacepointCollection,doOverlapColl);
     
@@ -193,11 +175,13 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
     // half-width of wafer
     
     checkForSCT_Points(clusCollection, *otherHash, 
+                       elements,
 		       -hwidth, -hwidth+m_overlapLimitPhi, 
 		       +hwidth-m_overlapLimitPhi, +hwidth);
     ++otherHash;
     if (otherHash == others->end() )  return;
     checkForSCT_Points(clusCollection, *otherHash, 
+                       elements,
 		       +hwidth-m_overlapLimitPhi, +hwidth,
 		       -hwidth, -hwidth+m_overlapLimitPhi);
     
@@ -213,6 +197,7 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
 	    m_idHelper->layer_disk(thisID)==2)
 	  {
 	    checkForSCT_Points(clusCollection, *otherHash, 
+                               elements,
 			       +m_overlapLimitEtaMin, 
 			       +m_overlapLimitEtaMax,
 			       spacepointCollection,doOverlapColl);
@@ -220,11 +205,13 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
 	    if (otherHash == others->end() )  return;
 	    
 	    checkForSCT_Points(clusCollection, *otherHash, 
+                               elements,
 			       -m_overlapLimitEtaMax, 
 			       -m_overlapLimitEtaMin,
 			       spacepointCollection,doOverlapColl);
 	  }else{
 	    checkForSCT_Points(clusCollection, *otherHash, 
+                               elements,
 			       -m_overlapLimitEtaMax, 
 			       -m_overlapLimitEtaMin,
 			       spacepointCollection,doOverlapColl);
@@ -232,6 +219,7 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
 	    if (otherHash == others->end() )  return;
 	     
 	    checkForSCT_Points(clusCollection, *otherHash, 
+                               elements,
 			       +m_overlapLimitEtaMin,
 			       +m_overlapLimitEtaMax,
 			       spacepointCollection,doOverlapColl);
@@ -246,7 +234,9 @@ addSCT_SpacePoints(const SCT_ClusterCollection* clusCollection,
 
 void SCT_TrigSpacePointTool::
 checkForSCT_Points(const SCT_ClusterCollection* clusters1,
-		   const IdentifierHash& id2, double min, double max,
+		   const IdentifierHash& id2,
+                   const InDetDD::SiDetectorElementCollection* elements,
+                   double min, double max,
 		   SpacePointCollection* spacepointCollection, 
 		   bool overlapColl) {
 
@@ -271,7 +261,7 @@ checkForSCT_Points(const SCT_ClusterCollection* clusters1,
   if (!overlapColl) {
     m_SiSpacePointMakerTool->
       fillSCT_SpacePointCollection(clusters1, clusters2,min, max, 
-				   m_allClusters, beampos, m_manager, 
+				   m_allClusters, beampos, elements,
 				   spacepointCollection);
   }
 
@@ -279,7 +269,7 @@ checkForSCT_Points(const SCT_ClusterCollection* clusters1,
     m_SiSpacePointMakerTool->
       fillSCT_SpacePointEtaOverlapCollection(clusters1, clusters2, min, max, 
 					     m_allClusters, beampos, 
-					     m_manager,
+					     elements,
 					     m_spacepointoverlapCollection);
   }
 }
@@ -288,6 +278,7 @@ checkForSCT_Points(const SCT_ClusterCollection* clusters1,
 void SCT_TrigSpacePointTool::
   checkForSCT_Points(const SCT_ClusterCollection* clusters1,
 		     const IdentifierHash& id2,
+                     const InDetDD::SiDetectorElementCollection* elements,
 		     double min1, double max1, double min2, double max2){
 
   // get the cluster collections for these two detectors. Clus1 must lie
@@ -312,7 +303,7 @@ void SCT_TrigSpacePointTool::
   m_SiSpacePointMakerTool->
     fillSCT_SpacePointPhiOverlapCollection(clusters1, clusters2, min1, max1, 
 					   min2, max2, m_allClusters, beampos,
-					   m_manager, 
+					   elements,
 					   m_spacepointoverlapCollection);
 
 }
diff --git a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.h b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.h
index a4711fa7304..148e52daf7d 100755
--- a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.h
+++ b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SCT_TrigSpacePointTool.h
@@ -53,6 +53,7 @@ class SCT_NeighboursTable;
 class IBeamCondSvc;
 
 namespace InDet { class SiElementPropertiesTable;}
+namespace InDetDD { class SiDetectorElementCollection; }
 typedef InDet::SCT_ClusterContainer SCT_ClusterContainer; 
 typedef InDet::SiClusterCollection SiClusterCollection; 
 typedef InDet::SiCluster SiCluster; 
@@ -84,25 +85,24 @@ namespace InDet {
     void addSCT_SpacePoints (const SCT_ClusterCollection* clusCollection,
                              const SCT_ClusterContainer* clusterContainer,
                              const SiElementPropertiesTable* properties,
+                             const InDetDD::SiDetectorElementCollection* elements,
                              SpacePointCollection* spacepointCollection,
                              SpacePointOverlapCollection* overlapColl);
 
-    void addSCT_SpacePoints (const SCT_ClusterCollection* clusCollection,
-                             const SCT_ClusterContainer* clusterContainer,
-                             const SiElementPropertiesTable* properties,
-                             SpacePointCollection* spacepointCollection);
-
+    void checkForSCT_Points (const SCT_ClusterCollection* clusters1,
+                             const IdentifierHash& id2,
+                             const InDetDD::SiDetectorElementCollection* elements,
+                             double minDiff,
+                             double maxDiff,
+                             SpacePointCollection* spacepointCollection,
+                             bool overlapColl);
 
     void checkForSCT_Points (const SCT_ClusterCollection* clusters1,
-			     const IdentifierHash& id2, double minDiff, 
-			     double maxDiff,
-			     SpacePointCollection* spacepointCollection, 
-			     bool overlapColl); 
-
-    void checkForSCT_Points (const SCT_ClusterCollection* clusters1, 
-			     const IdentifierHash& id2, double min1, 
-			     double max1,
-			     double min2, double max2);
+                             const IdentifierHash& id2,
+                             const InDetDD::SiDetectorElementCollection* elements,
+                             double min1,
+                             double max1,
+                             double min2, double max2);
 
 
   private:
diff --git a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SiTrigSpacePointFinder.cxx b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SiTrigSpacePointFinder.cxx
index 6d271e8e1d6..97312605e03 100755
--- a/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SiTrigSpacePointFinder.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/SiTrigSpacePointFormation/src/SiTrigSpacePointFinder.cxx
@@ -16,11 +16,9 @@ ATLAS Collaboration
 #include "InDetPrepRawData/PixelClusterCollection.h"
 #include "InDetPrepRawData/SCT_ClusterCollection.h"
 
-#include "GaudiKernel/ITHistSvc.h"
-
+#include "InDetReadoutGeometry/SCT_DetectorManager.h"
 #include "InDetReadoutGeometry/SiLocalPosition.h" 
 #include "InDetReadoutGeometry/SiDetectorElement.h" 
-#include "InDetReadoutGeometry/SiDetectorElementCollection.h" 
 
 // Space point Classes,
 #include "TrkSpacePoint/SpacePoint.h" 
@@ -30,12 +28,13 @@ ATLAS Collaboration
 #include "InDetIdentifier/PixelID.h"
 #include "InDetIdentifier/SCT_ID.h"
 
-
 // Trigger
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 #include "IRegionSelector/IRegSelSvc.h"
 #include "TrigTimeAlgs/TrigTimer.h"
 
+#include "GaudiKernel/ITHistSvc.h"
+
 namespace InDet{
 
   //  using namespace Trk;
@@ -57,6 +56,7 @@ namespace InDet{
     m_selectPixels(true),
     m_selectSCTs(true),
     m_overlap(false),
+    m_managerSCT(nullptr),
     m_SpacePointContainerSCT(0),
     m_SpacePointContainerPixel(0),
     m_spOverlapColl(0),
@@ -173,7 +173,12 @@ namespace InDet{
       ATH_MSG_FATAL( "Cannot retrieve SCT ID helper!" );
       return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
     } 
-  
+    // SCT detector manager
+    sc = detStore()->retrieve(m_managerSCT, "SCT");
+    if (sc.isFailure()) {
+      ATH_MSG_FATAL( "Cannot retrieve SCT detector manager!" );
+      return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
+    }
 
     // register the IdentifiableContainer into StoreGate
     // ------------------------------------------------------
@@ -264,6 +269,10 @@ namespace InDet{
 
     if (m_selectSCTs) {
       // ReadCondHandleKey for SCT alignment conditions
+      if (m_SCTDetEleCollKey.initialize().isFailure()) {
+        ATH_MSG_FATAL( "Failed to initialize " << m_SCTDetEleCollKey.fullKey() );
+        return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
+      }
       if (m_SCTPropertiesKey.initialize().isFailure()) {
         ATH_MSG_FATAL( "Failed to initialize " << m_SCTPropertiesKey.fullKey() );
         return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
@@ -428,7 +437,16 @@ namespace InDet{
     }
 
     if (m_selectSCTs &&  doSCT ){ 
-
+      // ReadCondHandle for SCT alignment conditions
+      SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey);
+      const InDetDD::SiDetectorElementCollection* elements(sctDetEle.retrieve());
+      if (elements==nullptr) {
+        ATH_MSG_FATAL("Pointer of SiDetectorElementCollection (" << m_SCTDetEleCollKey.fullKey() << ") could not be retrieved");
+        return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP);
+      }
+      if (m_useDetectorManager) {
+        elements = m_managerSCT->getDetectorElementCollection();
+      }
       SG::ReadCondHandle<SiElementPropertiesTable> sctProperties(m_SCTPropertiesKey);
       const SiElementPropertiesTable* properties(sctProperties.retrieve());
       if (properties==nullptr) {
@@ -486,6 +504,7 @@ namespace InDet{
 	    m_trigSpacePointTool->addSCT_SpacePoints(SCTClusterCollection,
 						     m_sctClusterContainer,
                                                      properties,
+                                                     elements,
 						     spacepointCollection,
 						     m_spOverlapColl);
 	  }
@@ -537,6 +556,7 @@ namespace InDet{
 	    m_trigSpacePointTool->addSCT_SpacePoints(colNext,
 						     m_sctClusterContainer,
                                                      properties,
+                                                     elements,
 						     spacepointCollection,
 						     m_spOverlapColl);
 	  }
diff --git a/InnerDetector/InDetTrigRecTools/InDetTrigToolInterfaces/InDetTrigToolInterfaces/ITrigSCT_SpacePointTool.h b/InnerDetector/InDetTrigRecTools/InDetTrigToolInterfaces/InDetTrigToolInterfaces/ITrigSCT_SpacePointTool.h
index 34996a91770..76061f80a25 100644
--- a/InnerDetector/InDetTrigRecTools/InDetTrigToolInterfaces/InDetTrigToolInterfaces/ITrigSCT_SpacePointTool.h
+++ b/InnerDetector/InDetTrigRecTools/InDetTrigToolInterfaces/InDetTrigToolInterfaces/ITrigSCT_SpacePointTool.h
@@ -27,6 +27,9 @@
 //fwd decl
 class SpacePointCollection;
 class SpacePointOverlapCollection;
+namespace InDetDD {
+  class SiDetectorElementCollection;
+}
 
 namespace InDet {
   class SiElementPropertiesTable;
@@ -44,37 +47,31 @@ namespace InDet {
      * @param[in]  clusCollection        Cluster collection
      * @param[in]  clusterContainer      Cluster container
      * @param[in]  properties            SiElementPropertiesTable
-     * @param[out] spacepointCollection  SpacePoint collection
-     */
-    virtual void addSCT_SpacePoints (const SCT_ClusterCollection* clusCollection,
-                                     const SCT_ClusterContainer* clusterContainer,
-                                     const SiElementPropertiesTable* properties,
-                                     SpacePointCollection* spacepointCollection)=0;
-
-    /**
-     * Convert clusters to SpacePoints
-     * @param[in]  clusCollection        Cluster collection
-     * @param[in]  clusterContainer      Cluster container
-     * @param[in]  properties            SiElementPropertiesTable
+     * @param[in]  elements              SiDetectorElementCollection
      * @param[out] spacepointCollection  SpacePoint collection
      * @param      overlapColl           collection of SP with overlaps
      */
     virtual void addSCT_SpacePoints (const SCT_ClusterCollection* clusCollection,
                                      const SCT_ClusterContainer* clusterContainer,
                                      const SiElementPropertiesTable* properties,
+                                     const InDetDD::SiDetectorElementCollection* elements,
                                      SpacePointCollection* spacepointCollection,
                                      SpacePointOverlapCollection* overlapColl)=0;
 
     virtual void checkForSCT_Points (const SCT_ClusterCollection* clusters1,
-				     const IdentifierHash& id2, double minDiff, 
-				     double maxDiff,
-				     SpacePointCollection* spacepointCollection, 
-				     bool overlapColl) = 0;
+                                     const IdentifierHash& id2,
+                                     const InDetDD::SiDetectorElementCollection* elements,
+                                     double minDiff,
+                                     double maxDiff,
+                                     SpacePointCollection* spacepointCollection,
+                                     bool overlapColl) = 0;
 
     virtual void checkForSCT_Points (const SCT_ClusterCollection* clusters1, 
-				     const IdentifierHash& id2, double min1, 
-				     double max1,
-				     double min2, double max2) = 0;
+                                     const IdentifierHash& id2,
+                                     const InDetDD::SiDetectorElementCollection* elements,
+                                     double min1,
+                                     double max1,
+                                     double min2, double max2) = 0;
 
   };
 
-- 
GitLab