CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/RecoBTag/SecondaryVertex/interface/TrackKinematics.h

Go to the documentation of this file.
00001 #ifndef RecoBTag_SecondaryVertex_TrackKinematics_h
00002 #define RecoBTag_SecondaryVertex_TrackKinematics_h
00003 
00004 #include <vector>
00005 
00006 #include "DataFormats/Math/interface/LorentzVector.h"
00007 #include "DataFormats/TrackReco/interface/Track.h"
00008 #include "DataFormats/VertexReco/interface/Vertex.h"
00009 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00010 
00011 namespace reco {
00012 
00013 class TrackKinematics {
00014     public:
00015         TrackKinematics();
00016         TrackKinematics(const std::vector<reco::Track> &tracks);
00017         TrackKinematics(const reco::TrackRefVector &tracks);
00018         TrackKinematics(const reco::Vertex &vertex);
00019         ~TrackKinematics() {}
00020 
00021         void add(const reco::Track &track, double weight = 1.0);
00022 
00023         TrackKinematics &operator += (const TrackKinematics &other);
00024         inline TrackKinematics operator + (const TrackKinematics &other)
00025         { TrackKinematics copy = *this; copy += other; return copy; }
00026 
00027         inline unsigned int numberOfTracks() const { return n; }
00028         inline double sumOfWeights() const { return sumWeights; }
00029 
00030         inline const math::XYZTLorentzVector &vectorSum() const
00031         { return sum; }
00032         inline const math::XYZTLorentzVector &weightedVectorSum() const
00033         { return weightedSum; }
00034 
00035     private:
00036         unsigned int            n;
00037         double                  sumWeights;
00038         math::XYZTLorentzVector sum;
00039         math::XYZTLorentzVector weightedSum;
00040 };
00041 
00042 } // namespace reco
00043 
00044 #endif // RecoBTag_SecondaryVertex_TrackKinematics_h