From 48ced9cd04bf2a7947ccfe54ef16844b11e85b9d Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 14:22:30 +0200 Subject: [PATCH 1/8] Changing configurables for Phi meson reconstruction --- .../Core/FemtoUniverseCascadeSelection.h | 4 +- .../Core/FemtoUniverseTrackSelection.h | 2 +- .../femtoUniverseProducerTask.cxx | 65 +++++++++++++++---- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 2 +- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 56 ---------------- 5 files changed, 58 insertions(+), 71 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h index 64e9c339b55..535dd5ace79 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h @@ -259,8 +259,8 @@ class FemtoUniverseCascadeSelection femtoUniverseSelection::kLowerLimit, // DCA v0 to PV max femtoUniverseSelection::kLowerLimit, // v0 mass min femtoUniverseSelection::kUpperLimit, // v0 mass max - }; ///< Map to match a variable with - ///< its type + }; ///< Map to match a variable with + ///< its type static constexpr std::string_view mSelectionHelper[kNcascadeSelection] = { "Cascade particle sign (+1 or -1)", diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index 71086d55b8d..881e2776960 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -288,7 +288,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 60e672fe819..f3cca73a370 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -121,7 +121,8 @@ struct femtoUniverseProducerTask { Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"}; Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"}; Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"}; - Configurable ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtouniverse tables"}; + Configurable ConfIsActivateV0{"ConfIsActivateV0", false, "Activate filling of V0 into femtouniverse tables"}; + Configurable ConfActivateSecondaries{"ConfActivateSecondaries", false, "Fill secondary MC gen particles that were reconstructed"}; Configurable ConfIsActivateCascade{"ConfIsActivateCascade", true, "Activate filling of Cascade into femtouniverse tables"}; Configurable ConfIsActivatePhi{"ConfIsActivatePhi", false, "Activate filling of Phi into femtouniverse tables"}; Configurable ConfMCTruthAnalysisWithPID{"ConfMCTruthAnalysisWithPID", true, "1: take only particles with specified PDG, 0: all particles (for MC Truth)"}; @@ -262,10 +263,11 @@ struct femtoUniverseProducerTask { Configurable ConfLooseTOFNSigmaValue{"ConfLooseTOFNSigmaValue", 10, "Value for the loose TOF N Sigma for Kaon PID."}; Configurable ConfInvMassLowLimitPhi{"ConfInvMassLowLimitPhi", 1.011, "Lower limit of the Phi invariant mass"}; // change that to do invariant mass cut Configurable ConfInvMassUpLimitPhi{"ConfInvMassUpLimitPhi", 1.027, "Upper limit of the Phi invariant mass"}; - Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 321, "Particle 1 - PDG code"}; - Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 321, "Particle 2 - PDG code"}; } ConfPhiSelection; + Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 321, "Particle 1 - PDG code"}; + Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 321, "Particle 2 - PDG code"}; + // D0/D0bar mesons struct : o2::framework::ConfigurableGroup { Configurable ConfD0D0barCandMaxY{"ConfD0D0barCandMaxY", -1., "max. cand. rapidity"}; @@ -640,7 +642,7 @@ struct femtoUniverseProducerTask { int particleOrigin = 99; auto motherparticlesMC = particleMC.template mothers_as(); - if (abs(pdgCode) == abs(ConfPhiSelection.ConfPDGCodePartOne.value) || abs(pdgCode) == abs(ConfPhiSelection.ConfPDGCodePartTwo.value)) { + if (abs(pdgCode) == abs(ConfPDGCodePartOne.value) || abs(pdgCode) == abs(ConfPDGCodePartTwo.value)) { if (particleMC.isPhysicalPrimary()) { particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; } else if (!motherparticlesMC.empty()) { @@ -1186,8 +1188,8 @@ struct femtoUniverseProducerTask { TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(ConfPhiSelection.ConfPDGCodePartOne)->Mass(); // FIXME: Get from the PDG service of the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(ConfPhiSelection.ConfPDGCodePartTwo)->Mass(); // FIXME: Get from the PDG service of the common header + float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header + float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header part1Vec.SetPtEtaPhiM(p1.pt(), p1.eta(), p1.phi(), mMassOne); part2Vec.SetPtEtaPhiM(p2.pt(), p2.eta(), p2.phi(), mMassTwo); @@ -1217,7 +1219,7 @@ struct femtoUniverseProducerTask { continue; } - phiCuts.fillQA(col, p1, p1, p2, ConfPhiSelection.ConfPDGCodePartOne, ConfPhiSelection.ConfPDGCodePartTwo); ///\todo fill QA also for daughters + phiCuts.fillQA(col, p1, p1, p2, 321, -321); ///\todo fill QA also for daughters int postrackID = p1.globalIndex(); int rowInPrimaryTrackTablePos = -1; // does it do anything? @@ -1283,10 +1285,11 @@ struct femtoUniverseProducerTask { } } - template + template void fillParticles(TrackType const& tracks, std::optional>> recoMcIds = std::nullopt) { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children + std::vector tmpIDtrack; for (auto& particle : tracks) { /// if the most open selection criteria are not fulfilled there is no @@ -1307,7 +1310,7 @@ struct femtoUniverseProducerTask { if (pdgCode == 333) { // ATTENTION: workaround for now, because all Phi mesons are NOT primary particles for now. pass = true; } else { - if (particle.isPhysicalPrimary() || (recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) + if (particle.isPhysicalPrimary() || (ConfActivateSecondaries && recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) pass = true; } } @@ -1328,6 +1331,10 @@ struct femtoUniverseProducerTask { // instead of the bitmask, the PDG of the particle is stored as uint32_t // now the table is filled + if constexpr (resolveDaughs) { + tmpIDtrack.push_back(particle.globalIndex()); + continue; + } outputParts(outputCollision.lastIndex(), particle.pt(), particle.eta(), @@ -1349,6 +1356,42 @@ struct femtoUniverseProducerTask { outputPartsMCLabels(-1); } } + if constexpr (resolveDaughs) { + childIDs[0] = 0; + childIDs[1] = 0; + for (int i = 0; i < tmpIDtrack.size(); i++) { + const auto& particle = tracks.iteratorAt(tmpIDtrack[i] - tracks.begin().globalIndex()); + for (int daughIndex = 0, n = std::min(2ul, particle.daughtersIds().size()); daughIndex < n; daughIndex++) { + // loop to find the corresponding index of the daughters + for (int j = 0; j < tmpIDtrack.size(); j++) { + if (tmpIDtrack[j] == particle.daughtersIds()[daughIndex]) { + childIDs[daughIndex] = i - j; + break; + } + } + } + outputParts(outputCollision.lastIndex(), + particle.pt(), + particle.eta(), + particle.phi(), + aod::femtouniverseparticle::ParticleType::kMCTruthTrack, + 0, + static_cast(particle.pdgCode()), + particle.pdgCode(), + childIDs, + 0, + 0); + if (ConfIsDebug) { + fillDebugParticle(particle); + } + + // Workaround to keep the FDParticles and MC label tables + // aligned, so that they can be joined in the task. + if constexpr (transientLabels) { + outputPartsMCLabels(-1); + } + } + } } template (groupedMCParticles, recoMcIds); // fills mc particles + fillMCTruthCollisions(groupedCollisions, groupedMCParticles); // fills the reco collisions for mc collision + fillParticles(groupedMCParticles, recoMcIds); // fills mc particles } } PROCESS_SWITCH(femtoUniverseProducerTask, processTruthAndFullMC, "Provide both MC truth and reco for tracks and V0s", false); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index bd59782fc0a..14ca3c834dd 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -556,7 +556,7 @@ struct femtoUniversePairTaskTrackD0 { } } } // It is the end of the for loop over D0bar mesons - } // It is the end of the for loop over all candidates + } // It is the end of the for loop over all candidates } PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 4617f5bd0c5..449eb6e876f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -430,20 +430,6 @@ struct femtoUniversePairTaskTrackPhi { float tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa; if (!ConfTrack.ConfIsSame) { for (auto& track : groupPartsTrack) { - // if (track.p() > ConfBothTracks.ConfCutTable->get("Track", "MaxP") || track.pt() > ConfBothTracks.ConfCutTable->get("Track", "MaxPt")) { - // continue; - // } - // if (!isFullPIDSelected(track.pidcut(), - // track.p(), - // ConfBothTracks.ConfCutTable->get("Track", "PIDthr"), - // vPIDTrack, - // ConfBothTracks.ConfNspecies, - // kNsigma, - // ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPC"), - // ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPCTOF"))) { - // continue; - // } - tpcNSigmaPi = trackCuts.getNsigmaTPC(track, o2::track::PID::Pion); tofNSigmaPi = trackCuts.getNsigmaTOF(track, o2::track::PID::Pion); tpcNSigmaKa = trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon); @@ -475,27 +461,6 @@ struct femtoUniversePairTaskTrackPhi { } /// Now build the combinations for (auto& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) { - // if (track.p() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxP") || track.pt() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxPt") || phicandidate.p() > ConfBothTracks.ConfCutTable->get("Track", "MaxP") || phicandidate.pt() > ConfBothTracks.ConfCutTable->get("Track", "MaxPt")) { - // continue; - // } - // if (!isFullPIDSelected(track.pidcut(), - // track.p(), - // ConfBothTracks.ConfCutTable->get("PhiCandidate", "PIDthr"), - // vPIDPhiCandidate, - // ConfBothTracks.ConfNspecies, - // kNsigma, - // ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPC"), - // ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPCTOF")) || - // !isFullPIDSelected(phicandidate.pidcut(), - // phicandidate.p(), - // ConfBothTracks.ConfCutTable->get("Track", "PIDthr"), - // vPIDTrack, - // ConfBothTracks.ConfNspecies, - // kNsigma, - // ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPC"), - // ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPCTOF"))) { - // continue; - // } if (ConfTrack.ConfIsTrackIdentified) { if (!IsParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; @@ -573,27 +538,6 @@ struct femtoUniversePairTaskTrackPhi { { for (auto& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) { - // if (track.p() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxP") || track.pt() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxPt") || phicandidate.p() > ConfBothTracks.ConfCutTable->get("Track", "MaxP") || phicandidate.pt() > ConfBothTracks.ConfCutTable->get("Track", "MaxPt")) { - // continue; - // } - // if (!isFullPIDSelected(track.pidcut(), - // track.p(), - // ConfBothTracks.ConfCutTable->get("PhiCandidate", "PIDthr"), - // vPIDPhiCandidate, - // ConfBothTracks.ConfNspecies, - // kNsigma, - // ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPC"), - // ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPCTOF")) || - // !isFullPIDSelected(phicandidate.pidcut(), - // phicandidate.p(), - // ConfBothTracks.ConfCutTable->get("Track", "PIDthr"), - // vPIDTrack, - // ConfBothTracks.ConfNspecies, - // kNsigma, - // ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPC"), - // ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPCTOF"))) { - // continue; - // } if (ConfTrack.ConfIsTrackIdentified) { if (!IsParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; From eecf9ba92958974ccdae974eae586e00e5be2bc1 Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 15:21:11 +0200 Subject: [PATCH 2/8] fix clang --- PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h | 6 +++--- PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h | 4 ++-- PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h index 535dd5ace79..01aea131831 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h @@ -259,8 +259,8 @@ class FemtoUniverseCascadeSelection femtoUniverseSelection::kLowerLimit, // DCA v0 to PV max femtoUniverseSelection::kLowerLimit, // v0 mass min femtoUniverseSelection::kUpperLimit, // v0 mass max - }; ///< Map to match a variable with - ///< its type + }; ///< Map to match a variable with + ///< its type static constexpr std::string_view mSelectionHelper[kNcascadeSelection] = { "Cascade particle sign (+1 or -1)", @@ -583,4 +583,4 @@ void FemtoUniverseCascadeSelection::fillQA(Col const& /*col*/, Casc const& /*cas } // namespace o2::analysis::femtoUniverse -#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ \ No newline at end of file diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index 881e2776960..a53312481c9 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -288,7 +288,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) @@ -583,4 +583,4 @@ void FemtoUniverseTrackSelection::fillQA(T const& track) } // namespace o2::analysis::femtoUniverse -#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSETRACKSELECTION_H_ +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSETRACKSELECTION_H_ \ No newline at end of file diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 14ca3c834dd..bd59782fc0a 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -556,7 +556,7 @@ struct femtoUniversePairTaskTrackD0 { } } } // It is the end of the for loop over D0bar mesons - } // It is the end of the for loop over all candidates + } // It is the end of the for loop over all candidates } PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false); From 85b551903300614f505553046544497e4bbb8765 Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 15:33:16 +0200 Subject: [PATCH 3/8] adding new line at the end --- PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h | 2 +- PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h index 01aea131831..64e9c339b55 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h @@ -583,4 +583,4 @@ void FemtoUniverseCascadeSelection::fillQA(Col const& /*col*/, Casc const& /*cas } // namespace o2::analysis::femtoUniverse -#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ \ No newline at end of file +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index a53312481c9..71086d55b8d 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -583,4 +583,4 @@ void FemtoUniverseTrackSelection::fillQA(T const& track) } // namespace o2::analysis::femtoUniverse -#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSETRACKSELECTION_H_ \ No newline at end of file +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSETRACKSELECTION_H_ From c4ab07b92ca29c14580e7f3333de3ec6c8723bc1 Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 16:09:05 +0200 Subject: [PATCH 4/8] Fixing PID rejection --- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 449eb6e876f..4ac9b12912b 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -182,11 +182,11 @@ struct femtoUniversePairTaskTrackPhi { bool IsProtonRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { + if (mom < 0.5) + return true; if (mom > 0.5) { if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaRejectPion) { return true; - } else if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfNsigmaRejectKaon) { - return true; } else { return false; } @@ -236,10 +236,12 @@ struct femtoUniversePairTaskTrackPhi { bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { - if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaRejectPion) { + if (mom < 0.5){ + if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { return true; - } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { + } + } else if (mom > 0.5) { + if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaRejectPion) { return true; } else { return false; @@ -271,10 +273,12 @@ struct femtoUniversePairTaskTrackPhi { bool IsPionRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCK, float nsigmaTOFK) { - if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfNsigmaRejectKaon) { + if (mom < 0.5){ + if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { return true; - } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { + } + } else if (mom > 0.5) { + if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfNsigmaRejectKaon) { return true; } else { return false; From 357db1bba0481fd5d3db71a3f5d228394e340bda Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 16:11:20 +0200 Subject: [PATCH 5/8] fix clang --- PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 4ac9b12912b..e0eb702f5ac 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -236,7 +236,7 @@ struct femtoUniversePairTaskTrackPhi { bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { - if (mom < 0.5){ + if (mom < 0.5) { if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { return true; } @@ -273,7 +273,7 @@ struct femtoUniversePairTaskTrackPhi { bool IsPionRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCK, float nsigmaTOFK) { - if (mom < 0.5){ + if (mom < 0.5) { if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { return true; } From ce311242f843de50e46a01caed098f3ba988ad3f Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 17:25:49 +0200 Subject: [PATCH 6/8] fixing exclusion PID + isSelectedMinimal for kaons added --- .../femtoUniverseProducerTask.cxx | 3 +++ .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index f3cca73a370..4ed997a5a84 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -1157,6 +1157,9 @@ struct femtoUniverseProducerTask { std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index // lorentz vectors and filling the tables for (auto& [p1, p2] : combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { + if (!trackCuts.isSelectedMinimal(p1) || !trackCuts.isSelectedMinimal(p1)) { + continue; + } // implementing PID cuts for phi children if (ConfPhiSelection.ConfLooseTPCNSigma) { if (!(IsKaonNSigmaTPCLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index e0eb702f5ac..82561f7c408 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -182,11 +182,14 @@ struct femtoUniversePairTaskTrackPhi { bool IsProtonRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { - if (mom < 0.5) + if (mom < 0.5) { return true; + } if (mom > 0.5) { if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaRejectPion) { return true; + } else if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfNsigmaRejectKaon) { + return true; } else { return false; } @@ -237,12 +240,17 @@ struct femtoUniversePairTaskTrackPhi { bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { if (mom < 0.5) { - if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { + if (TMath::Abs(nsigmaTPCPi) < ConfBothTracks.ConfNsigmaRejectPion) { + return true; + } else if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { return true; } - } else if (mom > 0.5) { + } + if (mom > 0.5) { if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaRejectPion) { return true; + } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { + return true; } else { return false; } @@ -274,12 +282,17 @@ struct femtoUniversePairTaskTrackPhi { bool IsPionRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.5) { - if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { + if (TMath::Abs(nsigmaTPCK) < ConfBothTracks.ConfNsigmaRejectKaon) { + return true; + } else if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { return true; } - } else if (mom > 0.5) { + } + if (mom > 0.5) { if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfNsigmaRejectKaon) { return true; + } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaRejectProton) { + return true; } else { return false; } From 184c3639143e7cca6b5a2e069a6ec7380364034a Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 18:59:32 +0200 Subject: [PATCH 7/8] fixing filters --- .../TableProducer/femtoUniverseProducerTask.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 4ed997a5a84..3ccd60457a3 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -206,13 +206,12 @@ struct femtoUniverseProducerTask { } ConfFilterCuts; Filter GlobalCutFilter = requireGlobalTrackWoDCAInFilter(); - Filter CustomTrackFilter = (aod::track::pt > ConfFilterCuts.ConfPtLowFilterCut) && (aod::track::pt < ConfFilterCuts.ConfPtHighFilterCut) && (nabs(aod::track::eta) < ConfFilterCuts.ConfEtaFilterCut) && - (!ConfFilterCuts.ConfDxaXYCustom0Cut || (aod::track::dcaXY < ConfFilterCuts.ConfDcaXYFilterCut)) && + (!ConfFilterCuts.ConfDxaXYCustom0Cut || (aod::track::dcaXY > ConfFilterCuts.ConfDcaXYFilterCut)) && //!(1 && 2) = !1 || !2 (aod::track::dcaZ < ConfFilterCuts.ConfDcaZFilterCut) && - (!ConfFilterCuts.ConfDcaXYCustom1Cut || (nabs(aod::track::dcaXY) < ConfFilterCuts.ConfDcaXYCustom11FilterCut + ConfFilterCuts.ConfDcaXYCustom12FilterCut / aod::track::pt)); + (!ConfFilterCuts.ConfDcaXYCustom1Cut || (nabs(aod::track::dcaXY) > ConfFilterCuts.ConfDcaXYCustom11FilterCut + ConfFilterCuts.ConfDcaXYCustom12FilterCut / aod::track::pt)); //!(1 && 2) = !1 || !2 // CASCADE FemtoUniverseCascadeSelection cascadeCuts; From d551a334f81807e1b92fc68795afbd9a118729db Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska Date: Mon, 26 Aug 2024 20:22:48 +0200 Subject: [PATCH 8/8] fix the logic --- .../FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 3ccd60457a3..1f818001bfd 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -209,9 +209,9 @@ struct femtoUniverseProducerTask { Filter CustomTrackFilter = (aod::track::pt > ConfFilterCuts.ConfPtLowFilterCut) && (aod::track::pt < ConfFilterCuts.ConfPtHighFilterCut) && (nabs(aod::track::eta) < ConfFilterCuts.ConfEtaFilterCut) && - (!ConfFilterCuts.ConfDxaXYCustom0Cut || (aod::track::dcaXY > ConfFilterCuts.ConfDcaXYFilterCut)) && //!(1 && 2) = !1 || !2 + (!ConfFilterCuts.ConfDxaXYCustom0Cut || (aod::track::dcaXY < ConfFilterCuts.ConfDcaXYFilterCut)) && // true if configurable set to false or if configurable is true and it passes the selection (aod::track::dcaZ < ConfFilterCuts.ConfDcaZFilterCut) && - (!ConfFilterCuts.ConfDcaXYCustom1Cut || (nabs(aod::track::dcaXY) > ConfFilterCuts.ConfDcaXYCustom11FilterCut + ConfFilterCuts.ConfDcaXYCustom12FilterCut / aod::track::pt)); //!(1 && 2) = !1 || !2 + (!ConfFilterCuts.ConfDcaXYCustom1Cut || (nabs(aod::track::dcaXY) < ConfFilterCuts.ConfDcaXYCustom11FilterCut + ConfFilterCuts.ConfDcaXYCustom12FilterCut / aod::track::pt)); // same logic here // CASCADE FemtoUniverseCascadeSelection cascadeCuts;