Skip to content

Commit 0eb6c9e

Browse files
committed
[PWGHF] Add forceTOF option in CharmReso bach selections
1 parent 344bfe5 commit 0eb6c9e

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

PWGHF/D2H/Core/DataCreationCharmReso.h

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,13 @@ struct HfResoConfigSingleTrackCuts : o2::framework::ConfigurableGroup {
197197
o2::framework::Configurable<int> setTrackSelections{"setTrackSelections", 2, "flag to apply track selections: 0=none; 1=global track w/o DCA selection; 2=global track; 3=only ITS quality"};
198198
o2::framework::Configurable<float> maxEta{"maxEta", 0.8, "maximum pseudorapidity for single tracks to be paired with D mesons"};
199199
o2::framework::Configurable<float> minPt{"minPt", 0.1, "minimum pT for single tracks to be paired with D mesons"};
200+
o2::framework::Configurable<float> forceTOF{"forceTOF", 0.1, "minimum pT for single tracks to be paired with D mesons"};
200201
o2::framework::Configurable<float> maxNsigmaTpcPi{"maxNsigmaTpcPi", -1., "maximum pion NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"};
201202
o2::framework::Configurable<float> maxNsigmaTpcKa{"maxNsigmaTpcKa", -1., "maximum kaon NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"};
202203
o2::framework::Configurable<float> maxNsigmaTpcPr{"maxNsigmaTpcPr", 3., "maximum proton NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"};
204+
o2::framework::Configurable<float> maxNsigmaTofPi{"maxNsigmaTofPi", -1., "maximum pion NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"};
205+
o2::framework::Configurable<float> maxNsigmaTofKa{"maxNsigmaTofKa", -1., "maximum kaon NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"};
206+
o2::framework::Configurable<float> maxNsigmaTofPr{"maxNsigmaTofPr", -1., "maximum proton NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"};
203207
};
204208

205209
struct HfResoConfigQaPlots : o2::framework::ConfigurableGroup {
@@ -727,9 +731,22 @@ bool isTrackSelected(const Tr& track, const std::array<int, 3>& dDaughtersIds, c
727731
if (!track.hasTPC()) {
728732
return false;
729733
}
730-
bool const isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value;
731-
bool const isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value;
732-
bool const isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value;
734+
// --- TPC PID ---
735+
bool isPionTPC = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value;
736+
bool isKaonTPC = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value;
737+
bool isProtonTPC = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value;
738+
739+
// --- TOF PID ---
740+
bool hasTOF = track.hasTOF();
741+
bool isPionTOF = hasTOF ? std::abs(track.tofNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTofPi.value : false;
742+
bool isKaonTOF = hasTOF ? std::abs(track.tofNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTofKa.value : false;
743+
bool isProtonTOF = hasTOF ? std::abs(track.tofNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTofPr.value : false;
744+
745+
// --- Combined logic ---
746+
bool isPion = isPionTPC && (!forceTOF || isPionTOF);
747+
bool isKaon = isKaonTPC && (!forceTOF || isKaonTOF);
748+
bool isProton = isProtonTPC && (!forceTOF || isProtonTOF);
749+
733750
return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected
734751
}
735752

0 commit comments

Comments
 (0)