From a9f21a0c63a6943e3daef47aec1361288e9df497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sun, 24 Nov 2024 15:45:43 +0100 Subject: [PATCH] [DPG] Add contributor cuts (#8594) --- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx | 29 ++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx index 8c1aeca6483..d1420da31fc 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx @@ -137,6 +137,8 @@ struct tofPidQa { Configurable splitSignalPerCharge{"splitSignalPerCharge", true, "Split the signal per charge (reduces memory footprint if off)"}; Configurable enableVsMomentumHistograms{"enableVsMomentumHistograms", false, "Enables plots vs momentum instead of just pT (reduces memory footprint if off)"}; Configurable requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"}; + Configurable pvContributorsMin{"pvContributorsMin", -10, "Minimum pvContributors"}; + Configurable pvContributorsMax{"pvContributorsMax", 10000, "Maximum pvContributors"}; template void initPerParticle(const AxisSpec& pAxis, @@ -282,6 +284,8 @@ struct tofPidQa { h->GetXaxis()->SetBinLabel(1, "Events read"); h->GetXaxis()->SetBinLabel(2, "Passed ev. sel."); h->GetXaxis()->SetBinLabel(3, "Passed vtx Z"); + h->GetXaxis()->SetBinLabel(4, Form("Passed pvContributorsMin %f", pvContributorsMin.value)); + h->GetXaxis()->SetBinLabel(5, Form("Passed pvContributorsMax %f", pvContributorsMax.value)); h = histos.add("event/trackselection", "", kTH1D, {{10, 0.5, 10.5, "Selection passed"}}); h->GetXaxis()->SetBinLabel(1, "Tracks read"); @@ -375,11 +379,30 @@ struct tofPidQa { } } } - if (abs(collision.posZ()) > 10.f) { + if (std::abs(collision.posZ()) > 10.f) { return false; } + // Count the number of contributors + int pvContributors = 0; + for (const auto& trk : tracks) { + if (trk.isPVContributor()) { + pvContributors++; + } + } + if (pvContributors < pvContributorsMin) { + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 4); + } + if (pvContributors > pvContributorsMax) { + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 5); + } if constexpr (fillHistograms) { - histos.fill(HIST("event/evsel"), 3); + histos.fill(HIST("event/evsel"), 6); histos.fill(HIST("event/vertexz"), collision.posZ()); histos.fill(HIST("event/evtime/colltime"), collision.collisionTime() * 1000.f); @@ -505,7 +528,7 @@ struct tofPidQa { } if (applyRapidityCut) { - if (abs(t.rapidity(PID::getMass(id))) > 0.5) { + if (std::abs(t.rapidity(PID::getMass(id))) > 0.5) { continue; } }