CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
reco::TrackKinematics Class Reference

#include <TrackKinematics.h>

Public Member Functions

void add (const reco::CandidatePtr &track)
 
void add (const reco::Track &track, double weight=1.0)
 
void add (const reco::TrackRef &track, double weight=1.0)
 
unsigned int numberOfTracks () const
 
TrackKinematics operator+ (const TrackKinematics &other)
 
TrackKinematicsoperator+= (const TrackKinematics &other)
 
double sumOfWeights () const
 
 TrackKinematics ()
 
 TrackKinematics (const reco::CandidatePtrVector &tracks)
 
 TrackKinematics (const reco::TrackRefVector &tracks)
 
 TrackKinematics (const reco::Vertex &vertex)
 
 TrackKinematics (const reco::VertexCompositePtrCandidate &vertex)
 
 TrackKinematics (const std::vector< reco::CandidatePtr > &tracks)
 
 TrackKinematics (const std::vector< reco::Track > &tracks)
 
const math::XYZTLorentzVectorvectorSum () const
 
const math::XYZTLorentzVectorweightedVectorSum () const
 
 ~TrackKinematics ()
 

Private Attributes

unsigned int n
 
math::XYZTLorentzVector sum
 
double sumWeights
 
math::XYZTLorentzVector weightedSum
 

Detailed Description

Definition at line 16 of file TrackKinematics.h.

Constructor & Destructor Documentation

◆ TrackKinematics() [1/7]

TrackKinematics::TrackKinematics ( )

Definition at line 16 of file TrackKinematics.cc.

16 : n(0), sumWeights(0) {}

◆ TrackKinematics() [2/7]

TrackKinematics::TrackKinematics ( const std::vector< reco::Track > &  tracks)

Definition at line 18 of file TrackKinematics.cc.

18  : n(0), sumWeights(0) {
19  for (std::vector<Track>::const_iterator iter = tracks.begin(); iter != tracks.end(); iter++)
20  add(*iter);
21 }

References add(), and PDWG_EXOHSCP_cff::tracks.

◆ TrackKinematics() [3/7]

TrackKinematics::TrackKinematics ( const reco::TrackRefVector tracks)

Definition at line 23 of file TrackKinematics.cc.

23  : n(0), sumWeights(0) {
24  for (TrackRefVector::const_iterator iter = tracks.begin(); iter != tracks.end(); iter++)
25  add(**iter);
26 }

References add(), and PDWG_EXOHSCP_cff::tracks.

◆ TrackKinematics() [4/7]

TrackKinematics::TrackKinematics ( const std::vector< reco::CandidatePtr > &  tracks)

Definition at line 28 of file TrackKinematics.cc.

28  : n(0), sumWeights(0) {
29  for (std::vector<CandidatePtr>::const_iterator iter = tracks.begin(); iter != tracks.end(); iter++)
30  add(*iter);
31 }

References add(), and PDWG_EXOHSCP_cff::tracks.

◆ TrackKinematics() [5/7]

TrackKinematics::TrackKinematics ( const reco::CandidatePtrVector tracks)

Definition at line 33 of file TrackKinematics.cc.

33  : n(0), sumWeights(0) {
34  for (CandidatePtrVector::const_iterator iter = tracks.begin(); iter != tracks.end(); iter++)
35  add(*iter);
36 }

References add(), and PDWG_EXOHSCP_cff::tracks.

◆ TrackKinematics() [6/7]

TrackKinematics::TrackKinematics ( const reco::Vertex vertex)

Definition at line 38 of file TrackKinematics.cc.

38  : n(0), sumWeights(0) {
39  bool hasRefittedTracks = vertex.hasRefittedTracks();
40  for (Vertex::trackRef_iterator iter = vertex.tracks_begin(); iter != vertex.tracks_end(); ++iter) {
41  if (hasRefittedTracks)
42  add(vertex.refittedTrack(*iter), vertex.trackWeight(*iter));
43  else
44  add(**iter, vertex.trackWeight(*iter));
45  }
46 }

References add(), and bphysicsOniaDQM_cfi::vertex.

◆ TrackKinematics() [7/7]

reco::TrackKinematics::TrackKinematics ( const reco::VertexCompositePtrCandidate vertex)
inline

Definition at line 24 of file TrackKinematics.h.

25  : n(vertex.numberOfSourceCandidatePtrs()),
26  sumWeights(vertex.numberOfSourceCandidatePtrs()),
27  sum(vertex.p4()),
28  weightedSum(vertex.p4()) {}

◆ ~TrackKinematics()

reco::TrackKinematics::~TrackKinematics ( )
inline

Definition at line 30 of file TrackKinematics.h.

30 {}

Member Function Documentation

◆ add() [1/3]

void TrackKinematics::add ( const reco::CandidatePtr track)

Definition at line 71 of file TrackKinematics.cc.

