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