CMS 3D CMS Logo

PFJet.h
Go to the documentation of this file.
1 #ifndef DataFormats_L1TParticleFlow_PFJet_h
2 #define DataFormats_L1TParticleFlow_PFJet_h
3 
4 #include <vector>
7 
8 namespace l1t {
9 
10  class PFJet : public L1Candidate {
11  public:
13  typedef std::vector<edm::Ptr<l1t::L1Candidate>> Constituents;
14 
15  PFJet() {}
16  PFJet(float pt, float eta, float phi, float mass = 0, int hwpt = 0, int hweta = 0, int hwphi = 0)
17  : L1Candidate(PolarLorentzVector(pt, eta, phi, mass), hwpt, hweta, hwphi, /*hwQuality=*/0), rawPt_(pt) {}
18 
19  PFJet(const LorentzVector& p4, int hwpt = 0, int hweta = 0, int hwphi = 0)
20  : L1Candidate(p4, hwpt, hweta, hwphi, /*hwQuality=*/0), rawPt_(p4.Pt()) {}
21 
22  // change the pt (but doesn't change the raw pt)
23  void calibratePt(float newpt);
24 
25  // return the raw pT()
26  float rawPt() const { return rawPt_; }
27 
29  const Constituents& constituents() const { return constituents_; }
32 
33  // candidate interface
34  size_t numberOfDaughters() const override { return constituents_.size(); }
35  const reco::Candidate* daughter(size_type i) const override { return constituents_[i].get(); }
36  using reco::LeafCandidate::daughter; // avoid hiding the base
38 
39  // Get and set the encodedJet_ bits. The Jet is encoded in 128 bits as a 2-element array of uint64_t
40  std::array<uint64_t, 2> encodedJet() { return encodedJet_; }
41  void setEncodedJet(std::array<uint64_t, 2> jet) { encodedJet_ = jet; }
42 
43  private:
44  float rawPt_;
46  std::array<uint64_t, 2> encodedJet_ = {{0, 0}};
47  };
48 
49  typedef std::vector<l1t::PFJet> PFJetCollection;
51  typedef std::vector<l1t::PFJetRef> PFJetVectorRef;
52 } // namespace l1t
53 #endif
void setEncodedJet(std::array< uint64_t, 2 > jet)
Definition: PFJet.h:41
double pt() const final
transverse momentum
float rawPt_
Definition: PFJet.h:44
size_t size_type
Definition: Candidate.h:29
PFJet(const LorentzVector &p4, int hwpt=0, int hweta=0, int hwphi=0)
Definition: PFJet.h:19
const reco::Candidate * daughter(size_type i) const override
return daughter at a given position (throws an exception)
Definition: PFJet.h:35
delete x;
Definition: CaloConfig.h:22
Constituents constituents_
Definition: PFJet.h:45
void addConstituent(const edm::Ptr< l1t::L1Candidate > &cand)
adds a candidate to this cluster; note that this only records the information, it&#39;s up to you to also...
Definition: PFJet.h:31
const LorentzVector & p4() const final
four-momentum Lorentz vector
std::vector< l1t::PFJet > PFJetCollection
Definition: PFJet.h:49
const Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
edm::Ptr< l1t::L1Candidate > daughterPtr(size_type i) const
Definition: PFJet.h:37
float rawPt() const
Definition: PFJet.h:26
PFJet(float pt, float eta, float phi, float mass=0, int hwpt=0, int hweta=0, int hwphi=0)
Definition: PFJet.h:16
void calibratePt(float newpt)
Definition: PFJet.cc:3
edm::Ref< l1t::PFJetCollection > PFJetRef
Definition: PFJet.h:50
PFJet()
Definition: PFJet.h:15
const Constituents & constituents() const
constituent information. note that this is not going to be available in the hardware! ...
Definition: PFJet.h:29
std::vector< l1t::PFJetRef > PFJetVectorRef
Definition: PFJet.h:51
std::array< uint64_t, 2 > encodedJet()
Definition: PFJet.h:40
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
double mass() const final
mass
std::array< uint64_t, 2 > encodedJet_
Definition: PFJet.h:46
double phi() const final
momentum azimuthal angle
std::vector< edm::Ptr< l1t::L1Candidate > > Constituents
constituent information. note that this is not going to be available in the hardware! ...
Definition: PFJet.h:13
size_t numberOfDaughters() const override
number of daughters
Definition: PFJet.h:34
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
double eta() const final
momentum pseudorapidity