71  {
72  double weight = 1.0;
73 
74  n++;
75  sumWeights += weight;
76  sum += track->p4();
77  weightedSum += weight * track->p4();
78 }

References n, sum, sumWeights, HLT_FULL_cff::track, mps_merge::weight, and weightedSum.

Referenced by counter.Counter::register().

◆ add() [2/3]

void TrackKinematics::add ( const reco::Track track,
double  weight = 1.0 
)

Definition at line 57 of file TrackKinematics.cc.

57  {
58  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
59 
60  vec.SetPx(track.px());
61  vec.SetPy(track.py());
62  vec.SetPz(track.pz());
63  vec.SetM(ParticleMasses::piPlus);
64 
65  n++;
66  sumWeights += weight;
67  sum += vec;
68  weightedSum += weight * vec;
69 }

References n, reco::ParticleMasses::piPlus, sum, sumWeights, HLT_FULL_cff::track, mps_merge::weight, and weightedSum.

Referenced by CombinedSVComputer::fillCommonVariables(), GhostTrackComputer::operator()(), CombinedSVComputer::operator()(), BoostedDoubleSVProducer::produce(), counter.Counter::register(), and TrackKinematics().

◆ add() [3/3]

void reco::TrackKinematics::add ( const reco::TrackRef track,
double  weight = 1.0 
)
inline

Definition at line 35 of file TrackKinematics.h.

35 { return add(*track, weight); }

References add(), and HLT_FULL_cff::track.

Referenced by add(), and counter.Counter::register().

◆ numberOfTracks()

unsigned int reco::TrackKinematics::numberOfTracks ( ) const
inline

Definition at line 44 of file TrackKinematics.h.

44 { return n; }

References n.

Referenced by CombinedSVComputer::fillCommonVariables(), and GhostTrackComputer::operator()().

◆ operator+()

TrackKinematics reco::TrackKinematics::operator+ ( const TrackKinematics other)
inline

Definition at line 38 of file TrackKinematics.h.

38  {
39  TrackKinematics copy = *this;
40  copy += other;
41  return copy;
42  }

References filterCSVwithJSON::copy, and trackingPlots::other.

◆ operator+=()

TrackKinematics & TrackKinematics::operator+= ( const TrackKinematics other)

Definition at line 48 of file TrackKinematics.cc.

48  {
49  n += other.n;
50  sumWeights += other.sumWeights;
51  sum += other.sum;
52  weightedSum += other.weightedSum;
53 
54  return *this;
55 }

References n, trackingPlots::other, sum, sumWeights, and weightedSum.

◆ sumOfWeights()

double reco::TrackKinematics::sumOfWeights ( ) const
inline

Definition at line 45 of file TrackKinematics.h.

45 { return sumWeights; }

References sumWeights.

◆ vectorSum()

const math::XYZTLorentzVector& reco::TrackKinematics::vectorSum ( ) const
inline

◆ weightedVectorSum()

const math::XYZTLorentzVector& reco::TrackKinematics::weightedVectorSum ( ) const
inline

Member Data Documentation

◆ n

unsigned int reco::TrackKinematics::n
private

Definition at line 51 of file TrackKinematics.h.

Referenced by add(), numberOfTracks(), and operator+=().

◆ sum

math::XYZTLorentzVector reco::TrackKinematics::sum
private

Definition at line 53 of file TrackKinematics.h.

Referenced by add(), operator+=(), and vectorSum().

◆ sumWeights

double reco::TrackKinematics::sumWeights
private

Definition at line 52 of file TrackKinematics.h.

Referenced by add(), operator+=(), and sumOfWeights().

◆ weightedSum

math::XYZTLorentzVector reco::TrackKinematics::weightedSum
private

Definition at line 54 of file TrackKinematics.h.

Referenced by add(), operator+=(), and weightedVectorSum().

reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
reco::ParticleMasses::piPlus
const double piPlus
Definition: ParticleMasses.h:9
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
reco::TrackKinematics::TrackKinematics
TrackKinematics()
Definition: TrackKinematics.cc:16
mps_merge.weight
weight
Definition: mps_merge.py:88
edm::PtrVectorItr
Definition: PtrVector.h:51
trackingPlots.other
other
Definition: trackingPlots.py:1467
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
reco::TrackKinematics::sum
math::XYZTLorentzVector sum
Definition: TrackKinematics.h:53
edm::RefVectorIterator
Definition: EDProductfwd.h:33
reco::TrackKinematics::sumWeights
double sumWeights
Definition: TrackKinematics.h:52
reco::TrackKinematics::n
unsigned int n
Definition: TrackKinematics.h:51
reco::TrackKinematics::weightedSum
math::XYZTLorentzVector weightedSum
Definition: TrackKinematics.h:54
weight
Definition: weight.py:1
reco::TrackKinematics::add
void add(const reco::Track &track, double weight=1.0)
Definition: TrackKinematics.cc:57