@@ -815,9 +815,11 @@ struct HfFilter { // Main struct for HF triggers
815815 } // end beauty selection
816816
817817 // 2-prong femto
818- if (!keepEvent[kFemto2P ] && enableFemtoChannels->get (0u , 0u ) && isD0CharmTagged && track.collisionId () == thisCollId) {
819- bool isProton = helper.isSelectedTrack4Femto (track, trackParThird, activateQA, hPrDePID[0 ], hPrDePID[1 ], kProtonForFemto );
820- if (isProton) {
818+ bool isProtonForCharm2Prong = helper.isSelectedTrack4Femto (track, trackParThird, activateQA, hPrDePID[0 ], hPrDePID[1 ], kProtonForFemto );
819+ bool isDeuteronForCharm2Prong = helper.isSelectedTrack4Femto (track, trackParThird, activateQA, hPrDePID[2 ], hPrDePID[3 ], kDeuteronForFemto );
820+
821+ if (track.collisionId () == thisCollId) {
822+ if (isProtonForCharm2Prong && !keepEvent[kFemto2P ] && enableFemtoChannels->get (0u , 0u ) && isD0CharmTagged) {
821823 float relativeMomentum = helper.computeRelativeMomentum (pVecThird, pVec2Prong, massD0);
822824 if (applyOptimisation) {
823825 optimisationTreeFemto (thisCollId, o2::constants::physics::Pdg::kD0 , pt2Prong, scores[0 ], scores[1 ], scores[2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr (), track.tpcNSigmaDe (), track.tofNSigmaDe ());
@@ -829,7 +831,20 @@ struct HfFilter { // Main struct for HF triggers
829831 }
830832 }
831833 }
832- } // end femto selection
834+
835+ if (isDeuteronForCharm2Prong && !keepEvent[kFemto2P ] && enableFemtoChannels->get (1u , 0u ) && isD0CharmTagged) {
836+ float relativeMomentum = helper.computeRelativeMomentum (pVecThird, pVec2Prong, massD0);
837+ if (applyOptimisation) {
838+ optimisationTreeFemto (thisCollId, o2::constants::physics::Pdg::kD0 , pt2Prong, scores[0 ], scores[1 ], scores[2 ], relativeMomentum, track.tpcNSigmaPr (), track.tofNSigmaPr (), track.tpcNSigmaDe (), track.tofNSigmaDe ());
839+ }
840+ if (relativeMomentum < femtoMaxRelativeMomentum) {
841+ keepEvent[kFemto2P ] = true ;
842+ if (activateQA) {
843+ hCharmDeuteronKstarDistr[kD0 ]->Fill (relativeMomentum);
844+ }
845+ }
846+ }
847+ } // end femto charm 2prong selection
833848
834849 // Beauty with JPsi
835850 if (preselJPsiToMuMu) {
0 commit comments