CMS 3D CMS Logo

pdgIdUtils.h
Go to the documentation of this file.
1 #ifndef CommonTools_CandUtils_pdgIdUtils_h
2 #define CommonTools_CandUtils_pdgIdUtils_h
4 
5 namespace reco {
6 
7  inline bool isElectron(const Candidate& part) { return abs(part.pdgId()) == 11; }
8 
9  inline bool isMuon(const Candidate& part) { return abs(part.pdgId()) == 13; }
10 
11  inline bool isTau(const Candidate& part) { return abs(part.pdgId()) == 15; }
12 
13  inline bool isLepton(const Candidate& part) {
14  return abs(part.pdgId()) == 11 || abs(part.pdgId()) == 13 || abs(part.pdgId()) == 15;
15  }
16 
17  inline bool isNeutrino(const Candidate& part) {
18  return abs(part.pdgId()) == 12 || abs(part.pdgId()) == 14 || abs(part.pdgId()) == 16;
19  }
20 
21  inline int flavour(const Candidate& part) {
22  int id = part.pdgId();
23  return id / abs(id);
24  }
25 
26 } // namespace reco
27 
28 #endif
reco::isElectron
bool isElectron(const Candidate &part)
Definition: pdgIdUtils.h:7
reco::flavour
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::isNeutrino
bool isNeutrino(const Candidate &part)
Definition: pdgIdUtils.h:17
reco::isLepton
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
part
part
Definition: HCALResponse.h:20
reco::Candidate
Definition: Candidate.h:27
reco::isTau
bool isTau(const Candidate &part)
Definition: pdgIdUtils.h:11
Candidate.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::isMuon
bool isMuon(const Candidate &part)
Definition: pdgIdUtils.h:9