From b11ce52b2f56e87c680ed072f9033650f7627feb Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Fri, 12 Jun 2020 15:46:38 +0100
Subject: [PATCH] Prevent unnecessary checking in offline mode

---
 .../InDetPrepRawDataFormation/src/PixelClusterization.cxx     | 4 ++--
 .../InDetPrepRawDataFormation/src/SCT_Clusterization.cxx      | 4 ++--
 .../InDetPrepRawDataFormation/src/TRT_RIO_Maker.cxx           | 4 ++--
 .../SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx   | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx
index f6560df5b12..bf694c1e3ed 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx
@@ -138,7 +138,7 @@ namespace InDet{
         const COLLECTION* RDO_Collection(*rdoCollections);
         if (!RDO_Collection || RDO_Collection->empty()) continue;
         PixelClusterContainer::IDC_WriteHandle lock = clusterContainer->getWriteHandle(rdoCollections.hashId());
-        if( lock.alreadyPresent() ) continue;
+        if( lock.OnlineAndPresentInAnotherView() ) continue;
 
         // Use one of the specific clustering AlgTools to make clusters
         std::unique_ptr<PixelClusterCollection> clusterCollection (m_clusteringTool->clusterize(*RDO_Collection, *m_idHelper));
@@ -172,7 +172,7 @@ namespace InDet{
 
           if (!RDO_Collection) continue;
           PixelClusterContainer::IDC_WriteHandle lock = clusterContainer->getWriteHandle(listOfPixIds[i]);
-          if( lock.alreadyPresent() ) continue;
+          if( lock.OnlineAndPresentInAnotherView() ) continue;
 
           // Use one of the specific clustering AlgTools to make clusters
           std::unique_ptr<PixelClusterCollection> clusterCollection (m_clusteringTool->clusterize(*RDO_Collection, *m_idHelper));
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/SCT_Clusterization.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/SCT_Clusterization.cxx
index d4304456c73..0392d0aa6d5 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/SCT_Clusterization.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/SCT_Clusterization.cxx
@@ -119,7 +119,7 @@ namespace InDet {
           const InDetRawDataCollection<SCT_RDORawData>* rd{*rdoCollections};
           ATH_MSG_DEBUG("RDO collection size=" << rd->size() << ", Hash=" << rd->identifyHash());
           SCT_ClusterContainer::IDC_WriteHandle lock{clusterContainer->getWriteHandle(rdoCollections.hashId())};
-          if (lock.alreadyPresent()) {
+          if (lock.OnlineAndPresentInAnotherView()) {
             ATH_MSG_DEBUG("Item already in cache , Hash=" << rd->identifyHash());
             continue;
           }
@@ -187,7 +187,7 @@ namespace InDet {
 
 
             SCT_ClusterContainer::IDC_WriteHandle lock{clusterContainer->getWriteHandle(listOfSCTIds[i])};
-            if (lock.alreadyPresent()) {
+            if (lock.OnlineAndPresentInAnotherView()) {
 	      ATH_MSG_DEBUG("Item already in cache , Hash=" << listOfSCTIds[i]);
               continue;
             }
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/TRT_RIO_Maker.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/TRT_RIO_Maker.cxx
index b5351ac681a..0008dcf2549 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/TRT_RIO_Maker.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/TRT_RIO_Maker.cxx
@@ -96,7 +96,7 @@ namespace InDet {
       for(const auto& rdoCollections : *rdoContainer) {
         const InDetRawDataCollection<TRT_RDORawData>* currentCollection(rdoCollections);
         InDet::TRT_DriftCircleContainer::IDC_WriteHandle lock = rioContainer->getWriteHandle(currentCollection->identifyHash());
-        if( lock.alreadyPresent() ) continue;
+        if( lock.OnlineAndPresentInAnotherView() ) continue;
         std::unique_ptr<TRT_DriftCircleCollection> p_rio(m_driftcircle_tool->convert(m_mode_rio_production,
           currentCollection, ctx, m_trtBadChannels));
         if(p_rio && !p_rio->empty()) {
@@ -120,7 +120,7 @@ namespace InDet {
             const InDetRawDataCollection<TRT_RDORawData>* RDO_Collection (rdoContainer->indexFindPtr(id));
             if (!RDO_Collection) continue;
             InDet::TRT_DriftCircleContainer::IDC_WriteHandle lock = rioContainer->getWriteHandle(id);
-            if( lock.alreadyPresent() ) continue;
+            if( lock.OnlineAndPresentInAnotherView() ) continue;
 
             // Use one of the specific clustering AlgTools to make clusters
             std::unique_ptr<TRT_DriftCircleCollection> p_rio(m_driftcircle_tool->convert(m_mode_rio_production,
diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
index 7f9c9b63e52..882c26a2835 100755
--- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
+++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx
@@ -221,7 +221,7 @@ StatusCode SiTrackerSpacePointFinder::execute (const EventContext& ctx) const
       // Create SpacePointCollection
       IdentifierHash idHash = colNext->identifyHash();
       SpacePointContainer::IDC_WriteHandle lock = spacePointContainer_SCT->getWriteHandle(idHash);
-      if(lock.alreadyPresent()){
+      if(lock.OnlineAndPresentInAnotherView()){
           ATH_MSG_DEBUG("SCT Hash " << idHash << " is already in cache");
           ++sctCacheCount;
           continue; //Skip if already present in cache
@@ -277,7 +277,7 @@ StatusCode SiTrackerSpacePointFinder::execute (const EventContext& ctx) const
       nReceivedClustersPIX = (*colNext)->size();
       IdentifierHash idHash = (*colNext)->identifyHash();
       SpacePointContainer::IDC_WriteHandle lock = spacePointContainerPixel->getWriteHandle(idHash);
-      if(lock.alreadyPresent()){
+      if(lock.OnlineAndPresentInAnotherView()){
           ATH_MSG_DEBUG("pixel Hash " << idHash << " is already in cache");
           ++pixCacheCount;
           continue;
-- 
GitLab