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)),
6  dxy_(0),
7  puppiWeight_(puppiWeight),
8  hwZ0_(0),
9  hwDxy_(0),
10  hwTkQuality_(0),
11  hwPuppiWeight_(0),
12  hwEmID_(0),
13  encodedPuppi64_(0) {
16 }
17 
19  switch (kind) {
20  case ChargedHadron:
21  setPdgId(charge > 0 ? 211 : -211);
22  break;
23  case Electron:
24  setPdgId(charge > 0 ? -11 : +11);
25  break;
26  case NeutralHadron:
27  setPdgId(130);
28  break;
29  case Photon:
30  setPdgId(22);
31  break;
32  case Muon:
33  setPdgId(charge > 0 ? -13 : +13);
34  break;
35  };
36 }
void setCharge(Charge q) final
set electric charge
Definition: Muon.py:1
void setPdgIdFromParticleType(int charge, ParticleType kind)
Definition: PFCandidate.cc:18
int charge() const final
electric charge
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38