Skip to content
Snippets Groups Projects
Commit 836aae86 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

Add ATLAS_CHECK_THREAD_SAFETY to TrkVertexOnTrack

parent 971046f5
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 ...@@ -78,8 +78,8 @@ Trk::CaloCluster_OnTrack& Trk::CaloCluster_OnTrack::operator=(const Trk::CaloClu
const Amg::Vector3D& Trk::CaloCluster_OnTrack::globalPosition() const const Amg::Vector3D& Trk::CaloCluster_OnTrack::globalPosition() const
{ {
if (!m_globalpos) {return INVALID_VECTOR3D;} if (m_globalpos) { return *m_globalpos;}
return *m_globalpos; return INVALID_VECTOR3D;
} }
MsgStream& Trk::CaloCluster_OnTrack::dump( MsgStream& sl ) const MsgStream& Trk::CaloCluster_OnTrack::dump( MsgStream& sl ) const
......
...@@ -125,9 +125,7 @@ Trk::PseudoMeasurementOnTrack& Trk::PseudoMeasurementOnTrack::operator=(PseudoMe ...@@ -125,9 +125,7 @@ Trk::PseudoMeasurementOnTrack& Trk::PseudoMeasurementOnTrack::operator=(PseudoMe
const Amg::Vector3D& Trk::PseudoMeasurementOnTrack::globalPosition() const const Amg::Vector3D& Trk::PseudoMeasurementOnTrack::globalPosition() const
{ {
if (m_globalPosition!=nullptr) { if (m_globalPosition) { return *m_globalPosition;}
return *m_globalPosition;
}
return INVALID_VECTOR3D; return INVALID_VECTOR3D;
} }
......
Tracking/TrkEvent/TrkVertexOnTrack
...@@ -90,10 +90,10 @@ namespace Trk{ ...@@ -90,10 +90,10 @@ namespace Trk{
protected: protected:
/** Perigee surface of the VoT*/ /** Perigee surface of the VoT*/
mutable const PerigeeSurface* m_associatedSurface; const PerigeeSurface* m_associatedSurface;
/** Global position of the VoT*/ /** Global position of the VoT*/
mutable const Amg::Vector3D* m_globalPosition; const Amg::Vector3D* m_globalPosition;
}; };
inline VertexOnTrack* VertexOnTrack::clone() const inline VertexOnTrack* VertexOnTrack::clone() const
...@@ -102,11 +102,6 @@ namespace Trk{ ...@@ -102,11 +102,6 @@ namespace Trk{
inline const PerigeeSurface& VertexOnTrack::associatedSurface() const inline const PerigeeSurface& VertexOnTrack::associatedSurface() const
{ return *m_associatedSurface; } { 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 @@ ...@@ -15,6 +15,10 @@
#include <string> #include <string>
#include <typeinfo> #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: // Constructor with parameters:
Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars, Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars,
...@@ -22,7 +26,7 @@ Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars, ...@@ -22,7 +26,7 @@ Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars,
const PerigeeSurface& assocSurf) : const PerigeeSurface& assocSurf) :
Trk::MeasurementBase(locpars,locerr), Trk::MeasurementBase(locpars,locerr),
m_associatedSurface(assocSurf.clone()), m_associatedSurface(assocSurf.clone()),
m_globalPosition(0) m_globalPosition(nullptr)
{ {
} }
...@@ -32,7 +36,7 @@ Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars, ...@@ -32,7 +36,7 @@ Trk::VertexOnTrack::VertexOnTrack( const LocalParameters& locpars,
Trk::SurfaceUniquePtrT<const PerigeeSurface> assocSurf) : Trk::SurfaceUniquePtrT<const PerigeeSurface> assocSurf) :
Trk::MeasurementBase(locpars,locerr), Trk::MeasurementBase(locpars,locerr),
m_associatedSurface(assocSurf.release()), m_associatedSurface(assocSurf.release()),
m_globalPosition(0) m_globalPosition(nullptr)
{ {
} }
...@@ -74,16 +78,20 @@ Trk::VertexOnTrack::~VertexOnTrack() ...@@ -74,16 +78,20 @@ Trk::VertexOnTrack::~VertexOnTrack()
// default constructor: // default constructor:
Trk::VertexOnTrack::VertexOnTrack() : Trk::VertexOnTrack::VertexOnTrack() :
Trk::MeasurementBase(), Trk::MeasurementBase(),
m_associatedSurface(0), m_associatedSurface(nullptr),
m_globalPosition(0) m_globalPosition(nullptr)
{} {}
// copy constructor: // copy constructor:
Trk::VertexOnTrack::VertexOnTrack( const Trk::VertexOnTrack& vot) : Trk::VertexOnTrack::VertexOnTrack( const Trk::VertexOnTrack& vot) :
Trk::MeasurementBase(vot), Trk::MeasurementBase(vot),
m_associatedSurface( new Trk::PerigeeSurface(*vot.m_associatedSurface) ), 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: // assignment operator:
Trk::VertexOnTrack& Trk::VertexOnTrack::operator=(const VertexOnTrack& vot) Trk::VertexOnTrack& Trk::VertexOnTrack::operator=(const VertexOnTrack& vot)
...@@ -92,12 +100,22 @@ 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_associatedSurface;
delete m_globalPosition; delete m_globalPosition;
Trk::MeasurementBase::operator=(vot); Trk::MeasurementBase::operator=(vot);
m_globalPosition = 0;
m_globalPosition =nullptr ;
m_associatedSurface = new Trk::PerigeeSurface(*vot.m_associatedSurface); m_associatedSurface = new Trk::PerigeeSurface(*vot.m_associatedSurface);
if(vot.m_globalPosition){
m_globalPosition = new Amg::Vector3D (*vot.m_globalPosition);
}
} }
return *this; 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 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