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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include <CCDB/BasicCCDBManager.h>

#include "Math/Vector4D.h"
#include "TLorentzVector.h"

Check failure on line 58 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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 "TMath.h"
#include <TPDGCode.h>

Expand Down Expand Up @@ -188,6 +188,7 @@
Configurable<std::vector<float>> confTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kDCAzMax, "ConfTrk"), std::vector<float>{0.2f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kDCAzMax, "Track selection: ")}; /// \todo Reintegrate PID to the general selection container
Configurable<std::vector<float>> confTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kPIDnSigmaMax, "ConfTrk"), std::vector<float>{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kPIDnSigmaMax, "Track selection: ")};
Configurable<std::vector<int>> confTrkPIDspecies{"confTrkPIDspecies", std::vector<int>{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID (Pion=2, Kaon=3, Proton=4, Deuteron=5)"};
Configurable<bool> confIsOnlyMCTrack{"confIsOnlyMCTrack", false, "Enable filling of only MC Tracks"};
// Numbers from ~/alice/O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h //static constexpr ID Pion = 2; static constexpr ID Kaon = 3; static constexpr ID Proton = 4; static constexpr ID Deuteron = 5;
} ConfTrkSelection;

Expand Down Expand Up @@ -457,7 +458,7 @@
{
static const o2::track::PID pids[] = {o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon};
aod::femtouniverseparticle::CutContainerType mask = 0u;
for (UInt_t i = 0; i < 3; ++i) {

Check failure on line 461 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (isNSigmaTPC(trackCuts.getNsigmaTPC(track, pids[i])))
mask |= (1u << i);
if (isNSigmaTOF(track.p(), trackCuts.getNsigmaTOF(track, pids[i]), track.hasTOF()))
Expand Down Expand Up @@ -941,8 +942,8 @@
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake;
}

TLorentzVector part1Vec;

Check failure on line 945 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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.
TLorentzVector part2Vec;

Check failure on line 946 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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 auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header
const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header
Expand All @@ -950,7 +951,7 @@
part1Vec.SetPtEtaPhiM(kaon1MC.pt(), kaon1MC.eta(), kaon1MC.phi(), mMassOne);
part2Vec.SetPtEtaPhiM(kaon2MC.pt(), kaon2MC.eta(), kaon2MC.phi(), mMassTwo);

TLorentzVector sumVec(part1Vec);

Check failure on line 954 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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.
sumVec += part2Vec;

float phiEta = sumVec.Eta();
Expand Down Expand Up @@ -1349,6 +1350,27 @@
}
}

template <typename MCParticlesType>
void fillTracksMCTruth(MCParticlesType const& mcParticles)
{
for (const auto& mc : mcParticles) { // Loop over all MC Truth particles

std::vector<int> childIDs = {0, 0};
outputParts(outputCollision.lastIndex(),
mc.pt(),
mc.eta(),
mc.phi(),
aod::femtouniverseparticle::ParticleType::kMCTruthTrack,
0,
0,
mc.pdgCode(),
childIDs,
0,
0);
fillMCTruthParticle(mc, aod::femtouniverseparticle::ParticleType::kMCTruthTrack);
}
}

template <bool isMC, typename CollisionType, typename CascadeType, typename TrackType>
void fillCascade(CollisionType const& col, CascadeType const& fullCascades, TrackType const&)
{
Expand Down Expand Up @@ -1904,8 +1926,8 @@
continue;
}

TLorentzVector part1Vec;

Check failure on line 1929 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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.
TLorentzVector part2Vec;

Check failure on line 1930 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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 auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header
const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header
Expand All @@ -1913,7 +1935,7 @@
part1Vec.SetPtEtaPhiM(p1.pt(), p1.eta(), p1.phi(), mMassOne);
part2Vec.SetPtEtaPhiM(p2.pt(), p2.eta(), p2.phi(), mMassTwo);

TLorentzVector sumVec(part1Vec);

Check failure on line 1938 in PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.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.
sumVec += part2Vec;

float phiEta = sumVec.Eta();
Expand Down Expand Up @@ -2534,7 +2556,11 @@
if (colcheck) {
auto groupedMCParticles = mcParticles.sliceBy(perMCCollision, mccol.globalIndex());
outputCollExtra(1.0, 1.0);
fillParticles<decltype(groupedMCParticles), true, true>(groupedMCParticles, recoMcIds); // fills mc particles
if (!ConfTrkSelection.confIsOnlyMCTrack) {
fillParticles<decltype(groupedMCParticles), true, true>(groupedMCParticles, recoMcIds); // fills mc particles
} else {
fillTracksMCTruth(groupedMCParticles);
}
}
}
}
Expand Down
Loading