CMS 3D CMS Logo

PFCandidate.cc
Go to the documentation of this file.
2 
4  ParticleType kind, int charge, const PolarLorentzVector& p, float puppiWeight, int hwpt, int hweta, int hwphi)
5  : L1Candidate(p, hwpt, hweta, hwphi, /*hwQuality=*/int(kind)), puppiWeight_(puppiWeight) {
8 }
9 
11  switch (kind) {
12  case ChargedHadron:
13  setPdgId(charge > 0 ? 211 : -211);
14  break;
15  case Electron:
16  setPdgId(charge > 0 ? -11 : +11);
17  break;
18  case NeutralHadron:
19  setPdgId(130);
20  break;
21  case Photon:
22  setPdgId(22);
23  break;
24  case Muon:
25  setPdgId(charge > 0 ? -13 : +13);
26  break;
27  };
28 }
void setCharge(Charge q) final
set electric charge
Definition: Muon.py:1
void setPdgIdFromParticleType(int charge, ParticleType kind)
Definition: PFCandidate.cc:10
int charge() const final
electric charge
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38