@@ -134,14 +134,12 @@ enum ChannelsLightNucleiPid {
134134 NChannelsLightNucleiPid
135135};
136136
137-
138137// kaon PID (opposite-sign track in 3-prong decays)
139138constexpr int ChannelKaonPid = ChannelsProtonPid::NChannelsProtonPid;
140139constexpr int ChannelsDeuteronPid = ChannelsProtonPid::NChannelsProtonPid + 1 ;
141140constexpr int ChannelsTritonPid = ChannelsProtonPid::NChannelsProtonPid + 2 ;
142141constexpr int ChannelsHeliumPid = ChannelsProtonPid::NChannelsProtonPid + 3 ;
143- constexpr int NChannelsPidFor3Prong = ChannelsProtonPid::NChannelsProtonPid + ChannelsKaonPid::NChannelsKaonPid + ChannelsLightNucleiPid::NChannelsLightNucleiPid;
144-
142+ constexpr int NChannelsPidFor3Prong = static_cast <int >(ChannelsProtonPid::NChannelsProtonPid) + static_cast <int >(ChannelsKaonPid::NChannelsKaonPid) + static_cast <int >(ChannelsLightNucleiPid::NChannelsLightNucleiPid);
145143enum class ChannelsNucleiQA : int {
146144 Deuteron = 0 ,
147145 Triton = 1 ,
@@ -1344,6 +1342,7 @@ struct HfTrackIndexSkimCreator {
13441342 static constexpr int kNCuts2Prong [kN2ProngDecays ] = {hf_cuts_presel_2prong::NCutVars, hf_cuts_presel_2prong::NCutVars, hf_cuts_presel_2prong::NCutVars}; // how many different selections are made on 2-prongs
13451343 static constexpr int kNCuts3Prong [kN3ProngDecays ] = {hf_cuts_presel_3prong::NCutVars, hf_cuts_presel_3prong::NCutVars + 1 , hf_cuts_presel_ds::NCutVars, hf_cuts_presel_3prong::NCutVars + 1 , hf_cuts_presel_3prong::NCutVars + 2 , hf_cuts_presel_3prong::NCutVars + 2 , hf_cuts_presel_3prong::NCutVars + 2 }; // how many different selections are made on 3-prongs (Lc, Xic and CharmNuclei have also PID potentially, charmnuclei has also daughter track quality cut potentially)
13461344 static constexpr int kNCutsDstar = 3 ; // how many different selections are made on Dstars
1345+ static constexpr int kN3ProngDecaysUsedMlForHfFilters = kN3ProngDecays - NChannelsLightNucleiPid; // number of 3-prong HF decays using ML filters
13471346 std::array<std::array<std::array<double , 2 >, 2 >, kN2ProngDecays > arrMass2Prong{};
13481347 std::array<std::array<std::array<double , 3 >, 2 >, kN3ProngDecays > arrMass3Prong{};
13491348 // arrays of 2-prong and 3-prong cuts
@@ -1530,12 +1529,12 @@ struct HfTrackIndexSkimCreator {
15301529 if (config.applyMlForHfFilters ) {
15311530 const std::vector<std::string> onnxFileNames2Prongs{config.onnxFileNames ->get (0u , 0u )};
15321531 // Exclude Cd, Ct, Ch from the 3-prong list, as it is not included in the pp trigger program
1533- const std::array<std::vector<std::string>, kN3ProngDecays - 3 > onnxFileNames3Prongs{std::vector<std::string>{config.onnxFileNames ->get (1u , 0u )}, std::vector<std::string>{config.onnxFileNames ->get (2u , 0u )}, std::vector<std::string>{config.onnxFileNames ->get (3u , 0u )}, std::vector<std::string>{config.onnxFileNames ->get (4u , 0u )}};
1532+ const std::array<std::vector<std::string>, kN3ProngDecaysUsedMlForHfFilters > onnxFileNames3Prongs{std::vector<std::string>{config.onnxFileNames ->get (1u , 0u )}, std::vector<std::string>{config.onnxFileNames ->get (2u , 0u )}, std::vector<std::string>{config.onnxFileNames ->get (3u , 0u )}, std::vector<std::string>{config.onnxFileNames ->get (4u , 0u )}};
15341533 const std::vector<std::string> mlModelPathCcdb2Prongs{config.mlModelPathCCDB .value + " D0" };
1535- const std::array<std::vector<std::string>, kN3ProngDecays - 3 > mlModelPathCcdb3Prongs{std::vector<std::string>{config.mlModelPathCCDB .value + " Dplus" }, std::vector<std::string>{config.mlModelPathCCDB .value + " Lc" }, std::vector<std::string>{config.mlModelPathCCDB .value + " Ds" }, std::vector<std::string>{config.mlModelPathCCDB .value + " Xic" }};
1534+ const std::array<std::vector<std::string>, kN3ProngDecaysUsedMlForHfFilters > mlModelPathCcdb3Prongs{std::vector<std::string>{config.mlModelPathCCDB .value + " Dplus" }, std::vector<std::string>{config.mlModelPathCCDB .value + " Lc" }, std::vector<std::string>{config.mlModelPathCCDB .value + " Ds" }, std::vector<std::string>{config.mlModelPathCCDB .value + " Xic" }};
15361535 const std::vector<double > ptBinsMl{0 ., 1 .e10 };
15371536 const std::vector<int > cutDirMl{o2::cuts_ml::CutDirection::CutGreater, o2::cuts_ml::CutDirection::CutSmaller, o2::cuts_ml::CutDirection::CutSmaller};
1538- const std::array<LabeledArray<double >, kN3ProngDecays - 3 > thresholdMlScore3Prongs{config.thresholdMlScoreDplusToPiKPi , config.thresholdMlScoreLcToPiKP , config.thresholdMlScoreDsToPiKK , config.thresholdMlScoreXicToPiKP };
1537+ const std::array<LabeledArray<double >, kN3ProngDecaysUsedMlForHfFilters > thresholdMlScore3Prongs{config.thresholdMlScoreDplusToPiKPi , config.thresholdMlScoreLcToPiKP , config.thresholdMlScoreDsToPiKK , config.thresholdMlScoreXicToPiKP };
15391538
15401539 // initialise 2-prong ML response
15411540 hfMlResponse2Prongs.configure (ptBinsMl, config.thresholdMlScoreD0ToKPi , cutDirMl, 3 );
@@ -1548,7 +1547,7 @@ struct HfTrackIndexSkimCreator {
15481547 hfMlResponse2Prongs.init ();
15491548
15501549 // initialise 3-prong ML responses
1551- for (int iDecay3P{0 }; iDecay3P < kN3ProngDecays - 3 ; ++iDecay3P) {
1550+ for (int iDecay3P{0 }; iDecay3P < kN3ProngDecaysUsedMlForHfFilters ; ++iDecay3P) {
15521551 if (onnxFileNames3Prongs[iDecay3P][0 ].empty ()) { // 3-prong species to be skipped
15531552 continue ;
15541553 }
@@ -1983,14 +1982,14 @@ struct HfTrackIndexSkimCreator {
19831982 // / \param outputScores is the array of vectors with the output scores to be filled
19841983 // / \param isSelected ia s bitmap with selection outcome
19851984 template <bool UsePidForHfFiltersBdt>
1986- void applyMlSelectionForHfFilters3Prong (std::vector<float > featuresCand, std::vector<float > featuresCandPid, std::array<std::vector<float >, kN3ProngDecays - 3 >& outputScores, auto & isSelected)
1985+ void applyMlSelectionForHfFilters3Prong (std::vector<float > featuresCand, std::vector<float > featuresCandPid, std::array<std::vector<float >, kN3ProngDecaysUsedMlForHfFilters >& outputScores, auto & isSelected)
19871986 {
19881987 if (isSelected == 0 ) {
19891988 return ;
19901989 }
19911990
19921991 const float ptDummy = 1 .f ; // dummy pT value (only one pT bin)
1993- for (int iDecay3P{0 }; iDecay3P < kN3ProngDecays - 3 ; ++iDecay3P) {
1992+ for (int iDecay3P{0 }; iDecay3P < kN3ProngDecaysUsedMlForHfFilters ; ++iDecay3P) {
19941993 if (TESTBIT (isSelected, iDecay3P) && hasMlModel3Prong[iDecay3P]) {
19951994 bool isMlSel = false ;
19961995 if constexpr (UsePidForHfFiltersBdt) {
@@ -2724,7 +2723,7 @@ struct HfTrackIndexSkimCreator {
27242723 // 3-prong selections after secondary vertex
27252724 applySelection3Prong (pVecCandProng3Pos, secondaryVertex3, pvRefitCoord3Prong2Pos1Neg, cutStatus3Prong, isSelected3ProngCand);
27262725
2727- std::array<std::vector<float >, kN3ProngDecays - 3 > mlScores3Prongs;
2726+ std::array<std::vector<float >, kN3ProngDecaysUsedMlForHfFilters > mlScores3Prongs;
27282727 if (config.applyMlForHfFilters ) {
27292728 const std::vector<float > inputFeatures{trackParVarPcaPos1.getPt (), dcaInfoPos1[0 ], dcaInfoPos1[1 ], trackParVarPcaNeg1.getPt (), dcaInfoNeg1[0 ], dcaInfoNeg1[1 ], trackParVarPcaPos2.getPt (), dcaInfoPos2[0 ], dcaInfoPos2[1 ]};
27302729 std::vector<float > inputFeaturesLcPid{};
@@ -2994,7 +2993,7 @@ struct HfTrackIndexSkimCreator {
29942993 // 3-prong selections after secondary vertex
29952994 applySelection3Prong (pVecCandProng3Neg, secondaryVertex3, pvRefitCoord3Prong1Pos2Neg, cutStatus3Prong, isSelected3ProngCand);
29962995
2997- std::array<std::vector<float >, kN3ProngDecays - 3 > mlScores3Prongs{};
2996+ std::array<std::vector<float >, kN3ProngDecaysUsedMlForHfFilters > mlScores3Prongs{};
29982997 if (config.applyMlForHfFilters ) {
29992998 const std::vector<float > inputFeatures{trackParVarPcaNeg1.getPt (), dcaInfoNeg1[0 ], dcaInfoNeg1[1 ], trackParVarPcaPos1.getPt (), dcaInfoPos1[0 ], dcaInfoPos1[1 ], trackParVarPcaNeg2.getPt (), dcaInfoNeg2[0 ], dcaInfoNeg2[1 ]};
30002999 std::vector<float > inputFeaturesLcPid{};
0 commit comments