Skip to content
Merged
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
9 changes: 8 additions & 1 deletion ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

#include <TGenPhaseSpace.h>
#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>

Check failure on line 56 in ALICE3/TableProducer/OTF/onTheFlyTracker.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 <TPDGCode.h>
#include <TRandom3.h>

Expand Down Expand Up @@ -307,13 +307,20 @@

if (enablePrimarySmearing) {
auto loadLUT = [&](int icfg, int pdg, const std::vector<std::string>& tables) {
LOG(info) << "Loading LUT for pdg " << pdg << " for config " << icfg << " from provided tables with size " << tables.size();
if (tables.empty()) {
LOG(debug) << "No LUT file passed for pdg " << pdg << ", skipping.";
return false;
}
const bool foundNewCfg = static_cast<size_t>(icfg) < tables.size();
std::string lutFile = foundNewCfg ? tables[icfg] : tables.front();
LOG(info) << "Loading LUT for pdg " << pdg << " from file " << lutFile << " for config " << icfg;
// strip from leading/trailing spaces
lutFile.erase(0, lutFile.find_first_not_of(" "));
lutFile.erase(lutFile.find_last_not_of(" ") + 1);
if (lutFile.empty()) {
LOG(fatal) << "Empty LUT file passed for pdg " << pdg << ", if you don't want to use a LUT remove the entry from the JSON config.";
LOG(debug) << "Empty LUT file name for pdg " << pdg << ", skipping.";
return false;
}
bool success = mSmearer[icfg]->loadTable(pdg, lutFile.c_str());
if (!success) {
Expand Down Expand Up @@ -581,7 +588,7 @@
/// \param xiDecayVertex the address of the xi decay vertex
/// \param laDecayVertex the address of the la decay vertex
template <typename McParticleType>
void decayCascade(McParticleType particle, o2::track::TrackParCov track, std::vector<TLorentzVector>& decayDaughters, std::vector<double>& xiDecayVertex, std::vector<double>& laDecayVertex)

Check failure on line 591 in ALICE3/TableProducer/OTF/onTheFlyTracker.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 double uXi = rand.Uniform(0, 1);
const double ctauXi = 4.91; // cm
Expand All @@ -604,12 +611,12 @@
xiDecayVertex.push_back(particle.vz() + rxyzXi * (particle.pz() / particle.p()));

std::vector<double> xiDaughters = {o2::constants::physics::MassLambda, o2::constants::physics::MassPionCharged};
TLorentzVector xi(newPx, newPy, particle.pz(), newE);

Check failure on line 614 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.
TGenPhaseSpace xiDecay;
xiDecay.SetDecay(xi, 2, xiDaughters.data());
xiDecay.Generate();
decayDaughters.push_back(*xiDecay.GetDecay(1));
TLorentzVector la = *xiDecay.GetDecay(0);

Check failure on line 619 in ALICE3/TableProducer/OTF/onTheFlyTracker.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 double uLa = rand.Uniform(0, 1);
const double ctauLa = 7.845; // cm
Expand All @@ -632,7 +639,7 @@
/// \param decayDaughters the address of resulting daughters
/// \param v0DecayVertex the address of the la decay vertex
template <typename McParticleType>
void decayV0Particle(McParticleType particle, std::vector<TLorentzVector>& decayDaughters, std::vector<double>& v0DecayVertex, int pdgCode)

Check failure on line 642 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.
{
double u = rand.Uniform(0, 1);
double v0Mass = -1.;
Expand All @@ -659,7 +666,7 @@

const double v0BetaGamma = particle.p() / v0Mass;
const double v0rxyz = (-v0BetaGamma * ctau * std::log(1 - u));
TLorentzVector v0(particle.px(), particle.py(), particle.pz(), particle.e());

Check failure on line 669 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.

v0DecayVertex.push_back(particle.vx() + v0rxyz * (particle.px() / particle.p()));
v0DecayVertex.push_back(particle.vy() + v0rxyz * (particle.py() / particle.p()));
Expand Down Expand Up @@ -743,8 +750,8 @@
double xiDecayRadius2D = 0;
double laDecayRadius2D = 0;
double v0DecayRadius2D = 0;
std::vector<TLorentzVector> decayProducts;

Check failure on line 753 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.
std::vector<TLorentzVector> v0DecayProducts;

Check failure on line 754 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.
std::vector<double> xiDecayVertex, laDecayVertex, v0DecayVertex;
if (cascadeDecaySettings.decayXi) {
if (mcParticle.pdgCode() == kXiMinus) {
Expand Down Expand Up @@ -831,8 +838,8 @@
histos.fill(HIST("hXiBuilding"), 0.0f);
}

o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, decayProducts[0], xiDecayVertex, xiDaughterTrackParCovsPerfect[0], pdgDB);

Check failure on line 841 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.
o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, decayProducts[1], laDecayVertex, xiDaughterTrackParCovsPerfect[1], pdgDB);

Check failure on line 842 in ALICE3/TableProducer/OTF/onTheFlyTracker.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.
o2::upgrade::convertTLorentzVectorToO2Track(kProton, decayProducts[2], laDecayVertex, xiDaughterTrackParCovsPerfect[2], pdgDB);

for (int i = 0; i < kCascProngs; i++) {
Expand Down
Loading