From 866bcb42dc7756d8cd609b32d86c2a6f657305c3 Mon Sep 17 00:00:00 2001 From: wefeng1110 <147308878+wefeng1110@users.noreply.github.com> Date: Mon, 7 Jul 2025 12:07:39 +0200 Subject: [PATCH 1/2] Add occupancy cut to trackEfficiency task 1. Add occupancy cut to trackEfficiency.cxx for general purpose Pb-Pb MC 2. Fix some cuts in weighted process functions --- PWGJE/Tasks/jetSpectraCharged.cxx | 5 +++-- PWGJE/Tasks/trackEfficiency.cxx | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 9eb8221163f..3bbd6b8196c 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -549,7 +549,7 @@ struct JetSpectraCharged { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) { return; } - if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + if (std::abs(collision.posZ()) > vertexZCut) { return; } for (auto const& track : tracks) { @@ -591,7 +591,7 @@ struct JetSpectraCharged { } registry.fill(HIST("h_collisions"), 1.5); registry.fill(HIST("h_collisions_weighted"), 1.5, eventWeight); - if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { + if (std::abs(collision.posZ()) > vertexZCut) { return; } registry.fill(HIST("h_collisions"), 2.5); @@ -869,6 +869,7 @@ struct JetSpectraCharged { } registry.fill(HIST("h_mcColl_counts"), 2.5); registry.fill(HIST("h_mcColl_counts_weight"), 2.5, eventWeight); + registry.fill(HIST("h_mc_zvertex"), mccollision.posZ(), eventWeight); bool hasSel8Coll = false; for (auto const& collision : collisions) { diff --git a/PWGJE/Tasks/trackEfficiency.cxx b/PWGJE/Tasks/trackEfficiency.cxx index 1143eac9143..d9297e69d39 100644 --- a/PWGJE/Tasks/trackEfficiency.cxx +++ b/PWGJE/Tasks/trackEfficiency.cxx @@ -53,6 +53,7 @@ struct TrackEfficiency { // Tracking efficiency process function configurables: Configurable checkPrimaryPart{"checkPrimaryPart", true, "0: doesn't check mcparticle.isPhysicalPrimary() - 1: checks particle.isPhysicalPrimary()"}; Configurable checkCentrality{"checkCentrality", false, ""}; + Configurable checkOccupancy{"checkOccupancy", false, "check occupancy only in general purpose Pb-Pb MC, default as false"}; Configurable acceptSplitCollisions{"acceptSplitCollisions", 0, "0: only look at mcCollisions that are not split; 1: accept split mcCollisions, 2: accept split mcCollisions but only look at the first reco collision associated with it"}; Configurable trackEtaAcceptanceCountQA{"trackEtaAcceptanceCountQA", 0.9, "eta acceptance"}; // removed from actual cuts for now because all the histograms have an eta axis Configurable centralityMin{"centralityMin", -999, ""}; @@ -164,6 +165,9 @@ struct TrackEfficiency { registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(5, "recoCollEvtSel"); registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(6, "centralityCut"); registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(7, "ptHatCut"); + if(checkOccupancy){ + registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(8, "occupancyCut"); + } registry.add("hMcPartCutsCounts", "McPart cuts count checks", {HistType::kTH1F, {{10, 0., 10.}}}); registry.get(HIST("hMcPartCutsCounts"))->GetXaxis()->SetBinLabel(1, "allPartsInSelMcColl"); @@ -315,6 +319,7 @@ struct TrackEfficiency { bool hasSel8Coll = false; bool centralityCheck = false; + bool occupancyCheck = false; if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents)) { // Skipping MC events that have not a single selected reconstructed collision ; effect unclear if mcColl is split hasSel8Coll = true; @@ -322,6 +327,9 @@ struct TrackEfficiency { if (!checkCentrality || ((centralityMin < collisions.begin().centrality()) && (collisions.begin().centrality() < centralityMax))) { // effect unclear if mcColl is split centralityCheck = true; } + if (!checkOccupancy || ((trackOccupancyInTimeRangeMin < collisions.begin().trackOccupancyInTimeRange()) && (collisions.begin().trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMax))) { // check occupancy only in GP Pb-Pb MC + occupancyCheck = true; + } } else if (acceptSplitCollisions == SplitOkCheckAnyAssocColl) { // check that at least one of the reconstructed collisions passes the checks for (auto const& collision : collisions) { if (jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) { // Skipping MC events that have not a single selected reconstructed collision ; effect unclear if mcColl is split @@ -330,6 +338,9 @@ struct TrackEfficiency { if (!checkCentrality || ((centralityMin < collision.centrality()) && (collision.centrality() < centralityMax))) { // effect unclear if mcColl is split centralityCheck = true; } + if (!checkOccupancy || ((trackOccupancyInTimeRangeMin < collisions.begin().trackOccupancyInTimeRange()) && (collisions.begin().trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMax))) { // check occupancy only in GP Pb-Pb MC + occupancyCheck = true; + } } } if (!hasSel8Coll) { @@ -348,6 +359,13 @@ struct TrackEfficiency { } registry.fill(HIST("hMcCollCutsCounts"), 6.5); // ptHat condition + if(checkOccupancy){ + if(!occupancyCheck){ + return; + } + registry.fill(HIST("hMcCollCutsCounts"), 7.5); + } + for (auto const& jMcParticle : jMcParticles) { registry.fill(HIST("hMcPartCutsCounts"), 0.5); // allPartsInSelMcColl From e571c787387e7100ff3952e932c5276369684c46 Mon Sep 17 00:00:00 2001 From: wefeng1110 <147308878+wefeng1110@users.noreply.github.com> Date: Mon, 7 Jul 2025 12:14:39 +0200 Subject: [PATCH 2/2] fix PR formatting --- PWGJE/Tasks/trackEfficiency.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/trackEfficiency.cxx b/PWGJE/Tasks/trackEfficiency.cxx index d9297e69d39..bb2683b0918 100644 --- a/PWGJE/Tasks/trackEfficiency.cxx +++ b/PWGJE/Tasks/trackEfficiency.cxx @@ -165,7 +165,7 @@ struct TrackEfficiency { registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(5, "recoCollEvtSel"); registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(6, "centralityCut"); registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(7, "ptHatCut"); - if(checkOccupancy){ + if (checkOccupancy) { registry.get(HIST("hMcCollCutsCounts"))->GetXaxis()->SetBinLabel(8, "occupancyCut"); } @@ -359,8 +359,8 @@ struct TrackEfficiency { } registry.fill(HIST("hMcCollCutsCounts"), 6.5); // ptHat condition - if(checkOccupancy){ - if(!occupancyCheck){ + if (checkOccupancy) { + if (!occupancyCheck) { return; } registry.fill(HIST("hMcCollCutsCounts"), 7.5);