CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
reco::TrackKinematics Class Reference

#include <TrackKinematics.h>

Public Member Functions

void add (const reco::Track &track, double weight=1.0)
 
unsigned int numberOfTracks () const
 
TrackKinematics operator+ (const TrackKinematics &other)
 
TrackKinematicsoperator+= (const TrackKinematics &other)
 
double sumOfWeights () const
 
 TrackKinematics ()
 
 TrackKinematics (const std::vector< reco::Track > &tracks)
 
 TrackKinematics (const reco::TrackRefVector &tracks)
 
 TrackKinematics (const reco::Vertex &vertex)
 
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 13 of file TrackKinematics.h.

Constructor & Destructor Documentation

TrackKinematics::TrackKinematics ( )

Definition at line 16 of file TrackKinematics.cc.

16  :
17  n(0), sumWeights(0)
18 {
19 }
TrackKinematics::TrackKinematics ( const std::vector< reco::Track > &  tracks)

Definition at line 21 of file TrackKinematics.cc.

References add(), and getDQMSummary::iter.

21  :
22  n(0), sumWeights(0)
23 {
24  for(std::vector<Track>::const_iterator iter = tracks.begin();
25  iter != tracks.end(); iter++)
26  add(*iter);
27 }
void add(const reco::Track &track, double weight=1.0)
tuple tracks
Definition: testEve_cfg.py:39
TrackKinematics::TrackKinematics ( const reco::TrackRefVector tracks)

Definition at line 29 of file TrackKinematics.cc.

References add(), edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), and getDQMSummary::iter.

29  :
30  n(0), sumWeights(0)
31 {
33  iter != tracks.end(); iter++)
34  add(**iter);
35 }
void add(const reco::Track &track, double weight=1.0)
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
TrackKinematics::TrackKinematics ( const reco::Vertex vertex)

Definition at line 37 of file TrackKinematics.cc.

References add(), reco::Vertex::hasRefittedTracks(), getDQMSummary::iter, reco::Vertex::refittedTrack(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

37  :
38  n(0), sumWeights(0)
39 {
40  bool hasRefittedTracks = vertex.hasRefittedTracks();
42  iter != vertex.tracks_end(); ++iter) {
43  if (hasRefittedTracks)
44  add(vertex.refittedTrack(*iter),
45  vertex.trackWeight(*iter));
46  else
47  add(**iter, vertex.trackWeight(*iter));
48  }
49 }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
void add(const reco::Track &track, double weight=1.0)
Track refittedTrack(const TrackBaseRef &track) const
bool hasRefittedTracks() const
Checks whether refitted tracks are stored.
Definition: Vertex.h:134
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
reco::TrackKinematics::~TrackKinematics ( )
inline

Definition at line 19 of file TrackKinematics.h.

19 {}

Member Function Documentation

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

Definition at line 61 of file TrackKinematics.cc.

References n, reco::ParticleMasses::piPlus, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), sum, sumWeights, histoStyle::weight, and weightedSum.

Referenced by GhostTrackComputer::threshTrack(), and TrackKinematics().

62 {
63  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
64 
65  vec.SetPx(track.px());
66  vec.SetPy(track.py());
67  vec.SetPz(track.pz());
68  vec.SetM(ParticleMasses::piPlus);
69 
70  n++;
71  sumWeights += weight;
72  sum += vec;
73  weightedSum += weight * vec;
74 }
math::XYZTLorentzVector weightedSum
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:131
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:135
int weight
Definition: histoStyle.py:50
math::XYZTLorentzVector sum
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:133
unsigned int reco::TrackKinematics::numberOfTracks ( ) const
inline

Definition at line 27 of file TrackKinematics.h.

References n.

27 { return n; }
TrackKinematics reco::TrackKinematics::operator+ ( const TrackKinematics other)
inline

Definition at line 24 of file TrackKinematics.h.

References filterCSVwithJSON::copy.

25  { TrackKinematics copy = *this; copy += other; return copy; }
TrackKinematics & TrackKinematics::operator+= ( const TrackKinematics other)

Definition at line 51 of file TrackKinematics.cc.

References n, sum, sumWeights, and weightedSum.

52 {
53  n += other.n;
54  sumWeights += other.sumWeights;
55  sum += other.sum;
56  weightedSum += other.weightedSum;
57 
58  return *this;
59 }
math::XYZTLorentzVector weightedSum
math::XYZTLorentzVector sum
double reco::TrackKinematics::sumOfWeights ( ) const
inline

Definition at line 28 of file TrackKinematics.h.

References sumWeights.

28 { return sumWeights; }
const math::XYZTLorentzVector& reco::TrackKinematics::vectorSum ( ) const
inline

Definition at line 30 of file TrackKinematics.h.

References sum.

Referenced by SimpleSecondaryVertexComputer::discriminator(), reco::VertexFilter::operator()(), and GhostTrackComputer::threshTrack().

31  { return sum; }
math::XYZTLorentzVector sum
const math::XYZTLorentzVector& reco::TrackKinematics::weightedVectorSum ( ) const
inline

Definition at line 32 of file TrackKinematics.h.

References weightedSum.

Referenced by reco::VertexFilter::operator()().

33  { return weightedSum; }
math::XYZTLorentzVector weightedSum

Member Data Documentation

unsigned int reco::TrackKinematics::n
private

Definition at line 36 of file TrackKinematics.h.

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

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

Definition at line 38 of file TrackKinematics.h.

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

double reco::TrackKinematics::sumWeights
private

Definition at line 37 of file TrackKinematics.h.

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

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

Definition at line 39 of file TrackKinematics.h.

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