CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/CommonTools/Utils/interface/MasslessInvariantMass.h

Go to the documentation of this file.
00001 #ifndef CommonTools_Utils_MasslessInvariantMass_h
00002 #define CommonTools_Utils_MasslessInvariantMass_h
00003 #include "DataFormats/Math/interface/LorentzVector.h"
00004 #include "DataFormats/Math/interface/Vector3D.h"
00005 
00006 struct MasslessInvariantMass {
00007   template<typename T1, typename T2>
00008   double operator()( const T1 & t1, const T2 & t2 ) const {
00009     math::XYZVector p1 = t1.momentum(), p2 = t2.momentum();
00010     math::XYZTLorentzVector v1( p1.x(), p1.y(), p1.z(), p1.r() ), v2( p2.x(), p2.y(), p2.z(), p2.r() );
00011     return ( v1 + v2 ).mass();
00012   }
00013 };
00014 
00015 #endif