Skip to content

Commit 0ce0e1b

Browse files
authored
[PWGLF] kstar892LightIon: Optimised PID selection (#16975)
1 parent 2d69402 commit 0ce0e1b

1 file changed

Lines changed: 36 additions & 23 deletions

File tree

PWGLF/Tasks/Resonances/kstar892LightIon.cxx

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include <TString.h>
4949

5050
#include <algorithm>
51-
#include <array>
51+
// #include <array>
5252
#include <cmath>
5353
#include <cstddef>
5454
#include <cstdint>
@@ -845,7 +845,7 @@ struct Kstar892LightIon {
845845
case PIDMode::TOF: // Apply only TOF cut
846846
return passTOF(candidate, pid);
847847

848-
case PIDMode::TOFVeto: // Require TOF hit; apply both TPC and TOF cuts. Tracks without TOF are rejected.
848+
case PIDMode::TOFVeto: // Require TOF hit; apply both TPC and TOF cuts separately. Tracks without TOF are rejected.
849849
return passTPC(candidate, pid) && passTOF(candidate, pid);
850850

851851
case PIDMode::TOFHIT: // Apply only TOF cut that has tof hits, apply TPC cut for the rest
@@ -908,43 +908,56 @@ struct Kstar892LightIon {
908908
return (std::abs(tpcSigma(candidate, pid)) < regionTPCCut);
909909
} */
910910

911-
case PIDStrategy::ThreePtDependent: // Apply region-dependent PID cuts using one PID cut per pT region. In the middle pT region TOF is mandatory.
911+
case PIDStrategy::ThreePtDependent: // Apply region-dependent PID cuts using one PID cut per pT region. The middle pT region supports two TOF modes.
912912
{
913913
const float pidCut = (candidate.pt() < selectionConfig.lowPtCutPid) ? selectionConfig.lowPtPid : (candidate.pt() < selectionConfig.highPtCutPid) ? selectionConfig.midPtPid
914914
: selectionConfig.highPtPid;
915915

916916
// Low-pT region
917917
if (candidate.pt() < selectionConfig.lowPtCutPid) {
918-
if (candidate.hasTOF()) {
919-
if (!candidate.hasTOF() || candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
920-
return false;
921-
}
922-
923-
return combinedNSigma2(candidate, pid) < pidCut * pidCut;
918+
if (!candidate.hasTOF()) {
919+
return std::abs(tpcSigma(candidate, pid)) < pidCut;
924920
}
925-
926-
return std::abs(tpcSigma(candidate, pid)) < pidCut;
927-
}
928-
929-
// Mid-pT region (TOF mandatory)
930-
if (candidate.pt() < selectionConfig.highPtCutPid) {
931-
if (!candidate.hasTOF() || candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
921+
if (candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
932922
return false;
933923
}
934-
935924
return combinedNSigma2(candidate, pid) < pidCut * pidCut;
936925
}
937926

938-
// High-pT region
939-
if (candidate.hasTOF()) {
940-
if (!candidate.hasTOF() || candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
941-
return false;
927+
// Mid-pT region
928+
if (candidate.pt() < selectionConfig.highPtCutPid) {
929+
switch (mode) {
930+
case PIDMode::TOFVeto: // Mid-pT region (TOF mandatory with combined cut)
931+
if (!candidate.hasTOF() || candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
932+
return false;
933+
}
934+
return combinedNSigma2(candidate, pid) < pidCut * pidCut;
935+
936+
case PIDMode::Combined: // Mid-pT region (If TOF available use combined cut, otherwise use TPC cut)
937+
if (!candidate.hasTOF()) {
938+
return std::abs(tpcSigma(candidate, pid)) < pidCut;
939+
}
940+
if (candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
941+
return false;
942+
}
943+
944+
return combinedNSigma2(candidate, pid) < pidCut * pidCut;
945+
946+
default:
947+
LOGF(fatal, "ThreePtDependent supports only Combined and TOFVeto modes.");
948+
return false;
942949
}
950+
}
943951

944-
return combinedNSigma2(candidate, pid) < pidCut * pidCut;
952+
// High-pT region
953+
if (!candidate.hasTOF()) {
954+
return std::abs(tpcSigma(candidate, pid)) < pidCut;
955+
}
956+
if (candidate.beta() <= selectionConfig.cfgTOFBetaCut) {
957+
return false;
945958
}
946959

947-
return std::abs(tpcSigma(candidate, pid)) < pidCut;
960+
return combinedNSigma2(candidate, pid) < pidCut * pidCut;
948961
}
949962

950963
case PIDStrategy::PIDCompare: // Apply independent TPC/TOF cuts below lowPtCutPid, within lowPtCutPid and highPtCutPid, require TOF and accept the track only if its combined nsigma is smaller than that of the alternate PID hypothesis and above highPtCutPid if TOF is available, accept if the track passes combined cut and if TOF is not available, check if it passes TPC cut

0 commit comments

Comments
 (0)