Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:24

0001 #ifndef DataFormats_JetReco_TrackJet_h
0002 #define DataFormats_JetReco_TrackJet_h
0003 
0004 /** \class reco::TrackJet
0005  *
0006  * \short Jets made out of tracks
0007  *
0008  * TrackJet represents Jets with tracks as constituents.
0009  * The consitutents are in this case RecoChargedRefCandidates, that
0010  * preserve the Refs to the original tracks. Those Refs are used to
0011  * provide transparent access to the tracks.
0012  *
0013  * \author Steven Lowette
0014  *
0015  *
0016  ************************************************************/
0017 
0018 #include "DataFormats/JetReco/interface/Jet.h"
0019 #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidate.h"
0020 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0021 
0022 namespace reco {
0023 
0024   class TrackJet : public Jet {
0025   public:
0026     /// Default constructor
0027     TrackJet();
0028     /// Constructor without constituents
0029     TrackJet(const LorentzVector& fP4, const Point& fVertex);
0030     /// Constructor from RecoChargedRefCandidate constituents
0031     TrackJet(const LorentzVector& fP4, const Point& fVertex, const Jet::Constituents& fConstituents);
0032     /// Destructor
0033     ~TrackJet() override {}
0034     /// Polymorphic clone
0035     TrackJet* clone() const override;
0036 
0037     /// Number of track daughters
0038     size_t numberOfTracks() const { return numberOfDaughters(); }
0039     /// Return Ptr to the track costituent
0040     virtual edm::Ptr<reco::Track> track(size_t i) const;
0041     /// Return pointers to all track costituents
0042     std::vector<edm::Ptr<reco::Track> > tracks() const;
0043 
0044     /// calculate and set the charge by adding up the constituting track charges
0045     void resetCharge();
0046     /// get associated primary vertex
0047     const reco::VertexRef primaryVertex() const;
0048     /// set associated primary vertex
0049     void setPrimaryVertex(const reco::VertexRef& vtx);
0050     /// check jet to be associated to the hard primary vertex
0051     bool fromHardVertex() const { return (this->primaryVertex().index() == 0); }
0052 
0053     /// Print object
0054     std::string print() const override;
0055 
0056   private:
0057     /// Polymorphic overlap
0058     bool overlap(const Candidate& dummy) const override;
0059 
0060   private:
0061     /// Associated primary vertex
0062     reco::VertexRef vtx_;
0063   };
0064 
0065 }  // namespace reco
0066 
0067 #endif