Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ALICE3/Core/TrackUtilities.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
#include <MathUtils/Utils.h>
#include <ReconstructionDataFormats/Track.h>

#include <TLorentzVector.h>

Check failure on line 25 in ALICE3/Core/TrackUtilities.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

#include <array>
#include <cmath>
#include <vector>

void o2::upgrade::convertTLorentzVectorToO2Track(const int charge,

Check failure on line 31 in ALICE3/Core/TrackUtilities.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
const TLorentzVector particle,
const std::vector<double> productionVertex,
const TLorentzVector& particle,

Check failure on line 32 in ALICE3/Core/TrackUtilities.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
const std::vector<double>& productionVertex,
o2::track::TrackParCov& o2track)
{
std::array<float, 5> params;
Expand All @@ -48,14 +48,14 @@
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;
Expand Down
18 changes: 9 additions & 9 deletions ALICE3/Core/TrackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <ReconstructionDataFormats/Track.h>

#include <TLorentzVector.h>

Check failure on line 25 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

#include <cmath>
#include <vector>
Expand All @@ -35,9 +35,9 @@
/// \param particle the particle to convert (TLorentzVector)
/// \param productionVertex where the particle was produced
/// \param o2track the address of the resulting TrackParCov
void convertTLorentzVectorToO2Track(const int charge,

Check failure on line 38 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
const TLorentzVector particle,
const std::vector<double> productionVertex,
const TLorentzVector& particle,

Check failure on line 39 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
const std::vector<double>& productionVertex,
o2::track::TrackParCov& o2track);

/// Function to convert a TLorentzVector into a perfect Track
Expand All @@ -47,9 +47,9 @@
/// \param o2track the address of the resulting TrackParCov
/// \param pdg the pdg service
template <typename PdgService>
void convertTLorentzVectorToO2Track(int pdgCode,
TLorentzVector particle,
std::vector<double> productionVertex,
void convertTLorentzVectorToO2Track(const int pdgCode,

Check failure on line 50 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
const TLorentzVector& particle,

Check failure on line 51 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
const std::vector<double>& productionVertex,
o2::track::TrackParCov& o2track,
const PdgService& pdg)
{
Expand All @@ -58,7 +58,7 @@
if (pdgInfo != nullptr) {
charge = pdgInfo->Charge() / 3;
}
convertTLorentzVectorToO2Track(charge, particle, productionVertex, o2track);

Check failure on line 61 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
}

/// Function to convert a OTFParticle into a perfect Track
Expand All @@ -70,7 +70,7 @@
o2::track::TrackParCov& o2track,
const PdgService& pdg)
{
static TLorentzVector tlv;

Check failure on line 73 in ALICE3/Core/TrackUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
tlv.SetPxPyPzE(particle.px(), particle.py(), particle.pz(), particle.e());
convertTLorentzVectorToO2Track(particle.pdgCode(), tlv, {particle.vx(), particle.vy(), particle.vz()}, o2track, pdg);
}
Expand All @@ -80,7 +80,7 @@
/// \param o2track the address of the resulting TrackParCov
/// \param pdg the pdg service
template <typename McParticleType, typename PdgService>
void convertMCParticleToO2Track(McParticleType& particle,
void convertMCParticleToO2Track(const McParticleType& particle,
o2::track::TrackParCov& o2track,
const PdgService& pdg)
{
Expand All @@ -94,7 +94,7 @@
/// \param o2track the address of the resulting TrackParCov
/// \param pdg the pdg service
template <typename McParticleType, typename PdgService>
o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle,
o2::track::TrackParCov convertMCParticleToO2Track(const McParticleType& particle,
const PdgService& pdg)
{
o2::track::TrackParCov o2track;
Expand All @@ -105,13 +105,13 @@
/// 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

Expand Down
Loading