diff --git a/corsika/detail/framework/utility/COMBoost.inl b/corsika/detail/framework/utility/COMBoost.inl index 4905b940ba2ff53e2055ed68fc9ad6c5b4da6969..2664bfa7c13c6885f97011b084e2d6828eba9de3 100644 --- a/corsika/detail/framework/utility/COMBoost.inl +++ b/corsika/detail/framework/utility/COMBoost.inl @@ -23,7 +23,7 @@ namespace corsika { HEPMassType const massTarget) : originalCS_{P4projectile.getSpaceLikeComponents().getCoordinateSystem()} , rotatedCS_{make_rotationToZ(originalCS_, P4projectile.getSpaceLikeComponents())} { - auto const pProjectile = P4projectile.getSpaceLikeComponents(); + auto const& pProjectile = P4projectile.getSpaceLikeComponents(); auto const pProjNormSquared = pProjectile.getSquaredNorm(); auto const pProjNorm = sqrt(pProjNormSquared); @@ -82,7 +82,7 @@ namespace corsika { template <typename FourVector> inline FourVector COMBoost::toCoM(FourVector const& p4) const { - auto pComponents = p4.getSpaceLikeComponents().getComponents(rotatedCS_); + auto const pComponents = p4.getSpaceLikeComponents().getComponents(rotatedCS_); Eigen::Vector3d eVecRotated = pComponents.getEigenVector(); Eigen::Vector2d lab; @@ -102,7 +102,7 @@ namespace corsika { template <typename FourVector> inline FourVector COMBoost::fromCoM(FourVector const& p4) const { - auto pCM = p4.getSpaceLikeComponents().getComponents(rotatedCS_); + auto const pCM = p4.getSpaceLikeComponents().getComponents(rotatedCS_); auto const Ecm = p4.getTimeLikeComponent(); Eigen::Vector2d com; @@ -134,8 +134,10 @@ namespace corsika { inverseBoost_ << coshEta, -sinhEta, -sinhEta, coshEta; } - inline CoordinateSystemPtr COMBoost::getRotatedCS() const { return rotatedCS_; } + inline CoordinateSystemPtr const& COMBoost::getRotatedCS() const { return rotatedCS_; } - inline CoordinateSystemPtr COMBoost::getOriginalCS() const { return originalCS_; } + inline CoordinateSystemPtr const& COMBoost::getOriginalCS() const { + return originalCS_; + } } // namespace corsika diff --git a/corsika/framework/utility/COMBoost.hpp b/corsika/framework/utility/COMBoost.hpp index 98be9fc070a90c2918975de8d0debbe15505ed3c..5089736027ec01a737a1d729ba943afee2c0de02 100644 --- a/corsika/framework/utility/COMBoost.hpp +++ b/corsika/framework/utility/COMBoost.hpp @@ -76,10 +76,10 @@ namespace corsika { FourVector fromCoM(FourVector const& p4) const; //! returns the rotated coordinate system: +z is projectile direction - CoordinateSystemPtr getRotatedCS() const; + CoordinateSystemPtr const& getRotatedCS() const; //! returns the original coordinate system of the projectile (lab) - CoordinateSystemPtr getOriginalCS() const; + CoordinateSystemPtr const& getOriginalCS() const; protected: //! internal method @@ -88,7 +88,7 @@ namespace corsika { private: Eigen::Matrix2d boost_; Eigen::Matrix2d inverseBoost_; - CoordinateSystemPtr originalCS_; + CoordinateSystemPtr const originalCS_; CoordinateSystemPtr rotatedCS_; }; } // namespace corsika