@@ -596,27 +596,25 @@ struct HfTaskDs {
596596 {
597597
598598 int id = o2::constants::physics::Pdg::kDS ;
599- auto yCand = hfHelper.yDs (candidate);
600599 if (dataType == DataType::McDplusPrompt || dataType == DataType::McDplusNonPrompt || dataType == DataType::McDplusBkg) {
601600 id = o2::constants::physics::Pdg::kDPlus ;
602- yCand = hfHelper.yDplus (candidate);
603601 } else if (dataType == DataType::McLcBkg) {
604602 id = o2::constants::physics::Pdg::kLambdaCPlus ;
605- yCand = hfHelper.yLc (candidate);
606603 }
607604
608605 auto indexMother = RecoDecay::getMother (mcParticles,
609606 candidate.template prong0_as <aod::TracksWMc>().template mcParticle_as <CandDsMcGen>(),
610607 id, true );
611608
612609 if (indexMother != -1 ) {
613- if (yCandRecoMax >= 0 . && std::abs (yCand) > yCandRecoMax) {
614- return ;
615- }
616610
617611 auto pt = candidate.pt (); // rec. level pT
618612
619613 if (candidate.isSelDsToKKPi () >= selectionFlagDs) { // KKPi
614+ auto yCand = candidate.y (hfHelper.invMassDsToKKPi (candidate));
615+ if (yCandRecoMax >= 0 . && std::abs (yCand) > yCandRecoMax) {
616+ return ;
617+ }
620618 fillHisto (candidate, dataType);
621619 fillHistoKKPi<true , Coll>(candidate, dataType);
622620
@@ -631,6 +629,10 @@ struct HfTaskDs {
631629 }
632630 }
633631 if (candidate.isSelDsToPiKK () >= selectionFlagDs) { // PiKK
632+ auto yCand = candidate.y (hfHelper.invMassDsToPiKK (candidate));
633+ if (yCandRecoMax >= 0 . && std::abs (yCand) > yCandRecoMax) {
634+ return ;
635+ }
634636 fillHisto (candidate, dataType);
635637 fillHistoPiKK<true , Coll>(candidate, dataType);
636638
@@ -651,15 +653,17 @@ struct HfTaskDs {
651653 template <typename Coll, typename CandDs>
652654 void runDataAnalysisPerCandidate (CandDs const & candidate)
653655 {
654- if (yCandRecoMax >= 0 . && std::abs (hfHelper.yDs (candidate)) > yCandRecoMax) {
655- return ;
656- }
657-
658656 if (candidate.isSelDsToKKPi () >= selectionFlagDs) { // KKPi
657+ if (yCandRecoMax >= 0 . && std::abs (candidate.y (hfHelper.invMassDsToKKPi (candidate))) > yCandRecoMax) {
658+ return ;
659+ }
659660 fillHisto (candidate, DataType::Data);
660661 fillHistoKKPi<false , Coll>(candidate, DataType::Data);
661662 }
662663 if (candidate.isSelDsToPiKK () >= selectionFlagDs) { // PiKK
664+ if (yCandRecoMax >= 0 . && std::abs (candidate.y (hfHelper.invMassDsToPiKK (candidate))) > yCandRecoMax) {
665+ return ;
666+ }
663667 fillHisto (candidate, DataType::Data);
664668 fillHistoPiKK<false , Coll>(candidate, DataType::Data);
665669 }
@@ -687,16 +691,19 @@ struct HfTaskDs {
687691 }
688692 }
689693 if (isBkg && fillMcBkgHistos) {
690- if (yCandRecoMax >= 0 . && std::abs (hfHelper.yDs (candidate)) > yCandRecoMax) {
691- return ;
692- }
693694
694695 if (candidate.isSelDsToKKPi () >= selectionFlagDs || candidate.isSelDsToPiKK () >= selectionFlagDs) {
695696 if (candidate.isSelDsToKKPi () >= selectionFlagDs) { // KKPi
697+ if (yCandRecoMax >= 0 . && std::abs (candidate.y (hfHelper.invMassDsToKKPi (candidate))) > yCandRecoMax) {
698+ return ;
699+ }
696700 fillHisto (candidate, DataType::McBkg);
697701 fillHistoKKPi<true , Coll>(candidate, DataType::McBkg);
698702 }
699703 if (candidate.isSelDsToPiKK () >= selectionFlagDs) { // PiKK
704+ if (yCandRecoMax >= 0 . && std::abs (candidate.y (hfHelper.invMassDsToPiKK (candidate))) > yCandRecoMax) {
705+ return ;
706+ }
700707 fillHisto (candidate, DataType::McBkg);
701708 fillHistoPiKK<true , Coll>(candidate, DataType::McBkg);
702709 }
0 commit comments