Skip to content
Merged
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
41 changes: 41 additions & 0 deletions PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "ReconstructionDataFormats/Track.h"
#include "TMath.h"
#include "TLorentzVector.h"

Check failure on line 57 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 "Framework/O2DatabasePDGPlugin.h"

using namespace o2;
Expand Down Expand Up @@ -746,7 +746,7 @@
if ((kaon1MC.isPhysicalPrimary() && kaon2MC.isPhysicalPrimary()) && (!motherskaon1MC.empty() && !motherskaon2MC.empty())) {
for (const auto& particleMotherOfNeg : motherskaon1MC) {
for (const auto& particleMotherOfPos : motherskaon2MC) {
if (particleMotherOfNeg == particleMotherOfPos && particleMotherOfNeg.pdgCode() == 333) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kPrimary;
} else {
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake;
Expand All @@ -760,8 +760,8 @@
phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake;
}

TLorentzVector part1Vec;

Check failure on line 763 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 764 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 @@ -769,7 +769,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 772 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 @@ -1579,8 +1579,8 @@
continue;
}

TLorentzVector part1Vec;

Check failure on line 1582 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 1583 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 @@ -1588,7 +1588,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 1591 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 @@ -1695,7 +1695,7 @@
std::vector<int> tmpPDGCodes = confMCTruthPDGCodes; // necessary due to some features of the Configurable
for (auto const& pdg : tmpPDGCodes) {
if (static_cast<int>(pdg) == static_cast<int>(pdgCode)) {
if (pdgCode == 333) { // && (recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) { // ATTENTION: all Phi mesons are NOT primary particles

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

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
pass = true;
} else {
if (confStoreMCmothers || particle.isPhysicalPrimary() || (confActivateSecondaries && recoMcIds && recoMcIds->get().contains(particle.globalIndex())))
Expand Down Expand Up @@ -1841,7 +1841,7 @@
std::vector<int> tmpPDGCodes = confMCTruthPDGCodes; // necessary due to some features of the Configurable
for (auto const& pdg : tmpPDGCodes) {
if (static_cast<int>(pdg) == static_cast<int>(pdgCode)) {
if (pdgCode == 333) { // && (recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) { // ATTENTION: all Phi mesons are NOT primary particles

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

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
pass = true;
} else if (pdgCode == 421) {
pass = true;
Expand Down Expand Up @@ -2336,6 +2336,47 @@
}
PROCESS_SWITCH(FemtoUniverseProducerTask, processTruthAndFullMCCasc, "Provide both MC truth and reco for tracks and Cascades", false);

void processTruthAndFullMCCentRun3Casc(
aod::McCollisions const& mccols,
aod::McParticles const& mcParticles,
aod::FemtoFullCollisionCentRun3MCs const& collisions,
soa::Filtered<soa::Join<aod::FemtoFullTracks, aod::McTrackLabels>> const& tracks,
soa::Join<o2::aod::CascDatas, aod::McCascLabels> const& fullCascades,
aod::BCsWithTimestamps const&)
{

// recos
std::set<int> recoMcIds;
for (const auto& col : collisions) {
auto groupedTracks = tracks.sliceBy(perCollisionTracks, col.globalIndex());
auto groupedCascParts = fullCascades.sliceBy(perCollisionCascs, col.globalIndex());
getMagneticFieldTesla(col.bc_as<aod::BCsWithTimestamps>());
const auto colcheck = fillCollisionsCentRun3<true>(col);
if (colcheck) {
fillTracks<true>(groupedTracks);
fillCascade<true>(col, groupedCascParts, groupedTracks);
}
for (const auto& track : groupedTracks) {
if (trackCuts.isSelectedMinimal(track))
recoMcIds.insert(track.mcParticleId());
}
}

// truth
for (const auto& mccol : mccols) {
auto groupedCollisions = collisions.sliceBy(recoCollsPerMCCollCentPbPb, mccol.globalIndex());
for (const auto& col : groupedCollisions) {
const auto colcheck = fillMCTruthCollisionsCentRun3(col); // fills the reco collisions for mc collision
if (colcheck) {
auto groupedMCParticles = mcParticles.sliceBy(perMCCollision, mccol.globalIndex());
outputCollExtra(1.0, 1.0);
fillParticles<decltype(groupedMCParticles), true, true>(groupedMCParticles, recoMcIds); // fills mc particles
}
}
}
}
PROCESS_SWITCH(FemtoUniverseProducerTask, processTruthAndFullMCCentRun3Casc, "Provide both MC truth and reco for tracks and cascades with centrality", false);

Preslice<soa::Join<aod::HfCand2Prong, aod::HfCand2ProngMcRec, aod::HfSelD0, aod::HfMlD0>> perCollisionD0s = aod::track::collisionId;
void processTrackD0MC(aod::McCollisions const& mccols,
aod::TracksWMc const&,
Expand Down
6 changes: 6 additions & 0 deletions PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ struct FemtoUniverseEfficiencyBase {
trackHistoPartOneRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, 0, confPDGCodePartOne, confIsDebug);
registryMCOrigin.add("part1/hPt", " ;#it{p}_{T} (GeV/c); Entries", {HistType::kTH1F, {{240, 0, 6}}});
registryPDG.add("part1/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}});
registryPDG.add("part1/PDGvspTall", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}});
if (confParticleTypePartOne == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) {
trackHistoV0OneRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarCPABins, 0, confPDGCodePartOne, confIsDebug);
trackHistoV0OneChildPosRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, 0, 0, confIsDebug, "posChildV0_1");
Expand All @@ -169,6 +170,7 @@ struct FemtoUniverseEfficiencyBase {
}

registryPDG.add("part2/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}});
registryPDG.add("part2/PDGvspTall", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}});
if (!confIsSame) {
trackHistoPartTwoGen.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarPDGBins, 0, confPDGCodePartTwo, false);
trackHistoPartTwoRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, 0, confPDGCodePartTwo, confIsDebug);
Expand Down Expand Up @@ -373,6 +375,8 @@ struct FemtoUniverseEfficiencyBase {
continue;
}

registryPDG.fill(HIST("part1/PDGvspTall"), part.pt(), mcParticle.pdgMCTruth());

if (!(std::abs(mcParticle.pdgMCTruth()) == std::abs(confPDGCodePartOne))) {
continue;
}
Expand All @@ -397,6 +401,8 @@ struct FemtoUniverseEfficiencyBase {
continue;
}

registryPDG.fill(HIST("part2/PDGvspTall"), part.pt(), mcParticle.pdgMCTruth());

if (!(std::abs(mcParticle.pdgMCTruth()) == std::abs(confPDGCodePartTwo))) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ struct femtoUniversePairTaskTrackCascadeExtended {
// MC truth
void processSameEventMCgen(const FilteredFDCollision& col, [[maybe_unused]] const FemtoFullParticles& parts)
{
const int multCol = confUseCent ? col.multV0M() : col.multNtr();

auto groupPartsOne = partsOneMCgen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
auto groupPartsTwo = partsTwoMCgen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);

Expand Down Expand Up @@ -665,7 +667,7 @@ struct femtoUniversePairTaskTrackCascadeExtended {
int pdgCodeCasc = static_cast<int>(p2.pidCut());
if ((confCascType1 == 0 && pdgCodeCasc != 3334) || (confCascType1 == 2 && pdgCodeCasc != -3334) || (confCascType1 == 1 && pdgCodeCasc != 3312) || (confCascType1 == 3 && pdgCodeCasc != -3312))
continue;
sameEventCont.setPair<false>(p1, p2, col.multNtr(), confUse3D, 1.0f);
sameEventCont.setPair<false>(p1, p2, multCol, confUse3D, 1.0f);
}
}
}
Expand All @@ -676,6 +678,7 @@ struct femtoUniversePairTaskTrackCascadeExtended {
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinning{{confVtxBins, confMultBins}, true};

for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) {
const int multCol = confUseCent ? collision1.multV0M() : collision1.multNtr();

auto groupPartsOne = partsOneMCgen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
auto groupPartsTwo = partsTwoMCgen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
Expand All @@ -692,7 +695,7 @@ struct femtoUniversePairTaskTrackCascadeExtended {
int pdgCodeCasc = static_cast<int>(p2.pidCut());
if ((confCascType1 == 0 && pdgCodeCasc != 3334) || (confCascType1 == 2 && pdgCodeCasc != -3334) || (confCascType1 == 1 && pdgCodeCasc != 3312) || (confCascType1 == 3 && pdgCodeCasc != -3312))
continue;
mixedEventCont.setPair<false>(p1, p2, collision1.multNtr(), confUse3D, 1.0f);
mixedEventCont.setPair<false>(p1, p2, multCol, confUse3D, 1.0f);
}
}
}
Expand Down
Loading