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
79 changes: 60 additions & 19 deletions PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx
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 @@ -465,7 +465,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 468 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 All @@ -479,14 +479,39 @@
}

template <class T>
using hasStrangeTOF = decltype(std::declval<T&>().tofNSigmaXiLaPi());
using hasStrangeTOFinV0 = decltype(std::declval<T&>().tofNSigmaLaPr());

/// bitmask to save strangeness TOF for V0 analysis
template <typename V0Type>
aod::femtouniverseparticle::CutContainerType PIDStrangeTOFBitmaskV0(const V0Type& v0)
{
aod::femtouniverseparticle::CutContainerType mask = 0u;
if constexpr (std::experimental::is_detected<hasStrangeTOFinV0, V0Type>::value) {
if (v0.tofNSigmaLaPr() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (1u);
if (v0.tofNSigmaLaPi() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (2u);
if (v0.tofNSigmaALaPr() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (4u);
if (v0.tofNSigmaALaPi() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (8u);
if (v0.tofNSigmaK0PiPlus() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (16u);
if (v0.tofNSigmaK0PiMinus() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (32u);
}
return mask;
}

template <class T>
using hasStrangeTOFinCasc = decltype(std::declval<T&>().tofNSigmaXiLaPi());

/// bitmask to save strangeness TOF for cascade analysis
template <typename CascType>
aod::femtouniverseparticle::CutContainerType PIDStrangeTOFBitmask(const CascType& casc)
aod::femtouniverseparticle::CutContainerType PIDStrangeTOFBitmaskCasc(const CascType& casc)
{
aod::femtouniverseparticle::CutContainerType mask = 0u;
if constexpr (std::experimental::is_detected<hasStrangeTOF, CascType>::value) {
if constexpr (std::experimental::is_detected<hasStrangeTOFinCasc, CascType>::value) {
if (casc.tofNSigmaXiLaPi() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (1u);
if (casc.tofNSigmaXiLaPr() < ConfPIDBitmask.confNsigmaTOFParticleChild)
Expand Down Expand Up @@ -718,18 +743,34 @@
void fillDebugParticle(ParticleType const& particle)
{
if constexpr (isTrackOrV0) {
outputDebugParts(particle.sign(), (uint8_t)particle.tpcNClsFound(),
particle.tpcNClsFindable(),
(uint8_t)particle.tpcNClsCrossedRows(),
particle.tpcNClsShared(), particle.tpcFractionSharedCls(), particle.tpcInnerParam(),
particle.itsNCls(), particle.itsNClsInnerBarrel(),
particle.dcaXY(), particle.dcaZ(), particle.tpcSignal(),
particle.tpcNSigmaStoreEl(), particle.tpcNSigmaStorePi(),
particle.tpcNSigmaStoreKa(), particle.tpcNSigmaStorePr(),
particle.tpcNSigmaStoreDe(), particle.tofNSigmaStoreEl(),
particle.tofNSigmaStorePi(), particle.tofNSigmaStoreKa(),
particle.tofNSigmaStorePr(), particle.tofNSigmaStoreDe(),
-999., -999., -999., -999., -999., -999.);
if constexpr (std::experimental::is_detected<hasStrangeTOFinV0, ParticleType>::value) {
outputDebugParts(particle.sign(), (uint8_t)particle.tpcNClsFound(),
particle.tpcNClsFindable(),
(uint8_t)particle.tpcNClsCrossedRows(),
particle.tpcNClsShared(), particle.tpcFractionSharedCls(), particle.tpcInnerParam(),
particle.itsNCls(), particle.itsNClsInnerBarrel(),
particle.dcaXY(), particle.dcaZ(), particle.tpcSignal(),
particle.tpcNSigmaStoreEl(), particle.tpcNSigmaStorePi(),
particle.tpcNSigmaStoreKa(), particle.tpcNSigmaStorePr(),
particle.tpcNSigmaStoreDe(), particle.tofNSigmaStoreEl(),
particle.tofNSigmaStorePi(), particle.tofNSigmaStoreKa(),
particle.tofNSigmaStorePr(), particle.tofNSigmaStoreDe(),
particle.tofNSigmaLaPr(), particle.tofNSigmaLaPi(), particle.tofNSigmaALaPr(),
particle.tofNSigmaALaPi(), particle.tofNSigmaK0PiPlus(), particle.tofNSigmaK0PiMinus());
} else {
outputDebugParts(particle.sign(), (uint8_t)particle.tpcNClsFound(),
particle.tpcNClsFindable(),
(uint8_t)particle.tpcNClsCrossedRows(),
particle.tpcNClsShared(), particle.tpcFractionSharedCls(), particle.tpcInnerParam(),
particle.itsNCls(), particle.itsNClsInnerBarrel(),
particle.dcaXY(), particle.dcaZ(), particle.tpcSignal(),
particle.tpcNSigmaStoreEl(), particle.tpcNSigmaStorePi(),
particle.tpcNSigmaStoreKa(), particle.tpcNSigmaStorePr(),
particle.tpcNSigmaStoreDe(), particle.tofNSigmaStoreEl(),
particle.tofNSigmaStorePi(), particle.tofNSigmaStoreKa(),
particle.tofNSigmaStorePr(), particle.tofNSigmaStoreDe(),
-999., -999., -999., -999., -999., -999.);
}
} else if constexpr (isPhiOrD0) {
outputDebugParts(-999., -999., -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999., -999., -999., -999.,
Expand All @@ -738,7 +779,7 @@
-999., -999., -999.,
-999.); // QA for phi or D0/D0bar children
} else if constexpr (isCasc) {
if constexpr (std::experimental::is_detected<hasStrangeTOF, ParticleType>::value) {
if constexpr (std::experimental::is_detected<hasStrangeTOFinCasc, ParticleType>::value) {
outputDebugParts(-999., -999., -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999., -999., -999., particle.tofNSigmaXiLaPi(),
particle.tofNSigmaXiLaPr(), particle.tofNSigmaXiPi(), particle.tofNSigmaOmLaPi(),
Expand Down Expand Up @@ -955,8 +996,8 @@
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake;
}

TLorentzVector part1Vec;

Check failure on line 999 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 1000 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 @@ -964,7 +1005,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 1008 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 @@ -1277,7 +1318,7 @@
v0.phi(),
aod::femtouniverseparticle::ParticleType::kV0,
cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kV0),
0,
PIDStrangeTOFBitmaskV0(v0),
v0.v0cosPA(),
indexChildID,
v0.mLambda(),
Expand Down Expand Up @@ -1489,7 +1530,7 @@
casc.phi(),
aod::femtouniverseparticle::ParticleType::kCascade,
0,
PIDStrangeTOFBitmask(casc),
PIDStrangeTOFBitmaskCasc(casc),
0,
indexCascChildID,
casc.mXi(),
Expand Down Expand Up @@ -1951,8 +1992,8 @@
continue;
}

TLorentzVector part1Vec;

Check failure on line 1995 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 1996 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 @@ -1960,7 +2001,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 2004 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 @@ -2311,7 +2352,7 @@
void processTrackV0Cascade(aod::FemtoFullCollision const& col,
aod::BCsWithTimestamps const&,
soa::Filtered<aod::FemtoFullTracks> const& tracks,
o2::aod::V0Datas const& fullV0s,
soa::Join<o2::aod::V0Datas, o2::aod::V0TOFNSigmas> const& fullV0s,
soa::Join<o2::aod::CascDatas, o2::aod::CascTOFNSigmas> const& fullCascades)
{
getMagneticFieldTesla(col.bc_as<aod::BCsWithTimestamps>());
Expand Down
Loading