@@ -522,6 +522,7 @@ struct HfTaskCorrelationDsHadrons {
522522 int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows ();
523523 int const poolBin = pairEntry.poolBin ();
524524 int const ptBinD = o2::analysis::findBin (binsPtD, std::abs (ptD));
525+ const bool haveSameSign = ptD * ptHadron > 0 .;
525526
526527 if (!isSelectedCandidate (ptBinD, bdtScorePrompt, bdtScoreBkg)) {
527528 continue ;
@@ -540,9 +541,9 @@ struct HfTaskCorrelationDsHadrons {
540541
541542 // in signal region
542543 if (massD > signalRegionInner->at (ptBinD) && massD < signalRegionOuter->at (ptBinD)) {
543- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
544+ if (doLSpair && haveSameSign ) { // like-sign pairs
544545 registry.fill (HIST (" hCorrel2DVsPtSignalRegionLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
545- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
546+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
546547 registry.fill (HIST (" hCorrel2DVsPtSignalRegionULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
547548 } else if (fillHistoData) { // default case
548549 registry.fill (HIST (" hCorrel2DVsPtSignalRegion" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -552,9 +553,9 @@ struct HfTaskCorrelationDsHadrons {
552553 }
553554 // in sideband left region
554555 if (massD > sidebandLeftOuter->at (ptBinD) && massD < sidebandLeftInner->at (ptBinD)) {
555- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
556+ if (doLSpair && haveSameSign ) { // like-sign pairs
556557 registry.fill (HIST (" hCorrel2DVsPtSidebandLeftLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
557- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
558+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
558559 registry.fill (HIST (" hCorrel2DVsPtSidebandLeftULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
559560 } else if (fillHistoData) { // default case
560561 registry.fill (HIST (" hCorrel2DVsPtSidebandLeft" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -564,9 +565,9 @@ struct HfTaskCorrelationDsHadrons {
564565 }
565566 // in sideband right region
566567 if (massD > sidebandRightInner->at (ptBinD) && massD < sidebandRightOuter->at (ptBinD)) {
567- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
568+ if (doLSpair && haveSameSign ) { // like-sign pairs
568569 registry.fill (HIST (" hCorrel2DVsPtSidebandRightLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
569- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
570+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
570571 registry.fill (HIST (" hCorrel2DVsPtSidebandRightULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
571572 } else if (fillHistoData) { // default case
572573 registry.fill (HIST (" hCorrel2DVsPtSidebandRight" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -631,6 +632,7 @@ struct HfTaskCorrelationDsHadrons {
631632 int const statusPromptHadron = pairEntry.trackOrigin ();
632633 int const ptBinD = o2::analysis::findBin (binsPtD, std::abs (ptD));
633634 bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary ();
635+ const bool haveSameSign = ptD * ptHadron > 0 .;
634636
635637 if (!isSelectedCandidate (ptBinD, bdtScorePrompt, bdtScoreBkg)) {
636638 continue ;
@@ -655,9 +657,9 @@ struct HfTaskCorrelationDsHadrons {
655657 registry.fill (HIST (" hDeltaPhiPtIntSignalRegionMcRec" ), deltaPhi, efficiencyWeight);
656658 registry.fill (HIST (" hCorrel2DVsPtSignalRegionMcRec" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
657659 if (isPhysicalPrimary) {
658- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
660+ if (doLSpair && haveSameSign ) { // like-sign pairs
659661 registry.fill (HIST (" hCorrel2DVsPtPhysicalPrimaryMcRecLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
660- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
662+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
661663 registry.fill (HIST (" hCorrel2DVsPtPhysicalPrimaryMcRecULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
662664 } else { // default case
663665 registry.fill (HIST (" hCorrel2DVsPtPhysicalPrimaryMcRec" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
@@ -698,27 +700,28 @@ struct HfTaskCorrelationDsHadrons {
698700 int const poolBin = pairEntry.poolBin ();
699701 int const statusPromptHadron = pairEntry.trackOrigin ();
700702 bool const isDsPrompt = pairEntry.isPrompt ();
703+ const bool haveSameSign = ptD * ptHadron > 0 .;
701704
702705 registry.fill (HIST (" hCorrel2DVsPtMcGen" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
703706 registry.fill (HIST (" hDeltaEtaPtIntMcGen" ), deltaEta);
704707 registry.fill (HIST (" hDeltaPhiPtIntMcGen" ), deltaPhi);
705708 if (isDsPrompt) {
706709 registry.fill (HIST (" hCorrel2DVsPtMcGenPrompt" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
707- if (doULSpair) {
710+ if (doULSpair && !haveSameSign ) {
708711 registry.fill (HIST (" hCorrel2DVsPtMcGenPromptULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
709712 }
710- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) {
713+ if (doLSpair && haveSameSign ) {
711714 registry.fill (HIST (" hCorrel2DVsPtMcGenPromptLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
712715 }
713716 if (statusPromptHadron == RecoDecay::OriginType::Prompt) {
714717 registry.fill (HIST (" hCorrel2DVsPtMcGenPromptDsPromptHadron" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
715718 }
716719 } else {
717720 registry.fill (HIST (" hCorrel2DVsPtMcGenNonPrompt" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
718- if (doULSpair) {
721+ if (doULSpair && !haveSameSign ) {
719722 registry.fill (HIST (" hCorrel2DVsPtMcGenNonPromptULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
720723 }
721- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) {
724+ if (doLSpair && haveSameSign ) {
722725 registry.fill (HIST (" hCorrel2DVsPtMcGenNonPromptLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin);
723726 }
724727 if (statusPromptHadron == RecoDecay::OriginType::NonPrompt) {
@@ -746,6 +749,7 @@ struct HfTaskCorrelationDsHadrons {
746749 int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows ();
747750 int const poolBin = pairEntry.poolBin ();
748751 int const ptBinD = o2::analysis::findBin (binsPtD, std::abs (ptD));
752+ const bool haveSameSign = ptD * ptHadron > 0 .;
749753
750754 if (!isSelectedCandidate (ptBinD, bdtScorePrompt, bdtScoreBkg)) {
751755 continue ;
@@ -764,9 +768,9 @@ struct HfTaskCorrelationDsHadrons {
764768
765769 // in signal region
766770 if (massD > signalRegionInner->at (ptBinD) && massD < signalRegionOuter->at (ptBinD)) {
767- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
771+ if (doLSpair && haveSameSign ) { // like-sign pairs
768772 registry.fill (HIST (" hCorrel2DVsPtSignalRegionLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
769- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
773+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
770774 registry.fill (HIST (" hCorrel2DVsPtSignalRegionULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
771775 } else if (fillHistoData) { // default case
772776 registry.fill (HIST (" hCorrel2DVsPtSignalRegion" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -776,9 +780,9 @@ struct HfTaskCorrelationDsHadrons {
776780 }
777781 // in sideband left region
778782 if (massD > sidebandLeftOuter->at (ptBinD) && massD < sidebandLeftInner->at (ptBinD)) {
779- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
783+ if (doLSpair && haveSameSign ) { // like-sign pairs
780784 registry.fill (HIST (" hCorrel2DVsPtSidebandLeftLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
781- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
785+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
782786 registry.fill (HIST (" hCorrel2DVsPtSidebandLeftULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
783787 } else if (fillHistoData) { // default case
784788 registry.fill (HIST (" hCorrel2DVsPtSidebandLeft" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -788,9 +792,9 @@ struct HfTaskCorrelationDsHadrons {
788792 }
789793 // in sideband right region
790794 if (massD > sidebandRightInner->at (ptBinD) && massD < sidebandRightOuter->at (ptBinD)) {
791- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
795+ if (doLSpair && haveSameSign ) { // like-sign pairs
792796 registry.fill (HIST (" hCorrel2DVsPtSidebandRightLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
793- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
797+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
794798 registry.fill (HIST (" hCorrel2DVsPtSidebandRightULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
795799 } else if (fillHistoData) { // default case
796800 registry.fill (HIST (" hCorrel2DVsPtSidebandRight" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -814,6 +818,7 @@ struct HfTaskCorrelationDsHadrons {
814818 int multPvContrib = pairEntry.numPvContrib ();
815819 int const poolBin = pairEntry.poolBin ();
816820 int const ptBinD = o2::analysis::findBin (binsPtD, std::abs (ptD));
821+ const bool haveSameSign = ptD * ptHadron > 0 .;
817822
818823 double efficiencyWeight = 1 .;
819824 if (useHighDimHistoForEff) {
@@ -824,9 +829,9 @@ struct HfTaskCorrelationDsHadrons {
824829
825830 // in signal region
826831 if (massD > signalRegionInner->at (ptBinD) && massD < signalRegionOuter->at (ptBinD)) {
827- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
832+ if (doLSpair && haveSameSign ) { // like-sign pairs
828833 registry.fill (HIST (" hCorrel2DVsPtSignalRegionLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
829- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
834+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
830835 registry.fill (HIST (" hCorrel2DVsPtSignalRegionULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
831836 } else if (fillHistoData) { // default case
832837 registry.fill (HIST (" hCorrel2DVsPtSignalRegion" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -836,9 +841,9 @@ struct HfTaskCorrelationDsHadrons {
836841 }
837842 // in sideband left region
838843 if (massD > sidebandLeftOuter->at (ptBinD) && massD < sidebandLeftInner->at (ptBinD)) {
839- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
844+ if (doLSpair && haveSameSign ) { // like-sign pairs
840845 registry.fill (HIST (" hCorrel2DVsPtSidebandLeftLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
841- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
846+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
842847 registry.fill (HIST (" hCorrel2DVsPtSidebandLeftULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
843848 } else if (fillHistoData) { // default case
844849 registry.fill (HIST (" hCorrel2DVsPtSidebandLeft" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -848,9 +853,9 @@ struct HfTaskCorrelationDsHadrons {
848853 }
849854 // in sideband right region
850855 if (massD > sidebandRightInner->at (ptBinD) && massD < sidebandRightOuter->at (ptBinD)) {
851- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
856+ if (doLSpair && haveSameSign ) { // like-sign pairs
852857 registry.fill (HIST (" hCorrel2DVsPtSidebandRightLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
853- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
858+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
854859 registry.fill (HIST (" hCorrel2DVsPtSidebandRightULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
855860 } else if (fillHistoData) { // default case
856861 registry.fill (HIST (" hCorrel2DVsPtSidebandRight" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), poolBin, efficiencyWeight);
@@ -883,6 +888,7 @@ struct HfTaskCorrelationDsHadrons {
883888 int const statusPromptHadron = pairEntry.trackOrigin ();
884889 int const ptBinD = o2::analysis::findBin (binsPtD, std::abs (ptD));
885890 bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary ();
891+ const bool haveSameSign = ptD * ptHadron > 0 .;
886892
887893 if (!isSelectedCandidate (ptBinD, bdtScorePrompt, bdtScoreBkg)) {
888894 continue ;
@@ -907,9 +913,9 @@ struct HfTaskCorrelationDsHadrons {
907913 registry.fill (HIST (" hDeltaPhiPtIntSignalRegionMcRec" ), deltaPhi, efficiencyWeight);
908914 registry.fill (HIST (" hCorrel2DVsPtSignalRegionMcRec" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
909915 if (isPhysicalPrimary) {
910- if (doLSpair && ((ptD > 0 . && ptHadron > 0 .) || (ptD < 0 . && ptHadron < 0 .)) ) { // like-sign pairs
916+ if (doLSpair && haveSameSign ) { // like-sign pairs
911917 registry.fill (HIST (" hCorrel2DVsPtPhysicalPrimaryMcRecLS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
912- } else if (doULSpair && ((ptD > 0 . && ptHadron < 0 .) || (ptD < 0 . && ptHadron > 0 .)) ) { // unlike-sign pairs
918+ } else if (doULSpair && !haveSameSign ) { // unlike-sign pairs
913919 registry.fill (HIST (" hCorrel2DVsPtPhysicalPrimaryMcRecULS" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
914920 } else { // default case
915921 registry.fill (HIST (" hCorrel2DVsPtPhysicalPrimaryMcRec" ), deltaPhi, deltaEta, std::abs (ptD), std::abs (ptHadron), statusDsPrompt, poolBin, efficiencyWeight);
0 commit comments