diff --git a/ALICE3/Core/TrackUtilities.cxx b/ALICE3/Core/TrackUtilities.cxx index 86b41e6245c..3e52e4367af 100644 --- a/ALICE3/Core/TrackUtilities.cxx +++ b/ALICE3/Core/TrackUtilities.cxx @@ -29,8 +29,8 @@ #include void o2::upgrade::convertTLorentzVectorToO2Track(const int charge, - const TLorentzVector particle, - const std::vector productionVertex, + const TLorentzVector& particle, + const std::vector& productionVertex, o2::track::TrackParCov& o2track) { std::array params; @@ -48,14 +48,14 @@ void o2::upgrade::convertTLorentzVectorToO2Track(const int charge, new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm); } -float o2::upgrade::computeParticleVelocity(float momentum, float mass) +float o2::upgrade::computeParticleVelocity(const float momentum, const float mass) { const float a = momentum / mass; // uses light speed in cm/ps so output is in those units return o2::constants::physics::LightSpeedCm2PS * a / std::sqrt((1.f + a * a)); } -float o2::upgrade::computeTrackLength(o2::track::TrackParCov track, float radius, float magneticField) +float o2::upgrade::computeTrackLength(const o2::track::TrackParCov& track, const float radius, const float magneticField) { // don't make use of the track parametrization float length = -100; diff --git a/ALICE3/Core/TrackUtilities.h b/ALICE3/Core/TrackUtilities.h index 0cdcc5da92b..f591cd05d0f 100644 --- a/ALICE3/Core/TrackUtilities.h +++ b/ALICE3/Core/TrackUtilities.h @@ -36,8 +36,8 @@ namespace o2::upgrade /// \param productionVertex where the particle was produced /// \param o2track the address of the resulting TrackParCov void convertTLorentzVectorToO2Track(const int charge, - const TLorentzVector particle, - const std::vector productionVertex, + const TLorentzVector& particle, + const std::vector& productionVertex, o2::track::TrackParCov& o2track); /// Function to convert a TLorentzVector into a perfect Track @@ -47,9 +47,9 @@ void convertTLorentzVectorToO2Track(const int charge, /// \param o2track the address of the resulting TrackParCov /// \param pdg the pdg service template -void convertTLorentzVectorToO2Track(int pdgCode, - TLorentzVector particle, - std::vector productionVertex, +void convertTLorentzVectorToO2Track(const int pdgCode, + const TLorentzVector& particle, + const std::vector& productionVertex, o2::track::TrackParCov& o2track, const PdgService& pdg) { @@ -80,7 +80,7 @@ void convertOTFParticleToO2Track(const OTFParticle& particle, /// \param o2track the address of the resulting TrackParCov /// \param pdg the pdg service template -void convertMCParticleToO2Track(McParticleType& particle, +void convertMCParticleToO2Track(const McParticleType& particle, o2::track::TrackParCov& o2track, const PdgService& pdg) { @@ -94,7 +94,7 @@ void convertMCParticleToO2Track(McParticleType& particle, /// \param o2track the address of the resulting TrackParCov /// \param pdg the pdg service template -o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle, +o2::track::TrackParCov convertMCParticleToO2Track(const McParticleType& particle, const PdgService& pdg) { o2::track::TrackParCov o2track; @@ -105,13 +105,13 @@ o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle, /// returns velocity in centimeters per picoseconds /// \param momentum the momentum of the track /// \param mass the mass of the particle -float computeParticleVelocity(float momentum, float mass); +float computeParticleVelocity(const float momentum, const float mass); /// function to calculate track length of this track up to a certain radius /// \param track the input track (TrackParCov) /// \param radius the radius of the layer you're calculating the length to /// \param magneticField the magnetic field to use when propagating -float computeTrackLength(o2::track::TrackParCov track, float radius, float magneticField); +float computeTrackLength(const o2::track::TrackParCov& track, const float radius, const float magneticField); } // namespace o2::upgrade