00001 #ifndef PhysicsTools_CandUtils_pdgIdUtils_h 00002 #define PhysicsTools_CandUtils_pdgIdUtils_h 00003 #include "DataFormats/Candidate/interface/Particle.h" 00004 00005 namespace reco { 00006 00007 inline bool isElectron(const Particle & part) { 00008 return abs(part.pdgId())==11; 00009 } 00010 00011 inline bool isMuon(const Particle & part) { 00012 return abs(part.pdgId())==13; 00013 } 00014 00015 inline bool isTau(const Particle & part) { 00016 return abs(part.pdgId())==15; 00017 } 00018 00019 inline bool isLepton(const Particle & part) { 00020 return abs(part.pdgId())==11 || 00021 abs(part.pdgId())==13 || 00022 abs(part.pdgId())==15; 00023 } 00024 00025 inline bool isNeutrino(const Particle & part) { 00026 return abs(part.pdgId())==12 || 00027 abs(part.pdgId())==14 || 00028 abs(part.pdgId())==16; 00029 } 00030 00031 inline int flavour(const Particle & part) { 00032 int id = part.pdgId(); 00033 return id/abs(id); 00034 } 00035 00036 } 00037 00038 #endif