Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions PWGHF/Core/SelectorCuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,17 @@ static const std::vector<std::string> labelsPt{};

// column labels
static const std::vector<std::string> labelsCutVar = {"massMin", "massMax", "cosp", "decL"};

// Single prong min pt selection
static constexpr int NSpecies = 8; // number of species for 3-prong candidates
constexpr float ptProngMin[NSpecies][1] = {{0.4f}, {0.4f}, {0.4f}, {0.4f}, {0.4f}, {0.4f}, {0.4f}, {0.4f}};

// 3-prong species labels
static const std::vector<std::string> labelsSpecies = {"Dplus", "Lc", "Ds", "Xic", "Cd", "Ct", "Ch", "Ca"};

// column label
static const std::vector<std::string> labelsPtProngMin = {"Minimum pT (GeV/c)"};

} // namespace hf_cuts_presel_3prong

namespace hf_cuts_presel_ds
Expand Down
28 changes: 22 additions & 6 deletions PWGHF/TableProducer/trackIndexSkimCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,9 @@ struct HfTrackIndexSkimCreator {
Configurable<std::vector<double>> binsPtDstarToD0Pi{"binsPtDstarToD0Pi", std::vector<double>{hf_cuts_presel_dstar::vecBinsPt}, "pT bin limits for D*+->D0pi pT-dependent cuts"};
Configurable<LabeledArray<double>> cutsDstarToD0Pi{"cutsDstarToD0Pi", {hf_cuts_presel_dstar::Cuts[0], hf_cuts_presel_dstar::NBinsPt, hf_cuts_presel_dstar::NCutVars, hf_cuts_presel_dstar::labelsPt, hf_cuts_presel_dstar::labelsCutVar}, "D*+->D0pi selections per pT bin"};

// Species-differential track min pT selection for 3-prong candidates
Configurable<LabeledArray<float>> ptProngMin3Prong{"ptProngMin3Prong", {hf_cuts_presel_3prong::ptProngMin[0], hf_cuts_presel_3prong::NSpecies, 1, hf_cuts_presel_3prong::labelsSpecies, hf_cuts_presel_3prong::labelsPtProngMin}, "Min pT selection for prongs of 3-prong candidates in GeV/c"};

// proton PID selections for Lc and Xic
Configurable<bool> applyProtonPidForLcToPKPi{"applyProtonPidForLcToPKPi", false, "Apply proton PID for Lc->pKpi"};
Configurable<bool> applyProtonPidForXicToPKPi{"applyProtonPidForXicToPKPi", false, "Apply proton PID for Xic->pKpi"};
Expand Down Expand Up @@ -1848,7 +1851,7 @@ struct HfTrackIndexSkimCreator {
/// \param isIdentifiedPidTrack0 is the flag that tells if the track 0 has been tagged as a proton
/// \param isIdentifiedPidTrack2 is the flag that tells if the track 2 has been tagged as a proton
/// \param cutStatus is a 2D array with outcome of each selection (filled only in debug mode)
/// \param whichHypo information of the mass hypoteses that were selected
/// \param whichHypo information of the mass hypotheses that were selected
/// \param isSelected is a bitmap with selection outcome
template <typename T2, typename T3, typename T4>
void applyPreselection3Prong(T2 const& pVecTrack0, T2 const& pVecTrack1, T2 const& pVecTrack2, const auto isIdentifiedPidTrack0, const auto isIdentifiedPidTrack2, T3& cutStatus, T4& whichHypo, auto& isSelected)
Expand Down Expand Up @@ -1889,7 +1892,7 @@ struct HfTrackIndexSkimCreator {
}

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

Expand Down Expand Up @@ -2029,7 +2032,7 @@ struct HfTrackIndexSkimCreator {
}

// decay length
if ((config.debug || TESTBIT(isSelected, iDecay3P))) {
if (config.debug || TESTBIT(isSelected, iDecay3P)) {
const auto decayLength = RecoDecay::distance(primVtx, secVtx);
if (decayLength < cut3Prong[iDecay3P].get(binPt, 3u)) { // 3u == decLenIndex[iDecay3P]
CLRBIT(isSelected, iDecay3P);
Expand All @@ -2038,6 +2041,17 @@ struct HfTrackIndexSkimCreator {
}
}
}

// prong daughter pT
if (config.debug || TESTBIT(isSelected, iDecay3P)) {
const auto ptProngMin = config.ptProngMin3Prong->get(iDecay3P);
if (ptProngs[0] < ptProngMin || ptProngs[1] < ptProngMin || ptProngs[2] < ptProngMin) {
CLRBIT(isSelected, iDecay3P);
if (config.debug) {
cutStatus[iDecay3P][4] = false;
}
}
}
}
}
}
Expand Down Expand Up @@ -2643,6 +2657,7 @@ struct HfTrackIndexSkimCreator {

auto trackParVarPos2 = getTrackParCov(trackPos2);
std::array dcaInfoPos2{trackPos2.dcaXY(), trackPos2.dcaZ()};
std::array ptProngs{trackPos1.pt(), trackNeg1.pt(), trackPos2.pt()};

// preselection of 3-prong candidates
if (isSelected3ProngCand) {
Expand Down Expand Up @@ -2784,7 +2799,7 @@ struct HfTrackIndexSkimCreator {
const auto pVecCandProng3Pos = RecoDecay::pVec(pvec0, pvec1, pvec2);

// 3-prong selections after secondary vertex
applySelection3Prong(pVecCandProng3Pos, secondaryVertex3, pvRefitCoord3Prong2Pos1Neg, cutStatus3Prong, isSelected3ProngCand);
applySelection3Prong(pVecCandProng3Pos, ptProngs, secondaryVertex3, pvRefitCoord3Prong2Pos1Neg, cutStatus3Prong, isSelected3ProngCand);

std::array<std::vector<float>, kN3ProngDecaysUsedMlForHfFilters> mlScores3Prongs;
if (config.applyMlForHfFilters) {
Expand Down Expand Up @@ -2917,6 +2932,7 @@ struct HfTrackIndexSkimCreator {
auto trackNeg2 = trackIndexNeg2.template track_as<TTracks>();
auto trackParVarNeg2 = getTrackParCov(trackNeg2);
std::array dcaInfoNeg2{trackNeg2.dcaXY(), trackNeg2.dcaZ()};
std::array ptProngs{trackPos1.pt(), trackNeg1.pt(), trackNeg2.pt()};

// preselection of 3-prong candidates
if (isSelected3ProngCand) {
Expand Down Expand Up @@ -3059,7 +3075,7 @@ struct HfTrackIndexSkimCreator {
const auto pVecCandProng3Neg = RecoDecay::pVec(pvec0, pvec1, pvec2);

// 3-prong selections after secondary vertex
applySelection3Prong(pVecCandProng3Neg, secondaryVertex3, pvRefitCoord3Prong1Pos2Neg, cutStatus3Prong, isSelected3ProngCand);
applySelection3Prong(pVecCandProng3Neg, ptProngs, secondaryVertex3, pvRefitCoord3Prong1Pos2Neg, cutStatus3Prong, isSelected3ProngCand);

std::array<std::vector<float>, kN3ProngDecaysUsedMlForHfFilters> mlScores3Prongs{};
if (config.applyMlForHfFilters) {
Expand Down
Loading