Skip to content

Commit b475885

Browse files
authored
[PWGLF] Add pT dependent PID selection functionality (#16676)
1 parent bb6ddd4 commit b475885

2 files changed

Lines changed: 64 additions & 31 deletions

File tree

PWGLF/Tasks/Resonances/kstar0analysis.cxx

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ struct Kstar0analysis {
136136
Configurable<float> pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 4.0f, "pidnSigma Cut for pre-selection of tracks"};
137137
Configurable<bool> cByPassTOF{"cByPassTOF", false, "By pass TOF PID selection"}; // By pass TOF PID selection
138138
Configurable<int> cPIDcutType{"cPIDcutType", 2, "cPIDcutType = 1 for square cut, 2 for circular cut"}; // By pass TOF PID selection
139+
Configurable<bool> ispTdepPID{"ispTdepPID", false, "enable pT dependent PID"};
139140

140141
// Kaon
141142
Configurable<std::vector<float>> kaonTPCPIDpTintv{"kaonTPCPIDpTintv", {0.5f}, "pT intervals for Kaon TPC PID cuts"};
@@ -597,6 +598,24 @@ struct Kstar0analysis {
597598
return false;
598599
}
599600

601+
template <typename T>
602+
bool selectionPIDPion(const T& candidate)
603+
{
604+
auto vPionTPCPIDcuts = configPID.pionTPCPIDcuts.value;
605+
auto vPionTPCTOFCombinedPIDcuts = configPID.pionTPCTOFCombinedPIDcuts.value;
606+
607+
if (!configPID.cByPassTOF && candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (vPionTPCTOFCombinedPIDcuts[0] * vPionTPCTOFCombinedPIDcuts[0])) {
608+
return true;
609+
}
610+
if (!configPID.cByPassTOF && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < vPionTPCPIDcuts[0]) {
611+
return true;
612+
}
613+
if (configPID.cByPassTOF && std::abs(candidate.tpcNSigmaPi()) < vPionTPCPIDcuts[0]) {
614+
return true;
615+
}
616+
return false;
617+
}
618+
600619
template <typename T>
601620
bool ptDependentPidKaon(const T& candidate)
602621
{
@@ -669,6 +688,24 @@ struct Kstar0analysis {
669688
return false;
670689
}
671690

691+
template <typename T>
692+
bool selectionPIDKaon(const T& candidate)
693+
{
694+
auto vKaonTPCPIDcuts = configPID.kaonTPCPIDcuts.value;
695+
auto vKaonTPCTOFCombinedPIDcuts = configPID.kaonTPCTOFCombinedPIDcuts.value;
696+
697+
if (!configPID.cByPassTOF && candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (vKaonTPCTOFCombinedPIDcuts[0] * vKaonTPCTOFCombinedPIDcuts[0])) {
698+
return true;
699+
}
700+
if (!configPID.cByPassTOF && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts[0]) {
701+
return true;
702+
}
703+
if (configPID.cByPassTOF && std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts[0]) {
704+
return true;
705+
}
706+
return false;
707+
}
708+
672709
auto static constexpr MinPtforProtonRejection = 1.0f;
673710
auto static constexpr MaxPtforProtonRejection = 2.0f;
674711
auto static constexpr MaxnSigmaforProtonRejection = 2.0f;
@@ -786,7 +823,10 @@ struct Kstar0analysis {
786823
if (crejectProton && rejectProton(trk2)) // to remove proton contamination from the kaon track
787824
continue;
788825

789-
if (!ptDependentPidPion(trk1) || !ptDependentPidKaon(trk2))
826+
if (configPID.ispTdepPID && (!ptDependentPidPion(trk1) || !ptDependentPidKaon(trk2)))
827+
continue;
828+
829+
if (!configPID.ispTdepPID && (!selectionPIDPion(trk1) || !selectionPIDKaon(trk2)))
790830
continue;
791831

792832
//// QA plots after the selection
@@ -1313,22 +1353,6 @@ struct Kstar0analysis {
13131353
// =========================
13141354
if (std::abs(part.pdgCode()) == Pdg::kK0Star892) {
13151355

1316-
std::vector<int> daughterPDGs;
1317-
if (part.has_daughters()) {
1318-
auto daughter01 = mcParticles.rawIteratorAt(part.daughtersIds()[0] - mcParticles.offset());
1319-
auto daughter02 = mcParticles.rawIteratorAt(part.daughtersIds()[1] - mcParticles.offset());
1320-
daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()};
1321-
} else {
1322-
daughterPDGs = {-1, -1};
1323-
}
1324-
1325-
bool pass1 = std::abs(daughterPDGs[0]) == kKPlus || std::abs(daughterPDGs[1]) == kKPlus; // At least one decay to Kaon
1326-
bool pass2 = std::abs(daughterPDGs[0]) == kPiPlus || std::abs(daughterPDGs[1]) == kPiPlus; // At least one decay to Pion
1327-
1328-
// Checking if we have both decay products
1329-
if (!pass1 || !pass2)
1330-
continue;
1331-
13321356
if (part.pdgCode() > 0)
13331357
histos.fill(HIST("Result/SignalLoss/GenTruek892pt_den"), part.pt(), centrality);
13341358
else

PWGLF/Tasks/Resonances/phi1020analysis.cxx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ struct Phi1020analysis {
136136
Configurable<float> pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 4.0f, "pidnSigma Cut for pre-selection of tracks"};
137137
Configurable<bool> cByPassTOF{"cByPassTOF", false, "By pass TOF PID selection"}; // By pass TOF PID selection
138138
Configurable<int> cPIDcutType{"cPIDcutType", 2, "cPIDcutType = 1 for square cut, 2 for circular cut"}; // By pass TOF PID selection
139+
Configurable<bool> ispTdepPID{"ispTdepPID", false, "enable pT dependent PID"};
139140

140141
// Kaon
141142
Configurable<std::vector<float>> kaonTPCPIDpTintv{"kaonTPCPIDpTintv", {0.5f}, "pT intervals for Kaon TPC PID cuts"};
@@ -576,6 +577,24 @@ struct Phi1020analysis {
576577
return false;
577578
}
578579

580+
template <typename T>
581+
bool selectionPID(const T& candidate)
582+
{
583+
auto vKaonTPCPIDcuts = configPID.kaonTPCPIDcuts.value;
584+
auto vKaonTPCTOFCombinedPIDcuts = configPID.kaonTPCTOFCombinedPIDcuts.value;
585+
586+
if (!configPID.cByPassTOF && candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (vKaonTPCTOFCombinedPIDcuts[0] * vKaonTPCTOFCombinedPIDcuts[0])) {
587+
return true;
588+
}
589+
if (!configPID.cByPassTOF && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts[0]) {
590+
return true;
591+
}
592+
if (configPID.cByPassTOF && std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts[0]) {
593+
return true;
594+
}
595+
return false;
596+
}
597+
579598
auto static constexpr MinPtforPionRejection = 1.0f;
580599
auto static constexpr MaxPtforPionRejection = 2.0f;
581600
auto static constexpr MaxnSigmaforPionRejection = 2.0f;
@@ -685,7 +704,10 @@ struct Phi1020analysis {
685704
if (crejectPion && rejectPion(trk2)) // to remove pion contamination from the kaon track
686705
continue;
687706

688-
if (!ptDependentPidKaon(trk1) || !ptDependentPidKaon(trk2))
707+
if (configPID.ispTdepPID && (!ptDependentPidKaon(trk1) || !ptDependentPidKaon(trk2)))
708+
continue;
709+
710+
if (!configPID.ispTdepPID && (!selectionPID(trk1) || !selectionPID(trk2)))
689711
continue;
690712

691713
//// QA plots after the selection
@@ -1170,19 +1192,6 @@ struct Phi1020analysis {
11701192
// =========================
11711193
if (std::abs(part.pdgCode()) == Pdg::kPhi) {
11721194

1173-
std::vector<int> daughterPDGs;
1174-
if (part.has_daughters()) {
1175-
auto daughter01 = mcParticles.rawIteratorAt(part.daughtersIds()[0] - mcParticles.offset());
1176-
auto daughter02 = mcParticles.rawIteratorAt(part.daughtersIds()[1] - mcParticles.offset());
1177-
daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()};
1178-
} else {
1179-
daughterPDGs = {-1, -1};
1180-
}
1181-
1182-
if (std::abs(daughterPDGs[0]) != PDG_t::kKPlus || std::abs(daughterPDGs[1]) != PDG_t::kKPlus) { // At least one decay to Kaon
1183-
continue;
1184-
}
1185-
11861195
histos.fill(HIST("Result/SignalLoss/GenTruephi1020pt_den"), part.pt(), centrality);
11871196
}
11881197
}

0 commit comments

Comments
 (0)