TrackJet

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
#ifndef DataFormats_JetReco_TrackJet_h
#define DataFormats_JetReco_TrackJet_h

/** \class reco::TrackJet
 *
 * \short Jets made out of tracks
 *
 * TrackJet represents Jets with tracks as constituents.
 * The consitutents are in this case RecoChargedRefCandidates, that
 * preserve the Refs to the original tracks. Those Refs are used to
 * provide transparent access to the tracks.
 *
 * \author Steven Lowette
 *
 *
 ************************************************************/

#include "DataFormats/JetReco/interface/Jet.h"
#include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidate.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"

namespace reco {

  class TrackJet : public Jet {
  public:
    /// Default constructor
    TrackJet();
    /// Constructor without constituents
    TrackJet(const LorentzVector& fP4, const Point& fVertex);
    /// Constructor from RecoChargedRefCandidate constituents
    TrackJet(const LorentzVector& fP4, const Point& fVertex, const Jet::Constituents& fConstituents);
    /// Destructor
    ~TrackJet() override {}
    /// Polymorphic clone
    TrackJet* clone() const override;

    /// Number of track daughters
    size_t numberOfTracks() const { return numberOfDaughters(); }
    /// Return Ptr to the track costituent
    virtual edm::Ptr<reco::Track> track(size_t i) const;
    /// Return pointers to all track costituents
    std::vector<edm::Ptr<reco::Track> > tracks() const;

    /// calculate and set the charge by adding up the constituting track charges
    void resetCharge();
    /// get associated primary vertex
    const reco::VertexRef primaryVertex() const;
    /// set associated primary vertex
    void setPrimaryVertex(const reco::VertexRef& vtx);
    /// check jet to be associated to the hard primary vertex
    bool fromHardVertex() const { return (this->primaryVertex().index() == 0); }

    /// Print object
    std::string print() const override;

  private:
    /// Polymorphic overlap
    bool overlap(const Candidate& dummy) const override;

  private:
    /// Associated primary vertex
    reco::VertexRef vtx_;
  };

}  // namespace reco

#endif