From 57e9d554fcdbf76d94d8f49f2e9249fe4bfe2819 Mon Sep 17 00:00:00 2001 From: Monalisa Melo Date: Mon, 10 Aug 2026 11:55:18 +0200 Subject: [PATCH 1/5] [PWGJE] add matching status axis to MCD THnSparse --- PWGJE/Tasks/jetDsSpecSubs.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetDsSpecSubs.cxx b/PWGJE/Tasks/jetDsSpecSubs.cxx index eec30bba067..9be467bb90b 100644 --- a/PWGJE/Tasks/jetDsSpecSubs.cxx +++ b/PWGJE/Tasks/jetDsSpecSubs.cxx @@ -211,7 +211,7 @@ struct JetDsSpecSubs { registry.add("h_ds_mass_mcd", ";m_{D_{S}}^{det} (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{200, 1.7, 2.15}}}); // Detector-level sparse histograms - registry.add("hSparse_ds_mcd1", ";m_{D_{S}}^{rec};#it{p}_{T,D_{S}}^{det};#it{p}_{T,jet}^{det};z^{D_{S},jet}_{||,det};Origin(D_{S})", {HistType::kTHnSparseF, {{60, 1.6, 2.3}, {60, 0., 80.}, {60, 0., 100.}, {20, 0., 1.2}, {2, -0.5, 1.5}}}); + registry.add("hSparse_ds_mcd1", ";m_{D_{S}}^{rec};#it{p}_{T,D_{S}}^{det};#it{p}_{T,jet}^{det};z^{D_{S},jet}_{||,det};Origin(D_{S});Matching status", {HistType::kTHnSparseF, {{60, 1.6, 2.3}, {60, 0., 80.}, {60, 0., 100.}, {20, 0., 1.2}, {2, -0.5, 1.5}, {2, -0.5, 1.5}}}); registry.add("hSparse_ds_mcd2", ";#it{p}_{T,D_{S}}^{det};#it{p}_{T,jet}^{det};#DeltaR_{D_{S},jet}^{det}", {HistType::kTHnSparseF, {{60, 0., 80.}, {60, 0., 100.}, {20, 0., 1.}}}); registry.add("hSparse_ds_mcd3", ";#it{p}_{T,jet}^{det};z^{D_{S},jet}_{||,det};#DeltaR_{D_{S},jet}^{det}", {HistType::kTHnSparseF, {{60, 0., 100.}, {20, 0., 1.2}, {20, 0., 1.}}}); @@ -243,6 +243,8 @@ struct JetDsSpecSubs { auto hSparseMCD = registry.get(HIST("hSparse_ds_mcd1")); hSparseMCD->GetAxis(4)->SetBinLabel(1, "Prompt"); hSparseMCD->GetAxis(4)->SetBinLabel(2, "Non-prompt"); + hSparseMCD->GetAxis(5)->SetBinLabel(1, "Unmatched"); + hSparseMCD->GetAxis(5)->SetBinLabel(2, "Matched"); auto hSparseMCP = registry.get(HIST("hSparse_ds_mcp")); hSparseMCP->GetAxis(4)->SetBinLabel(1, "Prompt"); @@ -597,6 +599,9 @@ struct JetDsSpecSubs { // Check if it's prompt int origin = (mcdDscand.originMcRec() != RecoDecay::OriginType::Prompt) ? 1 : 0; + // Matching status: 1 if the detector-level jet has a particle-level partner, 0 otherwise + int isMatchedMCD = mcdjet.has_matchedJetCand() ? 1 : 0; + // Check whether a matched particle-level jet exists if (mcdjet.has_matchedJetCand()) { registry.fill(HIST("McEffJet"), getValFromBin(BinMCJetCntr::DetectorLevelJetWithMatchedCandidate)); @@ -627,7 +632,8 @@ struct JetDsSpecSubs { mcdDscand.pt(), mcdjet.pt(), mcd_zParallel, - origin); + origin, + isMatchedMCD); // MCD THnSparse2: invariant p{T,Ds}, pT and DeltaR registry.fill(HIST("hSparse_ds_mcd2"), mcdDscand.pt(), From eaed506189ea1ede6eb4eb2c1d00e49d9fc36b0b Mon Sep 17 00:00:00 2001 From: Monalisa Melo Date: Sat, 15 Aug 2026 17:47:00 +0200 Subject: [PATCH 2/5] [PWGJE] Update detector-level event selection --- PWGJE/Tasks/jetDsSpecSubs.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetDsSpecSubs.cxx b/PWGJE/Tasks/jetDsSpecSubs.cxx index 9be467bb90b..8a12674fca4 100644 --- a/PWGJE/Tasks/jetDsSpecSubs.cxx +++ b/PWGJE/Tasks/jetDsSpecSubs.cxx @@ -580,13 +580,19 @@ struct JetDsSpecSubs { registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::Matched)); // Apply standard event selection and vertex cut - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || - !(std::abs(collision.posZ()) < vertexZCut)) { - continue; - } + //if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || + // !(std::abs(collision.posZ()) < vertexZCut)) { + // continue; + //} // Matched collision passing analysis selections - registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); + //registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); + + if (jetderiveddatautilities::selectCollision(collision, eventSelectionBits) && + std::abs(collision.posZ()) < vertexZCut) { + registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); + } + // Detector-level Ds-tagged jets associated with the current reconstructed collision const auto dsmcdJetsPerCollision = mcdjets.sliceBy(jetmcdpreslice, collision.globalIndex()); for (const auto& mcdjet : dsmcdJetsPerCollision) { From eb4d185ece25b026e04a5fe0315fb429ba60b823 Mon Sep 17 00:00:00 2001 From: Monalisa Melo Date: Sat, 15 Aug 2026 17:54:18 +0200 Subject: [PATCH 3/5] [PWGJE] Fix clang-format --- PWGJE/Tasks/jetDsSpecSubs.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGJE/Tasks/jetDsSpecSubs.cxx b/PWGJE/Tasks/jetDsSpecSubs.cxx index 8a12674fca4..019aea1e567 100644 --- a/PWGJE/Tasks/jetDsSpecSubs.cxx +++ b/PWGJE/Tasks/jetDsSpecSubs.cxx @@ -578,21 +578,19 @@ struct JetDsSpecSubs { // Successfully matched reconstructed collision registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::Matched)); - // Apply standard event selection and vertex cut - //if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || + // if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || // !(std::abs(collision.posZ()) < vertexZCut)) { // continue; //} // Matched collision passing analysis selections - //registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); + // registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); if (jetderiveddatautilities::selectCollision(collision, eventSelectionBits) && std::abs(collision.posZ()) < vertexZCut) { registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); } - // Detector-level Ds-tagged jets associated with the current reconstructed collision const auto dsmcdJetsPerCollision = mcdjets.sliceBy(jetmcdpreslice, collision.globalIndex()); for (const auto& mcdjet : dsmcdJetsPerCollision) { From cbdde91b2d396baa74fdf6a0d039c994f10bd028 Mon Sep 17 00:00:00 2001 From: Monalisa Melo Date: Sat, 15 Aug 2026 18:08:56 +0200 Subject: [PATCH 4/5] [PWGJE] Apply event selection to MCP collisions --- PWGJE/Tasks/jetDsSpecSubs.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/PWGJE/Tasks/jetDsSpecSubs.cxx b/PWGJE/Tasks/jetDsSpecSubs.cxx index 019aea1e567..10a5570f92a 100644 --- a/PWGJE/Tasks/jetDsSpecSubs.cxx +++ b/PWGJE/Tasks/jetDsSpecSubs.cxx @@ -578,18 +578,13 @@ struct JetDsSpecSubs { // Successfully matched reconstructed collision registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::Matched)); - // Apply standard event selection and vertex cut - // if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || - // !(std::abs(collision.posZ()) < vertexZCut)) { - // continue; - //} - // Matched collision passing analysis selections - // registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); - if (jetderiveddatautilities::selectCollision(collision, eventSelectionBits) && - std::abs(collision.posZ()) < vertexZCut) { - registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); + // Apply standard event selection and vertex cut + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || !(std::abs(collision.posZ()) < vertexZCut)) { + continue; } + // Matched collision passing analysis selections + registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::MatchedSel8ZCut)); // Detector-level Ds-tagged jets associated with the current reconstructed collision const auto dsmcdJetsPerCollision = mcdjets.sliceBy(jetmcdpreslice, collision.globalIndex()); @@ -651,6 +646,10 @@ struct JetDsSpecSubs { } } // Particle level + + if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)){ + continue; + } const auto dsmcpJetsPerMCCollision = mcpjets.sliceBy(jetmcppreslice, mccollision.globalIndex()); for (const auto& mcpjet : dsmcpJetsPerMCCollision) { From 63a5a2f5273a4adc84193be7feb7eab6ce3c0c35 Mon Sep 17 00:00:00 2001 From: Monalisa Melo Date: Sat, 15 Aug 2026 18:22:21 +0200 Subject: [PATCH 5/5] [PWGJE] Align MC collision selection --- PWGJE/Tasks/jetDsSpecSubs.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGJE/Tasks/jetDsSpecSubs.cxx b/PWGJE/Tasks/jetDsSpecSubs.cxx index 10a5570f92a..d440e03fe4a 100644 --- a/PWGJE/Tasks/jetDsSpecSubs.cxx +++ b/PWGJE/Tasks/jetDsSpecSubs.cxx @@ -565,7 +565,11 @@ struct JetDsSpecSubs { // Count all generated MC collisions registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::All)); - // Apply MC vertex selection + // Apply standard event selection and vertex cut + if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits)) { + continue; + } + if (std::abs(mccollision.posZ()) > vertexZCut) { continue; } @@ -580,7 +584,8 @@ struct JetDsSpecSubs { registry.fill(HIST("McEffCol"), getValFromBin(BinMCColCntr::Matched)); // Apply standard event selection and vertex cut - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || !(std::abs(collision.posZ()) < vertexZCut)) { + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || + !(std::abs(collision.posZ()) < vertexZCut)) { continue; } // Matched collision passing analysis selections @@ -646,10 +651,6 @@ struct JetDsSpecSubs { } } // Particle level - - if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)){ - continue; - } const auto dsmcpJetsPerMCCollision = mcpjets.sliceBy(jetmcppreslice, mccollision.globalIndex()); for (const auto& mcpjet : dsmcpJetsPerMCCollision) {