9 #ifndef IDPERFMON_EVENTANALYSIS_H
10 #define IDPERFMON_EVENTANALYSIS_H
14 #include "CLHEP/Vector/LorentzVector.h"
43 template<
class T>
static float EvalInvMass(
const T* pxP1,
const T* pxP2,
45 template<
class T>
static float EvalInvMass(
const T* pxP1,
const T* pxP2,
const T* pxp3,
const T* pxP4,
46 float fMass1,
float fMass2 = -999.9,
float fMass3 = -999.9,
float fMass4 =
invalidAnswer );
48 template<
class T>
static float EvalFourMuInvMass(
const T* pxP1,
const T* pxP2,
const T* pxP3,
const T* pxP4);
49 template<
class T>
static float EvaluateAngle(
const T* pxP1,
const T* pxP2 );
50 template<
class T>
static float EvalPtDiff(
const T* pxP1,
const T* pxP2 );
51 template<
class T>
static float EvalPhiDiff(
const T* pxP1,
const T* pxP2 );
52 template<
class T>
static float EvalEtaDiff(
const T* pxP1,
const T* pxP2 );
54 template<
class T>
static float EvalPt(
const T* pxP1,
const T* pxP2 );
55 template<
class T>
static float EvalPhi(
const T* pxP1,
const T* pxP2 );
56 template<
class T>
static float EvalEta(
const T* pxP1,
const T* pxP2 );
57 template<
class T>
static float EvalCharge(
const T* pxP1,
const T* pxP2 );
61 template<
class T>
static float EvalTransverseMass(
const T* pxP1,
float fMETx,
float fMETy );
64 float fMETx,
float fMETy,
67 float fMETx,
float fMETy );
90 template<
class T> CLHEP::Hep3Vector
92 const auto & p4(pP->p4());
107 float fMass1,
float fMass2 )
113 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
117 CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp1, fMass1 );
118 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, fMass2 );
119 return static_cast<float>( xLVec1.invariantMass( xLVec2 ) );
133 float fMass1,
float fMass2,
float fMass3,
float fMass4 )
140 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
141 fMass3 = ( fMass3 < 0.0f ) ? fMass1 : fMass3;
142 fMass4 = ( fMass4 < 0.0f ) ? fMass1 : fMass4;
150 CLHEP::HepLorentzVector xLVec; xLVec.setVectM ( xTmp1, fMass1 );
151 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, fMass2 );
152 CLHEP::HepLorentzVector xLVec3; xLVec3.setVectM( xTmp3, fMass3 );
153 CLHEP::HepLorentzVector xLVec4; xLVec4.setVectM( xTmp4, fMass4 );
159 return static_cast<float>( xLVec.m() );
170 return static_cast<float>( xTmp1.angle(xTmp2) );
178 if ( pxP1->charge() > 0.5f )
197 return static_cast<float>( xTmp1.deltaPhi(xTmp2) );
208 return static_cast<float>( xTmp1.polarAngle(xTmp2) );
217 return static_cast<float>( (xTmp1 + xTmp2).
perp() );
226 return static_cast<float>( (xTmp1 + xTmp2).
phi() );
235 return static_cast<float>( (xTmp1 + xTmp2).pseudoRapidity() );
242 return static_cast<float>( pxP1->charge() + pxP2->charge() );
255 float fMass1,
float fMass2 )
261 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
263 CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() *
EAna::CGeV, pxP1->p4().Py() *
EAna::CGeV, 0.0f );
264 CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( fMETx, fMETy, 0.0
f );
265 CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp1, fMass1 );
266 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, 0.0
f );
267 return static_cast<float>( xLVec1.invariantMass( xLVec2 ) );
280 float fMass1,
float fMass2 )
286 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
288 CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() *
EAna::CGeV, pxP1->p4().Py() *
EAna::CGeV, 0.0f );
289 CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() *
EAna::CGeV, pxP2->p4().Py() *
EAna::CGeV, 0.0f );
290 CLHEP::Hep3Vector xTmp12 = xTmp1 + xTmp2;
291 CLHEP::Hep3Vector xTmp3 = CLHEP::Hep3Vector( fMETx, fMETy, 0.0
f );
292 CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp12, fMass1 );
293 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp3, 0.0
f );
294 return static_cast<float>( xLVec1.invariantMass( xLVec2 ) );