@@ -437,8 +437,12 @@ struct CascadeCorrelations {
437437
438438 double getEfficiency (TH1* h, double pT, double y = 0 )
439439 {
440- // This function returns the value of histogram h corresponding to the x-coordinate pT
441- return h->GetBinContent (h->FindFixBin (pT, y));
440+ // This function returns 1 / eff
441+ double eff = h->GetBinContent (h->FindFixBin (pT, y));
442+ if (eff == 0 )
443+ return 0 ;
444+ else
445+ return 1 . / eff;
442446 }
443447
444448 HistogramRegistry registry{
@@ -552,10 +556,10 @@ struct CascadeCorrelations {
552556 if (casc.isSelected () <= 2 ) { // not exclusively an Omega --> consistent with Xi or both
553557 if (casc.sign () < 0 ) {
554558 registry.fill (HIST (" hMassXiMinus" ), casc.mXi (), casc.pt ());
555- weight = 1 . / getEfficiency (hEffXiMin, casc.pt ());
559+ weight = getEfficiency (hEffXiMin, casc.pt ());
556560 } else {
557561 registry.fill (HIST (" hMassXiPlus" ), casc.mXi (), casc.pt ());
558- weight = 1 . / getEfficiency (hEffXiPlus, casc.pt ());
562+ weight = getEfficiency (hEffXiPlus, casc.pt ());
559563 }
560564 // LOGF(info, "casc pt %f, weight %f", casc.pt(), weight);
561565 registry.fill (HIST (" hMassXiEffCorrected" ), casc.mXi (), casc.pt (), casc.yXi (), collision.posZ (), collision.multFT0M (), weight);
@@ -564,10 +568,10 @@ struct CascadeCorrelations {
564568 if (casc.isSelected () >= 2 ) { // consistent with Omega or both
565569 if (casc.sign () < 0 ) {
566570 registry.fill (HIST (" hMassOmegaMinus" ), casc.mOmega (), casc.pt ());
567- weight = 1 . / getEfficiency (hEffOmegaMin, casc.pt ());
571+ weight = getEfficiency (hEffOmegaMin, casc.pt ());
568572 } else {
569573 registry.fill (HIST (" hMassOmegaPlus" ), casc.mOmega (), casc.pt ());
570- weight = 1 . / getEfficiency (hEffOmegaPlus, casc.pt ());
574+ weight = getEfficiency (hEffOmegaPlus, casc.pt ());
571575 }
572576 registry.fill (HIST (" hMassOmegaEffCorrected" ), casc.mOmega (), casc.pt (), casc.yOmega (), collision.posZ (), collision.multFT0M (), weight);
573577 registry.fill (HIST (" hRapidityOmega" ), casc.yOmega ());
@@ -648,29 +652,29 @@ struct CascadeCorrelations {
648652 // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information)
649653 if (trigger.isSelected () <= 2 && TMath::Abs (trigger.yXi ()) < maxRapidity) { // trigger Xi
650654 if (doEfficiencyCorrection)
651- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, trigger.pt ()) : 1 . / getEfficiency (hEffXiPlus, trigger.pt ());
655+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffXiMin, trigger.pt ()) : getEfficiency (hEffXiPlus, trigger.pt ());
652656 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
653657 if (doEfficiencyCorrection)
654- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
658+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
655659 registry.fill (HIST (" hXiXiOS" ), dphi, trigger.yXi () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassXiAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
656660 }
657661 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
658662 if (doEfficiencyCorrection)
659- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
663+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
660664 registry.fill (HIST (" hXiOmOS" ), dphi, trigger.yXi () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassOmAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
661665 }
662666 }
663667 if (trigger.isSelected () >= 2 && TMath::Abs (trigger.yOmega ()) < maxRapidity) { // trigger Omega
664668 if (doEfficiencyCorrection)
665- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, trigger.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, trigger.pt ());
669+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffOmegaMin, trigger.pt ()) : getEfficiency (hEffOmegaPlus, trigger.pt ());
666670 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
667671 if (doEfficiencyCorrection)
668- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
672+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
669673 registry.fill (HIST (" hOmXiOS" ), dphi, trigger.yOmega () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassXiAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
670674 }
671675 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
672676 if (doEfficiencyCorrection)
673- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
677+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
674678 registry.fill (HIST (" hOmOmOS" ), dphi, trigger.yOmega () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassOmAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
675679 }
676680 }
@@ -712,29 +716,29 @@ struct CascadeCorrelations {
712716 // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information)
713717 if (trigger.isSelected () <= 2 && TMath::Abs (trigger.yXi ()) < maxRapidity) { // trigger Xi
714718 if (doEfficiencyCorrection)
715- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, trigger.pt ()) : 1 . / getEfficiency (hEffXiPlus, trigger.pt ());
719+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffXiMin, trigger.pt ()) : getEfficiency (hEffXiPlus, trigger.pt ());
716720 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
717721 if (doEfficiencyCorrection)
718- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
722+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
719723 registry.fill (HIST (" hXiXiSS" ), dphi, trigger.yXi () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassXiAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
720724 }
721725 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
722726 if (doEfficiencyCorrection)
723- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
727+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
724728 registry.fill (HIST (" hXiOmSS" ), dphi, trigger.yXi () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassOmAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
725729 }
726730 }
727731 if (trigger.isSelected () >= 2 && TMath::Abs (trigger.yOmega ()) < maxRapidity) { // trigger Omega
728732 if (doEfficiencyCorrection)
729- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, trigger.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, trigger.pt ());
733+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffOmegaMin, trigger.pt ()) : getEfficiency (hEffOmegaPlus, trigger.pt ());
730734 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
731735 if (doEfficiencyCorrection)
732- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
736+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
733737 registry.fill (HIST (" hOmXiSS" ), dphi, trigger.yOmega () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassXiAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
734738 }
735739 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
736740 if (doEfficiencyCorrection)
737- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
741+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
738742 registry.fill (HIST (" hOmOmSS" ), dphi, trigger.yOmega () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassOmAssoc, collision.posZ (), collision.multFT0M (), weightTrigg * weightAssoc);
739743 }
740744 }
@@ -824,29 +828,29 @@ struct CascadeCorrelations {
824828 // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information)
825829 if (trigger.isSelected () <= 2 && TMath::Abs (trigger.yXi ()) < maxRapidity) { // trigger Xi
826830 if (doEfficiencyCorrection)
827- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, trigger.pt ()) : 1 . / getEfficiency (hEffXiPlus, trigger.pt ());
831+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffXiMin, trigger.pt ()) : getEfficiency (hEffXiPlus, trigger.pt ());
828832 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
829833 if (doEfficiencyCorrection)
830- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
834+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
831835 registry.fill (HIST (" MixedEvents/hMEXiXiOS" ), dphi, trigger.yXi () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassXiAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
832836 }
833837 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
834838 if (doEfficiencyCorrection)
835- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
839+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
836840 registry.fill (HIST (" MixedEvents/hMEXiOmOS" ), dphi, trigger.yXi () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassOmAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
837841 }
838842 }
839843 if (trigger.isSelected () >= 2 && TMath::Abs (trigger.yOmega ()) < maxRapidity) { // trigger Omega
840844 if (doEfficiencyCorrection)
841- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, trigger.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, trigger.pt ());
845+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffOmegaMin, trigger.pt ()) : getEfficiency (hEffOmegaPlus, trigger.pt ());
842846 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
843847 if (doEfficiencyCorrection)
844- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
848+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
845849 registry.fill (HIST (" MixedEvents/hMEOmXiOS" ), dphi, trigger.yOmega () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassXiAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
846850 }
847851 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
848852 if (doEfficiencyCorrection)
849- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
853+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
850854 registry.fill (HIST (" MixedEvents/hMEOmOmOS" ), dphi, trigger.yOmega () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassOmAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
851855 }
852856 }
@@ -889,29 +893,29 @@ struct CascadeCorrelations {
889893
890894 if (trigger.isSelected () <= 2 && TMath::Abs (trigger.yXi ()) < maxRapidity) { // trigger Xi
891895 if (doEfficiencyCorrection)
892- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, trigger.pt ()) : 1 . / getEfficiency (hEffXiPlus, trigger.pt ());
896+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffXiMin, trigger.pt ()) : getEfficiency (hEffXiPlus, trigger.pt ());
893897 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
894898 if (doEfficiencyCorrection)
895- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
899+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
896900 registry.fill (HIST (" MixedEvents/hMEXiXiSS" ), dphi, trigger.yXi () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassXiAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
897901 }
898902 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
899903 if (doEfficiencyCorrection)
900- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
904+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
901905 registry.fill (HIST (" MixedEvents/hMEXiOmSS" ), dphi, trigger.yXi () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassXiTrigg, invMassOmAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
902906 }
903907 }
904908 if (trigger.isSelected () >= 2 && TMath::Abs (trigger.yOmega ()) < maxRapidity) { // trigger Omega
905909 if (doEfficiencyCorrection)
906- weightTrigg = trigger.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, trigger.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, trigger.pt ());
910+ weightTrigg = trigger.sign () < 0 ? getEfficiency (hEffOmegaMin, trigger.pt ()) : getEfficiency (hEffOmegaPlus, trigger.pt ());
907911 if (assoc.isSelected () <= 2 && TMath::Abs (assoc.yXi ()) < maxRapidity) { // assoc Xi
908912 if (doEfficiencyCorrection)
909- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffXiMin, assoc.pt ()) : 1 . / getEfficiency (hEffXiPlus, assoc.pt ());
913+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffXiMin, assoc.pt ()) : getEfficiency (hEffXiPlus, assoc.pt ());
910914 registry.fill (HIST (" MixedEvents/hMEOmXiSS" ), dphi, trigger.yOmega () - assoc.yXi (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassXiAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
911915 }
912916 if (assoc.isSelected () >= 2 && TMath::Abs (assoc.yOmega ()) < maxRapidity) { // assoc Omega
913917 if (doEfficiencyCorrection)
914- weightAssoc = assoc.sign () < 0 ? 1 . / getEfficiency (hEffOmegaMin, assoc.pt ()) : 1 . / getEfficiency (hEffOmegaPlus, assoc.pt ());
918+ weightAssoc = assoc.sign () < 0 ? getEfficiency (hEffOmegaMin, assoc.pt ()) : getEfficiency (hEffOmegaPlus, assoc.pt ());
915919 registry.fill (HIST (" MixedEvents/hMEOmOmSS" ), dphi, trigger.yOmega () - assoc.yOmega (), trigger.pt (), assoc.pt (), invMassOmTrigg, invMassOmAssoc, col1.posZ (), col1.multFT0M (), weightTrigg * weightAssoc);
916920 }
917921 }
0 commit comments