Go to the documentation of this file.
46 enum Location { nj = 1, nq3, nq2, nq1, nl,
nr,
n, n8, n9, n10 };
48 enum Quark { down = 1,
up, strange, charm, bottom,
top, bottom_prime, top_prime, first = down, last = top_prime };
51 explicit ParticleID(
const int pid = 0 ) { setPid( pid ); }
54 int pid()
const {
return m_pid; }
56 constexpr
unsigned int abspid()
const {
return 0 > m_pid ? -m_pid : m_pid; }
58 void setPid(
const int pid ) { m_pid = pid; }
67 bool isBaryon()
const;
69 bool isDiQuark()
const;
71 bool isHadron()
const;
73 bool isLepton()
const;
75 bool isNucleus()
const;
80 bool hasQuarks()
const;
82 bool hasQuark(
const Quark& q )
const;
84 bool hasDown()
const {
return hasQuark( down ); }
86 bool hasUp()
const {
return hasQuark( up ); }
90 bool hasCharm()
const {
return hasQuark( charm ); }
92 bool hasBottom()
const {
return hasQuark( bottom ); }
101 int threeCharge()
const;
120 int fundamentalID()
const;
123 int extraBits()
const;
126 constexpr
std::uint32_t pows[10] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
127 return ( abspid() / pows[loc - 1] ) % 10;
136 const unsigned int i1( abspid() ), i2( o.
abspid() );
bool operator!=(const ParticleID &o) const
Non-equality operator.
size_t operator()(const Gaudi::ParticleID &s) const
constexpr unsigned short digit(const Location &loc) const
Return the digit for a given PDG ID digit location.
void setPid(const int pid)
Update the PDG ID.
Gaudi::ParticleID abs(const Gaudi::ParticleID &p)
Return the absolute value for a PID.
static std::ostream & printLocation(const long l, std::ostream &s)
Fill a stream with the PID digit enumeration.
size_t operator()(const Gaudi::ParticleID &s) const
std::ostream & fillStream(std::ostream &s) const
Fill a stream with the PID.
bool operator==(const ParticleID &o) const
Equality operator.
ParticleID(const int pid=0)
Constructor with PDG code.
bool hasTop() const
Return if the PID is a particle with a top quark.
bool operator<(const ParticleID &o) const
Comparison operator.
bool hasBottom() const
Return if the PID is a particle with a bottom quark.
bool hasUp() const
Return if the PID is a particle with an up quark.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
bool hasStrange() const
Return if the PID is a particle with a down quark.
bool hasCharm() const
Return if the PID is a particle with a charm quark.
constexpr unsigned int abspid() const
Absolute value of the PDG ID.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
static std::ostream & printQuark(const long q, std::ostream &s)
Fill a stream with the PID quark enumeration.
int pid() const
Retrieve the PDG ID.
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
Location
PDG ID digits (base 10) are: n nr nl nq1 ne2 nq3 nj.
bool hasBottomPrime() const
Return if the PID is a particle with a bottom' quark.
size_t operator()(const Gaudi::ParticleID &s) const
size_t operator()(const Gaudi::ParticleID &s) const
bool hasTopPrime() const
Return if the PID is a particle with a top' quark.
bool hasDown() const
Return if the PID is a particle with a down quark.