@@ -704,7 +704,7 @@ struct FlowGFWOmegaXi {
704704 if ((track.pt () > cfgCutPtMin) && (track.pt () < cfgCutPtMax)) {
705705 fGFW ->Fill (track.eta (), ptbin, track.phi (), wacc * weff, 1 ); // (eta, ptbin, phi, wacc*weff, bitmask)
706706 hLocalDensity->Fill (track.phi ());
707- hLocalDensity->Fill (track.phi () - constants::math::TwoPI);
707+ hLocalDensity->Fill (RecoDecay::constrainAngle ( track.phi (), - constants::math::TwoPI) );
708708 }
709709 if ((track.pt () > cfgCutPtPOIMin) && (track.pt () < cfgCutPtPOIMax)) {
710710 fGFW ->Fill (track.eta (), ptbin, track.phi (), wacc * weff, 32 );
@@ -787,10 +787,7 @@ struct FlowGFWOmegaXi {
787787 if (isK0s) {
788788 setCurrentParticleWeights (weff, wacc, v0, vtxz, 1 );
789789 int phibin = -999 ;
790- if (v0.phi () < constants::math::PI)
791- phibin = hLocalDensity->FindBin (v0.phi ());
792- else
793- phibin = hLocalDensity->FindBin (v0.phi () - constants::math::TwoPI);
790+ phibin = hLocalDensity->FindBin (RecoDecay::constrainAngle (v0.phi (), -constants::math::PI));
794791 if (phibin > -900 ) {
795792 int density = hLocalDensity->Integral (phibin - cfgDeltaPhiLocDen, phibin + cfgDeltaPhiLocDen);
796793 setCurrentLocalDensityWeights (wloc, v0, density, 1 );
@@ -806,10 +803,7 @@ struct FlowGFWOmegaXi {
806803 if (isLambda) {
807804 setCurrentParticleWeights (weff, wacc, v0, vtxz, 2 );
808805 int phibin = -999 ;
809- if (v0.phi () < constants::math::PI)
810- phibin = hLocalDensity->FindBin (v0.phi ());
811- else
812- phibin = hLocalDensity->FindBin (v0.phi () - constants::math::TwoPI);
806+ phibin = hLocalDensity->FindBin (RecoDecay::constrainAngle (v0.phi (), -constants::math::TwoPI));
813807 if (phibin > -900 ) {
814808 int density = hLocalDensity->Integral (phibin - cfgDeltaPhiLocDen, phibin + cfgDeltaPhiLocDen);
815809 setCurrentLocalDensityWeights (wloc, v0, density, 2 );
@@ -895,10 +889,7 @@ struct FlowGFWOmegaXi {
895889 if (isOmega) {
896890 setCurrentParticleWeights (weff, wacc, casc, vtxz, 4 );
897891 int phibin = -999 ;
898- if (casc.phi () < constants::math::PI)
899- phibin = hLocalDensity->FindBin (casc.phi ());
900- else
901- phibin = hLocalDensity->FindBin (casc.phi () - constants::math::TwoPI);
892+ phibin = hLocalDensity->FindBin (RecoDecay::constrainAngle (casc.phi (), -constants::math::TwoPI));
902893 if (phibin > -900 ) {
903894 int density = hLocalDensity->Integral (phibin - cfgDeltaPhiLocDen, phibin + cfgDeltaPhiLocDen);
904895 setCurrentLocalDensityWeights (wloc, casc, density, 4 );
@@ -914,10 +905,7 @@ struct FlowGFWOmegaXi {
914905 if (isXi) {
915906 setCurrentParticleWeights (weff, wacc, casc, vtxz, 3 );
916907 int phibin = -999 ;
917- if (casc.phi () < constants::math::PI)
918- phibin = hLocalDensity->FindBin (casc.phi ());
919- else
920- phibin = hLocalDensity->FindBin (casc.phi () - constants::math::TwoPI);
908+ phibin = hLocalDensity->FindBin (RecoDecay::constrainAngle (casc.phi (), -constants::math::TwoPI));
921909 if (phibin > -900 ) {
922910 int density = hLocalDensity->Integral (phibin - cfgDeltaPhiLocDen, phibin + cfgDeltaPhiLocDen);
923911 setCurrentLocalDensityWeights (wloc, casc, density, 3 );
0 commit comments