diff --git a/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp b/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp index d372cf8ffc9..b74ec0cbf13 100644 --- a/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp +++ b/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp @@ -291,8 +291,8 @@ struct NuclearInteraction { /// /// @return Azimuthal and polar angle of the second particle in the global /// coordinate system - std::pair globalAngle(double phi1, double theta1, float phi2, - float theta2) const; + std::pair globalAngle(double phi1, double theta1, double phi2, + double theta2) const; /// Converter from sampled numbers to a vector of particles /// @@ -483,7 +483,7 @@ NuclearInteraction::sampleKinematics( if (trials == nMatchingTrialsTotal) { return std::nullopt; } - // Re-sampole invariant masses if no fitting momenta were found + // Re-sample invariant masses if no fitting momenta were found if (trials++ % nMatchingTrials == 0) { invariantMasses = sampleInvariantMasses(generator, parameters); } else { @@ -513,13 +513,13 @@ std::vector NuclearInteraction::convertParametersToParticles( const float momentum = momenta[i]; const float invariantMass = invariantMasses[i]; const float p1p2 = 2. * momentum * parametrizedMomentum; - const float costheta = 1. - invariantMass * invariantMass / p1p2; + const double costheta = 1. - invariantMass * invariantMass / p1p2; - const auto phiTheta = globalAngle( + const auto [phiGlobal, thetaGlobal] = globalAngle( phi, theta, uniformDistribution(generator) * 2. * std::numbers::pi, std::acos(costheta)); const auto direction = - Acts::makeDirectionFromPhiTheta(phiTheta.first, phiTheta.second); + Acts::makeDirectionFromPhiTheta(phiGlobal, thetaGlobal); Particle p = Particle(initialParticle.particleId().makeDescendant(i), static_cast(pdgId[i])); diff --git a/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp b/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp index 84ab93921fe..d556104002a 100644 --- a/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp +++ b/Fatras/src/Physics/NuclearInteraction/NuclearInteraction.cpp @@ -113,8 +113,8 @@ unsigned int NuclearInteraction::finalStateMultiplicity( std::pair NuclearInteraction::globalAngle(double phi1, double theta1, - float phi2, - float theta2) const { + double phi2, + double theta2) const { // Rotation around the global y-axis Acts::SquareMatrix3 rotY = Acts::SquareMatrix3::Zero(); rotY(0, 0) = std::cos(theta1); @@ -138,10 +138,10 @@ std::pair NuclearInteraction::globalAngle(double phi1, const Acts::Vector3 vectorSum = rotZ * rotY * vector2; // Calculate the global angles - const float theta = std::acos(vectorSum.z() / vectorSum.norm()); - const float phi = std::atan2(vectorSum.y(), vectorSum.x()); + const double theta = std::acos(vectorSum.z() / vectorSum.norm()); + const double phi = std::atan2(vectorSum.y(), vectorSum.x()); - return std::make_pair(phi, theta); + return {phi, theta}; } bool NuclearInteraction::match(const Acts::ActsDynamicVector& momenta,