CMS 3D CMS Logo

PFCandidate.h
Go to the documentation of this file.
1 #ifndef DataFormats_L1TParticleFlow_PFCandidate_h
2 #define DataFormats_L1TParticleFlow_PFCandidate_h
3 
4 #include <vector>
10 
11 namespace l1t {
12 
13  class PFCandidate : public L1Candidate {
14  public:
16  enum ParticleType { ChargedHadron = 0, Electron = 1, NeutralHadron = 2, Photon = 3, Muon = 4 };
17 
20  int charge,
21  const LorentzVector& p,
22  float puppiWeight = -1,
23  int hwpt = 0,
24  int hweta = 0,
25  int hwphi = 0)
26  : PFCandidate(kind, charge, PolarLorentzVector(p), puppiWeight, hwpt, hweta, hwphi) {}
28  int charge,
29  const PolarLorentzVector& p,
30  float puppiWeight = -1,
31  int hwpt = 0,
32  int hweta = 0,
33  int hwphi = 0);
34 
35  ParticleType id() const { return ParticleType(hwQual()); }
36 
37  const PFTrackRef& pfTrack() const { return trackRef_; }
38  void setPFTrack(const PFTrackRef& ref) { trackRef_ = ref; }
39 
40  const PFClusterRef& pfCluster() const { return clusterRef_; }
41  void setPFCluster(const PFClusterRef& ref) { clusterRef_ = ref; }
42 
43  const MuonRef& muon() const { return muonRef_; }
44  void setMuon(const MuonRef& ref) { muonRef_ = ref; }
45 
47  float puppiWeight() const { return puppiWeight_; }
48 
49  void setZ0(float z0) { setVertex(reco::Particle::Point(0, 0, z0)); }
50  void setDxy(float dxy) { dxy_ = dxy; }
51  void setCaloEta(float caloeta) { caloEta_ = caloeta; }
52  void setCaloPhi(float calophi) { caloPhi_ = calophi; }
53 
54  float z0() const { return vz(); }
55  float dxy() const { return dxy_; }
56  float caloEta() const { return caloEta_; }
57  float caloPhi() const { return caloPhi_; }
58 
59  int16_t hwZ0() const { return hwZ0_; }
60  int16_t hwDxy() const { return hwDxy_; }
61  uint16_t hwTkQuality() const { return hwTkQuality_; }
62  uint16_t hwPuppiWeight() const { return hwPuppiWeight_; }
63  uint16_t hwEmID() const { return hwEmID_; }
65 
66  void setHwZ0(int16_t hwZ0) { hwZ0_ = hwZ0; }
67  void setHwDxy(int16_t hwDxy) { hwDxy_ = hwDxy; }
70  void setHwEmID(uint16_t hwEmID) { hwEmID_ = hwEmID; }
72 
73  private:
78 
79  int16_t hwZ0_, hwDxy_;
82 
84  };
85 
86  typedef std::vector<l1t::PFCandidate> PFCandidateCollection;
90 } // namespace l1t
91 #endif
uint16_t hwPuppiWeight() const
Definition: PFCandidate.h:62
uint16_t hwTkQuality_
Definition: PFCandidate.h:80
Definition: Photon.py:1
l1t::SAMuonRef MuonRef
Definition: PFCandidate.h:15
double vz() const override
z coordinate of vertex position
void setDxy(float dxy)
Definition: PFCandidate.h:50
float caloPhi() const
Definition: PFCandidate.h:57
std::vector< l1t::PFCandidate > PFCandidateCollection
Definition: PFCandidate.h:86
void setHwZ0(int16_t hwZ0)
Definition: PFCandidate.h:66
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
edm::RefVector< l1t::PFCandidateCollection > PFCandidateRefVector
Definition: PFCandidate.h:88
delete x;
Definition: CaloConfig.h:22
float dxy() const
Definition: PFCandidate.h:55
PFTrackRef trackRef_
Definition: PFCandidate.h:75
float caloEta() const
Definition: PFCandidate.h:56
uint16_t hwTkQuality() const
Definition: PFCandidate.h:61
PFClusterRef clusterRef_
Definition: PFCandidate.h:74
int hwQual() const
Definition: L1Candidate.h:38
void setVertex(const Point &vertex) override
set vertex
const PFClusterRef & pfCluster() const
Definition: PFCandidate.h:40
void setMuon(const MuonRef &ref)
Definition: PFCandidate.h:44
void setHwEmID(uint16_t hwEmID)
Definition: PFCandidate.h:70
double p() const final
magnitude of momentum vector
Definition: Muon.py:1
float z0() const
Definition: PFCandidate.h:54
int16_t hwDxy() const
Definition: PFCandidate.h:60
math::XYZPoint Point
point in the space
Definition: Particle.h:25
uint64_t encodedPuppi64() const
Definition: PFCandidate.h:64
void setCaloEta(float caloeta)
Definition: PFCandidate.h:51
void setHwDxy(int16_t hwDxy)
Definition: PFCandidate.h:67
uint16_t hwEmID() const
Definition: PFCandidate.h:63
const MuonRef & muon() const
Definition: PFCandidate.h:43
void setZ0(float z0)
Definition: PFCandidate.h:49
void setHwPuppiWeight(uint16_t hwPuppiWeight)
Definition: PFCandidate.h:69
void setHwTkQuality(uint16_t hwTkQuality)
Definition: PFCandidate.h:68
l1t::RegionalOutput< l1t::PFCandidateCollection > PFCandidateRegionalOutput
Definition: PFCandidate.h:89
float puppiWeight() const
PUPPI weight (-1 if not available)
Definition: PFCandidate.h:47
unsigned long long uint64_t
Definition: Time.h:13
void setEncodedPuppi64(uint64_t encodedPuppi64)
Definition: PFCandidate.h:71
uint64_t encodedPuppi64_
Definition: PFCandidate.h:81
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
int16_t hwZ0() const
Definition: PFCandidate.h:59
MuonRef muonRef_
Definition: PFCandidate.h:76
PFCandidate(ParticleType kind, int charge, const LorentzVector &p, float puppiWeight=-1, int hwpt=0, int hweta=0, int hwphi=0)
Definition: PFCandidate.h:19
uint16_t hwEmID_
Definition: PFCandidate.h:80
const PFTrackRef & pfTrack() const
Definition: PFCandidate.h:37
void setCaloPhi(float calophi)
Definition: PFCandidate.h:52
void setPdgIdFromParticleType(int charge, ParticleType kind)
Definition: PFCandidate.cc:20
edm::Ref< l1t::PFCandidateCollection > PFCandidateRef
Definition: PFCandidate.h:87
void setPFCluster(const PFClusterRef &ref)
Definition: PFCandidate.h:41
void setPFTrack(const PFTrackRef &ref)
Definition: PFCandidate.h:38
uint16_t hwPuppiWeight_
Definition: PFCandidate.h:80
ParticleType id() const
Definition: PFCandidate.h:35
int charge() const final
electric charge
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38