diff --git a/Event/FourMom/FourMom/DeepCopyPointer.h b/Event/FourMom/FourMom/DeepCopyPointer.h index efe834c12ab0edbaf5a3ca251964370fc6554135..091da12c9096c5708cf298db2fd28bc461264327 100644 --- a/Event/FourMom/FourMom/DeepCopyPointer.h +++ b/Event/FourMom/FourMom/DeepCopyPointer.h @@ -35,6 +35,9 @@ public: return *this; } + T* get() { return m_theData; } + const T* get() const { return m_theData; } + T& operator*() { return *m_theData;} const T& operator*() const { return *m_theData;} diff --git a/Event/FourMom/FourMom/Lib/P4ImplEEtaPhiM.h b/Event/FourMom/FourMom/Lib/P4ImplEEtaPhiM.h index 4b04851d7babdace87a209e272685c418d52e5cb..81eae8a7089a088b107e17f14457e88314aaa01a 100755 --- a/Event/FourMom/FourMom/Lib/P4ImplEEtaPhiM.h +++ b/Event/FourMom/FourMom/Lib/P4ImplEEtaPhiM.h @@ -215,7 +215,7 @@ inline double P4ImplEEtaPhiM::e() const inline const I4MomentumError* P4ImplEEtaPhiM::errors() const { - return &(*m_error); + return m_error.get(); } inline void P4ImplEEtaPhiM::setE( const double theE ) diff --git a/Event/FourMom/FourMom/Lib/P4ImplIPtCotThPhiM.h b/Event/FourMom/FourMom/Lib/P4ImplIPtCotThPhiM.h index c9477a9c0dfbcf7d9ce87c65aeda14048426b2b2..cd4bb69b3a80292471701a168a23c0833c5daeae 100755 --- a/Event/FourMom/FourMom/Lib/P4ImplIPtCotThPhiM.h +++ b/Event/FourMom/FourMom/Lib/P4ImplIPtCotThPhiM.h @@ -228,8 +228,7 @@ inline double P4ImplIPtCotThPhiM::cotTh() const inline const I4MomentumError* P4ImplIPtCotThPhiM::errors() const { - // check if the pointer is empty before dereferencing - return (m_error ? &(*m_error) : 0); + return m_error.get(); } // setters diff --git a/Event/FourMom/FourMom/Lib/P4ImplPtEtaPhiM.h b/Event/FourMom/FourMom/Lib/P4ImplPtEtaPhiM.h index 73bc2e66ee18eb7b020c36092075c46fa303fc3f..cc99936c573a9934ea4efafc5ff6b37ec34dbe71 100755 --- a/Event/FourMom/FourMom/Lib/P4ImplPtEtaPhiM.h +++ b/Event/FourMom/FourMom/Lib/P4ImplPtEtaPhiM.h @@ -212,7 +212,7 @@ inline double P4ImplPtEtaPhiM::pt() const inline const I4MomentumError* P4ImplPtEtaPhiM::errors() const { // check if the pointer is empty before dereferencing - return (m_error ? &(*m_error) : 0); + return m_error.get(); } // setters diff --git a/Event/FourMom/FourMom/Lib/P4ImplPxPyPzE.h b/Event/FourMom/FourMom/Lib/P4ImplPxPyPzE.h index af8f0b084b72ddafeeccf169a4acb9adbfd40378..7b371c34efc1ed8ba74da766895fdd6eb761bc16 100755 --- a/Event/FourMom/FourMom/Lib/P4ImplPxPyPzE.h +++ b/Event/FourMom/FourMom/Lib/P4ImplPxPyPzE.h @@ -219,7 +219,7 @@ inline double P4ImplPxPyPzE::e() const inline const I4MomentumError* P4ImplPxPyPzE::errors() const { // check if the pointer is empty before dereferencing - return (m_error ? &(*m_error) : 0); + return m_error.get(); } inline void P4ImplPxPyPzE::setPx( const double px )