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
60 changes: 44 additions & 16 deletions PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
#include "PWGHF/DataModel/CandidateSelectionTables.h"
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Common/CCDB/ctpRateFetcher.h"
Expand All @@ -54,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 @@ -455,11 +456,11 @@
}

template <typename TrackType>
aod::femtouniverseparticle::CutContainerType PIDBitmask(const TrackType& track)

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
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 463 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.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (isNSigmaTPC(trackCuts.getNsigmaTPC(track, pids[i])))
mask |= (1u << i);
if (isNSigmaTOF(track.p(), trackCuts.getNsigmaTOF(track, pids[i]), track.hasTOF()))
Expand All @@ -472,6 +473,31 @@
return mask;
}

template <class T>
using hasStrangeTOF = 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 mask = 0u;
if constexpr (std::experimental::is_detected<hasStrangeTOF, CascType>::value) {
if (casc.tofNSigmaXiLaPi() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (1u);
if (casc.tofNSigmaXiLaPr() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (2u);
if (casc.tofNSigmaXiPi() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (4u);
if (casc.tofNSigmaOmLaPi() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (8u);
if (casc.tofNSigmaOmLaPr() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (16u);
if (casc.tofNSigmaOmKa() < ConfPIDBitmask.confNsigmaTOFParticleChild)
mask |= (32u);
}
return mask;
}

Zorro zorro;
OutputObj<ZorroSummary> zorroSummary{"zorroSummary"};
int mRunNumberZorro = 0;
Expand Down Expand Up @@ -683,7 +709,7 @@
mRunNumber = bc.runNumber();
}

template <bool isTrackOrV0, bool isPhiOrD0, bool isXi, typename ParticleType>
template <bool isTrackOrV0, bool isPhiOrD0, bool isCasc, typename ParticleType>
void fillDebugParticle(ParticleType const& particle)
{
if constexpr (isTrackOrV0) {
Expand All @@ -706,13 +732,15 @@
-999., -999.,
-999., -999., -999.,
-999.); // QA for phi or D0/D0bar children
} else if constexpr (isXi) {
outputDebugParts(-999., -999., -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999., -999., -999., -999.,
-999., -999., -999., -999., -999.,
particle.dcacascdaughters(), particle.cascradius(),
particle.x(), particle.y(), particle.z(),
particle.mOmega()); // QA for Xi Cascades (later do the same for Omegas)
} else if constexpr (isCasc) {
if constexpr (std::experimental::is_detected<hasStrangeTOF, 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(),
particle.tofNSigmaOmLaPr(), particle.tofNSigmaOmKa(),
particle.dcacascdaughters(), particle.cascradius(),
particle.x(), particle.y(), particle.z(), -999.);
}
} else {
// LOGF(info, "isTrack0orV0: %d, isPhi: %d", isTrackOrV0, isPhiOrD0);
outputDebugParts(-999., -999., -999., -999., -999., -999., -999., -999., -999.,
Expand Down Expand Up @@ -879,8 +907,8 @@
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake;
}

TLorentzVector part1Vec;

Check failure on line 910 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 911 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 @@ -888,7 +916,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 919 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 @@ -1246,8 +1274,8 @@
casc.positiveeta(),
casc.positivephi(),
aod::femtouniverseparticle::ParticleType::kV0Child,
0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosCuts),
PIDBitmask(posTrackCasc), // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosPID),
0,
PIDBitmask(posTrackCasc),
hasTOF,
childIDs,
0,
Expand All @@ -1268,8 +1296,8 @@
casc.negativeeta(),
casc.negativephi(),
aod::femtouniverseparticle::ParticleType::kV0Child,
0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegCuts),
PIDBitmask(negTrackCasc), // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegPID),
0,
PIDBitmask(negTrackCasc),
hasTOF,
childIDs,
0,
Expand All @@ -1291,8 +1319,8 @@
casc.bacheloreta(),
casc.bachelorphi(),
aod::femtouniverseparticle::ParticleType::kCascadeBachelor,
0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegCuts),
PIDBitmask(bachTrackCasc), // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegPID),
0,
PIDBitmask(bachTrackCasc),
hasTOF,
childIDs,
0,
Expand All @@ -1308,8 +1336,8 @@
casc.eta(),
casc.phi(),
aod::femtouniverseparticle::ParticleType::kCascade,
0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kV0),
0,
PIDStrangeTOFBitmask(casc),
0,
indexCascChildID,
casc.mXi(),
Expand Down Expand Up @@ -1759,8 +1787,8 @@
continue;
}

TLorentzVector part1Vec;

Check failure on line 1790 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 1791 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 @@ -1768,7 +1796,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 1799 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 @@ -2112,7 +2140,7 @@
aod::BCsWithTimestamps const&,
soa::Filtered<aod::FemtoFullTracks> const& tracks,
o2::aod::V0Datas const& fullV0s,
o2::aod::CascDatas const& fullCascades)
soa::Join<o2::aod::CascDatas, o2::aod::CascTOFNSigmas> const& fullCascades)
{
getMagneticFieldTesla(col.bc_as<aod::BCsWithTimestamps>());
const auto colcheck = fillCollisions<false>(col, tracks);
Expand Down
Loading