From 6a68e2899fd3f7a49aced53723ccdc84b28c8ab9 Mon Sep 17 00:00:00 2001 From: Wooseok Ham Date: Wed, 7 Oct 2026 11:51:52 +0900 Subject: [PATCH] PWGJE: add hasColl pass/fail diagnostics for event selections --- PWGJE/Tasks/jetCrossSectionEfficiency.cxx | 58 +++++++++++++++++++++-- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx index cfc984b2c50..9fce23a2353 100644 --- a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx +++ b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -151,6 +152,7 @@ struct JetCrossSectionEfficiency { static constexpr float ConfigSwitchHigh = 9998.0f; static constexpr float BrokenPtHardSentinel = 1.0f; static constexpr int MinITSClustersForOccupancy = 5; + static constexpr int NumberOfHasCollSelectionConditionDiagnostics = 5; static constexpr int HasCollQaMaxCount = 500; static constexpr int HasCollQaMaxDeltaGlobalBC = 100000; static constexpr int64_t NoOtherTruthCollision = -1; @@ -370,6 +372,8 @@ struct JetCrossSectionEfficiency { if (isSel8FullPbPb) { AxisSpec axisPbPbTruthSelectionOnly = {PbPbTruthSelectionOnlyNBins, 0.5, static_cast(PbPbTruthSelectionOnlyNBins) + 0.5, "event selection (PbPb truth-only)"}; + AxisSpec selectionConditionAxis = {NumberOfHasCollSelectionConditionDiagnostics, 0.5, static_cast(NumberOfHasCollSelectionConditionDiagnostics) + 0.5, "selection condition"}; + AxisSpec hasCollSelectionStateAxis = {4, 0.5, 4.5, "hasColl and selection-condition state"}; std::vector timeRangeOnlyLabels = {"INEL", "+RCT_pass", "+kTVX(truth)", "+kNoTFB(truth)", "+kNoITSROFB(truth)", "+kNoCollInTimeRangeStandard(truth)", "+hasColl", "+|zReco|<10", "+noSplit"}; std::vector rofOnlyLabels = {"INEL", "+RCT_pass", "+kTVX(truth)", "+kNoTFB(truth)", "+kNoITSROFB(truth)", "+kNoCollInRofStandard(truth)", "+hasColl", "+|zReco|<10", "+noSplit"}; @@ -390,6 +394,19 @@ struct JetCrossSectionEfficiency { {HistType::kTH1F, {axisPbPbTruthSelectionOnly}}); setAxisLabels(registry.get(HIST("h2_jet_pt_part_eventselection_bcBitsFirst_rofOnly_truth"))->GetYaxis(), rofOnlyLabels); setAxisLabels(registry.get(HIST("h_mccollisions_eventselection_bcBitsFirst_rofOnly_truth"))->GetXaxis(), rofOnlyLabels); + + registry.add("h2_mccollisions_selection_bit_vs_has_coll_state", + "weighted MC collisions after common RCT+TVX baseline with valid PbPb truth-proxy evaluation;selection condition;hasColl and selection-condition state", + {HistType::kTH2F, {selectionConditionAxis, hasCollSelectionStateAxis}}); + registry.add("h2_mcpjets_selection_bit_vs_has_coll_state", + "weighted selected MCP jets after common RCT+TVX baseline with valid PbPb truth-proxy evaluation;selection condition;hasColl and selection-condition state", + {HistType::kTH2F, {selectionConditionAxis, hasCollSelectionStateAxis}}); + std::vector selectionConditionLabels = {"kNoTimeFrameBorder", "kNoITSROFrameBorder", "kNoSameBunchPileup (truth proxy)", "kNoCollInTimeRangeStandard (truth proxy)", "kNoCollInRofStandard (truth proxy)"}; + std::vector hasCollSelectionStateLabels = {"noColl, fail", "noColl, pass", "hasColl, fail", "hasColl, pass"}; + setAxisLabels(registry.get(HIST("h2_mccollisions_selection_bit_vs_has_coll_state"))->GetXaxis(), selectionConditionLabels); + setAxisLabels(registry.get(HIST("h2_mccollisions_selection_bit_vs_has_coll_state"))->GetYaxis(), hasCollSelectionStateLabels); + setAxisLabels(registry.get(HIST("h2_mcpjets_selection_bit_vs_has_coll_state"))->GetXaxis(), selectionConditionLabels); + setAxisLabels(registry.get(HIST("h2_mcpjets_selection_bit_vs_has_coll_state"))->GetYaxis(), hasCollSelectionStateLabels); } } @@ -1369,11 +1386,12 @@ struct JetCrossSectionEfficiency { bool passesNoTFBTruth = truthBC.selection_bit(aod::evsel::kNoTimeFrameBorder); bool passesNoITSROFBTruth = truthBC.selection_bit(aod::evsel::kNoITSROFrameBorder); - bool truthNoSBP = true; - if (applySBP) { + bool truthNoSBPDiagnostic = true; + if (applySBP || isSel8FullPbPb) { auto sameBC = allMcCollisions.sliceBy(mcCollsPerBC, mccollision.bcId()); - truthNoSBP = (sameBC.size() == 1); + truthNoSBPDiagnostic = (sameBC.size() == 1); } + bool truthNoSBP = applySBP ? truthNoSBPDiagnostic : true; bool hasRecoColl = (collisions.size() >= 1); bool passesZvtxCutReco = false; @@ -1398,6 +1416,38 @@ struct JetCrossSectionEfficiency { } bool passesRct = applyRCT ? (truthBC.rct_raw() & rctMask) == 0 : true; + float weight = mccollision.weight(); + + if (isSel8FullPbPb && passesRct && passesTVXTruth && truthPbPbSelections.valid) { + // The five selection conditions are evaluated independently on the same RCT+TVX + // baseline with valid PbPb truth-proxy evaluation. + const std::array selectionConditionPasses = { + passesNoTFBTruth, + passesNoITSROFBTruth, + truthNoSBPDiagnostic, + truthPbPbSelections.noCollInTimeRangeStandard, + truthPbPbSelections.noCollInRofStandard}; + for (size_t conditionIndex = 0; conditionIndex < selectionConditionPasses.size(); ++conditionIndex) { + const int hasCollSelectionState = (hasRecoColl ? 3 : 1) + (selectionConditionPasses[conditionIndex] ? 1 : 0); + registry.fill(HIST("h2_mccollisions_selection_bit_vs_has_coll_state"), static_cast(conditionIndex + 1), hasCollSelectionState, weight); + } + + float pTHatDiagnostic = computePtHat(mccollision); + if (pTHatDiagnostic >= pTHatAbsoluteMin) { + for (const auto& jet : jets) { + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax) || + jet.pt() < jetPtMin || jet.pt() > pTHatMaxMCP * pTHatDiagnostic || + !isAcceptedJet(jet)) { + continue; + } + for (size_t conditionIndex = 0; conditionIndex < selectionConditionPasses.size(); ++conditionIndex) { + const int hasCollSelectionState = (hasRecoColl ? 3 : 1) + (selectionConditionPasses[conditionIndex] ? 1 : 0); + registry.fill(HIST("h2_mcpjets_selection_bit_vs_has_coll_state"), static_cast(conditionIndex + 1), hasCollSelectionState, weight); + } + } + } + } + std::vector pass = {true, passesRct, passesTVXTruth, applyTFB ? passesNoTFBTruth : true, applyROFB ? passesNoITSROFBTruth : true}; @@ -1414,8 +1464,6 @@ struct JetCrossSectionEfficiency { pass.push_back(passesZvtxCutReco); pass.push_back(hasRecoColl && noSplitPass); - float weight = mccollision.weight(); - int sMaxTimeRangeOnly = 0; int sMaxRofOnly = 0; if (isSel8FullPbPb) {