Skip to content

Commit 5beda6c

Browse files
MarcellocostiMarcello Di Costanzoalibuildvkucera
authored
[PWGHF] Species-dependent minimum prong pt cut in skimming (#15755)
Co-authored-by: Marcello Di Costanzo <mdicosta@aliceml.cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch> Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com>
1 parent d5e8524 commit 5beda6c

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

PWGHF/Core/SelectorCuts.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static const std::vector<std::string> labelsCutVar = {"massMin", "massMax", "cos
232232
namespace hf_cuts_presel_3prong
233233
{
234234
static constexpr int NBinsPt = 2;
235-
static constexpr int NCutVars = 4;
235+
static constexpr int NCutVars = 5;
236236
// default values for the pT bin edges (can be used to configure histogram axis)
237237
// common for any 3-prong candidate
238238
// offset by 1 from the bin numbers in cuts array
@@ -243,20 +243,21 @@ constexpr double BinsPt[NBinsPt + 1] = {
243243
const auto vecBinsPt = std::vector<double>{BinsPt, BinsPt + NBinsPt + 1};
244244

245245
// default values for the cuts
246-
constexpr double Cuts[NBinsPt][NCutVars] = {{1.75, 2.05, 0.7, 0.02}, /* 1 < pt < 5 */
247-
{1.75, 2.05, 0.5, 0.02}}; /* 5 < pt < 1000 */
246+
constexpr double Cuts[NBinsPt][NCutVars] = {{1.75, 2.05, 0.7, 0.02, 0.3}, /* 1 < pt < 5 */
247+
{1.75, 2.05, 0.5, 0.02, 0.3}}; /* 5 < pt < 1000 */
248248

249249
// row labels
250250
static const std::vector<std::string> labelsPt{};
251251

252252
// column labels
253-
static const std::vector<std::string> labelsCutVar = {"massMin", "massMax", "cosp", "decL"};
253+
static const std::vector<std::string> labelsCutVar = {"massMin", "massMax", "cosp", "decL", "ptProngMin"};
254+
254255
} // namespace hf_cuts_presel_3prong
255256

256257
namespace hf_cuts_presel_ds
257258
{
258259
static constexpr int NBinsPt = 2;
259-
static constexpr int NCutVars = 5;
260+
static constexpr int NCutVars = 6;
260261
// default values for the pT bin edges (can be used to configure histogram axis)
261262
// offset by 1 from the bin numbers in cuts array
262263
constexpr double BinsPt[NBinsPt + 1] = {
@@ -266,14 +267,14 @@ constexpr double BinsPt[NBinsPt + 1] = {
266267
const auto vecBinsPt = std::vector<double>{BinsPt, BinsPt + NBinsPt + 1};
267268

268269
// default values for the cuts
269-
constexpr double Cuts[NBinsPt][NCutVars] = {{1.70, 2.15, 0.7, 0.02, 0.02}, /* 1 < pt < 5 */
270-
{1.70, 2.15, 0.5, 0.02, 0.02}}; /* 5 < pt < 1000 */
270+
constexpr double Cuts[NBinsPt][NCutVars] = {{1.70, 2.15, 0.7, 0.02, 0.3, 0.02}, /* 1 < pt < 5 */
271+
{1.70, 2.15, 0.5, 0.02, 0.3, 0.02}}; /* 5 < pt < 1000 */
271272

272273
// row labels
273274
static const std::vector<std::string> labelsPt{};
274275

275276
// column labels
276-
static const std::vector<std::string> labelsCutVar = {"massMin", "massMax", "cosp", "decL", "deltaMassKK"};
277+
static const std::vector<std::string> labelsCutVar = {"massMin", "massMax", "cosp", "decL", "ptProngMin", "deltaMassKK"};
277278
} // namespace hf_cuts_presel_ds
278279

279280
namespace hf_cuts_presel_dstar

PWGHF/TableProducer/trackIndexSkimCreator.cxx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ struct HfTrackIndexSkimCreator {
18201820
template <typename T1, typename T2, typename T3>
18211821
void applyPreselectionPhiDecay(const int binPt, T1 const& pVecTrack0, T1 const& pVecTrack1, T1 const& pVecTrack2, T2& cutStatus, T3& whichHypo, auto& isSelected)
18221822
{
1823-
const double deltaMassMax = cut3Prong[hf_cand_3prong::DecayType::DsToKKPi].get(binPt, 4u);
1823+
const double deltaMassMax = cut3Prong[hf_cand_3prong::DecayType::DsToKKPi].get(binPt, 5u);
18241824
if (TESTBIT(whichHypo[hf_cand_3prong::DecayType::DsToKKPi], 0)) {
18251825
const double mass2PhiKKPi = RecoDecay::m2(std::array{pVecTrack0, pVecTrack1}, std::array{arrMass3Prong[hf_cand_3prong::DecayType::DsToKKPi][0][0], arrMass3Prong[hf_cand_3prong::DecayType::DsToKKPi][0][1]});
18261826
if (mass2PhiKKPi > (MassPhi + deltaMassMax) * (MassPhi + deltaMassMax) || mass2PhiKKPi < (MassPhi - deltaMassMax) * (MassPhi - deltaMassMax)) {
@@ -1836,7 +1836,7 @@ struct HfTrackIndexSkimCreator {
18361836
if (whichHypo[hf_cand_3prong::DecayType::DsToKKPi] == 0) {
18371837
CLRBIT(isSelected, hf_cand_3prong::DecayType::DsToKKPi);
18381838
if (config.debug) {
1839-
cutStatus[hf_cand_3prong::DecayType::DsToKKPi][4] = false;
1839+
cutStatus[hf_cand_3prong::DecayType::DsToKKPi][5] = false;
18401840
}
18411841
}
18421842
}
@@ -1848,7 +1848,7 @@ struct HfTrackIndexSkimCreator {
18481848
/// \param isIdentifiedPidTrack0 is the flag that tells if the track 0 has been tagged as a proton
18491849
/// \param isIdentifiedPidTrack2 is the flag that tells if the track 2 has been tagged as a proton
18501850
/// \param cutStatus is a 2D array with outcome of each selection (filled only in debug mode)
1851-
/// \param whichHypo information of the mass hypoteses that were selected
1851+
/// \param whichHypo information of the mass hypotheses that were selected
18521852
/// \param isSelected is a bitmap with selection outcome
18531853
template <typename T2, typename T3, typename T4>
18541854
void applyPreselection3Prong(T2 const& pVecTrack0, T2 const& pVecTrack1, T2 const& pVecTrack2, const auto isIdentifiedPidTrack0, const auto isIdentifiedPidTrack2, T3& cutStatus, T4& whichHypo, auto& isSelected)
@@ -1889,7 +1889,7 @@ struct HfTrackIndexSkimCreator {
18891889
}
18901890

18911891
// invariant mass
1892-
if ((config.debug || TESTBIT(isSelected, iDecay3P))) {
1892+
if (config.debug || TESTBIT(isSelected, iDecay3P)) {
18931893
const double minMass = cut3Prong[iDecay3P].get(binPt, 0u);
18941894
const double maxMass = cut3Prong[iDecay3P].get(binPt, 1u);
18951895
if (minMass >= 0. && maxMass > 0.) { // no need to check isSelected but to avoid mistakes
@@ -2000,7 +2000,7 @@ struct HfTrackIndexSkimCreator {
20002000
/// \param cutStatus is a 2D array with outcome of each selection (filled only in debug mode)
20012001
/// \param isSelected ia s bitmap with selection outcome
20022002
template <typename T1, typename T2, typename T3, typename T4>
2003-
void applySelection3Prong(const T1& pVecCand, const T2& secVtx, const T3& primVtx, T4& cutStatus, auto& isSelected)
2003+
void applySelection3Prong(const T1& pVecCand, const std::array<float, 3>& ptProngs, const T2& secVtx, const T3& primVtx, T4& cutStatus, auto& isSelected)
20042004
{
20052005
if (config.debug || isSelected > 0) {
20062006

@@ -2029,7 +2029,7 @@ struct HfTrackIndexSkimCreator {
20292029
}
20302030

20312031
// decay length
2032-
if ((config.debug || TESTBIT(isSelected, iDecay3P))) {
2032+
if (config.debug || TESTBIT(isSelected, iDecay3P)) {
20332033
const auto decayLength = RecoDecay::distance(primVtx, secVtx);
20342034
if (decayLength < cut3Prong[iDecay3P].get(binPt, 3u)) { // 3u == decLenIndex[iDecay3P]
20352035
CLRBIT(isSelected, iDecay3P);
@@ -2038,6 +2038,17 @@ struct HfTrackIndexSkimCreator {
20382038
}
20392039
}
20402040
}
2041+
2042+
// prong pT
2043+
if (config.debug || TESTBIT(isSelected, iDecay3P)) {
2044+
const auto ptProngMin = cut3Prong[iDecay3P].get(binPt, 4u); // 4u == ptProngMinIndex[iDecay3P]
2045+
if (ptProngs[0] < ptProngMin || ptProngs[1] < ptProngMin || ptProngs[2] < ptProngMin) {
2046+
CLRBIT(isSelected, iDecay3P);
2047+
if (config.debug) {
2048+
cutStatus[iDecay3P][4] = false;
2049+
}
2050+
}
2051+
}
20412052
}
20422053
}
20432054
}
@@ -2784,7 +2795,8 @@ struct HfTrackIndexSkimCreator {
27842795
const auto pVecCandProng3Pos = RecoDecay::pVec(pvec0, pvec1, pvec2);
27852796

27862797
// 3-prong selections after secondary vertex
2787-
applySelection3Prong(pVecCandProng3Pos, secondaryVertex3, pvRefitCoord3Prong2Pos1Neg, cutStatus3Prong, isSelected3ProngCand);
2798+
const std::array ptProngs{trackPos1.pt(), trackNeg1.pt(), trackPos2.pt()};
2799+
applySelection3Prong(pVecCandProng3Pos, ptProngs, secondaryVertex3, pvRefitCoord3Prong2Pos1Neg, cutStatus3Prong, isSelected3ProngCand);
27882800

27892801
std::array<std::vector<float>, kN3ProngDecaysUsedMlForHfFilters> mlScores3Prongs;
27902802
if (config.applyMlForHfFilters) {
@@ -3059,7 +3071,8 @@ struct HfTrackIndexSkimCreator {
30593071
const auto pVecCandProng3Neg = RecoDecay::pVec(pvec0, pvec1, pvec2);
30603072

30613073
// 3-prong selections after secondary vertex
3062-
applySelection3Prong(pVecCandProng3Neg, secondaryVertex3, pvRefitCoord3Prong1Pos2Neg, cutStatus3Prong, isSelected3ProngCand);
3074+
const std::array ptProngs{trackPos1.pt(), trackNeg1.pt(), trackNeg2.pt()};
3075+
applySelection3Prong(pVecCandProng3Neg, ptProngs, secondaryVertex3, pvRefitCoord3Prong1Pos2Neg, cutStatus3Prong, isSelected3ProngCand);
30633076

30643077
std::array<std::vector<float>, kN3ProngDecaysUsedMlForHfFilters> mlScores3Prongs{};
30653078
if (config.applyMlForHfFilters) {

0 commit comments

Comments
 (0)