@@ -3516,24 +3516,20 @@ struct HfTrackIndexSkimCreatorCascades {
35163516 double mass2K0sHe = RecoDecay::m (std::array{pVecBach, pVecV0}, std::array{MassHelium3, MassK0Short});
35173517 double mass2K0sAl = RecoDecay::m (std::array{pVecBach, pVecV0}, std::array{MassAlpha, MassK0Short});
35183518
3519+ const auto isIdentifiedPid = bachIdx.isIdentifiedPid ();
35193520 const bool applyAnyBachelorPid = config.applyProtonPid || config.applyDeuteronPid || config.applyTritonPid || config.applyHelium3Pid || config.applyAlphaPid ;
3520- bool keepMassHypothesis = false ;
3521- if (!applyAnyBachelorPid || config.applyProtonPid ) {
3522- keepMassHypothesis |= (config.cutInvMassCascLc < 0 .) || (std::abs (mass2K0sP - MassLambdaCPlus) <= config.cutInvMassCascLc );
3523- }
3524- if (config.applyDeuteronPid ) {
3525- keepMassHypothesis |= (config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sDe - MassDeuteron - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei );
3526- }
3527- if (config.applyTritonPid ) {
3528- keepMassHypothesis |= (config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sTr - MassTriton - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei );
3529- }
3530- if (config.applyHelium3Pid ) {
3531- keepMassHypothesis |= (config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sHe - MassHelium3 - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei );
3532- }
3533- if (config.applyAlphaPid ) {
3534- keepMassHypothesis |= (config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sAl - MassAlpha - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei );
3535- }
3536- if (!keepMassHypothesis) {
3521+ const bool isChannelLc = !applyAnyBachelorPid || (config.applyProtonPid && TESTBIT (isIdentifiedPid, ChannelsProtonPid::LcToPK0S));
3522+ const bool isChannelCd = config.applyDeuteronPid && TESTBIT (isIdentifiedPid, ChannelsDeuteronPid);
3523+ const bool isChannelCt = config.applyTritonPid && TESTBIT (isIdentifiedPid, ChannelsTritonPid);
3524+ const bool isChannelCh = config.applyHelium3Pid && TESTBIT (isIdentifiedPid, ChannelsHeliumPid);
3525+ const bool isChannelCa = config.applyAlphaPid && TESTBIT (isIdentifiedPid, ChannelsAlphaPid);
3526+
3527+ bool isSelectedLc = isChannelLc && ((config.cutInvMassCascLc < 0 .) || (std::abs (mass2K0sP - MassLambdaCPlus) <= config.cutInvMassCascLc ));
3528+ bool isSelectedCd = isChannelCd && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sDe - MassDeuteron - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3529+ bool isSelectedCt = isChannelCt && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sTr - MassTriton - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3530+ bool isSelectedCh = isChannelCh && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sHe - MassHelium3 - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3531+ bool isSelectedCa = isChannelCa && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sAl - MassAlpha - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3532+ if (!isSelectedLc && !isSelectedCd && !isSelectedCt && !isSelectedCh && !isSelectedCa) {
35373533 continue ;
35383534 }
35393535
@@ -3581,6 +3577,12 @@ struct HfTrackIndexSkimCreatorCascades {
35813577 mass2K0sHe = RecoDecay::m (std::array{pVecBach, pVecV0}, std::array{MassHelium3, MassK0Short});
35823578 mass2K0sAl = RecoDecay::m (std::array{pVecBach, pVecV0}, std::array{MassAlpha, MassK0Short});
35833579
3580+ isSelectedLc = isChannelLc && ((config.cutInvMassCascLc < 0 .) || (std::abs (mass2K0sP - MassLambdaCPlus) <= config.cutInvMassCascLc ));
3581+ isSelectedCd = isChannelCd && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sDe - MassDeuteron - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3582+ isSelectedCt = isChannelCt && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sTr - MassTriton - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3583+ isSelectedCh = isChannelCh && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sHe - MassHelium3 - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3584+ isSelectedCa = isChannelCa && ((config.cutInvMassCascCharmNuclei < 0 .) || (mass2K0sAl - MassAlpha - MassLambdaCPlus <= config.cutInvMassCascCharmNuclei ));
3585+
35843586 std::array posCasc{0 ., 0 ., 0 .};
35853587 if (config.useDCAFitter ) {
35863588 const auto & cascVtx = df2.getPCACandidate ();
@@ -3596,11 +3598,21 @@ struct HfTrackIndexSkimCreatorCascades {
35963598 registry.fill (HIST (" hVtx2ProngX" ), posCasc[0 ]);
35973599 registry.fill (HIST (" hVtx2ProngY" ), posCasc[1 ]);
35983600 registry.fill (HIST (" hVtx2ProngZ" ), posCasc[2 ]);
3599- registry.fill (HIST (" hMassLcToPK0S" ), mass2K0sP);
3600- registry.fill (HIST (" hMassCdToDeK0S" ), mass2K0sDe);
3601- registry.fill (HIST (" hMassCtToTrK0S" ), mass2K0sTr);
3602- registry.fill (HIST (" hMassChToHeK0S" ), mass2K0sHe);
3603- registry.fill (HIST (" hMassCaToAlK0S" ), mass2K0sAl);
3601+ if (isSelectedLc) {
3602+ registry.fill (HIST (" hMassLcToPK0S" ), mass2K0sP);
3603+ }
3604+ if (isSelectedCd) {
3605+ registry.fill (HIST (" hMassCdToDeK0S" ), mass2K0sDe);
3606+ }
3607+ if (isSelectedCt) {
3608+ registry.fill (HIST (" hMassCtToTrK0S" ), mass2K0sTr);
3609+ }
3610+ if (isSelectedCh) {
3611+ registry.fill (HIST (" hMassChToHeK0S" ), mass2K0sHe);
3612+ }
3613+ if (isSelectedCa) {
3614+ registry.fill (HIST (" hMassCaToAlK0S" ), mass2K0sAl);
3615+ }
36043616 }
36053617 } // loop over V0s
36063618 } // loop over tracks
0 commit comments