CMS 3D CMS Logo

TrackKinematics.h
Go to the documentation of this file.
1 #ifndef RecoBTag_SecondaryVertex_TrackKinematics_h
2 #define RecoBTag_SecondaryVertex_TrackKinematics_h
3 
4 #include <vector>
5 
13 
14 namespace reco {
15 
17  public:
19  TrackKinematics(const std::vector<reco::Track> &tracks);
21  TrackKinematics(const std::vector<reco::CandidatePtr> &tracks);
25  : n(vertex.numberOfSourceCandidatePtrs()),
26  sumWeights(vertex.numberOfSourceCandidatePtrs()),
27  sum(vertex.p4()),
28  weightedSum(vertex.p4()) {}
29 
31 
32  void add(const reco::Track &track, double weight = 1.0);
33  void add(const reco::CandidatePtr &track);
34 
35  inline void add(const reco::TrackRef &track, double weight = 1.0) { return add(*track, weight); }
36 
39  TrackKinematics copy = *this;
40  copy += other;
41  return copy;
42  }
43 
44  inline unsigned int numberOfTracks() const { return n; }
45  inline double sumOfWeights() const { return sumWeights; }
46 
47  inline const math::XYZTLorentzVector &vectorSum() const { return sum; }
48  inline const math::XYZTLorentzVector &weightedVectorSum() const { return weightedSum; }
49 
50  private:
51  unsigned int n;
52  double sumWeights;
55  };
56 
57 } // namespace reco
58 
59 #endif // RecoBTag_SecondaryVertex_TrackKinematics_h
reco::TrackKinematics
Definition: TrackKinematics.h:16
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
reco::TrackKinematics::add
void add(const reco::TrackRef &track, double weight=1.0)
Definition: TrackKinematics.h:35
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
reco::TrackKinematics::~TrackKinematics
~TrackKinematics()
Definition: TrackKinematics.h:30
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
reco::TrackKinematics::TrackKinematics
TrackKinematics()
Definition: TrackKinematics.cc:16
edm::RefVector< TrackCollection >
reco::TrackKinematics::numberOfTracks
unsigned int numberOfTracks() const
Definition: TrackKinematics.h:44
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::TrackKinematics::operator+=
TrackKinematics & operator+=(const TrackKinematics &other)
Definition: TrackKinematics.cc:48
reco::VertexCompositePtrCandidate
Definition: VertexCompositePtrCandidate.h:16
edm::Ref< TrackCollection >
CandidateFwd.h
Track.h
edm::PtrVector< Candidate >
reco::Track
Definition: Track.h:27
VertexCompositePtrCandidate.h
trackingPlots.other
other
Definition: trackingPlots.py:1467
reco::TrackKinematics::vectorSum
const math::XYZTLorentzVector & vectorSum() const
Definition: TrackKinematics.h:47
Vertex.h
reco::TrackKinematics::sumOfWeights
double sumOfWeights() const
Definition: TrackKinematics.h:45
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LorentzVector.h
p4
double p4[4]
Definition: TauolaWrapper.h:92
reco::TrackKinematics::operator+
TrackKinematics operator+(const TrackKinematics &other)
Definition: TrackKinematics.h:38
edm::Ptr< Candidate >
VertexFwd.h
reco::TrackKinematics::weightedVectorSum
const math::XYZTLorentzVector & weightedVectorSum() const
Definition: TrackKinematics.h:48
reco::TrackKinematics::sum
math::XYZTLorentzVector sum
Definition: TrackKinematics.h:53
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::TrackKinematics::sumWeights
double sumWeights
Definition: TrackKinematics.h:52
reco::TrackKinematics::TrackKinematics
TrackKinematics(const reco::VertexCompositePtrCandidate &vertex)
Definition: TrackKinematics.h:24
Candidate.h
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::Vertex
Definition: Vertex.h:35
reco::TrackKinematics::add
void add(const reco::Track &track, double weight=1.0)
Definition: TrackKinematics.cc:57