@@ -1311,16 +1311,6 @@ class VarManager : public TObject
13111311 static float calculatePhiV (const T1& t1, const T2& t2);
13121312 template <typename T1, typename T2>
13131313 static float LorentzTransformJpsihadroncosChi (TString Option, const T1& v1, const T2& v2);
1314- static float RotationDeltaPhi (float deltaphi) // rotate deltaphi to the range -0.5*pi < deltaphi < 1.5*pi
1315- {
1316- if (deltaphi > 3.0 / 2.0 * TMath::Pi ()) {
1317- deltaphi -= 2.0 * TMath::Pi ();
1318- }
1319- if (deltaphi < -0.5 * TMath::Pi ()) {
1320- deltaphi += 2.0 * TMath::Pi ();
1321- }
1322- return deltaphi;
1323- }
13241314
13251315 static o2::vertexing::DCAFitterN<2 > fgFitterTwoProngBarrel;
13261316 static o2::vertexing::DCAFitterN<3 > fgFitterThreeProngBarrel;
@@ -2836,7 +2826,7 @@ void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* va
28362826 MassHadron = o2::constants::physics::MassPionCharged;
28372827 }
28382828 ROOT::Math::PtEtaPhiMVector v1 (track.pt (), track.eta (), track.phi (), o2::constants::physics::MassJPsi);
2839- float deltaphi = RotationDeltaPhi (track.phi () - t1.phi ());
2829+ float deltaphi = RecoDecay::constrainAngle (track.phi () - t1.phi (), -o2::constants::math::PIHalf );
28402830 float deltaeta = t1.eta () - track.eta ();
28412831 ROOT::Math::PtEtaPhiMVector v2 (t1.pt (), t1.eta (), t1.phi (), MassHadron);
28422832 float E_boost = LorentzTransformJpsihadroncosChi (" weight_boost" , v1, v2);
@@ -2886,9 +2876,9 @@ void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* va
28862876 values[kMCWeight_trans_minus ] = LorentzTransformJpsihadroncosChi (" weight_boost" , v1, v2_trans_minus) / o2::constants::physics::MassJPsi;
28872877
28882878 values[kMCdeltaphi_minus ] = deltaphi;
2889- values[kMCdeltaphi_toward_minus ] = RotationDeltaPhi (track.phi () - (t1.phi () - 0.5 * TMath::Pi ()));
2890- values[kMCdeltaphi_away_minus ] = RotationDeltaPhi (track.phi () - (t1.phi () + 0.5 * TMath::Pi ()));
2891- values[kMCdeltaphi_trans_minus ] = RotationDeltaPhi (track.phi () - t1.phi () + TMath::Pi ());
2879+ values[kMCdeltaphi_toward_minus ] = RecoDecay::constrainAngle (track.phi () - (t1.phi () - 0.5 * TMath::Pi ()), -o2::constants::math::PIHalf );
2880+ values[kMCdeltaphi_away_minus ] = RecoDecay::constrainAngle (track.phi () - (t1.phi () + 0.5 * TMath::Pi ()), -o2::constants::math::PIHalf );
2881+ values[kMCdeltaphi_trans_minus ] = RecoDecay::constrainAngle (track.phi () - t1.phi () + TMath::Pi (), -o2::constants::math::PIHalf );
28922882 }
28932883
28942884 values[kMCCosChi_plus ] = -999 .9f ;
@@ -2925,9 +2915,9 @@ void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* va
29252915 values[kMCWeight_trans_plus ] = LorentzTransformJpsihadroncosChi (" weight_boost" , v1, v2_trans_plus) / o2::constants::physics::MassJPsi;
29262916
29272917 values[kMCdeltaphi_plus ] = deltaphi;
2928- values[kMCdeltaphi_toward_plus ] = RotationDeltaPhi (track.phi () - (t1.phi () + 0.5 * TMath::Pi ()));
2929- values[kMCdeltaphi_away_plus ] = RotationDeltaPhi (track.phi () - (t1.phi () - 0.5 * TMath::Pi ()));
2930- values[kMCdeltaphi_trans_plus ] = RotationDeltaPhi (track.phi () - t1.phi () + TMath::Pi ());
2918+ values[kMCdeltaphi_toward_plus ] = RecoDecay::constrainAngle (track.phi () - (t1.phi () + 0.5 * TMath::Pi ()), -o2::constants::math::PIHalf );
2919+ values[kMCdeltaphi_away_plus ] = RecoDecay::constrainAngle (track.phi () - (t1.phi () - 0.5 * TMath::Pi ()), -o2::constants::math::PIHalf );
2920+ values[kMCdeltaphi_trans_plus ] = RecoDecay::constrainAngle (track.phi () - ( t1.phi () - 0.5 * TMath::Pi ()), -o2::constants::math::PIHalf );
29312921 }
29322922}
29332923
0 commit comments