CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexMass.cc
Go to the documentation of this file.
2 
5 
6 VertexMass::VertexMass() : thePionMass(0.13957) {}
7 
8 VertexMass::VertexMass(double pionMass) : thePionMass(pionMass) {}
9 
10 double VertexMass::operator()(const TransientVertex& vtx) const
11 {
12 
13  std::vector<reco::TransientTrack> tracks = vtx.originalTracks();
14 
15  double esum=0., pxsum=0., pysum=0., pzsum=0.;
16 
17  for(std::vector<reco::TransientTrack>::const_iterator it=tracks.begin();
18  it!=tracks.end();it++) {
19  reco::TransientTrack track = *it;
20 
21  double px = track.impactPointState().globalMomentum().x();
22  double py = track.impactPointState().globalMomentum().y();
23  double pz = track.impactPointState().globalMomentum().z();
24 
25  pxsum += px;
26  pysum += py;
27  pzsum += pz;
28  esum += sqrt(px*px + py*py + pz*pz + thePionMass*thePionMass);
29  }
30 
31  return sqrt(esum*esum - (pxsum*pxsum + pysum*pysum + pzsum*pzsum));
32 }
T y() const
Definition: PV3DBase.h:63
std::vector< reco::TransientTrack > originalTracks() const
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
tuple tracks
Definition: testEve_cfg.py:39
GlobalVector globalMomentum() const
double thePionMass
Definition: VertexMass.h:20
double operator()(const TransientVertex &) const
Definition: VertexMass.cc:10
TrajectoryStateOnSurface impactPointState() const
T x() const
Definition: PV3DBase.h:62