Skip to content

Commit 39043de

Browse files
committed
Don't copy trackparcov when computing tracklengths
1 parent 7467239 commit 39043de

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ALICE3/Core/TrackUtilities.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ void o2::upgrade::convertTLorentzVectorToO2Track(const int charge,
4848
new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm);
4949
}
5050

51-
float o2::upgrade::computeParticleVelocity(float momentum, float mass)
51+
float o2::upgrade::computeParticleVelocity(const float momentum, const float mass)
5252
{
5353
const float a = momentum / mass;
5454
// uses light speed in cm/ps so output is in those units
5555
return o2::constants::physics::LightSpeedCm2PS * a / std::sqrt((1.f + a * a));
5656
}
5757

58-
float o2::upgrade::computeTrackLength(o2::track::TrackParCov track, float radius, float magneticField)
58+
float o2::upgrade::computeTrackLength(const o2::track::TrackParCov& track, const float radius, const float magneticField)
5959
{
6060
// don't make use of the track parametrization
6161
float length = -100;

ALICE3/Core/TrackUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle,
105105
/// returns velocity in centimeters per picoseconds
106106
/// \param momentum the momentum of the track
107107
/// \param mass the mass of the particle
108-
float computeParticleVelocity(float momentum, float mass);
108+
float computeParticleVelocity(const float momentum, const float mass);
109109

110110
/// function to calculate track length of this track up to a certain radius
111111
/// \param track the input track (TrackParCov)
112112
/// \param radius the radius of the layer you're calculating the length to
113113
/// \param magneticField the magnetic field to use when propagating
114-
float computeTrackLength(o2::track::TrackParCov track, float radius, float magneticField);
114+
float computeTrackLength(const o2::track::TrackParCov& track, const float radius, const float magneticField);
115115

116116
} // namespace o2::upgrade
117117

0 commit comments

Comments
 (0)