diff --git a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..0e5538127e02f79b05b8b3ac87aa748c7a3177b0 --- /dev/null +++ b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEvent/TrkEventUtils diff --git a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h index d1b42b7266998218f794958d21f7181901d5550f..aeaf9f2c02ef957e56cbb8d34ab1c1fc75e02d5d 100755 --- a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h +++ b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/PerigeeFromVertexCreator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -50,10 +50,9 @@ namespace Trk { Trk::Perigee* createNewPerigee(Amg::Vector3D& gp, double phi, double theta, double qOverP) const; private: - double m_field; //!< magnetic field in tesla, can be set through constructor - - static double s_unitConversion; //!< unit conversion factor - static double s_magField; //!< default magnetic field value + double m_field; //!< magnetic field in tesla, can be set through constructor + static const double s_unitConversion; //!< unit conversion factor + static const double s_magField; //!< default magnetic field value }; diff --git a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h index 7a46036f6effe09a4d8a923ca03aff7038e112d4..a47e3ac218fb9d366e7e79c9759da210c29513e2 100755 --- a/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h +++ b/Tracking/TrkEvent/TrkEventUtils/TrkEventUtils/TruthCollectionFilter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -8,11 +8,11 @@ * This file provides @ref TruthFilters that can be used with the * @ref TruthInverters. */ - - #ifndef TRUTHCOLLECTIONFILTER_H #define TRUTHCOLLECTIONFILTER_H +#include <atomic> + namespace Trk { /** @@ -86,9 +86,9 @@ namespace Trk { private: BasicTruthCollectionFilter<TruthCollection> m_basicFilter; double m_probabilityCut; - mutable unsigned m_numTruthTotal; - mutable unsigned m_numTruthInvalid; - mutable unsigned m_numTruthNoVtx; + std::atomic_ulong m_numTruthTotal; + std::atomic_ulong m_numTruthInvalid; + std::atomic_ulong m_numTruthNoVtx; }; template<class OStream, class TruthCollection> diff --git a/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx b/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx index be037c6386b36b009cfbeb2f71cd9be66a1b73ba..7ce915e9acf09cf58596718374371dc0b38fa09b 100755 --- a/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx +++ b/Tracking/TrkEvent/TrkEventUtils/src/PerigeeFromVertexCreator.cxx @@ -9,8 +9,8 @@ #include "TrkEventUtils/PerigeeFromVertexCreator.h" #include <cmath> -double Trk::PerigeeFromVertexCreator::s_unitConversion = -0.3; -double Trk::PerigeeFromVertexCreator::s_magField = 2.083; +const double Trk::PerigeeFromVertexCreator::s_unitConversion = -0.3; +const double Trk::PerigeeFromVertexCreator::s_magField = 2.083; Trk::Perigee Trk::PerigeeFromVertexCreator::createPerigee(Amg::Vector3D& vertex, Amg::Vector3D& momentum, diff --git a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..dcada01d90ced603cfc3313b67909b890418106d --- /dev/null +++ b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEvent/TrkMaterialOnTrack diff --git a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h index b69903e4d9750dbdaecab20e70f3f77b4907e060..348b84614fd1884b9ea1c63ce6f65239414f6f50 100755 --- a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h +++ b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/EnergyLoss.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -87,13 +87,13 @@ class EnergyLoss { double length() const; //update from mean values - void update(double ioni, double sigi, double rad, double sigr, bool mpv=false) const; + void update(double ioni, double sigi, double rad, double sigr, bool mpv=false) ; //update - void update( EnergyLoss&, bool mpv=false ) const; + void update( EnergyLoss&, bool mpv=false ) ; //set - void set(double eLoss, double sigde, double ioni, double sigi, double rad, double sigr) const; + void set(double eLoss, double sigde, double ioni, double sigi, double rad, double sigr) ; //! Interface method for output, can be overloaded by child classes virtual MsgStream& dump( MsgStream& sl ) const; @@ -103,19 +103,19 @@ class EnergyLoss { private: //! @f$ \Delta E @f$ - the estimated or measured energy loss - mutable double m_deltaE; + double m_deltaE; //!< @f$ \sigma(\Delta E) @f$ - error on the energy loss - mutable double m_sigmaDeltaE; + double m_sigmaDeltaE; //!< @f$ \sigma(\Delta E) @f$ - negative error on the energy loss - double m_sigmaMinusDeltaE; + double m_sigmaMinusDeltaE; //!< @f$ \sigma(\Delta E) @f$ - positive error on the energy loss - double m_sigmaPlusDeltaE; + double m_sigmaPlusDeltaE; // additional information about components (cache only, not persistified) - mutable double m_mean_ioni; // mean value for ionization - mutable double m_sig_ioni; // sigma for ionization - mutable double m_mean_rad; // mean value for radiation - mutable double m_sig_rad; // sigma for radiation - mutable double m_length; // 3D length of material + double m_mean_ioni; // mean value for ionization + double m_sig_ioni; // sigma for ionization + double m_mean_rad; // mean value for radiation + double m_sig_rad; // sigma for radiation + double m_length; // 3D length of material }; @@ -149,7 +149,7 @@ class EnergyLoss { inline double EnergyLoss::length() const { return m_length; } // length can be positive and negative like Eloss depending on (back)tracking - inline void EnergyLoss::update(double ioni, double sigi, double rad, double sigr, bool mpv) const + inline void EnergyLoss::update(double ioni, double sigi, double rad, double sigr, bool mpv) { m_mean_ioni += ioni; m_mean_rad += rad; m_sig_ioni += sigi; @@ -158,7 +158,7 @@ class EnergyLoss { m_sigmaDeltaE = sqrt( m_sig_ioni*m_sig_ioni + m_sig_rad*m_sig_rad); } - inline void EnergyLoss::update(EnergyLoss& eloss, bool mpv) const + inline void EnergyLoss::update(EnergyLoss& eloss, bool mpv) { m_mean_ioni += eloss.meanIoni(); m_mean_rad += eloss.meanRad(); m_sig_ioni += eloss.sigmaIoni(); @@ -167,7 +167,7 @@ class EnergyLoss { m_sigmaDeltaE = sqrt( m_sig_ioni*m_sig_ioni + m_sig_rad*m_sig_rad); } - inline void EnergyLoss::set(double eloss, double sigde, double ioni, double sigi, double rad, double sigr) const + inline void EnergyLoss::set(double eloss, double sigde, double ioni, double sigi, double rad, double sigr) { m_mean_ioni = ioni; m_mean_rad = rad; m_sig_ioni = sigi; diff --git a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h index b49077a1137a5ed88356b9de7a710f22bff88eac..d30dac430c5ccf0ac5682125b361fe6ab13fbc48 100755 --- a/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h +++ b/Tracking/TrkEvent/TrkMaterialOnTrack/TrkMaterialOnTrack/MaterialEffectsBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -122,7 +122,7 @@ class MaterialEffectsBase two cases are distinguished by the presence of a pointer from the Trk::Surface to a Trk::DetectorElement, if not present it is a custom-made surface. */ - mutable const Surface* m_associatedSurface; + const Surface* m_associatedSurface; //! the flags (bits) telling what information this ME are based on long m_typeFlags;