Skip to content

Commit 73daccf

Browse files
[PWGHF] Add forceTOF option in CharmReso bach selections (#15521)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 3dad17c commit 73daccf

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
@@ -198,9 +198,13 @@ struct HfResoConfigSingleTrackCuts : o2::framework::ConfigurableGroup {
198198
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"};
199199
o2::framework::Configurable<float> maxEta{"maxEta", 0.8, "maximum pseudorapidity for single tracks to be paired with D mesons"};
200200
o2::framework::Configurable<float> minPt{"minPt", 0.1, "minimum pT for single tracks to be paired with D mesons"};
201+
o2::framework::Configurable<bool> forceTOF{"forceTOF", false, "force TOF for single tracks to be paired with D mesons"};
201202
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"};
202203
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"};
203204
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"};
205+
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"};
206+
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"};
207+
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"};
204208
};
205209

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

0 commit comments

Comments
 (0)