Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions PWGHF/D2H/Core/DataCreationCharmReso.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,13 @@ struct HfResoConfigSingleTrackCuts : o2::framework::ConfigurableGroup {
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"};
o2::framework::Configurable<float> maxEta{"maxEta", 0.8, "maximum pseudorapidity for single tracks to be paired with D mesons"};
o2::framework::Configurable<float> minPt{"minPt", 0.1, "minimum pT for single tracks to be paired with D mesons"};
o2::framework::Configurable<bool> forceTOF{"forceTOF", false, "force TOF for single tracks to be paired with D mesons"};
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"};
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"};
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"};
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"};
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"};
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"};
};

struct HfResoConfigQaPlots : o2::framework::ConfigurableGroup {
Expand Down Expand Up @@ -727,9 +731,22 @@ bool isTrackSelected(const Tr& track, const std::array<int, 3>& dDaughtersIds, c
if (!track.hasTPC()) {
return false;
}
bool const isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value;
bool const isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value;
bool const isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value;
// --- TPC PID ---
bool isPionTPC = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value;
bool isKaonTPC = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value;
bool isProtonTPC = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value;

// --- TOF PID ---
bool hasTOF = track.hasTOF();
bool isPionTOF = hasTOF ? std::abs(track.tofNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTofPi.value : false;
bool isKaonTOF = hasTOF ? std::abs(track.tofNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTofKa.value : false;
bool isProtonTOF = hasTOF ? std::abs(track.tofNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTofPr.value : false;

// --- Combined logic ---
bool isPion = isPionTPC && (!cfgSingleTrackCuts.forceTOF || isPionTOF);
bool isKaon = isKaonTPC && (!cfgSingleTrackCuts.forceTOF || isKaonTOF);
bool isProton = isProtonTPC && (!cfgSingleTrackCuts.forceTOF || isProtonTOF);

return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected
}

Expand Down
Loading