Skip to content
Snippets Groups Projects
Commit 03165b3d authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'TrkVertexOnTrack_ATLAS_CHECK_THREAD_SAFETY' into 'master'

Add ATLAS_CHECK_THREAD_SAFETY to TrkVertexOnTrack

See merge request atlas/athena!23391
parents eb865945 836aae86
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,8 @@ Trk::CaloCluster_OnTrack& Trk::CaloCluster_OnTrack::operator=(const Trk::CaloClu
const Amg::Vector3D& Trk::CaloCluster_OnTrack::globalPosition() const
{
if (!m_globalpos) {return INVALID_VECTOR3D;}
return *m_globalpos;
if (m_globalpos) { return *m_globalpos;}
return INVALID_VECTOR3D;
}
MsgStream& Trk::CaloCluster_OnTrack::dump( MsgStream& sl ) const
......
......@@ -125,9 +125,7 @@ Trk::PseudoMeasurementOnTrack& Trk::PseudoMeasurementOnTrack::operator=(PseudoMe
const Amg::Vector3D& Trk::PseudoMeasurementOnTrack::globalPosition() const
{
if (m_globalPosition!=nullptr) {
return *m_globalPosition;
}
if (m_globalPosition) { return *m_globalPosition;}
return INVALID_VECTOR3D;
}
......
Tracking/TrkEvent/TrkVertexOnTrack
......@@ -90,10 +90,10 @@ namespace Trk{
protected:
/** Perigee surface of the VoT*/
mutable const PerigeeSurface* m_associatedSurface;
const PerigeeSurface* m_associatedSurface;
/** Global position of the VoT*/
mutable const Amg::Vector3D* m_globalPosition;
const Amg::Vector3D* m_globalPosition;
};
inline VertexOnTrack* VertexOnTrack::clone() const
......@@ -102,11 +102,6 @@ namespace Trk{
inline const PerigeeSurface& VertexOnTrack::associatedSurface() const
{ return *m_associatedSurface; }
inline const Amg::Vector3D& VertexOnTrack::globalPosition() const
{
if (m_globalPosition == 0) {m_globalPosition = new Amg::Vector3D();}
return *m_globalPosition;
}
}
......
......@@ -15,6 +15,10 @@
#include <string>
#include <typeinfo>
namespace{
const double NaN(std::numeric_limits<double>::quiet_NaN());
alignas(16) const Amg::Vector3D INVALID_VECTOR3D(NaN, NaN, NaN);
}
// Constructor with parameters:
Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars,
......@@ -22,7 +26,7 @@ Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars,
const PerigeeSurface& assocSurf) :
Trk::MeasurementBase(locpars,locerr),
m_associatedSurface(assocSurf.clone()),
m_globalPosition(0)
m_globalPosition(nullptr)
{
}
......@@ -32,7 +36,7 @@ Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars,
Trk::SurfaceUniquePtrT<const PerigeeSurface> assocSurf) :
Trk::MeasurementBase(locpars,locerr),
m_associatedSurface(assocSurf.release()),
m_globalPosition(0)
m_globalPosition(nullptr)
{
}
......@@ -74,16 +78,20 @@ Trk::VertexOnTrack::~VertexOnTrack()
// default constructor:
Trk::VertexOnTrack::VertexOnTrack() :
Trk::MeasurementBase(),
m_associatedSurface(0),
m_globalPosition(0)
m_associatedSurface(nullptr),
m_globalPosition(nullptr)
{}
// copy constructor:
Trk::VertexOnTrack::VertexOnTrack( const Trk::VertexOnTrack& vot) :
Trk::MeasurementBase(vot),
m_associatedSurface( new Trk::PerigeeSurface(*vot.m_associatedSurface) ),
m_globalPosition(0)
{}
m_globalPosition(nullptr)
{
if(vot.m_globalPosition){
m_globalPosition = new Amg::Vector3D (*vot.m_globalPosition);
}
}
// assignment operator:
Trk::VertexOnTrack& Trk::VertexOnTrack::operator=(const VertexOnTrack& vot)
......@@ -92,12 +100,22 @@ Trk::VertexOnTrack& Trk::VertexOnTrack::operator=(const VertexOnTrack& vot)
delete m_associatedSurface;
delete m_globalPosition;
Trk::MeasurementBase::operator=(vot);
m_globalPosition = 0;
m_globalPosition =nullptr ;
m_associatedSurface = new Trk::PerigeeSurface(*vot.m_associatedSurface);
if(vot.m_globalPosition){
m_globalPosition = new Amg::Vector3D (*vot.m_globalPosition);
}
}
return *this;
}
const Amg::Vector3D& Trk::VertexOnTrack::globalPosition() const
{
if (m_globalPosition) {return *m_globalPosition;}
return INVALID_VECTOR3D;
}
MsgStream& Trk::VertexOnTrack::dump( MsgStream& sl ) const
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment