test
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)
 
void add (const reco::CandidatePtr &track)
 
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 std::vector< reco::Track > &tracks)
 
 TrackKinematics (const reco::TrackRefVector &tracks)
 
 TrackKinematics (const std::vector< reco::CandidatePtr > &tracks)
 
 TrackKinematics (const reco::CandidatePtrVector &tracks)
 
 TrackKinematics (const reco::Vertex &vertex)
 
 TrackKinematics (const reco::VertexCompositePtrCandidate &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 16 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().

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(), and edm::RefVector< C, T, F >::end().

29  :
30  n(0), sumWeights(0)
31 {
32  for(TrackRefVector::const_iterator iter = tracks.begin();
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:253
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
TrackKinematics::TrackKinematics ( const std::vector< reco::CandidatePtr > &  tracks)

Definition at line 37 of file TrackKinematics.cc.

References add().

37  :
38  n(0), sumWeights(0)
39 {
40  for(std::vector<CandidatePtr>::const_iterator iter = tracks.begin();
41  iter != tracks.end(); iter++)
42  add(*iter);
43 }
void add(const reco::Track &track, double weight=1.0)
tuple tracks
Definition: testEve_cfg.py:39
TrackKinematics::TrackKinematics ( const reco::CandidatePtrVector tracks)

Definition at line 45 of file TrackKinematics.cc.

References add(), edm::PtrVector< T >::begin(), and edm::PtrVector< T >::end().

45  :
46  n(0), sumWeights(0)
47 {
48  for(CandidatePtrVector::const_iterator iter = tracks.begin();
49  iter != tracks.end(); iter++)
50  add(*iter);
51 }
void add(const reco::Track &track, double weight=1.0)
const_iterator begin() const
Definition: PtrVector.h:130
const_iterator end() const
Definition: PtrVector.h:135
TrackKinematics::TrackKinematics ( const reco::Vertex vertex)

Definition at line 53 of file TrackKinematics.cc.

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

53  :
54  n(0), sumWeights(0)
55 {
56  bool hasRefittedTracks = vertex.hasRefittedTracks();
57  for(Vertex::trackRef_iterator iter = vertex.tracks_begin();
58  iter != vertex.tracks_end(); ++iter) {
59  if (hasRefittedTracks)
60  add(vertex.refittedTrack(*iter),
61  vertex.trackWeight(*iter));
62  else
63  add(**iter, vertex.trackWeight(*iter));
64  }
65 }
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:127
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:73
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 ( const reco::VertexCompositePtrCandidate vertex)
inline

Definition at line 24 of file TrackKinematics.h.

24  :
26  sum(vertex.p4()),weightedSum(vertex.p4()){}
math::XYZTLorentzVector weightedSum
virtual size_type numberOfSourceCandidatePtrs() const
math::XYZTLorentzVector sum
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
reco::TrackKinematics::~TrackKinematics ( )
inline

Definition at line 28 of file TrackKinematics.h.

28 {}

Member Function Documentation

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

Definition at line 77 of file TrackKinematics.cc.

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

Referenced by add(), CandidateBoostedDoubleSecondaryVertexComputer::discriminator(), CombinedSVComputer::fillCommonVariables(), counter.Counter::register(), GhostTrackComputer::threshTrack(), and TrackKinematics().

78 {
79  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
80 
81  vec.SetPx(track.px());
82  vec.SetPy(track.py());
83  vec.SetPz(track.pz());
84  vec.SetM(ParticleMasses::piPlus);
85 
86  n++;
87  sumWeights += weight;
88  sum += vec;
89  weightedSum += weight * vec;
90 }
const double piPlus
Definition: ParticleMasses.h:9
math::XYZTLorentzVector weightedSum
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
math::XYZTLorentzVector sum
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
void TrackKinematics::add ( const reco::CandidatePtr track)

Definition at line 92 of file TrackKinematics.cc.

References n, sum, sumWeights, puppiForMET_cff::weight, and weightedSum.

Referenced by counter.Counter::register().

93 {
94  double weight = 1.0;
95 
96  n++;
97  sumWeights += weight;
98  sum += track->p4();
99  weightedSum += weight * track->p4();
100 }
math::XYZTLorentzVector weightedSum
math::XYZTLorentzVector sum
void reco::TrackKinematics::add ( const reco::TrackRef track,
double  weight = 1.0 
)
inline

Definition at line 34 of file TrackKinematics.h.

References add(), and puppiForMET_cff::weight.

Referenced by counter.Counter::register().

35  {return add(*track, weight); }
void add(const reco::Track &track, double weight=1.0)
unsigned int reco::TrackKinematics::numberOfTracks ( ) const
inline

Definition at line 41 of file TrackKinematics.h.

References n.

Referenced by CombinedSVComputer::fillCommonVariables().

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

Definition at line 38 of file TrackKinematics.h.

References filterCSVwithJSON::copy.

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

Definition at line 67 of file TrackKinematics.cc.

References n, sum, sumWeights, and weightedSum.

68 {
69  n += other.n;
70  sumWeights += other.sumWeights;
71  sum += other.sum;
72  weightedSum += other.weightedSum;
73 
74  return *this;
75 }
math::XYZTLorentzVector weightedSum
math::XYZTLorentzVector sum
double reco::TrackKinematics::sumOfWeights ( ) const
inline

Definition at line 42 of file TrackKinematics.h.

References sumWeights.

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

Member Data Documentation

unsigned int reco::TrackKinematics::n
private

Definition at line 50 of file TrackKinematics.h.

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

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

Definition at line 52 of file TrackKinematics.h.

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

double reco::TrackKinematics::sumWeights
private

Definition at line 51 of file TrackKinematics.h.

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

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

Definition at line 53 of file TrackKinematics.h.

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