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

Merge branch 'master-Amg-deltaPhi-const' into 'master'

Make deltaPhi and deltaR const

See merge request atlas/athena!35508
parents 6b71a74d fa76e461
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
return -std::log(std::tan(this->theta()*.5)); //TODO: slow return -std::log(std::tan(this->theta()*.5)); //TODO: slow
} //old method with safeguards, new method is in SymmetricMatrixHelpers.h } //old method with safeguards, new method is in SymmetricMatrixHelpers.h
inline Scalar deltaR(const MatrixBase<Derived>& vec){ inline Scalar deltaR(const MatrixBase<Derived>& vec) const {
if (this->rows() < 2) return 0.; if (this->rows() < 2) return 0.;
double a = this->eta() - vec.eta(); double a = this->eta() - vec.eta();
double b = this->deltaPhi(vec); double b = this->deltaPhi(vec);
return std::sqrt ( a*a + b*b ); return std::sqrt ( a*a + b*b );
} }
inline Scalar deltaPhi(const MatrixBase<Derived>& vec){ inline Scalar deltaPhi(const MatrixBase<Derived>& vec) const {
if (this->rows() < 2) return 0.; if (this->rows() < 2) return 0.;
double dphi = vec.phi() - this->phi(); double dphi = vec.phi() - this->phi();
if ( dphi > M_PI ) { if ( dphi > M_PI ) {
......
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