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
static const float ptProngMin[NSpecies] = {0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4};

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

// column label
static const std::vector<std::string> labelsMinPt = {"Minimum prong transverse momentum (GeV/c)"};

} // namespace hf_cuts_presel_3prong

namespace hf_cuts_presel_ds
Expand Down
24 changes: 20 additions & 4 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, hf_cuts_presel_3prong::NSpecies, 1, hf_cuts_presel_3prong::labelsPtProngMin, hf_cuts_presel_3prong::labelsMinPt}, "Min pT selection for prongs of 3-prong candidates in GeV/c"};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused. This looks like a declaration of a 2D array, but yours is 1D.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Vit, this was done to have the entry in hyperloop looking like the current onnxFileNames of the workflow hf-track-index-skim-creator, which seems to me the best layout for this config

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But onnxFileNames is a 2D array.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that onnxFileNames results in a table with rows containing a fixed particle name + a configurable, wouldn't the current implementation achieve the same result for ptProngMin3Prong? The dpl-config.json files from my local test show that, with this implementation, they have the same structure. Or maybe do you have in mind a cleaner alternative?


// 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 @@ -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 @@ -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