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);
23  TrackKinematics(const reco::Vertex &vertex);
25  n(vertex.numberOfSourceCandidatePtrs()), sumWeights(vertex.numberOfSourceCandidatePtrs()),
26  sum(vertex.p4()),weightedSum(vertex.p4()){}
27 
29 
30  void add(const reco::Track &track, double weight = 1.0);
31  void add(const reco::CandidatePtr &track);
32 
33  inline
34  void add(const reco::TrackRef &track, double weight = 1.0)
35  {return add(*track, weight); }
36 
39  { TrackKinematics copy = *this; copy += other; return copy; }
40 
41  inline unsigned int numberOfTracks() const { return n; }
42  inline double sumOfWeights() const { return sumWeights; }
43 
44  inline const math::XYZTLorentzVector &vectorSum() const
45  { return sum; }
47  { return weightedSum; }
48 
49  private:
50  unsigned int n;
51  double sumWeights;
54 };
55 
56 } // namespace reco
57 
58 #endif // RecoBTag_SecondaryVertex_TrackKinematics_h
const math::XYZTLorentzVector & weightedVectorSum() const
math::XYZTLorentzVector weightedSum
TrackKinematics & operator+=(const TrackKinematics &other)
void add(const reco::Track &track, double weight=1.0)
Definition: weight.py:1
double sumOfWeights() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double p4[4]
Definition: TauolaWrapper.h:92
unsigned int numberOfTracks() const
TrackKinematics operator+(const TrackKinematics &other)
fixed size matrix
const math::XYZTLorentzVector & vectorSum() const
math::XYZTLorentzVector sum
void add(const reco::TrackRef &track, double weight=1.0)
TrackKinematics(const reco::VertexCompositePtrCandidate &vertex)