Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:18

0001 #ifndef CommonTools_Utils_MasslessInvariantMass_h
0002 #define CommonTools_Utils_MasslessInvariantMass_h
0003 #include "DataFormats/Math/interface/LorentzVector.h"
0004 #include "DataFormats/Math/interface/Vector3D.h"
0005 
0006 struct MasslessInvariantMass {
0007   template <typename T1, typename T2>
0008   double operator()(const T1& t1, const T2& t2) const {
0009     const math::XYZVector &p1 = t1.momentum(), &p2 = t2.momentum();
0010     math::XYZTLorentzVector v1(p1.x(), p1.y(), p1.z(), p1.r()), v2(p2.x(), p2.y(), p2.z(), p2.r());
0011     return (v1 + v2).mass();
0012   }
0013 };
0014 
0015 #endif