From ddb1263e0cc945ddd08cd9adedbf5a0afb16b708 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 17 Jul 2025 12:41:58 +0200 Subject: [PATCH 1/6] Adding function to calculate fraction of bad TPC cluster points for closed-pairs --- .../Core/FemtoUniverseDetaDphiStar.h | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 65344e45bba..66766295d75 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -413,6 +413,65 @@ class FemtoUniverseDetaDphiStar } } + + /// Check if pair is close or not + template + bool isClosePairFrac(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType, bool IsDphiAvgOrDist, float DistMax, float FracMax) + { + magfield = lmagfield; + + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { + /// Track-Track combination + // check if provided particles are in agreement with the class instantiation + if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack) { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kTrack,kTrack candidates."; + return false; + } + auto deta = part1.eta() - part2.eta(); + auto dphiAvg = averagePhiStar(part1, part2, 0); + auto distfrac = averagePhiStarFrac(part1, part2, DistMax); + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadpisame[0][0]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadpimixed[0][0]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + + if (IsDphiAvgOrDist) { + if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { + return true; + } else { + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadpisame[0][1]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadpimixed[0][1]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; + } + } else { + if (distfrac > FracMax) { + return true; + } else { + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadpisame[0][1]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadpimixed[0][1]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; + } + } + + } else { + LOG(fatal) << "FemtoUniversePairCleaner: Combination of objects not defined - quitting!"; + return false; + } + } + /// Check if pair is close or not template bool isClosePairFrac(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType, bool IsDphiAvgOrDist, float DistMax, float FracMax) From cba05cf3890c9a8861b757c63d0a4e108941c46b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 4 Aug 2025 11:08:03 +0200 Subject: [PATCH 2/6] Adding function to check closed pair at vertex --- .../Core/FemtoUniverseDetaDphiStar.h | 43 +++++-------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 66766295d75..a3f50942e12 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -413,10 +413,9 @@ class FemtoUniverseDetaDphiStar } } - /// Check if pair is close or not template - bool isClosePairFrac(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType, bool IsDphiAvgOrDist, float DistMax, float FracMax) + bool isClosePairAtITS(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType) { magfield = lmagfield; @@ -428,8 +427,7 @@ class FemtoUniverseDetaDphiStar return false; } auto deta = part1.eta() - part2.eta(); - auto dphiAvg = averagePhiStar(part1, part2, 0); - auto distfrac = averagePhiStarFrac(part1, part2, DistMax); + auto dphiAvg = part1.phi() - part2.phi(); if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[0][0]->Fill(deta, dphiAvg); } else if (ChosenEventType == femto_universe_container::EventType::mixed) { @@ -438,37 +436,18 @@ class FemtoUniverseDetaDphiStar LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if (IsDphiAvgOrDist) { - if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { - return true; - } else { - if (ChosenEventType == femto_universe_container::EventType::same) { - histdetadpisame[0][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femto_universe_container::EventType::mixed) { - histdetadpimixed[0][1]->Fill(deta, dphiAvg); - } else { - LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; - } - return false; - } + if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { + return true; } else { - if (distfrac > FracMax) { - return true; + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadpisame[0][1]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadpimixed[0][1]->Fill(deta, dphiAvg); } else { - if (ChosenEventType == femto_universe_container::EventType::same) { - histdetadpisame[0][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femto_universe_container::EventType::mixed) { - histdetadpimixed[0][1]->Fill(deta, dphiAvg); - } else { - LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; - } - return false; + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } + return false; } - - } else { - LOG(fatal) << "FemtoUniversePairCleaner: Combination of objects not defined - quitting!"; - return false; } } @@ -744,4 +723,4 @@ class FemtoUniverseDetaDphiStar } /* namespace femto_universe */ } /* namespace o2::analysis */ -#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_ +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_ \ No newline at end of file From 94088b12b64b7ad7b03dd5637a22b927762dcd53 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 4 Aug 2025 11:08:15 +0200 Subject: [PATCH 3/6] Adding function to check closed pair at vertex --- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 05c910b0b24..3899030612f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -185,6 +185,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable ConfIsFillAngqLCMS{"ConfIsFillAngqLCMS", true, "Fill qLCMS vs dEta vs dPhi"}; Configurable confCPRDistMax{"confCPRDistMax", 0.0, "Max. radial seperation between two closed-pairs"}; Configurable confCPRFracMax{"confCPRFracMax", 0.0, "Max. allowed fraction bad to all TPC points of radial seperation between two closed-pairs"}; + Configurable confCPRIsAtITS{"confCPRIsAtITS", false, "Close Pair Rejection at ITS or TPC"}; Configurable confCPRDphiAvgOrDist{"confCPRDphiAvgOrDist", true, "Close Pair Rejection by radial or angular seperation"}; FemtoUniverseSHContainer sameEventCont; @@ -485,8 +486,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) { - continue; + if (confCPRIsAtITS.value) { + if (pairCloseRejection.isClosePairAtITS(p1, p2, magFieldTesla, femto_universe_container::EventType::same)) { + continue; + } + } else { + if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) { + continue; + } } } @@ -509,8 +516,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) { - continue; + if (confCPRIsAtITS.value) { + if (pairCloseRejection.isClosePairAtITS(p1, p2, magFieldTesla, femto_universe_container::EventType::same)) { + continue; + } + } else { + if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) { + continue; + } } } @@ -667,8 +680,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::mixed, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) { - continue; + if (confCPRIsAtITS.value) { + if (pairCloseRejection.isClosePairAtITS(p1, p2, magFieldTesla, femto_universe_container::EventType::same)) { + continue; + } + } else { + if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, confCPRDphiAvgOrDist, confCPRDistMax, confCPRFracMax)) { + continue; + } } } From c5e1a87e13b203e80188a58a115b81c2d4909b0a Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Mon, 4 Aug 2025 11:36:29 +0200 Subject: [PATCH 4/6] Fixing clang-format error --- PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index a3f50942e12..ec96d469d76 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -723,4 +723,4 @@ class FemtoUniverseDetaDphiStar } /* namespace femto_universe */ } /* namespace o2::analysis */ -#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_ \ No newline at end of file +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_ From f19f5d8f9919cb88121a24b7ac570b921d885956 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Mon, 4 Aug 2025 11:44:47 +0200 Subject: [PATCH 5/6] Fixing megalinter error --- PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index ec96d469d76..0365e6995b0 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -447,7 +447,9 @@ class FemtoUniverseDetaDphiStar LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } return false; - } + } else { + LOG(fatal) << "FemtoUniversePairCleaner: Combination of objects not defined - quitting!"; + return false; } } From fe58bffa6914293e0a2fe16a57237b789a4c7463 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Mon, 4 Aug 2025 13:59:47 +0200 Subject: [PATCH 6/6] Fixing megalinter, O2 build error --- PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 0365e6995b0..2fa14b2098a 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -447,7 +447,8 @@ class FemtoUniverseDetaDphiStar LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } return false; - } else { + } + } else { LOG(fatal) << "FemtoUniversePairCleaner: Combination of objects not defined - quitting!"; return false; }