@@ -1461,6 +1461,8 @@ class VarManager : public TObject
14611461 static void FillPair (T1 const & t1, T2 const & t2, float * values = nullptr );
14621462 template <int pairType, uint32_t fillMap, typename T1 , typename T2 >
14631463 static void FillPairRotation (T1 const & t1, T2 const & t2, int rotation, float * values = nullptr );
1464+ template <typename T>
1465+ static void FillPairRotation_ME (T const & t1, T const & t2, int rotation, float * values = nullptr );
14641466 template <int pairType, uint32_t fillMap, typename C, typename T1 , typename T2 >
14651467 static void FillPairCollision (C const & collision, T1 const & t1, T2 const & t2, float * values = nullptr );
14661468 template <int pairType, uint32_t fillMap, typename C, typename T1 , typename T2 , typename M, typename P>
@@ -4511,6 +4513,51 @@ void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values)
45114513 }
45124514}
45134515
4516+ template <typename T>
4517+ void VarManager::FillPairRotation_ME (T const & t1, T const & t2, int rotation, float * values)
4518+ {
4519+ if (!values) {
4520+ values = fgValues;
4521+ }
4522+
4523+ float m1 = o2::constants::physics::MassElectron;
4524+ double rotationphi2 = t2.phi ;
4525+
4526+ if (rotation == 1 ) {
4527+ rotationphi2 = t2.phi + o2::constants::math::PI ;
4528+ } else if (rotation == 2 ) {
4529+ rotationphi2 = 2 * values[kPsi2A ] - t2.phi ;
4530+ } else if (rotation == 3 ) {
4531+ rotationphi2 = 2 * values[kPsi2A ] - t2.phi + o2::constants::math::PI ;
4532+ }
4533+
4534+ if (rotationphi2 >= o2::constants::math::TwoPI) {
4535+ rotationphi2 -= o2::constants::math::TwoPI;
4536+ } else if (rotationphi2 < 0 ) {
4537+ rotationphi2 += o2::constants::math::TwoPI;
4538+ }
4539+
4540+ ROOT ::Math::PtEtaPhiMVector v1 (t1.pt , t1.eta , t1.phi , m1);
4541+ ROOT ::Math::PtEtaPhiMVector v2 (t2.pt , t2.eta , rotationphi2, m1);
4542+ ROOT ::Math::PtEtaPhiMVector v12 = v1 + v2;
4543+ values[kMass ] = v12.M ();
4544+ values[kPt ] = v12.Pt ();
4545+ values[kEta ] = v12.Eta ();
4546+ // values[kPhi] = v12.Phi();
4547+ values[kPhi ] = RecoDecay::constrainAngle (v12.Phi ());
4548+ values[kRap ] = -v12.Rapidity ();
4549+ double Ptot1 = TMath::Sqrt (v1.Px () * v1.Px () + v1.Py () * v1.Py () + v1.Pz () * v1.Pz ());
4550+ double Ptot2 = TMath::Sqrt (v2.Px () * v2.Px () + v2.Py () * v2.Py () + v2.Pz () * v2.Pz ());
4551+ values[kDeltaPtotTracks ] = Ptot1 - Ptot2;
4552+
4553+ values[kPt1 ] = t1.pt ;
4554+ values[kEta1 ] = t1.eta ;
4555+ values[kPhi1 ] = t1.phi ;
4556+ values[kPt2 ] = t2.pt ;
4557+ values[kEta2 ] = t2.eta ;
4558+ values[kPhi2 ] = rotationphi2;
4559+ }
4560+
45144561template <typename T>
45154562void VarManager::FillPairMEAcrossTFs (T const & t1, T const & t2, float * values)
45164563{
0 commit comments