From c8640a409896bc2c14a0186ce9642f65407631c6 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Fri, 25 Oct 2019 19:47:24 +0200
Subject: [PATCH] Remove thread unsafe getSVOwnership completely

---
 .../src/InDetImprovedJetFitterVxFinder.cxx                | 2 +-
 .../InDetTrigVxSecondary/src/TrigVxSecondary.cxx          | 2 +-
 .../InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx     | 2 +-
 .../VKalVrtValidation/src/TestCascadeAlg.cxx              | 2 +-
 .../TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h    | 8 ++------
 5 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx
index cf1fe8f1323..9345d5eaddd 100755
--- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetImprovedJetFitterVxFinder.cxx
@@ -2046,7 +2046,7 @@ namespace InDet
                                                                              myTwoTrackVerticesInJet,
                                                                              mySelectedTracksInJet);
       
-     myOutputInfo->getSVOwnership(true);
+     myOutputInfo->setSVOwnership(true);
 
 
      delete signalVertex;
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx
index 07a4c03ecd9..5763e49b3a3 100644
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx
@@ -401,7 +401,7 @@ namespace InDet {
             m_secVertexInfo->vertices().front()->setVertexType((xAOD::VxType::VertexType)2);
           }
           m_secVertexInfoContainer->push_back(const_cast<Trk::VxSecVertexInfo*>(m_secVertexInfo));
-          m_secVertexInfoContainer->back()->getSVOwnership(true);
+          m_secVertexInfoContainer->back()->setSVOwnership(true);
           m_nVxSecVertexInfo++;
         }
         if(outputLevel <= MSG::DEBUG) {
diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx
index c5735bf19da..8d406973cc6 100644
--- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx
+++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx
@@ -434,7 +434,7 @@ namespace InDet {
 	  }
 	  m_secVertexInfoContainer->push_back(const_cast<Trk::VxSecVertexInfo*>(m_secVertexInfo));
 	  
-	  m_secVertexInfoContainer->back()->getSVOwnership(true);
+	  m_secVertexInfoContainer->back()->setSVOwnership(true);
 	  m_nVxSecVertexInfo++;
 	}
 
diff --git a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx
index dc3ff419731..a04b2c92805 100644
--- a/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx
+++ b/PhysicsAnalysis/PhysicsValidation/VKalVrtValidation/src/TestCascadeAlg.cxx
@@ -98,7 +98,7 @@ StatusCode TestCascadeAlg::execute() {
           }
           std::unique_ptr<Trk::VxCascadeInfo> result(m_iVertexFitter->fitCascade(*state));
           if(result) {
-          	result->getSVOwnership(true);
+          	result->setSVOwnership(true);
           	const std::vector< std::vector<TLorentzVector> > &moms = result->getParticleMoms();
           	for(auto& p :moms) { ATH_MSG_DEBUG("new part"); for(auto &l : p) ATH_MSG_DEBUG("vect " << l.M()); }
            pereventcount++;
diff --git a/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h b/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h
index 48b0e860f34..50d3793ae05 100755
--- a/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h
+++ b/Tracking/TrkEvent/VxSecVertex/VxSecVertex/VxSecVertexInfo.h
@@ -22,7 +22,7 @@ given by a vector of VxCandidate*. The class OWNS the VxCandidate. Pointers
 
     May 2014:  VxSecVertexInfo doesn't own the corresponding secondary vertices anymore by default.
                Beware - this leads to a strong memory leak if SV are not explictly deleted before VxSecVertexInfo destructor.
-	       VxSecVertexInfo gets back the SV ownership if getSVOwnership(true) is called.  
+               VxSecVertexInfo gets back the SV ownership if setSVOwnership(true) is called.  
 
 *****************************************/
 
@@ -70,11 +70,7 @@ namespace Trk {
     /* set the list of Vertices */
     void setVertices(const std::vector<xAOD::Vertex*> &);
 
-    /* non MT safe setter with get in its name ...*/
-    void getSVOwnership ATLAS_NOT_THREAD_SAFE(bool Ownership) const { 
-      const_cast<bool&> (m_SVOwnership)=Ownership;/*Marked ATLAS_NOT_THREAD_SAFE*/ 
-    }
-    /* set Ownership */
+   /* set Ownership */
     void setSVOwnership (bool Ownership) { 
       m_SVOwnership=Ownership; 
     }
-- 
GitLab