CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
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
tuple tracks
Definition: testEve_cfg.py:39
TrackKinematics operator+(const TrackKinematics &other)
const math::XYZTLorentzVector & vectorSum() const
int weight
Definition: histoStyle.py:50
math::XYZTLorentzVector sum
void add(const reco::TrackRef &track, double weight=1.0)
TrackKinematics(const reco::VertexCompositePtrCandidate &vertex)