ATLAS Offline Software
Loading...
Searching...
No Matches
AtlasPID.h File Reference
#include <vector>
#include <cmath>
#include <algorithm>
#include <array>
#include <cstdlib>
#include <cstddef>
Include dependency graph for AtlasPID.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DecodedPID

Functions

template<typename... Ns>
constexpr bool hasAllowedNumberOfDigits (int p, Ns... digits)
template<class T>
bool isQuark (const T &p)
 PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to do this they are first ordered by family and within families by weak isospin.
template<>
bool isQuark (const int &p)
template<>
bool isQuark (const DecodedPID &p)
template<class T>
bool isSMQuark (const T &p)
template<>
bool isSMQuark (const int &p)
template<>
bool isSMQuark (const DecodedPID &p)
template<class T>
bool isStrange (const T &p)
template<>
bool isStrange (const int &p)
template<class T>
bool isCharm (const T &p)
template<>
bool isCharm (const int &p)
template<class T>
bool isBottom (const T &p)
template<>
bool isBottom (const int &p)
template<class T>
bool isTop (const T &p)
template<>
bool isTop (const int &p)
template<class T>
bool isLepton (const T &p)
 APID: the fourth generation leptons are leptons.
template<>
bool isLepton (const int &p)
template<>
bool isLepton (const DecodedPID &p)
template<class T>
bool isSMLepton (const T &p)
 APID: the fourth generation leptons are not standard model leptons.
template<>
bool isSMLepton (const int &p)
template<>
bool isSMLepton (const DecodedPID &p)
template<class T>
bool isChLepton (const T &p)
 APID: the fourth generation leptons are leptons.
template<>
bool isChLepton (const int &p)
template<class T>
bool isElectron (const T &p)
template<>
bool isElectron (const int &p)
template<class T>
bool isMuon (const T &p)
template<>
bool isMuon (const int &p)
template<class T>
bool isTau (const T &p)
template<>
bool isTau (const int &p)
template<class T>
bool isNeutrino (const T &p)
 APID: the fourth generation neutrinos are neutrinos.
template<>
bool isNeutrino (const int &p)
template<class T>
bool isSMNeutrino (const T &p)
template<>
bool isSMNeutrino (const int &p)
template<class T>
bool isFourthGeneration (const T &p)
 Is this a 4th generation fermion?
template<>
bool isFourthGeneration (const int &p)
template<class T>
bool isDiquark (const T &p)
 PDG rule 4 Diquarks have 4-digit numbers with nq1 >= nq2 and nq3 = 0 APID: states with top quarks are diquarks APID: states with fourth generation quarks are not diquarks.
template<>
bool isDiquark (const DecodedPID &p)
template<>
bool isDiquark (const int &p)
template<class T>
bool isMeson (const T &p)
 Table 43.1 PDG rule 5a: The numbers specifying the meson’s quark content conform to the convention nq1= 0 and nq2 >= nq3.
template<>
bool isMeson (const DecodedPID &p)
template<>
bool isMeson (const int &p)
template<class T>
bool isQuarkonium (const T &p)
 APID: states with s,sbar are not considered quarkonium.
template<>
bool isQuarkonium (const DecodedPID &p)
template<>
bool isQuarkonium (const int &p)
template<class T>
bool isBaryon (const T &p)
 Table 43.2 APID: states with fourth generation quarks are not baryons.
template<>
bool isBaryon (const DecodedPID &p)
template<>
bool isBaryon (const int &p)
template<class T>
bool isTetraquark (const T &p)
 PDG rule 14 The 9-digit tetra-quark codes are ±1nrnLnq1nq20nq3nq4nJ.
template<>
bool isTetraquark (const DecodedPID &p)
template<>
bool isTetraquark (const int &p)
template<class T>
bool isPentaquark (const T &p)
 PDG rule 15 The 9-digit penta-quark codes are ±1nrnLnq1nq2nq3nq4nq5nJ, sorted such that nq1≥nq2≥nq3≥nq4.
template<>
bool isPentaquark (const DecodedPID &p)
template<>
bool isPentaquark (const int &p)
template<class T>
bool isHadron (const T &p)
template<>
bool isHadron (const DecodedPID &p)
template<>
bool isHadron (const int &p)
template<class T>
bool isTrajectory (const T &p)
 PDG rule 8: The pomeron and odderon trajectories and a generic reggeon trajectory of states in QCD are assigned codes 990, 9990, and 110 respectively.
template<>
bool isTrajectory (const int &p)
template<class T>
bool isBoson (const T &p)
 PDG rule 9: Two-digit numbers in the range 21–30 are provided for the Standard Model gauge and Higgs bosons.
template<>
bool isBoson (const int &p)
template<>
bool isBoson (const DecodedPID &p)
template<class T>
bool isGluon (const T &p)
template<>
bool isGluon (const int &p)
template<class T>
bool isPhoton (const T &p)
template<>
bool isPhoton (const int &p)
template<class T>
bool isZ (const T &p)
template<>
bool isZ (const int &p)
template<class T>
bool isW (const T &p)
template<>
bool isW (const int &p)
template<class T>
bool isHeavyBoson (const T &p)
 APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier).
template<>
bool isHeavyBoson (const int &p)
template<class T>
bool isHiggs (const T &p)
 APID: HIGGS boson is only one particle.
template<>
bool isHiggs (const int &p)
template<class T>
bool isMSSMHiggs (const T &p)
 APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier).
template<>
bool isMSSMHiggs (const int &p)
template<class T>
bool isGraviton (const T &p)
template<>
bool isGraviton (const int &p)
template<class T>
bool isResonance (const T &p)
template<class T>
bool isLeptoQuark (const T &p)
 PDG rule 11c: “One-of-a-kind” exotic particles are assigned numbers in the range 41–80.
template<>
bool isLeptoQuark (const int &p)
template<class T>
bool isPythia8Specific (const T &p)
template<>
bool isPythia8Specific (const DecodedPID &p)
template<>
bool isPythia8Specific (const int &p)
template<class T>
bool isMonotopModel (const T &p)
 APID: exotic particles of the monotop model, 9000001-9000006.
template<>
bool isMonotopModel (const int &p)
template<>
bool isMonotopModel (const DecodedPID &p)
template<class T>
bool isNeutrinoRH (const T &p)
 PDG rule 12: Occasionally program authors add their own states.
template<>
bool isNeutrinoRH (const int &p)
template<class T>
bool isGenSpecific (const T &p)
 Main Table for MC internal use 81–100,901–930,998-999,1901–1930,2901–2930, and 3901–3930.
template<>
bool isGenSpecific (const int &p)
template<class T>
bool isGeantino (const T &p)
template<>
bool isGeantino (const int &p)
template<class T>
bool isGlueball (const T &p)
 PDG rule 7: The gluon, when considered as a gauge boson, has official number 21.
template<>
bool isGlueball (const DecodedPID &p)
template<>
bool isGlueball (const int &p)
template<class T>
bool isSquark (const T &p)
 PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particle number.
template<>
bool isSquark (const DecodedPID &p)
template<>
bool isSquark (const int &p)
template<class T>
bool isSquarkLH (const T &p)
template<>
bool isSquarkLH (const DecodedPID &p)
template<>
bool isSquarkLH (const int &p)
template<class T>
bool isSquarkRH (const T &p)
template<>
bool isSquarkRH (const DecodedPID &p)
template<>
bool isSquarkRH (const int &p)
template<class T>
bool isSlepton (const T &p)
template<>
bool isSlepton (const DecodedPID &p)
template<>
bool isSlepton (const int &p)
template<class T>
bool isSleptonLH (const T &p)
template<>
bool isSleptonLH (const DecodedPID &p)
template<>
bool isSleptonLH (const int &p)
template<class T>
bool isSleptonRH (const T &p)
template<>
bool isSleptonRH (const DecodedPID &p)
template<>
bool isSleptonRH (const int &p)
template<class T>
bool isGaugino (const T &p)
template<>
bool isGaugino (const DecodedPID &p)
template<>
bool isGaugino (const int &p)
template<class T>
bool isSuperpartner (const T &p)
template<>
bool isSuperpartner (const DecodedPID &p)
template<>
bool isSuperpartner (const int &p)
template<class T>
bool isTechnicolor (const T &p)
 PDG rule 11e Technicolor states have n = 3, with technifermions treated like ordinary fermions.
template<>
bool isTechnicolor (const DecodedPID &p)
template<>
bool isTechnicolor (const int &p)
template<class T>
bool isExcited (const T &p)
 PDG rule 11f Excited (composite) quarks and leptons are identified by setting n= 4 and nr= 0.
template<>
bool isExcited (const DecodedPID &p)
template<>
bool isExcited (const int &p)
template<class T>
bool isRGlueball (const T &p)
 PDG rule 11g: Within several scenarios of new physics, it is possible to have colored particles sufficiently long-lived for color-singlet hadronic states to form around them.
template<>
bool isRGlueball (const DecodedPID &p)
template<>
bool isRGlueball (const int &p)
template<class T>
bool isRMeson (const T &p)
template<>
bool isRMeson (const DecodedPID &p)
template<>
bool isRMeson (const int &p)
template<class T>
bool isRBaryon (const T &p)
template<>
bool isRBaryon (const DecodedPID &p)
template<>
bool isRBaryon (const int &p)
template<class T>
bool isRHadron (const T &p)
template<>
bool isRHadron (const DecodedPID &p)
template<>
bool isRHadron (const int &p)
template<class T>
bool hasSquark (const T &p, const int &q)
template<>
bool hasSquark (const DecodedPID &p, const int &q)
template<>
bool hasSquark (const int &p, const int &q)
template<class T>
bool isSUSY (const T &p)
template<>
bool isSUSY (const DecodedPID &p)
template<>
bool isSUSY (const int &p)
template<class T>
bool isKK (const T &p)
 PDG rule 11h A black hole in models with extra dimensions has code 5000040.
template<>
bool isKK (const DecodedPID &p)
template<>
bool isKK (const int &p)
template<class T>
bool isMonopole (const T &p)
 PDG rule 11i Magnetic monopoles and dyons are assumed to have one unit of Dirac monopole charge and a variable integer number nq1nq2 nq3 units of electric charge.
template<>
bool isMonopole (const DecodedPID &p)
template<>
bool isMonopole (const int &p)
template<class T>
bool isDM (const T &p)
 PDG rule 11j: The nature of Dark Matter (DM) is not known, and therefore a definitive classification is too early.
template<>
bool isDM (const int &p)
template<class T>
bool isHiddenValley (const T &p)
 PDG rule 11k Hidden Valley particles have n = 4 and n_r = 9, and trailing numbers in agreement with their nearest-analog standard particles, as far as possible.
template<>
bool isHiddenValley (const DecodedPID &p)
template<>
bool isHiddenValley (const int &p)
template<class T>
bool isHiddenValleyFundamental (const T &p)
template<>
bool isHiddenValleyFundamental (const DecodedPID &p)
template<>
bool isHiddenValleyFundamental (const int &p)
template<class T>
bool isGenericMultichargedParticle (const T &p)
 In addition, there is a need to identify ”Q-ball” and similar very exotic (multi-charged) particles which may have large, non-integer charge.
template<>
bool isGenericMultichargedParticle (const DecodedPID &p)
template<>
bool isGenericMultichargedParticle (const int &p)
template<class T>
bool isNucleus (const T &p)
 PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
template<>
bool isNucleus (const DecodedPID &p)
template<>
bool isNucleus (const int &p)
template<class T>
bool hasQuark (const T &p, const int &q)
template<>
bool hasQuark (const DecodedPID &p, const int &q)
template<>
bool hasQuark (const int &p, const int &q)
template<class T>
bool hasStrange (const T &p)
template<class T>
bool hasCharm (const T &p)
template<class T>
bool hasBottom (const T &p)
template<class T>
bool hasTop (const T &p)
template<class T>
int baryonNumber3 (const T &p)
template<>
int baryonNumber3 (const DecodedPID &p)
template<>
int baryonNumber3 (const int &p)
template<class T>
double baryonNumber (const T &p)
template<>
double baryonNumber (const DecodedPID &p)
template<>
double baryonNumber (const int &p)
template<class T>
int strangeness (const T &p)
template<>
int strangeness (const DecodedPID &p)
template<>
int strangeness (const int &p)
template<class T>
int numberOfLambdas (const T &p)
template<>
int numberOfLambdas (const DecodedPID &p)
template<>
int numberOfLambdas (const int &p)
template<class T>
int numberOfProtons (const T &p)
template<>
int numberOfProtons (const DecodedPID &p)
template<>
int numberOfProtons (const int &p)
template<class T>
bool isBSM (const T &p)
 APID: graviton and all Higgs extensions are BSM.
template<>
bool isBSM (const DecodedPID &p)
template<>
bool isBSM (const int &p)
template<class T>
bool isTransportable (const T &p)
template<>
bool isTransportable (const DecodedPID &p)
template<>
bool isTransportable (const int &p)
template<class T>
bool isValid (const T &p)
 AV: we implement here an ATLAS-specific convention: all particles which are 99xxxxx are fine.
template<>
bool isValid (const DecodedPID &p)
template<>
bool isValid (const int &p)
template<class T>
int leadingQuark (const T &p)
template<>
int leadingQuark (const DecodedPID &p)
template<>
int leadingQuark (const int &p)
template<class T>
bool isLightHadron (const T &p)
template<class T>
bool isHeavyHadron (const T &p)
template<class T>
bool isStrangeHadron (const T &p)
template<class T>
bool isCharmHadron (const T &p)
template<class T>
bool isBottomHadron (const T &p)
template<class T>
bool isTopHadron (const T &p)
template<class T>
bool isLightMeson (const T &p)
template<class T>
bool isHeavyMeson (const T &p)
template<class T>
bool isStrangeMeson (const T &p)
template<class T>
bool isCharmMeson (const T &p)
template<class T>
bool isBottomMeson (const T &p)
template<class T>
bool isTopMeson (const T &p)
template<class T>
bool isCCbarMeson (const T &p)
template<>
bool isCCbarMeson (const DecodedPID &p)
template<>
bool isCCbarMeson (const int &p)
template<class T>
bool isBBbarMeson (const T &p)
template<>
bool isBBbarMeson (const DecodedPID &p)
template<>
bool isBBbarMeson (const int &p)
template<class T>
bool isLightBaryon (const T &p)
template<class T>
bool isHeavyBaryon (const T &p)
template<class T>
bool isStrangeBaryon (const T &p)
template<class T>
bool isCharmBaryon (const T &p)
template<class T>
bool isBottomBaryon (const T &p)
template<class T>
bool isTopBaryon (const T &p)
template<class T>
bool isWeaklyDecayingBHadron (const T &p)
template<>
bool isWeaklyDecayingBHadron (const int &p)
template<>
bool isWeaklyDecayingBHadron (const DecodedPID &p)
template<class T>
bool isWeaklyDecayingCHadron (const T &p)
template<>
bool isWeaklyDecayingCHadron (const int &p)
template<>
bool isWeaklyDecayingCHadron (const DecodedPID &p)
template<class T>
int charge3 (const T &p)
template<class T>
double fractionalCharge (const T &p)
template<class T>
double charge (const T &p)
template<class T>
double threeCharge (const T &p)
template<class T>
bool isCharged (const T &p)
template<>
int charge3 (const DecodedPID &p)
template<>
int charge3 (const int &p)
template<class T>
bool isNeutral (const T &p)
template<>
bool isNeutral (const DecodedPID &p)
template<>
bool isNeutral (const int &p)
template<>
double fractionalCharge (const DecodedPID &p)
template<>
double fractionalCharge (const int &p)
template<class T>
bool isEMInteracting (const T &p)
template<>
bool isEMInteracting (const int &p)
template<class T>
bool isParton (const T &p)
template<class T>
int spin2 (const T &p)
template<>
int spin2 (const DecodedPID &p)
template<>
int spin2 (const int &p)
template<class T>
double spin (const T &p)
template<>
double spin (const DecodedPID &p)
template<>
double spin (const int &p)
template<class T>
std::vector< int > containedQuarks (const T &p)
template<>
std::vector< int > containedQuarks (const int &p)
template<>
std::vector< int > containedQuarks (const DecodedPID &p)
template<class T>
bool isStrongInteracting (const T &p)
template<>
bool isStrongInteracting (const int &p)

Variables

constexpr std::array< int, 9 > MIN_DIGIT = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000}
 Implementation of classification functions according to PDG2022.
constexpr std::array< int, 9 > MAX_DIGIT = {9, 99, 999, 9999, 99999, 999999, 9999999,99999999, 999999999}
static const int TABLESIZE = 100
static const std::array< int, TABLESIZE > triple_charge
static const std::array< int, TABLESIZE > double_spin
static const int DQUARK = 1
 PDG Rule 1: Particles are given positive numbers, antiparticles negative numbers.
static const int UQUARK = 2
static const int SQUARK = 3
static const int CQUARK = 4
static const int BQUARK = 5
static const int TQUARK = 6
static const int BPRIME = 7
 PDG Rule 11a: The standard fourth generation of fermions is included by analogy with the first three.
static const int TPRIME = 8
static const int QUARK_LIMIT = BPRIME
static const int ELECTRON = 11
static const int POSITRON = -ELECTRON
static const int NU_E = 12
static const int MUON = 13
static const int NU_MU = 14
static const int TAU = 15
static const int NU_TAU = 16
static const int LPRIME = 17
static const int NUPRIME = 18
static const int GLUON = 21
static const int COMPOSITEGLUON = 9
static const int PHOTON = 22
static const int Z0BOSON = 23
static const int WPLUSBOSON = 24
static const int HIGGSBOSON = 25
static const int ZPRIME = 32
static const int ZDBLPRIME = 33
static const int WPLUSPRIME = 34
static const int HIGGS2 = 35
static const int HIGGS3 = 36
static const int HIGGSPLUS = 37
static const int HIGGSPLUSPLUS = 38
static const int GRAVITON = 39
static const int HIGGS4 = 40
static const int LEPTOQUARK = 42
static const int DARKPHOTON = 60000
 PDG Ids for Mavtop madgraph UFO model found under DarkX.
static const int MAVTOP = 60001
static const int PIPLUS = 211
static const int PIMINUS = -PIPLUS
static const int PI0 = 111
static const int K0L = 130
static const int K0S = 310
static const int K0 = 311
static const int KPLUS = 321
static const int DPLUS = 411
static const int DSTAR = 413
static const int D0 = 421
static const int DSPLUS = 431
static const int JPSI = 443
static const int B0 = 511
static const int BCPLUS = 541
static const int PROTON = 2212
static const int NEUTRON = 2112
static const int LAMBDA0 = 3122
static const int LAMBDACPLUS = 4122
static const int LAMBDAB0 = 5122
static const int PSI2S = 20443
static const int RH_NU_E = 9900012
 PDG Rule 12: Occasionally program authors add their own states.
static const int RH_NU_MU = 9900014
static const int RH_NU_TAU = 9900016
static const int WBOSON_LRSM = 9900024
static const int LEAD = 1000822080
static const int INDIUM = 1000491150
static const int KRYPTON = 1000360840
static const int CALCIUM = 1000200400
static const int ARGON = 1000180400
static const int MAGNESIUM = 1000120240
static const int NEON = 1000100200
static const int OXYGEN = 1000080160
static const int BORON = 1000050110
static const int HELIUM = 1000020040
static const int POMERON = 990
 PDG rule 8: The pomeron and odderon trajectories and a generic reggeon trajectory of states in QCD are assigned codes 990, 9990, and 110 respectively.
static const int ODDERON = 9990
static const int REGGEON = 110
static const int GEANTINOPLUS = 998
 PDG rule 10: Codes 81–100 are reserved for generator-specific pseudoparticles and concepts.
static const int GEANTINO0 = 999
static const std::array< int, 10 > is_strange

Function Documentation

◆ baryonNumber() [1/3]

template<>
double baryonNumber ( const DecodedPID & p)
inline

Definition at line 824 of file AtlasPID.h.

824{ return static_cast<double>(baryonNumber3(p))/3.0;}
int baryonNumber3(const T &p)
Definition AtlasPID.h:798

◆ baryonNumber() [2/3]

template<>
double baryonNumber ( const int & p)
inline

Definition at line 825 of file AtlasPID.h.

825{ auto value_digits = DecodedPID(p); return static_cast<double>(baryonNumber3(value_digits))/3.0;}

◆ baryonNumber() [3/3]

template<class T>
double baryonNumber ( const T & p)
inline

Definition at line 823 of file AtlasPID.h.

823{return baryonNumber(p->pdg_id());}
double baryonNumber(const T &p)
Definition AtlasPID.h:823

◆ baryonNumber3() [1/3]

template<>
int baryonNumber3 ( const DecodedPID & p)
inline

Definition at line 799 of file AtlasPID.h.

799 {
800 if (isQuark(p.pid())) { return (p.pid() > 0) ? 1 : - 1;}
801 if (isDiquark(p)) { return (p.pid() > 0) ? 2 : -2; }
802 if (isMeson(p) || isTetraquark(p)) { return 0; }
803 if (isBaryon(p) || isPentaquark(p)){ return (p.pid() > 0) ? 3 : -3; }
804 if (isNucleus(p)) {
805 const int result = 3*p(8) + 30*p(7) + 300*p(6);
806 return (p.pid() > 0) ? result : -result;
807 }
808 if (isSUSY(p)) {
809 auto pp = p.shift(1);
810 if (pp.ndigits() < 3 ) { return baryonNumber3(pp); } // super-partners of fundamental particles
811 if (pp(0) == COMPOSITEGLUON) {
812 if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
813 if ( pp.ndigits() == 4 ) { return 0; } // states with gluino-quark-antiquark
814 if ( pp.ndigits() == 5) { return (p.pid() > 0) ? 3 : -3; } // states with gluino-quark-quark-quark
815 }
816 if (pp.ndigits() == 3) { return 0; } // squark-antiquark
817 if (pp.ndigits() == 4) { return (p.pid() > 0) ? 3 : -3; } // states with squark-quark-quark
818 }
819 return 0;
820}
bool isPentaquark(const T &p)
PDG rule 15 The 9-digit penta-quark codes are ±1nrnLnq1nq2nq3nq4nq5nJ, sorted such that nq1≥nq2≥nq3≥n...
Definition AtlasPID.h:365
bool isTetraquark(const T &p)
PDG rule 14 The 9-digit tetra-quark codes are ±1nrnLnq1nq20nq3nq4nJ.
Definition AtlasPID.h:348
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to do ...
Definition AtlasPID.h:188
bool isMeson(const T &p)
Table 43.1 PDG rule 5a: The numbers specifying the meson’s quark content conform to the convention nq...
Definition AtlasPID.h:271
bool isDiquark(const T &p)
PDG rule 4 Diquarks have 4-digit numbers with nq1 >= nq2 and nq3 = 0 APID: states with top quarks are...
Definition AtlasPID.h:248
static const int COMPOSITEGLUON
Definition AtlasPID.h:99
bool isSUSY(const T &p)
Definition AtlasPID.h:662
bool isBaryon(const T &p)
Table 43.2 APID: states with fourth generation quarks are not baryons.
Definition AtlasPID.h:305
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
Definition AtlasPID.h:751

◆ baryonNumber3() [2/3]

template<>
int baryonNumber3 ( const int & p)
inline

Definition at line 821 of file AtlasPID.h.

821{ auto value_digits = DecodedPID(p); return baryonNumber3(value_digits);}

◆ baryonNumber3() [3/3]

template<class T>
int baryonNumber3 ( const T & p)
inline

Definition at line 798 of file AtlasPID.h.

798{return baryonNumber3(p->pdg_id());}

◆ charge()

template<class T>
double charge ( const T & p)
inline

Definition at line 1043 of file AtlasPID.h.

1043 {
1044 if (isGenericMultichargedParticle(p)) // BSM multi-charged particles might have a fractional charge that's not a multiple of 1/3
1045 return fractionalCharge(p);
1046 else
1047 return 1.0*charge3(p)/3.0;
1048}
int charge3(const T &p)
Definition AtlasPID.h:1041
double fractionalCharge(const T &p)
Definition AtlasPID.h:1042
bool isGenericMultichargedParticle(const T &p)
In addition, there is a need to identify ”Q-ball” and similar very exotic (multi-charged) particles w...
Definition AtlasPID.h:733

◆ charge3() [1/3]

template<>
int charge3 ( const DecodedPID & p)
inline

Codes 411nq1nq2 nq3 0 are then used when the magnetic and electrical charge sign agree and 412nq1nq2 nq3 0 when they disagree, with the overall sign of the particle set by the magnetic charge.

Definition at line 1053 of file AtlasPID.h.

1053 {
1054 auto ap = std::abs(p.pid());
1055 if (ap < TABLESIZE ) return p.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
1056 if (ap == K0) return 0;
1057 if (ap == GEANTINO0) return 0;
1058 if (ap == GEANTINOPLUS) return p.pid() > 0 ? 3 : -3;
1059 if (ap == MAVTOP) return p.pid() > 0 ? 2 : -2;
1060 size_t nq = 0;
1061 int sign = 1;
1062 int signmult = 1;
1063 int result=0;
1064 bool classified = false;
1065 if (!classified && isMeson(p)) { classified = true; nq = 2; if ((*(p.second.rbegin()+2)) == 2||(*(p.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
1066 if (!classified && isDiquark(p)) {return triple_charge.at(p(0))+triple_charge.at(p(1)); }
1067 if (!classified && isBaryon(p)) { classified = true; nq = 3; }
1068 if (!classified && isTetraquark(p)){ return triple_charge.at(p(3)) + triple_charge.at(p(4)) - triple_charge.at(p(6)) - triple_charge.at(p(7)); }
1069 if (!classified && isPentaquark(p)){ return triple_charge.at(p(3)) + triple_charge.at(p(4)) + triple_charge.at(p(5)) + triple_charge.at(p(6)) - triple_charge.at(p(7)); }
1070 if (!classified && isNucleus(p)) { return 3*numberOfProtons(p);}
1071 if (!classified && isSUSY(p)) {
1072 nq = 0;
1073 auto pp = p.shift(1);
1074 if (pp.ndigits() < 3 ) { return charge3(pp); } // super-partners of fundamental particles
1075 if (pp(0) == COMPOSITEGLUON) {
1076 if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
1077 if ( pp.ndigits() == 4 || pp.ndigits() == 5) {
1078 pp = pp.shift(1); // Remove gluino
1079 }
1080 }
1081 if (pp.ndigits() == 3) { classified = true; nq = 2; if (p.last()%2==0) {sign = -1;} signmult = -1; } // states with squark-antiquark or quark-anti-quark
1082 if (pp.ndigits() == 4) { classified = true; nq = 3; } // states with squark-quark-quark or quark-quark-quark
1083 }
1084 if (!classified && isHiddenValley(p)) { // Hidden Valley particles
1085 auto pp = p.shift(2);
1086 if (!classified && isMeson(pp)) { classified = true; nq = 2; if ((*(pp.second.rbegin()+2)) == 2||(*(pp.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
1087 if (!classified && isDiquark(pp)) {return triple_charge.at(pp(0))+triple_charge.at(pp(1)); }
1088 if (!classified && isBaryon(pp)) { classified = true; nq = 3; }
1089 }
1090 if (!classified && isExcited(p)) { //Excited/composite leptons/quarks
1091 auto pp = p.shift(2);
1092 auto ap = std::abs(pp.pid());
1093 if (ap < TABLESIZE ) return pp.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
1094 }
1095 if (!classified && isKK(p)) { // Kaluza-Klein particles
1096 auto pp = p.shift(2);
1097 auto ap = std::abs(pp.pid());
1098 if (ap < TABLESIZE ) return pp.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
1099
1100 }
1101 if (!classified && isDM(p.pid())) { //Dark Matter Particles
1102 if (p.ndigits() == 7){ // Determining the charges for the more elaborate, 7-digit DM codes
1103 auto pp = p.shift(3); // The first two digits indicate the particle is DM, the third indicates left/right-handedness (see 11(j))
1104 auto ap = std::abs(pp.pid());
1105 if (ap < TABLESIZE ) return pp.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
1106 }else if (std::abs(p.pid()) < TABLESIZE) return p.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap); // Just to make sure the correct charge is returned for DM 51-60
1107 }
1108 if (!classified && isMonopole(p)) {
1111 result = 3*(p(3)*100 + p(4)*10 + p(5));
1112 return ( (p.pid() > 0 && p(2) == 1) || (p.pid() < 0 && p(2) == 2) ) ? result : -result;
1113 }
1114 if (!classified && isGenericMultichargedParticle(p)) {
1115 double abs_charge = 0.0;
1116 if (p(0) == 1) abs_charge = p(3)*100. + p(4)*10. + p(5)*1 + p(6)*0.1; // multi-charged particle PDG ID is +/-100XXXY0, where the charge is XXX.Y
1117 if (p(0) == 2) abs_charge = (p(3)*10. + p(4))/(p(5)*10.0 + p(6)); // multi-charged particle PDG ID is +/-200XXYY0, where the charge is XX/YY
1118 int abs_threecharge = static_cast<int>(std::round(abs_charge * 3.)); // the multi-charged particles might have a fractional charge that's not a multiple of 1/3, in that case round to the closest multiple of 1/3 for charge3 and threecharge
1119 return p.pid() > 0 ? abs_threecharge : -1 * abs_threecharge;
1120 }
1121 for (auto r = p.second.rbegin() + 1; r != p.second.rbegin() + 1 + nq; ++r) {
1122 result += triple_charge.at(*r)*sign;
1123 sign*=signmult;
1124 }
1125 return p.pid() > 0 ? result : -result;
1126}
int numberOfProtons(const T &p)
Definition AtlasPID.h:883
static const int TABLESIZE
Definition AtlasPID.h:43
static const int K0
Definition AtlasPID.h:128
static const int MAVTOP
Definition AtlasPID.h:120
bool isExcited(const T &p)
PDG rule 11f Excited (composite) quarks and leptons are identified by setting n= 4 and nr= 0.
Definition AtlasPID.h:575
static const std::array< int, TABLESIZE > triple_charge
Definition AtlasPID.h:44
bool isMonopole(const T &p)
PDG rule 11i Magnetic monopoles and dyons are assumed to have one unit of Dirac monopole charge and a...
Definition AtlasPID.h:684
bool isHiddenValley(const T &p)
PDG rule 11k Hidden Valley particles have n = 4 and n_r = 9, and trailing numbers in agreement with t...
Definition AtlasPID.h:707
static const int GEANTINOPLUS
PDG rule 10: Codes 81–100 are reserved for generator-specific pseudoparticles and concepts.
Definition AtlasPID.h:179
static const int GEANTINO0
Definition AtlasPID.h:180
bool isKK(const T &p)
PDG rule 11h A black hole in models with extra dimensions has code 5000040.
Definition AtlasPID.h:674
bool isDM(const T &p)
PDG rule 11j: The nature of Dark Matter (DM) is not known, and therefore a definitive classification ...
Definition AtlasPID.h:697
int sign(int a)
int r
Definition globals.cxx:22

◆ charge3() [2/3]

template<>
int charge3 ( const int & p)
inline

Definition at line 1127 of file AtlasPID.h.

1127 {
1128 int ap = std::abs(p);
1129 if (ap < TABLESIZE) return p > 0 ? triple_charge.at(ap):-triple_charge.at(ap);
1130 auto value_digits = DecodedPID(p);
1131 return charge3(value_digits);
1132}

◆ charge3() [3/3]

template<class T>
int charge3 ( const T & p)
inline

Definition at line 1041 of file AtlasPID.h.

1041{return charge3(p->pdg_id());}

◆ containedQuarks() [1/3]

template<>
std::vector< int > containedQuarks ( const DecodedPID & p)
inline

Definition at line 1226 of file AtlasPID.h.

1226{ return containedQuarks(p.pid()); }
std::vector< int > containedQuarks(const T &p)
Definition AtlasPID.h:1203

◆ containedQuarks() [2/3]

template<>
std::vector< int > containedQuarks ( const int & p)
inline

Definition at line 1204 of file AtlasPID.h.

1204 {
1205 auto pp = DecodedPID(p);
1206 std::vector<int> quarks;
1207 if (isQuark(pp.pid())) { quarks.push_back(std::abs(pp.pid())); }
1208 else if (isDiquark(pp)) { quarks.push_back(pp(0)); quarks.push_back(pp(1)); }
1209 else if (isMeson(pp)) { quarks.push_back(*(pp.second.rbegin() + 1)); quarks.push_back(*(pp.second.rbegin()+2)); }
1210 else if (isBaryon(pp)) { for (size_t digit = 1; digit < 4; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1211 else if (isTetraquark(pp)) { for (size_t digit = 1; digit < 5; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1212 else if (isPentaquark(pp)) { for (size_t digit = 1; digit < 6; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1213 else if (isNucleus(pp)) { const int A = std::abs(baryonNumber3(pp)/3); const int Z = std::abs(numberOfProtons(pp)); const int L = std::abs(numberOfLambdas(pp));
1214 const int n_uquarks = A + Z; const int n_dquarks = 2*A - Z - L; const int n_squarks = L;
1215 quarks.reserve(3*A); quarks.insert(quarks.end(), n_dquarks, 1); quarks.insert(quarks.end(), n_uquarks, 2); quarks.insert(quarks.end(), n_squarks, 3); }
1216 else if (isSUSY(pp)) { // APID SUSY case
1217 pp = pp.shift(1);
1218 if ( pp.ndigits() > 1 ) { // skip squarks
1219 if ( pp.ndigits() == 3 ) { pp = DecodedPID(pp(1)); } // Handle ~q qbar pairs
1220 if ( pp.ndigits() > 3 ) { pp = pp.shift(1); } // Drop gluinos and squarks
1221 return containedQuarks(pp.pid());
1222 }
1223 }
1224 return quarks;
1225}
int numberOfLambdas(const T &p)
Definition AtlasPID.h:874
hold the test vectors and ease the comparison

◆ containedQuarks() [3/3]

template<class T>
std::vector< int > containedQuarks ( const T & p)
inline

Definition at line 1203 of file AtlasPID.h.

1203{ return containedQuarks(p->pdg_id()); }

◆ fractionalCharge() [1/3]

template<>
double fractionalCharge ( const DecodedPID & p)
inline

Definition at line 1140 of file AtlasPID.h.

1140 {
1141 if(!isGenericMultichargedParticle(p)) return 1.0*charge3(p)/3.0; // this method is written for multi-charged particles, still make sure other cases are handled properly
1142 double abs_charge = 0;
1143 if (p(0) == 1) abs_charge = p(3)*100. + p(4)*10. + p(5)*1 + p(6)*0.1; // multi-charged particle PDG ID is +/-100XXXY0, where the charge is XXX.Y
1144 if (p(0) == 2) abs_charge = (p(3)*10. + p(4))/(p(5)*10.0 + p(6)); // multi-charged particle PDG ID is +/-200XXYY0, where the charge is XX/YY
1145 return p.pid() > 0 ? abs_charge : -1 * abs_charge;
1146}

◆ fractionalCharge() [2/3]

template<>
double fractionalCharge ( const int & p)
inline

Definition at line 1147 of file AtlasPID.h.

1147{auto value_digits = DecodedPID(p); return fractionalCharge(value_digits);}

◆ fractionalCharge() [3/3]

template<class T>
double fractionalCharge ( const T & p)
inline

Definition at line 1042 of file AtlasPID.h.

1042{return fractionalCharge(p->pdg_id());}

◆ hasAllowedNumberOfDigits()

template<typename... Ns>
bool hasAllowedNumberOfDigits ( int p,
Ns... digits )
constexpr

Definition at line 20 of file AtlasPID.h.

20 {
21 return ((std::abs(p) >= MIN_DIGIT[digits - 1] && std::abs(p) <= MAX_DIGIT[digits - 1]) || ...);
22}
constexpr std::array< int, 9 > MAX_DIGIT
Definition AtlasPID.h:18
constexpr std::array< int, 9 > MIN_DIGIT
Implementation of classification functions according to PDG2022.
Definition AtlasPID.h:17

◆ hasBottom()

template<class T>
bool hasBottom ( const T & p)
inline

Definition at line 788 of file AtlasPID.h.

788{ return hasQuark(p,BQUARK); }
static const int BQUARK
Definition AtlasPID.h:79
bool hasQuark(const T &p, const int &q)

◆ hasCharm()

template<class T>
bool hasCharm ( const T & p)
inline

Definition at line 787 of file AtlasPID.h.

787{ return hasQuark(p,CQUARK); }
static const int CQUARK
Definition AtlasPID.h:78

◆ hasQuark() [1/3]

template<>
bool hasQuark ( const DecodedPID & p,
const int & q )
inline

Definition at line 766 of file AtlasPID.h.

766 {
767 if (isQuark(p.pid())) { return (std::abs(p.pid()) == q );}
768 if (isMeson(p)) { return *(p.second.rbegin() + 1) == q ||*(p.second.rbegin()+2) ==q;}
769 if (isDiquark(p)) { auto i = std::find(p.second.rbegin() + 2,p.second.rbegin()+4,q); return (i!=p.second.rbegin()+4);}
770 if (isBaryon(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+4,q); return (i!=p.second.rbegin()+4);}
771 if (isTetraquark(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+5,q); return (i!=p.second.rbegin()+5);}
772 if (isPentaquark(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+6,q); return (i!=p.second.rbegin()+6);}
773 if (isNucleus(p) && std::abs(p.pid()) != PROTON) { return (q == 1 || q == 2 || (q==3 && p(2) > 0));}
774 if (isSUSY(p)) { // APID SUSY case
775 auto pp = p.shift(1);
776 if ( pp.ndigits() == 1 ) { return false; } // Handle squarks
777 if ( pp.ndigits() == 3 ) { return (pp(1) == q); } // Handle ~q qbar pairs
778 if ( pp.ndigits() == 4 ) { return (pp(1) == q || pp(2) == q); } // Ignore gluinos and squarks
779 if ( pp.ndigits() == 5 ) { return (pp(1) == q || pp(2) == q || pp(3) == q); } // Ignore gluinos and squarks
780 if ( pp.ndigits() > 5 ) { pp = pp.shift(1); } // Drop gluinos and squarks
781 return hasQuark(pp, q); }
782 return false;
783}
static const int PROTON
Definition AtlasPID.h:137

◆ hasQuark() [2/3]

template<>
bool hasQuark ( const int & p,
const int & q )
inline

Definition at line 784 of file AtlasPID.h.

784{ auto value_digits = DecodedPID(p); return hasQuark(value_digits, q);}

◆ hasQuark() [3/3]

template<class T>
bool hasQuark ( const T & p,
const int & q )
inline

◆ hasSquark() [1/3]

template<>
bool hasSquark ( const DecodedPID & p,
const int & q )
inline

Definition at line 650 of file AtlasPID.h.

650 {
651 auto pp = p.shift(1); return (
652 (isSquark(p) || isRHadron(p))
653 && pp.ndigits() != 2 // skip lepton and boson super-partners by vetoing ndigits==2
654 && pp(0) == q // After shifting, the first digit will always represent the squark in R-Hadron (and squark) PIDs
655 );
656}
bool isSquark(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition AtlasPID.h:497
bool isRHadron(const T &p)
Definition AtlasPID.h:642

◆ hasSquark() [2/3]

template<>
bool hasSquark ( const int & p,
const int & q )
inline

Definition at line 657 of file AtlasPID.h.

657{ auto value_digits = DecodedPID(p); return hasSquark(value_digits, q);}
bool hasSquark(const T &p, const int &q)
Definition AtlasPID.h:649

◆ hasSquark() [3/3]

template<class T>
bool hasSquark ( const T & p,
const int & q )
inline

Definition at line 649 of file AtlasPID.h.

649{ return hasSquark(p->pdg_id(), q); }

◆ hasStrange()

template<class T>
bool hasStrange ( const T & p)
inline

Definition at line 786 of file AtlasPID.h.

786{ return hasQuark(p,SQUARK); }
static const int SQUARK
Definition AtlasPID.h:77

◆ hasTop()

template<class T>
bool hasTop ( const T & p)
inline

Definition at line 789 of file AtlasPID.h.

789{ return hasQuark(p,TQUARK); }
static const int TQUARK
Definition AtlasPID.h:80

◆ isBaryon() [1/3]

template<>
bool isBaryon ( const DecodedPID & p)
inline

Definition at line 306 of file AtlasPID.h.

306 {
307 if (p.ndigits() < 4 ) return false;
308 if (p.max_digit(1,4) >= QUARK_LIMIT ) return false; // Ignore pdg_ids which would describe states including fourth generation quarks
309 if (p.min_digit(1,4) == 0) return false; // Ignore pdg_ids with zero for nq1, nq2, nq3
310 if (p.ndigits() == 4 && (p.last() == 2 || p.last() == 4|| p.last() == 6|| p.last() == 8) ) return true;
311
312 if (p.ndigits() == 5 && p(0) == 1 && (p.last() == 2 || p.last() == 4) ) return true;
313 if (p.ndigits() == 5 && p(0) == 3 && (p.last() == 2 || p.last() == 4) ) return true;
314
315 if (p.ndigits() == 6 ) {
316 if (p(0) == 1 && p(1) == 0 && p.last() == 2 ) return true;
317 if (p(0) == 1 && p(1) == 0 && p.last() == 4 ) return true;
318 if (p(0) == 1 && p(1) == 0 && p.last() == 6 ) return true;
319 if (p(0) == 1 && p(1) == 1 && p.last() == 2 ) return true;
320 if (p(0) == 1 && p(1) == 2 && p.last() == 4 ) return true;
321
322 if (p(0) == 2 && p(1) == 0 && p.last() == 2 ) return true;
323 if (p(0) == 2 && p(1) == 0 && p.last() == 4 ) return true;
324 if (p(0) == 2 && p(1) == 0 && p.last() == 6 ) return true;
325 if (p(0) == 2 && p(1) == 0 && p.last() == 8 ) return true;
326 if (p(0) == 2 && p(1) == 1 && p.last() == 2 ) return true;
327 }
328
329 if (p.ndigits() == 5 ) {
330 if (p(0) == 2 && p.last() == 2 ) return true;
331 if (p(0) == 2 && p.last() == 4 ) return true;
332 if (p(0) == 2 && p.last() == 6 ) return true;
333 if (p(0) == 5 && p.last() == 2 ) return true;
334 if (p(0) == 1 && p.last() == 6 ) return true;
335 if (p(0) == 4 && p.last() == 2 ) return true;
336 }
337 return false;
338}
static const int QUARK_LIMIT
Definition AtlasPID.h:85

◆ isBaryon() [2/3]

template<>
bool isBaryon ( const int & p)
inline

Definition at line 339 of file AtlasPID.h.

339{if (!hasAllowedNumberOfDigits(p,4,5,6)) return false; auto value_digits = DecodedPID(p); return isBaryon(value_digits);}
constexpr bool hasAllowedNumberOfDigits(int p, Ns... digits)
Definition AtlasPID.h:20

◆ isBaryon() [3/3]

template<class T>
bool isBaryon ( const T & p)
inline

Table 43.2 APID: states with fourth generation quarks are not baryons.

Definition at line 305 of file AtlasPID.h.

305{return isBaryon(p->pdg_id());}

◆ isBBbarMeson() [1/3]

template<>
bool isBBbarMeson ( const DecodedPID & p)
inline

Definition at line 978 of file AtlasPID.h.

978{ return leadingQuark(p) == BQUARK && isMeson(p) && (*(p.second.rbegin()+2)) == BQUARK && (*(p.second.rbegin()+1)) == BQUARK; }
int leadingQuark(const T &p)
Definition AtlasPID.h:940

◆ isBBbarMeson() [2/3]

template<>
bool isBBbarMeson ( const int & p)
inline

Definition at line 979 of file AtlasPID.h.

979{ return isBBbarMeson(DecodedPID(p)); }
bool isBBbarMeson(const T &p)
Definition AtlasPID.h:977

◆ isBBbarMeson() [3/3]

template<class T>
bool isBBbarMeson ( const T & p)
inline

Definition at line 977 of file AtlasPID.h.

977{ return isBBbarMeson(p->pdg_id());}

◆ isBoson() [1/3]

template<>
bool isBoson ( const DecodedPID & p)
inline

Definition at line 394 of file AtlasPID.h.

394{ return isBoson(p.pid()); }
bool isBoson(const T &p)
PDG rule 9: Two-digit numbers in the range 21–30 are provided for the Standard Model gauge and Higgs ...
Definition AtlasPID.h:392

◆ isBoson() [2/3]

template<>
bool isBoson ( const int & p)
inline

Definition at line 393 of file AtlasPID.h.

393{ auto sp = std::abs(p); return sp > 20 && sp < 41; }
static Double_t sp

◆ isBoson() [3/3]

template<class T>
bool isBoson ( const T & p)
inline

PDG rule 9: Two-digit numbers in the range 21–30 are provided for the Standard Model gauge and Higgs bosons.

PDG rule 11b: The graviton and the boson content of a two-Higgs-doublet scenario and of additional SU(2)×U(1) groups are found in the range 31–40.

Definition at line 392 of file AtlasPID.h.

392{return isBoson(p->pdg_id());}

◆ isBottom() [1/2]

template<>
bool isBottom ( const int & p)
inline

Definition at line 204 of file AtlasPID.h.

204{ return std::abs(p) == BQUARK;}

◆ isBottom() [2/2]

template<class T>
bool isBottom ( const T & p)
inline

Definition at line 203 of file AtlasPID.h.

203{return isBottom(p->pdg_id());}
bool isBottom(const T &p)
Definition AtlasPID.h:203

◆ isBottomBaryon()

template<class T>
bool isBottomBaryon ( const T & p)
inline

Definition at line 986 of file AtlasPID.h.

986{ return leadingQuark(p) == BQUARK && isBaryon(p); }

◆ isBottomHadron()

template<class T>
bool isBottomHadron ( const T & p)
inline

Definition at line 963 of file AtlasPID.h.

963{ return leadingQuark(p) == BQUARK && isHadron(p); }
bool isHadron(const T &p)
Definition AtlasPID.h:374

◆ isBottomMeson()

template<class T>
bool isBottomMeson ( const T & p)
inline

Definition at line 970 of file AtlasPID.h.

970{ return leadingQuark(p) == BQUARK && isMeson(p); }

◆ isBSM() [1/3]

template<>
bool isBSM ( const DecodedPID & p)
inline

Definition at line 897 of file AtlasPID.h.

897 {
898 if (p.pid() == GRAVITON || std::abs(p.pid()) == MAVTOP || p.pid() == DARKPHOTON) return true;
899 if (std::abs(p.pid()) > 16 && std::abs(p.pid()) < 19) return true;
900 if (std::abs(p.pid()) > 31 && std::abs(p.pid()) < 39) return true;
901 if (std::abs(p.pid()) > 39 && std::abs(p.pid()) < 81) return true;
902 if (std::abs(p.pid()) > 6 && std::abs(p.pid()) < 9) return true;
903 if (isSUSY(p)) return true;
904 if (isNeutrinoRH(p.pid())) return true;
905 if (isGenericMultichargedParticle(p)) return true;
906 if (isTechnicolor(p)) return true;
907 if (isExcited(p)) return true;
908 if (isKK(p)) return true;
909 if (isHiddenValley(p)) return true;
910 if (isMonopole(p)) return true;
911 if (isDM(p.pid())) return true;
912 return false;
913}
static const int GRAVITON
Definition AtlasPID.h:111
bool isTechnicolor(const T &p)
PDG rule 11e Technicolor states have n = 3, with technifermions treated like ordinary fermions.
Definition AtlasPID.h:563
bool isNeutrinoRH(const T &p)
PDG rule 12: Occasionally program authors add their own states.
Definition AtlasPID.h:456
static const int DARKPHOTON
PDG Ids for Mavtop madgraph UFO model found under DarkX.
Definition AtlasPID.h:119

◆ isBSM() [2/3]

template<>
bool isBSM ( const int & p)
inline

Definition at line 914 of file AtlasPID.h.

914 {
915 if (p == GRAVITON || std::abs(p) == MAVTOP || p == DARKPHOTON) return true;
916 if (std::abs(p) > 16 && std::abs(p) < 19) return true;
917 if (std::abs(p) > 31 && std::abs(p) < 38) return true;
918 if (std::abs(p) > 39 && std::abs(p) < 81) return true;
919 if (std::abs(p) > 6 && std::abs(p) < 9) return true;
920 auto value_digits = DecodedPID(p); return isBSM(value_digits);
921}
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition AtlasPID.h:896

◆ isBSM() [3/3]

template<class T>
bool isBSM ( const T & p)
inline

APID: graviton and all Higgs extensions are BSM.

Definition at line 896 of file AtlasPID.h.

896{return isBSM(p->pdg_id());}

◆ isCCbarMeson() [1/3]

template<>
bool isCCbarMeson ( const DecodedPID & p)
inline

Definition at line 974 of file AtlasPID.h.

974{ return leadingQuark(p) == CQUARK && isMeson(p) && (*(p.second.rbegin()+2)) == CQUARK && (*(p.second.rbegin()+1)) == CQUARK; }

◆ isCCbarMeson() [2/3]

template<>
bool isCCbarMeson ( const int & p)
inline

Definition at line 975 of file AtlasPID.h.

975{ return isCCbarMeson(DecodedPID(p)); }
bool isCCbarMeson(const T &p)
Definition AtlasPID.h:973

◆ isCCbarMeson() [3/3]

template<class T>
bool isCCbarMeson ( const T & p)
inline

Definition at line 973 of file AtlasPID.h.

973{ return isCCbarMeson(p->pdg_id());}

◆ isCharged()

template<class T>
bool isCharged ( const T & p)
inline

Definition at line 1050 of file AtlasPID.h.

1050{ return charge3(p) != 0;}

◆ isCharm() [1/2]

template<>
bool isCharm ( const int & p)
inline

Definition at line 201 of file AtlasPID.h.

201{ return std::abs(p) == CQUARK;}

◆ isCharm() [2/2]

template<class T>
bool isCharm ( const T & p)
inline

Definition at line 200 of file AtlasPID.h.

200{return isCharm(p->pdg_id());}
bool isCharm(const T &p)
Definition AtlasPID.h:200

◆ isCharmBaryon()

template<class T>
bool isCharmBaryon ( const T & p)
inline

Definition at line 985 of file AtlasPID.h.

985{ return leadingQuark(p) == CQUARK && isBaryon(p); }

◆ isCharmHadron()

template<class T>
bool isCharmHadron ( const T & p)
inline

Definition at line 962 of file AtlasPID.h.

962{ return leadingQuark(p) == CQUARK && isHadron(p); }

◆ isCharmMeson()

template<class T>
bool isCharmMeson ( const T & p)
inline

Definition at line 969 of file AtlasPID.h.

969{ return leadingQuark(p) == CQUARK && isMeson(p); }

◆ isChLepton() [1/2]

template<>
bool isChLepton ( const int & p)
inline

Definition at line 221 of file AtlasPID.h.

221{ auto sp = std::abs(p); return sp >= ELECTRON && sp <= LPRIME && sp%2 == 1; }
static const int ELECTRON
Definition AtlasPID.h:87
static const int LPRIME
Definition AtlasPID.h:94

◆ isChLepton() [2/2]

template<class T>
bool isChLepton ( const T & p)
inline

APID: the fourth generation leptons are leptons.

Definition at line 220 of file AtlasPID.h.

220{return isChLepton(p->pdg_id());}
bool isChLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition AtlasPID.h:220

◆ isDiquark() [1/3]

template<>
bool isDiquark ( const DecodedPID & p)
inline

Definition at line 249 of file AtlasPID.h.

249 {
250 if ( p.ndigits() == 4 && p(0) >= p(1) && p(1) != 0 && p(2) == 0 && (p.last() == 1 || p.last() == 3)
251 && p.max_digit(2,4) < QUARK_LIMIT
252 ) return true;
253 return false;
254}

◆ isDiquark() [2/3]

template<>
bool isDiquark ( const int & p)
inline

Definition at line 255 of file AtlasPID.h.

255{ if (!hasAllowedNumberOfDigits(p,4)) return false; auto value_digits = DecodedPID(p); return isDiquark(value_digits);}

◆ isDiquark() [3/3]

template<class T>
bool isDiquark ( const T & p)
inline

PDG rule 4 Diquarks have 4-digit numbers with nq1 >= nq2 and nq3 = 0 APID: states with top quarks are diquarks APID: states with fourth generation quarks are not diquarks.

Definition at line 248 of file AtlasPID.h.

248{return isDiquark(p->pdg_id());}

◆ isDM() [1/2]

template<>
bool isDM ( const int & p)
inline

Definition at line 698 of file AtlasPID.h.

698 {
699 auto sp = std::abs(p);
700 auto value_digits = DecodedPID(p);
701 return (sp >= 51 && sp <= 60) || (value_digits.ndigits() == 7 && value_digits(0) == 5 && value_digits(1) == 9) || sp == DARKPHOTON; }

◆ isDM() [2/2]

template<class T>
bool isDM ( const T & p)
inline

PDG rule 11j: The nature of Dark Matter (DM) is not known, and therefore a definitive classification is too early.

Candidates within specific scenarios are classified therein, such as 1000022 for the lightest neutralino. Generic fundamental states can be given temporary codes in the range 51 - 60, with 51, 52 and 53 reserved for spin 0, 1/2 and 1 ones (this could also be an axion state). Generic mediators of s-channel DM pair creation of annihilation can be given codes 54 and 55 for spin 0 or 1 ones. Separate antiparticles, with negative codes, may or may not exist. More elaborate new scenarios should be constructed with n= 5 and nr = 9.

Definition at line 697 of file AtlasPID.h.

697{return isDM(p->pdg_id());}

◆ isElectron() [1/2]

template<>
bool isElectron ( const int & p)
inline

Definition at line 224 of file AtlasPID.h.

224{ return std::abs(p) == ELECTRON;}

◆ isElectron() [2/2]

template<class T>
bool isElectron ( const T & p)
inline

Definition at line 223 of file AtlasPID.h.

223{return isElectron(p->pdg_id());}
bool isElectron(const T &p)
Definition AtlasPID.h:223

◆ isEMInteracting() [1/2]

template<>
bool isEMInteracting ( const int & p)
inline

Definition at line 1151 of file AtlasPID.h.

1151{return (isPhoton(p) || isZ(p) || p == ZPRIME || p == ZDBLPRIME || std::abs(charge(p))>std::numeric_limits<double>::epsilon() || isMonopole(p));}
static const int ZDBLPRIME
Definition AtlasPID.h:105
static const int ZPRIME
Definition AtlasPID.h:104
double charge(const T &p)
Definition AtlasPID.h:1043
bool isZ(const T &p)
Definition AtlasPID.h:402
bool isPhoton(const T &p)
Definition AtlasPID.h:399

◆ isEMInteracting() [2/2]

template<class T>
bool isEMInteracting ( const T & p)
inline

Definition at line 1150 of file AtlasPID.h.

1150{return isEMInteracting(p->pdg_id());}
bool isEMInteracting(const T &p)
Definition AtlasPID.h:1150

◆ isExcited() [1/3]

template<>
bool isExcited ( const DecodedPID & p)
inline

Definition at line 577 of file AtlasPID.h.

577 {
578 const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
579 return (p.ndigits() == 7 && (p(0) == 4 && p(1) == 0) &&
580 (isLepton(pp) || isQuark(pp)));
581}
bool isLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition AtlasPID.h:210

◆ isExcited() [2/3]

template<>
bool isExcited ( const int & p)
inline

Definition at line 582 of file AtlasPID.h.

582{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isExcited(value_digits);}

◆ isExcited() [3/3]

template<class T>
bool isExcited ( const T & p)
inline

PDG rule 11f Excited (composite) quarks and leptons are identified by setting n= 4 and nr= 0.

Definition at line 575 of file AtlasPID.h.

575{return isExcited(p->pdg_id());}

◆ isFourthGeneration() [1/2]

template<>
bool isFourthGeneration ( const int & p)
inline

Definition at line 242 of file AtlasPID.h.

242{return std::abs(p) == BPRIME || std::abs(p) == TPRIME || std::abs(p) == LPRIME || std::abs(p) == NUPRIME;}
static const int BPRIME
PDG Rule 11a: The standard fourth generation of fermions is included by analogy with the first three.
Definition AtlasPID.h:83
static const int NUPRIME
Definition AtlasPID.h:95
static const int TPRIME
Definition AtlasPID.h:84

◆ isFourthGeneration() [2/2]

template<class T>
bool isFourthGeneration ( const T & p)
inline

Is this a 4th generation fermion?

APID: 4th generation fermions are not standard model particles

Definition at line 241 of file AtlasPID.h.

241{return isFourthGeneration(p->pdg_id());}
bool isFourthGeneration(const T &p)
Is this a 4th generation fermion?
Definition AtlasPID.h:241

◆ isGaugino() [1/3]

template<>
bool isGaugino ( const DecodedPID & p)
inline

Definition at line 544 of file AtlasPID.h.

544 {
545 auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 1 && isBoson(pp.pid()));
546}

◆ isGaugino() [2/3]

template<>
bool isGaugino ( const int & p)
inline

Definition at line 547 of file AtlasPID.h.

547{ auto value_digits = DecodedPID(p); return isGaugino(value_digits);}
bool isGaugino(const T &p)
Definition AtlasPID.h:543

◆ isGaugino() [3/3]

template<class T>
bool isGaugino ( const T & p)
inline

Definition at line 543 of file AtlasPID.h.

543{ return isGaugino(p->pdg_id()); }

◆ isGeantino() [1/2]

template<>
bool isGeantino ( const int & p)
inline

Definition at line 474 of file AtlasPID.h.

474{ return (std::abs(p) == GEANTINO0 || std::abs(p) == GEANTINOPLUS);}

◆ isGeantino() [2/2]

template<class T>
bool isGeantino ( const T & p)
inline

Definition at line 473 of file AtlasPID.h.

473{return isGeantino(p->pdg_id());}
bool isGeantino(const T &p)
Definition AtlasPID.h:473

◆ isGenericMultichargedParticle() [1/3]

template<>
bool isGenericMultichargedParticle ( const DecodedPID & p)
inline

Definition at line 734 of file AtlasPID.h.

734{return (p.ndigits() == 8 && (p(0) == 1 || p(0) == 2) && p(1) == 0 && p(2) == 0 && p(7) == 0);}

◆ isGenericMultichargedParticle() [2/3]

template<>
bool isGenericMultichargedParticle ( const int & p)
inline

Definition at line 735 of file AtlasPID.h.

735{if (!hasAllowedNumberOfDigits(p,8)) return false; auto value_digits = DecodedPID(p); return isGenericMultichargedParticle(value_digits);}

◆ isGenericMultichargedParticle() [3/3]

template<class T>
bool isGenericMultichargedParticle ( const T & p)
inline

In addition, there is a need to identify ”Q-ball” and similar very exotic (multi-charged) particles which may have large, non-integer charge.

These particles are assigned the ad-hoc numbering +/-100XXXY0, where the charge is XXX.Y. or +/-200XXYY0, where the charge is XX/YY. The case of +/-200XXYY0 is legacy, see https://gitlab.cern.ch/atlas/athena/-/merge_requests/25862 Note that no other quantum numbers besides the charge are considered for these generic multi-charged particles (e.g. isSUSY() is false for them). Such a model was used in previous Run-1 (https://arxiv.org/abs/1301.5272, https://arxiv.org/abs/1504.04188) and Run-2 (https://arxiv.org/abs/1812.03673, https://arxiv.org/abs/2303.13613) ATLAS searches.

Definition at line 733 of file AtlasPID.h.

733{return isGenericMultichargedParticle(p->pdg_id());}

◆ isGenSpecific() [1/2]

template<>
bool isGenSpecific ( const int & p)
inline

Definition at line 462 of file AtlasPID.h.

462 {
463 int ap = std::abs(p);
464 if (ap >= 81 && ap <= 100) return true;
465 if (ap >= 901 && ap <= 930) return true;
466 if (ap >= 998 && ap <= 999) return true;
467 if (ap >= 1901 && ap <= 1930) return true;
468 if (ap >= 2901 && ap <= 2930) return true;
469 if (ap >= 3901 && ap <= 3930) return true;
470 return false;
471}

◆ isGenSpecific() [2/2]

template<class T>
bool isGenSpecific ( const T & p)
inline

Main Table for MC internal use 81–100,901–930,998-999,1901–1930,2901–2930, and 3901–3930.

Definition at line 461 of file AtlasPID.h.

461{return isGenSpecific(p->pdg_id());}
bool isGenSpecific(const T &p)
Main Table for MC internal use 81–100,901–930,998-999,1901–1930,2901–2930, and 3901–3930.
Definition AtlasPID.h:461

◆ isGlueball() [1/3]

template<>
bool isGlueball ( const DecodedPID & p)
inline

Definition at line 481 of file AtlasPID.h.

481 {
482 if (p.ndigits() > 4) return false; // APID avoid classifying R-Glueballs as SM Glueballs
483 return
484 ( ( p.ndigits() == 3 && p(0) == COMPOSITEGLUON && p(1) == COMPOSITEGLUON && (p.last() == 1 || p.last() == 5) ) ||
485 ( p.ndigits() == 4 && p(0) == COMPOSITEGLUON && p(1) == COMPOSITEGLUON && p(2) == COMPOSITEGLUON && (p.last() == 3 || p.last() == 7) ) );
486}

◆ isGlueball() [2/3]

template<>
bool isGlueball ( const int & p)
inline

Definition at line 487 of file AtlasPID.h.

487{ if (!hasAllowedNumberOfDigits(p,3,4)) return false; auto value_digits = DecodedPID(p); return isGlueball(value_digits); }
bool isGlueball(const T &p)
PDG rule 7: The gluon, when considered as a gauge boson, has official number 21.
Definition AtlasPID.h:480

◆ isGlueball() [3/3]

template<class T>
bool isGlueball ( const T & p)
inline

PDG rule 7: The gluon, when considered as a gauge boson, has official number 21.

In codes for glueballs, however, 9 is used to allow a notation in close analogy with that of hadrons. APID: Definition of Glueballs: SM glueballs 99X (X=1,5), 999Y (Y=3,7)

Definition at line 480 of file AtlasPID.h.

480{ return isGlueball(p->pdg_id()); }

◆ isGluon() [1/2]

template<>
bool isGluon ( const int & p)
inline

Definition at line 397 of file AtlasPID.h.

397{ return p == GLUON; }
static const int GLUON
Definition AtlasPID.h:97

◆ isGluon() [2/2]

template<class T>
bool isGluon ( const T & p)
inline

Definition at line 396 of file AtlasPID.h.

396{return isGluon(p->pdg_id());}
bool isGluon(const T &p)
Definition AtlasPID.h:396

◆ isGraviton() [1/2]

template<>
bool isGraviton ( const int & p)
inline

Definition at line 421 of file AtlasPID.h.

421{ return p == GRAVITON; }

◆ isGraviton() [2/2]

template<class T>
bool isGraviton ( const T & p)
inline

Definition at line 420 of file AtlasPID.h.

420{return isGraviton(p->pdg_id());}
bool isGraviton(const T &p)
Definition AtlasPID.h:420

◆ isHadron() [1/3]

template<>
bool isHadron ( const DecodedPID & p)
inline

Definition at line 375 of file AtlasPID.h.

375{ return isMeson(p) || isBaryon(p) || isTetraquark(p) || isPentaquark(p); }

◆ isHadron() [2/3]

template<>
bool isHadron ( const int & p)
inline

Definition at line 376 of file AtlasPID.h.

376{ auto value_digits = DecodedPID(p); return isHadron(value_digits);}

◆ isHadron() [3/3]

template<class T>
bool isHadron ( const T & p)
inline

Definition at line 374 of file AtlasPID.h.

374{return isHadron(p->pdg_id());}

◆ isHeavyBaryon()

template<class T>
bool isHeavyBaryon ( const T & p)
inline

Definition at line 983 of file AtlasPID.h.

983{ auto lq = leadingQuark(p); return (lq == CQUARK || lq == BQUARK || lq == TQUARK) && isBaryon(p); }

◆ isHeavyBoson() [1/2]

template<>
bool isHeavyBoson ( const int & p)
inline

Definition at line 410 of file AtlasPID.h.

410{ return p == ZPRIME || p == ZDBLPRIME || std::abs(p) == WPLUSPRIME; }
static const int WPLUSPRIME
Definition AtlasPID.h:106

◆ isHeavyBoson() [2/2]

template<class T>
bool isHeavyBoson ( const T & p)
inline

APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier).

Definition at line 409 of file AtlasPID.h.

409{return isHeavyBoson(p->pdg_id());}
bool isHeavyBoson(const T &p)
APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier).
Definition AtlasPID.h:409

◆ isHeavyHadron()

template<class T>
bool isHeavyHadron ( const T & p)
inline

Definition at line 960 of file AtlasPID.h.

960{ auto lq = leadingQuark(p); return (lq == CQUARK || lq == BQUARK || lq == TQUARK ) && isHadron(p); }

◆ isHeavyMeson()

template<class T>
bool isHeavyMeson ( const T & p)
inline

Definition at line 967 of file AtlasPID.h.

967{ auto lq = leadingQuark(p); return (lq == CQUARK || lq == BQUARK || lq == TQUARK) && isMeson(p); }

◆ isHiddenValley() [1/3]

template<>
bool isHiddenValley ( const DecodedPID & p)
inline

Definition at line 709 of file AtlasPID.h.

709 {
710 const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
711 return (4900100 < p.apid() && p.apid() < 4900109) || (p.ndigits() == 7 && p(0) == 4 && p(1) == 9 &&
712 (isQuark(pp) || isLepton(pp) || isBoson(pp) || isGlueball(pp) ||
713 isDiquark(pp) || isHadron(pp)));
714}

◆ isHiddenValley() [2/3]

template<>
bool isHiddenValley ( const int & p)
inline

Definition at line 715 of file AtlasPID.h.

715{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isHiddenValley(value_digits);}

◆ isHiddenValley() [3/3]

template<class T>
bool isHiddenValley ( const T & p)
inline

PDG rule 11k Hidden Valley particles have n = 4 and n_r = 9, and trailing numbers in agreement with their nearest-analog standard particles, as far as possible.

Thus 4900021 is the gauge boson g_v of a confining gauge field, 490000n_{q_v} and 490001n_{l_v} fundamental constituents charged or not under this, 4900022 is the γ_v of a non-confining field, and 4900n_{q_{v1}}n_{q_{v2}}n_J a Hidden Valley meson.

Definition at line 707 of file AtlasPID.h.

707{return isHiddenValley(p->pdg_id());}

◆ isHiddenValleyFundamental() [1/3]

template<>
bool isHiddenValleyFundamental ( const DecodedPID & p)
inline

Definition at line 719 of file AtlasPID.h.

719 {
720 const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
721 return (4900100 < p.apid() && p.apid() < 4900109) || (p.ndigits() == 7 && p(0) == 4 && p(1) == 9 &&
722 (isQuark(pp) || isLepton(pp) || isBoson(pp)));
723}

◆ isHiddenValleyFundamental() [2/3]

template<>
bool isHiddenValleyFundamental ( const int & p)
inline

Definition at line 724 of file AtlasPID.h.

724{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isHiddenValleyFundamental(value_digits);}
bool isHiddenValleyFundamental(const T &p)
Definition AtlasPID.h:717

◆ isHiddenValleyFundamental() [3/3]

template<class T>
bool isHiddenValleyFundamental ( const T & p)
inline

Definition at line 717 of file AtlasPID.h.

717{return isHiddenValleyFundamental(p->pdg_id());}

◆ isHiggs() [1/2]

template<>
bool isHiggs ( const int & p)
inline

Definition at line 414 of file AtlasPID.h.

414{ return p == HIGGSBOSON; }
static const int HIGGSBOSON
Definition AtlasPID.h:103

◆ isHiggs() [2/2]

template<class T>
bool isHiggs ( const T & p)
inline

APID: HIGGS boson is only one particle.

Definition at line 413 of file AtlasPID.h.

413{return isHiggs(p->pdg_id());}
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
Definition AtlasPID.h:413

◆ isKK() [1/3]

template<>
bool isKK ( const DecodedPID & p)
inline

Definition at line 675 of file AtlasPID.h.

675{return (p.ndigits() == 7 && (p(0) == 5 || p(0) == 6 ) && (p(1) != 9) );}

◆ isKK() [2/3]

template<>
bool isKK ( const int & p)
inline

Definition at line 676 of file AtlasPID.h.

676{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isKK(value_digits);}

◆ isKK() [3/3]

template<class T>
bool isKK ( const T & p)
inline

PDG rule 11h A black hole in models with extra dimensions has code 5000040.

Kaluza-Klein excitations in models with extra dimensions have n = 5 or n = 6, to distinguish excitations of left-or right-handed fermions or, in case of mixing, the lighter or heavier state (cf. 11d). The non zero nr digit gives the radial excitation number, in scenarios where the level spacing allows these to be distinguished. Should the model also contain supersymmetry, excited SUSY states would be denoted by a nn_r > 0, with n = 1 or 2 as usual. Should some colored states be long-lived enough that hadrons would form around them, the coding strategy of 11g applies, with the initial two nnr digits preserved in the combined code.

Definition at line 674 of file AtlasPID.h.

674{return isKK(p->pdg_id());}

◆ isLepton() [1/3]

template<>
bool isLepton ( const DecodedPID & p)
inline

Definition at line 212 of file AtlasPID.h.

212{ return isLepton(p.pid()); }

◆ isLepton() [2/3]

template<>
bool isLepton ( const int & p)
inline

Definition at line 211 of file AtlasPID.h.

211{ auto sp = std::abs(p); return sp >= ELECTRON && sp <= NUPRIME; }

◆ isLepton() [3/3]

template<class T>
bool isLepton ( const T & p)
inline

APID: the fourth generation leptons are leptons.

Definition at line 210 of file AtlasPID.h.

210{return isLepton(p->pdg_id());}

◆ isLeptoQuark() [1/2]

template<>
bool isLeptoQuark ( const int & p)
inline

Definition at line 432 of file AtlasPID.h.

432{ return std::abs(p) == LEPTOQUARK; }
static const int LEPTOQUARK
Definition AtlasPID.h:113

◆ isLeptoQuark() [2/2]

template<class T>
bool isLeptoQuark ( const T & p)
inline

PDG rule 11c: “One-of-a-kind” exotic particles are assigned numbers in the range 41–80.

The subrange 61-80 can be used for new heavier fermions in generic models, where partners to the SM fermions would have codes offset by 60. If required, however, other assignments could be made.

Definition at line 431 of file AtlasPID.h.

431{return isLeptoQuark(p->pdg_id());}
bool isLeptoQuark(const T &p)
PDG rule 11c: “One-of-a-kind” exotic particles are assigned numbers in the range 41–80.
Definition AtlasPID.h:431

◆ isLightBaryon()

template<class T>
bool isLightBaryon ( const T & p)
inline

Definition at line 982 of file AtlasPID.h.

982{ auto lq = leadingQuark(p); return (lq == DQUARK || lq == UQUARK||lq == SQUARK) && isBaryon(p); }
static const int DQUARK
PDG Rule 1: Particles are given positive numbers, antiparticles negative numbers.
Definition AtlasPID.h:75
static const int UQUARK
Definition AtlasPID.h:76

◆ isLightHadron()

template<class T>
bool isLightHadron ( const T & p)
inline

Definition at line 959 of file AtlasPID.h.

959{ auto lq = leadingQuark(p); return (lq == DQUARK || lq == UQUARK||lq == SQUARK) && isHadron(p); }

◆ isLightMeson()

template<class T>
bool isLightMeson ( const T & p)
inline

Definition at line 966 of file AtlasPID.h.

966{ auto lq = leadingQuark(p); return (lq == DQUARK || lq == UQUARK||lq == SQUARK) && isMeson(p); }

◆ isMeson() [1/3]

template<>
bool isMeson ( const DecodedPID & p)
inline

Definition at line 272 of file AtlasPID.h.

272 {
273 if (p.ndigits() < 3 ) return false;
274 if (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2)) return false; // APID don't match SUSY particles
275 if (std::abs(p.pid()) == K0S) return true;
276 if (std::abs(p.pid()) == K0L) return true;
277 if (std::abs(p.pid()) == K0) return true;
278 if (p.last() % 2 != 1 ) return false;
279 if (p.max_digit(1,3) >= QUARK_LIMIT ) return false; // Ignore pdg_ids which would describe states including fourth generation quarks
280 if (p.min_digit(1,3) == 0 ) return false;
281 if (*(p.second.rbegin() + 2) < *(p.second.rbegin() + 1) ) return false; // Quark ordering (nq2 >= nq3)
282 if (*(p.second.rbegin() + 2) == *(p.second.rbegin() + 1) && p.pid() < 0 ) return false; // Illegal antiparticle check (nq2 == nq3)
283 if (p.ndigits() == 3 ) return true;
284 if (*(p.second.rbegin() + 3) != 0 ) return false; // Only two quarks! (nq1 == 0)
285 if (p.ndigits() == 5 && p(0) == 1 ) return true;
286 if (p.ndigits() == 5 && p(0) == 2 && p.last() > 1 ) return true;
287 if (p.ndigits() == 5 && p(0) == 3 && p.last() > 1 ) return true;
288 if (p.ndigits() == 6 && p.last() % 2 == 1 ) return true;
289 if (p.ndigits() == 7 && p(0) == 9 && p(1) == 0 ) return true;
290
291 return false;
292}
static const int K0L
Definition AtlasPID.h:125
static const int K0S
Definition AtlasPID.h:127

◆ isMeson() [2/3]

template<>
bool isMeson ( const int & p)
inline

Definition at line 293 of file AtlasPID.h.

293{ auto value_digits = DecodedPID(p); return isMeson(value_digits);}

◆ isMeson() [3/3]

template<class T>
bool isMeson ( const T & p)
inline

Table 43.1 PDG rule 5a: The numbers specifying the meson’s quark content conform to the convention nq1= 0 and nq2 >= nq3.

The special case K0L is the sole exception to this rule. PDG rule 5b: The quark numbers of flavorless, light (u, d, s) mesons are: 11 for the member of the isotriplet (pi0, rho0, ...), 22 for the lighter isosinglet (eta, omega, ...), and 33 for the heavier isosinglet (eta', phi, ...). Since isosinglet mesons are often large mixtures of u ubar + d dbar and s sbar states, 22 and 33 are assigned by mass and do not necessarily specify the dominant quark composition. PDG rule 5c: The special numbers 310 and 130 are given to the K0S and K0L respectively. APID: The special code K0 is used when a generator uses K0S/K0L APID: states with fourth generation quarks are not mesons

Definition at line 271 of file AtlasPID.h.

271{return isMeson(p->pdg_id());}

◆ isMonopole() [1/3]

template<>
bool isMonopole ( const DecodedPID & p)
inline

Definition at line 685 of file AtlasPID.h.

685{return (p.ndigits() == 7 && p(0) == 4 && p(1) == 1 && (p(2) == 1 || p(2) == 2 ) && p(6) == 0);}

◆ isMonopole() [2/3]

template<>
bool isMonopole ( const int & p)
inline

Definition at line 686 of file AtlasPID.h.

686{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isMonopole(value_digits);}

◆ isMonopole() [3/3]

template<class T>
bool isMonopole ( const T & p)
inline

PDG rule 11i Magnetic monopoles and dyons are assumed to have one unit of Dirac monopole charge and a variable integer number nq1nq2 nq3 units of electric charge.

Codes 411nq1nq2 nq3 0 are then used when the magnetic and electrical charge sign agree and 412nq1nq2 nq3 0 when they disagree, with the overall sign of the particle set by the magnetic charge. For now no spin information is provided.

Definition at line 684 of file AtlasPID.h.

684{return isMonopole(p->pdg_id());}

◆ isMonotopModel() [1/3]

template<>
bool isMonotopModel ( const DecodedPID & p)
inline

Definition at line 447 of file AtlasPID.h.

447{ return isMonotopModel(p.pid()); }
bool isMonotopModel(const T &p)
APID: exotic particles of the monotop model, 9000001-9000006.
Definition AtlasPID.h:445

◆ isMonotopModel() [2/3]

template<>
bool isMonotopModel ( const int & p)
inline

Definition at line 446 of file AtlasPID.h.

446{ auto sp = std::abs(p); return sp >= 9000001 && sp <= 9000006; }

◆ isMonotopModel() [3/3]

template<class T>
bool isMonotopModel ( const T & p)
inline

APID: exotic particles of the monotop model, 9000001-9000006.

They are not flagged with nnr = 99 (see PDG rule 12). Model: J. Andrea, B. Fuks, F. Maltoni, "Monotops at the LHC", Phys. Rev. D 84 (2011) 074025, https://arxiv.org/abs/1106.6199 FeynRules model page: https://feynrules.irmp.ucl.ac.be/wiki/Monotops (monotops_UFO.tgz). Codes as in the UFO particles.py: 9000001 smet (neutral scalar, invisible), 9000002 vmet (neutral vector, invisible), 9000003 fmet (neutral fermion, invisible), 9000004 phic (scalar, charge 2/3), 9000005 vc (vector, charge 2/3), 9000006 tphic (scalar, charge -1/3). The three colour-triplet states are the resonant-production mediators. (The UFO also uses 9000007-9000011 for ghosts; those are not covered here.)

Definition at line 445 of file AtlasPID.h.

445{return isMonotopModel(p->pdg_id());}

◆ isMSSMHiggs() [1/2]

template<>
bool isMSSMHiggs ( const int & p)
inline

Definition at line 418 of file AtlasPID.h.

418{ return p == HIGGS2 || p == HIGGS3 || std::abs(p) == HIGGSPLUS; }
static const int HIGGSPLUS
Definition AtlasPID.h:109
static const int HIGGS3
Definition AtlasPID.h:108
static const int HIGGS2
Definition AtlasPID.h:107

◆ isMSSMHiggs() [2/2]

template<class T>
bool isMSSMHiggs ( const T & p)
inline

APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier).

Definition at line 417 of file AtlasPID.h.

417{return isMSSMHiggs(p->pdg_id());}
bool isMSSMHiggs(const T &p)
APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier).
Definition AtlasPID.h:417

◆ isMuon() [1/2]

template<>
bool isMuon ( const int & p)
inline

Definition at line 227 of file AtlasPID.h.

227{ return std::abs(p) == MUON;}
xAOD::Muon MUON
D3PD INCLUDES.

◆ isMuon() [2/2]

template<class T>
bool isMuon ( const T & p)
inline

Definition at line 226 of file AtlasPID.h.

226{return isMuon(p->pdg_id());}
bool isMuon(const T &p)
Definition AtlasPID.h:226

◆ isNeutral() [1/3]

template<>
bool isNeutral ( const DecodedPID & p)
inline

Definition at line 1136 of file AtlasPID.h.

1136{ return p.pid() != 0 && charge3(p) == 0;}

◆ isNeutral() [2/3]

template<>
bool isNeutral ( const int & p)
inline

Definition at line 1137 of file AtlasPID.h.

1137{ auto value_digits = DecodedPID(p); return isNeutral(value_digits);}
bool isNeutral(const T &p)
Definition AtlasPID.h:1135

◆ isNeutral() [3/3]

template<class T>
bool isNeutral ( const T & p)
inline

Definition at line 1135 of file AtlasPID.h.

1135{ return p->pdg_id() != 0 && charge3(p) == 0;}

◆ isNeutrino() [1/2]

template<>
bool isNeutrino ( const int & p)
inline

Definition at line 234 of file AtlasPID.h.

234{ auto sp = std::abs(p); return sp == NU_E || sp == NU_MU || sp == NU_TAU || sp == NUPRIME; }
static const int NU_E
Definition AtlasPID.h:89
static const int NU_MU
Definition AtlasPID.h:91
static const int NU_TAU
Definition AtlasPID.h:93

◆ isNeutrino() [2/2]

template<class T>
bool isNeutrino ( const T & p)
inline

APID: the fourth generation neutrinos are neutrinos.

Definition at line 233 of file AtlasPID.h.

233{return isNeutrino(p->pdg_id());}
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Definition AtlasPID.h:233

◆ isNeutrinoRH() [1/2]

template<>
bool isNeutrinoRH ( const int & p)
inline

Definition at line 457 of file AtlasPID.h.

457{ return (std::abs(p) == RH_NU_E || std::abs(p) == RH_NU_MU|| std::abs(p) == RH_NU_TAU);}
static const int RH_NU_MU
Definition AtlasPID.h:152
static const int RH_NU_E
PDG Rule 12: Occasionally program authors add their own states.
Definition AtlasPID.h:151
static const int RH_NU_TAU
Definition AtlasPID.h:153

◆ isNeutrinoRH() [2/2]

template<class T>
bool isNeutrinoRH ( const T & p)
inline

PDG rule 12: Occasionally program authors add their own states.

To avoid confusion, these should be flagged by setting nnr = 99. APID: Helper function for right-handed neutrino states These are generator defined PDG ID values for right handed neutrinos. (Defined for some MadGraph+Pythia8 samples and referenced in MCTruthClassifierGen.cxx)

Definition at line 456 of file AtlasPID.h.

456{return isNeutrinoRH(p->pdg_id());}

◆ isNucleus() [1/3]

template<>
bool isNucleus ( const DecodedPID & p)
inline

Definition at line 752 of file AtlasPID.h.

752 {
753 if (std::abs(p.pid()) == PROTON) return true;
754 if (p.ndigits() != 10) return false;
755 if (p(0) != 1 || p(1) != 0 ) return false;
756 // charge should always be less than or equal to baryon number
757 // the following line is A >= Z
758 const int A = p(8) + 10*p(7) + 100*p(6);
759 const int Z = p(5) + 10*p(4) + 100*p(3);
760 return ( A >= Z );
761}

◆ isNucleus() [2/3]

template<>
bool isNucleus ( const int & p)
inline

Definition at line 762 of file AtlasPID.h.

762{ auto value_digits = DecodedPID(p); return isNucleus(value_digits);}

◆ isNucleus() [3/3]

template<class T>
bool isNucleus ( const T & p)
inline

PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.

For a (hyper)nucleus consisting of n_p protons, n_n neutrons and n_Λ Λ’s: A = n_p + n_n + n_Λ gives the total baryon number, Z = n_p gives the total charge, L = n_Λ gives the total number of strange quarks. I gives the isomer level, with I= 0 corresponding to the ground state and I > 0 to excitations, see [http://www.nndc.bnl.gov/amdc/web/nubase en.html], where states denoted m, n, p ,q translate to I= 1–4. As examples, the deuteron is 1000010020 and 235U is 1000922350. To avoid ambiguities, nuclear codes should not be applied to a single hadron, like p, n or Λ^0, where quark-contents-based codes already exist.

Definition at line 751 of file AtlasPID.h.

751{return isNucleus(p->pdg_id());}

◆ isParton()

template<class T>
bool isParton ( const T & p)
inline

Definition at line 1153 of file AtlasPID.h.

1153{ return isQuark(p)||isGluon(p);}

◆ isPentaquark() [1/3]

template<>
bool isPentaquark ( const DecodedPID & p)
inline

Definition at line 366 of file AtlasPID.h.

366 {
367 return (p.ndigits() == 9 && p(0) == 1 &&
368 p.max_digit(1,6) < QUARK_LIMIT && p.min_digit(1,6) > 0 && // ignore 4th generation (anti-)quarks
369 ( p(3) >= p(4) && p(4) >= p(5) && p(5) >= p(6)) );
370}

◆ isPentaquark() [2/3]

template<>
bool isPentaquark ( const int & p)
inline

Definition at line 371 of file AtlasPID.h.

371{ if (!hasAllowedNumberOfDigits(p,9)) return false; auto value_digits = DecodedPID(p); return isPentaquark(value_digits);}

◆ isPentaquark() [3/3]

template<class T>
bool isPentaquark ( const T & p)
inline

PDG rule 15 The 9-digit penta-quark codes are ±1nrnLnq1nq2nq3nq4nq5nJ, sorted such that nq1≥nq2≥nq3≥nq4.

In the particle the first four are quarks and the fifth an antiquark while the opposite holds in the antiparticle, which is given with a negative sign. The nr, nL, and nJ numbers have the same meaning as for ordinary hadrons.

Definition at line 365 of file AtlasPID.h.

365{return isPentaquark(p->pdg_id());}

◆ isPhoton() [1/2]

template<>
bool isPhoton ( const int & p)
inline

Definition at line 400 of file AtlasPID.h.

400{ return p == PHOTON; }
static const int PHOTON
Definition AtlasPID.h:100

◆ isPhoton() [2/2]

template<class T>
bool isPhoton ( const T & p)
inline

Definition at line 399 of file AtlasPID.h.

399{return isPhoton(p->pdg_id());}

◆ isPythia8Specific() [1/3]

template<>
bool isPythia8Specific ( const DecodedPID & p)
inline

Definition at line 435 of file AtlasPID.h.

435{ return (p.ndigits() == 7 && p(0) == 9 && p(1) == 9);}

◆ isPythia8Specific() [2/3]

template<>
bool isPythia8Specific ( const int & p)
inline

Definition at line 436 of file AtlasPID.h.

436{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isPythia8Specific(value_digits);}
bool isPythia8Specific(const T &p)
Definition AtlasPID.h:434

◆ isPythia8Specific() [3/3]

template<class T>
bool isPythia8Specific ( const T & p)
inline

Definition at line 434 of file AtlasPID.h.

434{ return isPythia8Specific(p->pdg_id());}

◆ isQuark() [1/3]

template<>
bool isQuark ( const DecodedPID & p)
inline

Definition at line 190 of file AtlasPID.h.

190{ return isQuark(p.pid()); }

◆ isQuark() [2/3]

template<>
bool isQuark ( const int & p)
inline

Definition at line 189 of file AtlasPID.h.

189{ return p != 0 && (std::abs(p) <= TPRIME || std::abs(p) == MAVTOP);}

◆ isQuark() [3/3]

template<class T>
bool isQuark ( const T & p)
inline

PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to do this they are first ordered by family and within families by weak isospin.

APID: the fourth generation quarks are quarks.

Definition at line 188 of file AtlasPID.h.

188{return isQuark(p->pdg_id());}

◆ isQuarkonium() [1/3]

template<>
bool isQuarkonium ( const DecodedPID & p)
inline

Definition at line 297 of file AtlasPID.h.

297 {
298 if (!isMeson(p)) return false; //< all quarkonia are mesons
299 return (*(p.second.rbegin() + 2) > SQUARK && p.last() > 0 && *(p.second.rbegin() + 1) == *(p.second.rbegin() + 2));
300}

◆ isQuarkonium() [2/3]

template<>
bool isQuarkonium ( const int & p)
inline

Definition at line 301 of file AtlasPID.h.

301{ auto value_digits = DecodedPID(p); return isQuarkonium(value_digits);}
bool isQuarkonium(const T &p)
APID: states with s,sbar are not considered quarkonium.
Definition AtlasPID.h:296

◆ isQuarkonium() [3/3]

template<class T>
bool isQuarkonium ( const T & p)
inline

APID: states with s,sbar are not considered quarkonium.

Definition at line 296 of file AtlasPID.h.

296{return isQuarkonium(p->pdg_id());}

◆ isRBaryon() [1/3]

template<>
bool isRBaryon ( const DecodedPID & p)
inline

Definition at line 629 of file AtlasPID.h.

629 {
630 if (!(p.ndigits() == 7 && (p(0) == 1 || p(0) == 2))) return false;
631 auto pp = p.shift(1);
632 return (
633 // Handle ~gluino-quark-quark-quark states
634 (pp.ndigits() == 5 && p(0) == 1 && pp(0) == COMPOSITEGLUON && pp.min_digit(1,4) > 0 && pp.max_digit(1,4) < QUARK_LIMIT && pp(2) <= pp(1) && pp(3) <= pp(2) && (pp.last() == 2 || pp.last() == 4)) ||
635 // Handle squark-quark-quark states (previously called Sbaryons)
636 (pp.ndigits() == 4 && pp.min_digit(1,4) > 0 && pp.max_digit(1,4) < QUARK_LIMIT && pp(1) <= pp(0) && pp(2) <= pp(1) && (pp.last() == 1 || pp.last() == 3))
637 );
638}

◆ isRBaryon() [2/3]

template<>
bool isRBaryon ( const int & p)
inline

Definition at line 639 of file AtlasPID.h.

639{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isRBaryon(value_digits); }
bool isRBaryon(const T &p)
Definition AtlasPID.h:628

◆ isRBaryon() [3/3]

template<class T>
bool isRBaryon ( const T & p)
inline

Definition at line 628 of file AtlasPID.h.

628{ return isRBaryon(p->pdg_id()); }

◆ isResonance()

template<class T>
bool isResonance ( const T & p)
inline

Definition at line 423 of file AtlasPID.h.

423{ return isZ(p) || isW(p) || isHiggs(p) || isTop(p); } // APID: not including t' (pdg_id=8), Z', Z'' and W'+ or BSM Higgs bosons
bool isW(const T &p)
Definition AtlasPID.h:405
bool isTop(const T &p)
Definition AtlasPID.h:206

◆ isRGlueball() [1/3]

template<>
bool isRGlueball ( const DecodedPID & p)
inline

Definition at line 602 of file AtlasPID.h.

602 {
603 if (p.ndigits() != 7 || p(0) != 1) return false;
604 auto pp = p.shift(1);
605 return
606 ( ( pp.ndigits() == 3 && pp(0) == COMPOSITEGLUON && pp(1) == COMPOSITEGLUON && (pp.last() == 1 || pp.last() == 3) ) ||
607 ( pp.ndigits() == 4 && pp(0) == COMPOSITEGLUON && pp(1) == COMPOSITEGLUON && pp(2) == COMPOSITEGLUON && (pp.last() == 1 || pp.last() == 5) ) );
608}

◆ isRGlueball() [2/3]

template<>
bool isRGlueball ( const int & p)
inline

Definition at line 609 of file AtlasPID.h.

609{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isRGlueball(value_digits); }
bool isRGlueball(const T &p)
PDG rule 11g: Within several scenarios of new physics, it is possible to have colored particles suffi...
Definition AtlasPID.h:601

◆ isRGlueball() [3/3]

template<class T>
bool isRGlueball ( const T & p)
inline

PDG rule 11g: Within several scenarios of new physics, it is possible to have colored particles sufficiently long-lived for color-singlet hadronic states to form around them.

In the context of supersymmetric scenarios, these states are called R-hadrons, since they carry odd R- parity. R-hadron codes, defined here, should be viewed as templates for corresponding codes also in other scenarios, for any long-lived particle that is either an unflavored color octet or a flavored color triplet. The R-hadron code is obtained by combining the SUSY particle code with a code for the light degrees of freedom, with as many intermediate zeros removed from the former as required to make place for the latter at the end. (To exemplify, a sparticle n00000n˜q combined with quarks q1 and q2 obtains code n00n˜qnq1 nq2 nJ .) Specifically, the new-particle spin decouples in the limit of large masses, so that the final nJ digit is defined by the spin state of the light-quark system alone. An appropriate number of nq digits is used to define the ordinary-quark content. As usual, 9 rather than 21 is used to denote a gluon/gluino in composite states. The sign of the hadron agrees with that of the constituent new particle (a color triplet) where there is a distinct new antiparticle, and else is defined as for normal hadrons. Particle names are R with the flavor content as lower index. APID: Definition of R-Glueballs: 100099X (X=1,3), 100999Y (Y=1,5) APID: NB In the current numbering scheme, some states with 2 gluinos + gluon or 2 gluons + gluino could have degenerate PDG_IDs.

Definition at line 601 of file AtlasPID.h.

601{ return isRGlueball(p->pdg_id()); }

◆ isRHadron() [1/3]

template<>
bool isRHadron ( const DecodedPID & p)
inline

Definition at line 643 of file AtlasPID.h.

643 {
644 return (isRBaryon(p) || isRMeson(p) || isRGlueball(p));
645}
bool isRMeson(const T &p)
Definition AtlasPID.h:613

◆ isRHadron() [2/3]

template<>
bool isRHadron ( const int & p)
inline

Definition at line 646 of file AtlasPID.h.

646{ auto value_digits = DecodedPID(p); return isRHadron(value_digits); }

◆ isRHadron() [3/3]

template<class T>
bool isRHadron ( const T & p)
inline

Definition at line 642 of file AtlasPID.h.

642{ return isRHadron(p->pdg_id()); }

◆ isRMeson() [1/3]

template<>
bool isRMeson ( const DecodedPID & p)
inline

Definition at line 614 of file AtlasPID.h.

614 {
615 if (!(p.ndigits() == 7 && (p(0) == 1 || p(0) == 2))) return false;
616 auto pp = p.shift(1);
617 return (
618 // Handle ~gluino-quark-antiquark states
619 (pp.ndigits() == 4 && p(0) == 1 && pp(0) == COMPOSITEGLUON && pp.min_digit(1,3) > 0 && pp.max_digit(1,3) < QUARK_LIMIT && pp(2) <= pp(1) && (pp.last() == 1 || pp.last() == 3)) ||
620 // Handle squark-antiquark states (previously called Smeson/mesoninos)
621 (pp.ndigits() == 3 && pp.min_digit(1,3) > 0 && pp.max_digit(1,3) < QUARK_LIMIT && pp(1) <= pp(0) && pp.last() == 2)
622 );
623}

◆ isRMeson() [2/3]

template<>
bool isRMeson ( const int & p)
inline

Definition at line 624 of file AtlasPID.h.

624{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isRMeson(value_digits); }

◆ isRMeson() [3/3]

template<class T>
bool isRMeson ( const T & p)
inline

Definition at line 613 of file AtlasPID.h.

613{ return isRMeson(p->pdg_id()); }

◆ isSlepton() [1/3]

template<>
bool isSlepton ( const DecodedPID & p)
inline

Definition at line 522 of file AtlasPID.h.

522{ auto pp = p.shift(1); return (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2) && isSMLepton(pp));}
bool isSMLepton(const T &p)
APID: the fourth generation leptons are not standard model leptons.
Definition AtlasPID.h:215

◆ isSlepton() [2/3]

template<>
bool isSlepton ( const int & p)
inline

Definition at line 523 of file AtlasPID.h.

523{ auto value_digits = DecodedPID(p); return isSlepton(value_digits);}
bool isSlepton(const T &p)
Definition AtlasPID.h:521

◆ isSlepton() [3/3]

template<class T>
bool isSlepton ( const T & p)
inline

Definition at line 521 of file AtlasPID.h.

521{ return isSlepton(p->pdg_id()); }

◆ isSleptonLH() [1/3]

template<>
bool isSleptonLH ( const DecodedPID & p)
inline

Definition at line 528 of file AtlasPID.h.

528 {
529 auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 1 && isSMLepton(pp));
530}

◆ isSleptonLH() [2/3]

template<>
bool isSleptonLH ( const int & p)
inline

Definition at line 531 of file AtlasPID.h.

531{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isSleptonLH(value_digits);}
bool isSleptonLH(const T &p)
Definition AtlasPID.h:527

◆ isSleptonLH() [3/3]

template<class T>
bool isSleptonLH ( const T & p)
inline

Definition at line 527 of file AtlasPID.h.

527{ return isSleptonLH(p->pdg_id()); }

◆ isSleptonRH() [1/3]

template<>
bool isSleptonRH ( const DecodedPID & p)
inline

Definition at line 536 of file AtlasPID.h.

536 {
537 auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 2 && isSMLepton(pp));
538}

◆ isSleptonRH() [2/3]

template<>
bool isSleptonRH ( const int & p)
inline

Definition at line 539 of file AtlasPID.h.

539{ auto value_digits = DecodedPID(p); return isSleptonRH(value_digits);}
bool isSleptonRH(const T &p)
Definition AtlasPID.h:535

◆ isSleptonRH() [3/3]

template<class T>
bool isSleptonRH ( const T & p)
inline

Definition at line 535 of file AtlasPID.h.

535{ return isSleptonRH(p->pdg_id()); }

◆ isSMLepton() [1/3]

template<>
bool isSMLepton ( const DecodedPID & p)
inline

Definition at line 217 of file AtlasPID.h.

217{ return isSMLepton(p.pid()); }

◆ isSMLepton() [2/3]

template<>
bool isSMLepton ( const int & p)
inline

Definition at line 216 of file AtlasPID.h.

216{ auto sp = std::abs(p); return sp >= ELECTRON && sp <= NU_TAU; }

◆ isSMLepton() [3/3]

template<class T>
bool isSMLepton ( const T & p)
inline

APID: the fourth generation leptons are not standard model leptons.

Definition at line 215 of file AtlasPID.h.

215{return isSMLepton(p->pdg_id());}

◆ isSMNeutrino() [1/2]

template<>
bool isSMNeutrino ( const int & p)
inline

Definition at line 237 of file AtlasPID.h.

237{ auto sp = std::abs(p); return sp == NU_E || sp == NU_MU || sp == NU_TAU; }

◆ isSMNeutrino() [2/2]

template<class T>
bool isSMNeutrino ( const T & p)
inline

Definition at line 236 of file AtlasPID.h.

236{return isSMNeutrino(p->pdg_id());}
bool isSMNeutrino(const T &p)
Definition AtlasPID.h:236

◆ isSMQuark() [1/3]

template<>
bool isSMQuark ( const DecodedPID & p)
inline

Definition at line 195 of file AtlasPID.h.

195{ return isSMQuark(p.pid()); }
bool isSMQuark(const T &p)
Definition AtlasPID.h:193

◆ isSMQuark() [2/3]

template<>
bool isSMQuark ( const int & p)
inline

Definition at line 194 of file AtlasPID.h.

194{ return p != 0 && std::abs(p) <= TQUARK;}

◆ isSMQuark() [3/3]

template<class T>
bool isSMQuark ( const T & p)
inline

Definition at line 193 of file AtlasPID.h.

193{return isSMQuark(p->pdg_id());}

◆ isSquark() [1/3]

template<>
bool isSquark ( const DecodedPID & p)
inline

Definition at line 498 of file AtlasPID.h.

498 {
499 auto pp = p.shift(1); return (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2) && isSMQuark(pp));
500}

◆ isSquark() [2/3]

template<>
bool isSquark ( const int & p)
inline

Definition at line 501 of file AtlasPID.h.

501{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isSquark(value_digits);}

◆ isSquark() [3/3]

template<class T>
bool isSquark ( const T & p)
inline

PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particle number.

The superpartner of a boson or a left-handed fermion has n = 1 while the superpartner of a right-handed fermion has n = 2. When mixing occurs, such as between the winos and charged Higgsinos to give charginos, or between left and right sfermions, the lighter physical state is given the smaller basis state number.

Definition at line 497 of file AtlasPID.h.

497{ return isSquark(p->pdg_id()); }

◆ isSquarkLH() [1/3]

template<>
bool isSquarkLH ( const DecodedPID & p)
inline

Definition at line 506 of file AtlasPID.h.

506 {
507 auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 1 && isSMQuark(pp));
508}

◆ isSquarkLH() [2/3]

template<>
bool isSquarkLH ( const int & p)
inline

Definition at line 509 of file AtlasPID.h.

509{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isSquarkLH(value_digits);}
bool isSquarkLH(const T &p)
Definition AtlasPID.h:505

◆ isSquarkLH() [3/3]

template<class T>
bool isSquarkLH ( const T & p)
inline

Definition at line 505 of file AtlasPID.h.

505{ return isSquarkLH(p->pdg_id()); }

◆ isSquarkRH() [1/3]

template<>
bool isSquarkRH ( const DecodedPID & p)
inline

Definition at line 514 of file AtlasPID.h.

514 {
515 auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 2 && isSMQuark(pp));
516}

◆ isSquarkRH() [2/3]

template<>
bool isSquarkRH ( const int & p)
inline

Definition at line 517 of file AtlasPID.h.

517{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isSquarkRH(value_digits);}
bool isSquarkRH(const T &p)
Definition AtlasPID.h:513

◆ isSquarkRH() [3/3]

template<class T>
bool isSquarkRH ( const T & p)
inline

Definition at line 513 of file AtlasPID.h.

513{ return isSquarkRH(p->pdg_id()); }

◆ isStrange() [1/2]

template<>
bool isStrange ( const int & p)
inline

Definition at line 198 of file AtlasPID.h.

198{ return std::abs(p) == SQUARK;}

◆ isStrange() [2/2]

template<class T>
bool isStrange ( const T & p)
inline

Definition at line 197 of file AtlasPID.h.

197{return isStrange(p->pdg_id());}
bool isStrange(const T &p)
Definition AtlasPID.h:197

◆ isStrangeBaryon()

template<class T>
bool isStrangeBaryon ( const T & p)
inline

Definition at line 984 of file AtlasPID.h.

984{ return leadingQuark(p) == SQUARK && isBaryon(p); }

◆ isStrangeHadron()

template<class T>
bool isStrangeHadron ( const T & p)
inline

Definition at line 961 of file AtlasPID.h.

961{ return leadingQuark(p) == SQUARK && isHadron(p); }

◆ isStrangeMeson()

template<class T>
bool isStrangeMeson ( const T & p)
inline

Definition at line 968 of file AtlasPID.h.

968{ return leadingQuark(p) == SQUARK && isMeson(p); }

◆ isStrongInteracting() [1/2]

template<>
bool isStrongInteracting ( const int & p)
inline

Definition at line 1229 of file AtlasPID.h.

1229{ return (isGluon(p) || isQuark(p) || isDiquark(p) || isGlueball(p) || isLeptoQuark(p) || isHadron(p) || isRHadron(p));} // APID: Glueballs and R-Hadrons are also strong-interacting

◆ isStrongInteracting() [2/2]

template<class T>
bool isStrongInteracting ( const T & p)
inline

Definition at line 1228 of file AtlasPID.h.

1228{return isStrongInteracting(p->pdg_id());}
bool isStrongInteracting(const T &p)
Definition AtlasPID.h:1228

◆ isSuperpartner() [1/3]

template<>
bool isSuperpartner ( const DecodedPID & p)
inline

Definition at line 552 of file AtlasPID.h.

552 {
553 return isSlepton(p) || isSquark(p) || isGaugino(p);
554}

◆ isSuperpartner() [2/3]

template<>
bool isSuperpartner ( const int & p)
inline

Definition at line 555 of file AtlasPID.h.

555{ auto value_digits = DecodedPID(p); return isSuperpartner(value_digits);}
bool isSuperpartner(const T &p)
Definition AtlasPID.h:551

◆ isSuperpartner() [3/3]

template<class T>
bool isSuperpartner ( const T & p)
inline

Definition at line 551 of file AtlasPID.h.

551{ return isSuperpartner(p->pdg_id()); }

◆ isSUSY() [1/3]

template<>
bool isSUSY ( const DecodedPID & p)
inline

Definition at line 663 of file AtlasPID.h.

663{return (isSuperpartner(p) || isRHadron(p));}

◆ isSUSY() [2/3]

template<>
bool isSUSY ( const int & p)
inline

Definition at line 664 of file AtlasPID.h.

664{ auto value_digits = DecodedPID(p); return isSUSY(value_digits);}

◆ isSUSY() [3/3]

template<class T>
bool isSUSY ( const T & p)
inline

Definition at line 662 of file AtlasPID.h.

662{return isSUSY(p->pdg_id());}

◆ isTau() [1/2]

template<>
bool isTau ( const int & p)
inline

Definition at line 230 of file AtlasPID.h.

230{ return std::abs(p) == TAU;}
static const int TAU
Definition AtlasPID.h:92

◆ isTau() [2/2]

template<class T>
bool isTau ( const T & p)
inline

Definition at line 229 of file AtlasPID.h.

229{return isTau(p->pdg_id());}
bool isTau(const T &p)
Definition AtlasPID.h:229

◆ isTechnicolor() [1/3]

template<>
bool isTechnicolor ( const DecodedPID & p)
inline

Definition at line 565 of file AtlasPID.h.

565 {
566 const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
567 return (p.ndigits() == 7 && p(0) == 3 && (p(1) == 0 || p(1) == 1) &&
568 (isQuark(pp) || isLepton(pp) || isBoson(pp) || isGlueball(pp) ||
569 isDiquark(pp) || isHadron(pp)));
570}

◆ isTechnicolor() [2/3]

template<>
bool isTechnicolor ( const int & p)
inline

Definition at line 571 of file AtlasPID.h.

571{ if (!hasAllowedNumberOfDigits(p,7)) return false; auto value_digits = DecodedPID(p); return isTechnicolor(value_digits);}

◆ isTechnicolor() [3/3]

template<class T>
bool isTechnicolor ( const T & p)
inline

PDG rule 11e Technicolor states have n = 3, with technifermions treated like ordinary fermions.

States which are ordinary color singlets have n_r = 0. Color octets have n_r = 1. If a state has non-trivial quantum numbers under the topcolor groups SU(3)1×SU(3)2, the quantum numbers are specified by tech, ij, where i and j are 1 or 2. nLis then 2i+j. The coloron V8, is a heavy gluon color octet and thus is 3100021

Definition at line 563 of file AtlasPID.h.

563{return isTechnicolor(p->pdg_id());}

◆ isTetraquark() [1/3]

template<>
bool isTetraquark ( const DecodedPID & p)
inline

Definition at line 349 of file AtlasPID.h.

349 {
350 return (p.ndigits() == 9 && p(0) == 1 && p(5) == 0 &&
351 p.max_digit(1,3) < QUARK_LIMIT && p.min_digit(1,3) > 0 && // ignore 4th generation quarks for nq3 and nq4
352 p.max_digit(4,6) < QUARK_LIMIT && p.min_digit(4,6) > 0 && // ignore 4th generation quarks for nq1 and nq2
353 ( p(3) >= p(4) && p(6) >= p(7) ) && ( ( p(3) > p(6) ) || ( p(3) == p(6) && (p(4) >= p(7))))
354 );
355}

◆ isTetraquark() [2/3]

template<>
bool isTetraquark ( const int & p)
inline

Definition at line 356 of file AtlasPID.h.

356{ if (!hasAllowedNumberOfDigits(p,9)) return false; auto value_digits = DecodedPID(p); return isTetraquark(value_digits);}

◆ isTetraquark() [3/3]

template<class T>
bool isTetraquark ( const T & p)
inline

PDG rule 14 The 9-digit tetra-quark codes are ±1nrnLnq1nq20nq3nq4nJ.

For the particle q1q2 is a diquark and ̄q3 ̄q4 an antidiquark, sorted such that nq1≥nq2, nq3≥nq4, nq1≥nq3, and nq2≥nq4 if nq1=nq3. For the antiparticle, given with a negative sign, ̄q1 ̄q2 is an antidiquark and q3q4 a diquark, with the same sorting except that either nq1>nq3 or nq2>nq4 (so that flavour-diagonal states are particles). The nr, nL, and nJ numbers have the same meaning as for ordinary hadrons. APID: states with fourth generation quarks are not tetraquarks

Definition at line 348 of file AtlasPID.h.

348{return isTetraquark(p->pdg_id());}

◆ isTop() [1/2]

template<>
bool isTop ( const int & p)
inline

Definition at line 207 of file AtlasPID.h.

207{ return std::abs(p) == TQUARK;}

◆ isTop() [2/2]

template<class T>
bool isTop ( const T & p)
inline

Definition at line 206 of file AtlasPID.h.

206{return isTop(p->pdg_id());}

◆ isTopBaryon()

template<class T>
bool isTopBaryon ( const T & p)
inline

Definition at line 987 of file AtlasPID.h.

987{ return leadingQuark(p) == TQUARK && isBaryon(p); }

◆ isTopHadron()

template<class T>
bool isTopHadron ( const T & p)
inline

Definition at line 964 of file AtlasPID.h.

964{ return leadingQuark(p) == TQUARK && isHadron(p); }

◆ isTopMeson()

template<class T>
bool isTopMeson ( const T & p)
inline

Definition at line 971 of file AtlasPID.h.

971{ return leadingQuark(p) == TQUARK && isMeson(p); }

◆ isTrajectory() [1/2]

template<>
bool isTrajectory ( const int & p)
inline

Definition at line 383 of file AtlasPID.h.

383{ return std::abs(p) == POMERON || std::abs(p) == ODDERON || std::abs(p) == REGGEON; }
static const int REGGEON
Definition AtlasPID.h:172
static const int POMERON
PDG rule 8: The pomeron and odderon trajectories and a generic reggeon trajectory of states in QCD ar...
Definition AtlasPID.h:170
static const int ODDERON
Definition AtlasPID.h:171

◆ isTrajectory() [2/2]

template<class T>
bool isTrajectory ( const T & p)
inline

PDG rule 8: The pomeron and odderon trajectories and a generic reggeon trajectory of states in QCD are assigned codes 990, 9990, and 110 respectively.

Definition at line 382 of file AtlasPID.h.

382{return isTrajectory(p->pdg_id());}
bool isTrajectory(const T &p)
PDG rule 8: The pomeron and odderon trajectories and a generic reggeon trajectory of states in QCD ar...
Definition AtlasPID.h:382

◆ isTransportable() [1/3]

template<>
bool isTransportable ( const DecodedPID & p)
inline

Definition at line 924 of file AtlasPID.h.

924{ return isPhoton(p.pid()) || isGeantino(p.pid()) || isHadron(p) || isLepton(p.pid()) || p.pid() == DARKPHOTON;}

◆ isTransportable() [2/3]

template<>
bool isTransportable ( const int & p)
inline

Definition at line 925 of file AtlasPID.h.

925{ auto value_digits = DecodedPID(p); return isTransportable(value_digits);}
bool isTransportable(const T &p)
Definition AtlasPID.h:923

◆ isTransportable() [3/3]

template<class T>
bool isTransportable ( const T & p)
inline

Definition at line 923 of file AtlasPID.h.

923{return isTransportable(p->pdg_id());}

◆ isValid() [1/3]

template<>
bool isValid ( const DecodedPID & p)
inline

Definition at line 929 of file AtlasPID.h.

929 {
930 return p.pid() !=0 && ( isQuark(p) || isLepton(p) || isBoson(p) || isGlueball(p) ||
931 isTrajectory(p.pid()) || isGenSpecific(p.pid()) || isDiquark(p) ||
932 isBSM(p) || isHadron(p) || isNucleus(p) || isGeantino(p.pid()) ||
934 isMonotopModel(p) ); }

◆ isValid() [2/3]

template<>
bool isValid ( const int & p)
inline

Definition at line 935 of file AtlasPID.h.

935 { if (!p) return false; if (std::abs(p) < 42) return true;
936 if (isGenSpecific(p)) return true;
937 auto value_digits = DecodedPID(p); return isValid(value_digits);
938}

◆ isValid() [3/3]

template<class T>
bool isValid ( const T & p)
inline

AV: we implement here an ATLAS-specific convention: all particles which are 99xxxxx are fine.

Definition at line 928 of file AtlasPID.h.

928{return isValid(p->pdg_id());}

◆ isW() [1/2]

template<>
bool isW ( const int & p)
inline

Definition at line 406 of file AtlasPID.h.

406{ return std::abs(p) == WPLUSBOSON; }
static const int WPLUSBOSON
Definition AtlasPID.h:102

◆ isW() [2/2]

template<class T>
bool isW ( const T & p)
inline

Definition at line 405 of file AtlasPID.h.

405{return isW(p->pdg_id());}

◆ isWeaklyDecayingBHadron() [1/3]

template<>
bool isWeaklyDecayingBHadron ( const DecodedPID & p)
inline

Definition at line 1015 of file AtlasPID.h.

1015{ return isWeaklyDecayingBHadron(p.pid()); }
bool isWeaklyDecayingBHadron(const T &p)
Definition AtlasPID.h:995

◆ isWeaklyDecayingBHadron() [2/3]

template<>
bool isWeaklyDecayingBHadron ( const int & p)
inline

Definition at line 996 of file AtlasPID.h.

996 {
997 const int pid = std::abs(p);
998 return ( pid == 511 || // B0
999 pid == 521 || // B+
1000 pid == 531 || // B_s0
1001 pid == 541 || // B_c+
1002 pid == 5122 || // Lambda_b0
1003 pid == 5132 || // Xi_b-
1004 pid == 5232 || // Xi_b0
1005 pid == 5332 || // Omega_b-
1006 pid == 5142 || // Xi_bc0
1007 pid == 5242 || // Xi_bc+
1008 pid == 5342 || // Omega_bc0
1009 pid == 5442 || // Omega_bcc+
1010 pid == 5512 || // Xi_bb-
1011 pid == 5522 || // Xi_bb0
1012 pid == 5532 || // Omega_bb-
1013 pid == 5542 ); // Omega_bbc0
1014}

◆ isWeaklyDecayingBHadron() [3/3]

template<class T>
bool isWeaklyDecayingBHadron ( const T & p)
inline

Definition at line 995 of file AtlasPID.h.

995{return isWeaklyDecayingBHadron(p->pdg_id());}

◆ isWeaklyDecayingCHadron() [1/3]

template<>
bool isWeaklyDecayingCHadron ( const DecodedPID & p)
inline

Definition at line 1038 of file AtlasPID.h.

1038{ return isWeaklyDecayingCHadron(p.pid()); }
bool isWeaklyDecayingCHadron(const T &p)
Definition AtlasPID.h:1024

◆ isWeaklyDecayingCHadron() [2/3]

template<>
bool isWeaklyDecayingCHadron ( const int & p)
inline

Definition at line 1025 of file AtlasPID.h.

1025 {
1026 const int pid = std::abs(p);
1027 return ( pid == 411 || // D+
1028 pid == 421 || // D0
1029 pid == 431 || // Ds+
1030 pid == 4122 || // Lambda_c+
1031 pid == 4132 || // Xi_c0
1032 pid == 4232 || // Xi_c+
1033 pid == 4332 || // Omega_c0
1034 pid == 4412 || // Xi_cc+
1035 pid == 4422 || // Xi_cc++
1036 pid == 4432 ); // Omega_cc+
1037}

◆ isWeaklyDecayingCHadron() [3/3]

template<class T>
bool isWeaklyDecayingCHadron ( const T & p)
inline

Definition at line 1024 of file AtlasPID.h.

1024{return isWeaklyDecayingCHadron(p->pdg_id());}

◆ isZ() [1/2]

template<>
bool isZ ( const int & p)
inline

Definition at line 403 of file AtlasPID.h.

403{ return p == Z0BOSON; }
static const int Z0BOSON
Definition AtlasPID.h:101

◆ isZ() [2/2]

template<class T>
bool isZ ( const T & p)
inline

Definition at line 402 of file AtlasPID.h.

402{return isZ(p->pdg_id());}

◆ leadingQuark() [1/3]

template<>
int leadingQuark ( const DecodedPID & p)
inline

Definition at line 941 of file AtlasPID.h.

941 {
942 if (isQuark(p.pid())) { return std::abs(p.pid());}
943 if (isMeson(p)) { return p.max_digit(1,3);}
944 if (isDiquark(p)) { return p.max_digit(2,4);}
945 if (isBaryon(p)) { return p.max_digit(1,4);}
946 if (isTetraquark(p)) { return p.max_digit(1,5);}
947 if (isPentaquark(p)) { return p.max_digit(1,6);}
948 if (isSUSY(p)) { // APID SUSY case
949 auto pp = p.shift(1);
950 if ( pp.ndigits() == 1 ) { return 0; } // Handle squarks
951 if ( pp.ndigits() == 3 ) { pp = DecodedPID(pp(1)); } // Handle ~q qbar pairs
952 if ( pp.ndigits() > 3 ) { pp = pp.shift(1); } // Drop gluinos and squarks
953 return leadingQuark(pp); }
954 return 0;
955}

◆ leadingQuark() [2/3]

template<>
int leadingQuark ( const int & p)
inline

Definition at line 957 of file AtlasPID.h.

957{ auto value_digits = DecodedPID(p); return leadingQuark(value_digits);}

◆ leadingQuark() [3/3]

template<class T>
int leadingQuark ( const T & p)
inline

Definition at line 940 of file AtlasPID.h.

940{return leadingQuark(p->pdg_id());}

◆ numberOfLambdas() [1/3]

template<>
int numberOfLambdas ( const DecodedPID & p)
inline

Definition at line 875 of file AtlasPID.h.

875 {
876 if (std::abs(p.pid()) == LAMBDA0) { return (p.pid() > 0) ? 1 : -1; }
877 if (isNucleus(p) && p.ndigits() == 10) { return (p.pid() > 0) ? p(2) : -p(2); }
878 return 0;
879}
static const int LAMBDA0
Definition AtlasPID.h:139

◆ numberOfLambdas() [2/3]

template<>
int numberOfLambdas ( const int & p)
inline

Definition at line 880 of file AtlasPID.h.

880{ auto value_digits = DecodedPID(p); return numberOfLambdas(value_digits);}

◆ numberOfLambdas() [3/3]

template<class T>
int numberOfLambdas ( const T & p)
inline

Definition at line 874 of file AtlasPID.h.

874{return numberOfLambdas(p->pdg_id());}

◆ numberOfProtons() [1/3]

template<>
int numberOfProtons ( const DecodedPID & p)
inline

Definition at line 884 of file AtlasPID.h.

884 {
885 if (std::abs(p.pid()) == PROTON) { return (p.pid() > 0) ? 1 : -1; }
886 if (isNucleus(p)) {
887 const int result = p(5) + 10*p(4) + 100*p(3);
888 return (p.pid() > 0) ? result : -result;
889 }
890 return 0;
891}

◆ numberOfProtons() [2/3]

template<>
int numberOfProtons ( const int & p)
inline

Definition at line 892 of file AtlasPID.h.

892{ auto value_digits = DecodedPID(p); return numberOfProtons(value_digits);}

◆ numberOfProtons() [3/3]

template<class T>
int numberOfProtons ( const T & p)
inline

Definition at line 883 of file AtlasPID.h.

883{return numberOfProtons(p->pdg_id());}

◆ spin() [1/3]

template<>
double spin ( const DecodedPID & p)
inline

Definition at line 1198 of file AtlasPID.h.

1198{ return 1.0*spin2(p)/2.0; }
int spin2(const T &p)
Definition AtlasPID.h:1157

◆ spin() [2/3]

template<>
double spin ( const int & p)
inline

Definition at line 1199 of file AtlasPID.h.

1199{ auto value_digits = DecodedPID(p); return spin(value_digits);}
double spin(const T &p)
Definition AtlasPID.h:1197

◆ spin() [3/3]

template<class T>
double spin ( const T & p)
inline

Definition at line 1197 of file AtlasPID.h.

1197{ return spin(p->pdg_id()); }

◆ spin2() [1/3]

template<>
int spin2 ( const DecodedPID & p)
inline

Definition at line 1158 of file AtlasPID.h.

1158 {
1159 if (isSUSY(p)) {
1160 auto pp = p.shift(1);
1161 auto ap = std::abs(pp.pid());
1162 if (ap < TABLESIZE ) { return std::abs(double_spin.at(ap)-1); } // sparticles (0->1, 1 -> 0, 2->1, 4->3)
1163 return p.last()-1; // R-Hadrons (p.last() == 2J +1)
1164 }
1165 if (isHiddenValley(p)) { //Hidden Valley spins
1166 auto pp = p.shift(2);
1167 if (isHadron(pp)) { return pp.last()-1; } // Hadrons (p.last == 2J+1 - special cases handled above)
1168 }
1169 if (isKK(p)) { // Kaluza-Klein spins
1170 auto pp = p.shift(2);
1171 auto ap = std::abs(pp.pid());
1172 if (ap < TABLESIZE ) { return double_spin.at(ap); } // fundamental particles
1173 }
1174 if (isDM(std::abs(p.pid()))) { //DM spins
1175 if (p.ndigits() == 7) { // Determining the spins for the more elaborate, 7-digit DM codes
1176 auto pp = p.shift(3); // The first two digits indicate the particle is DM, the third indicates left/right-handedness (see 11(j))
1177 auto ap = std::abs(pp.pid());
1178 if (ap < TABLESIZE) { return double_spin.at(ap); } // fundamental particles
1179 }else if (std::abs(p.pid()) < TABLESIZE) { // Just to make sure the correct spin is returned for DM 51-60
1180 return std::abs(double_spin.at(std::abs(p.pid())));
1181 }
1182 }
1183 auto ap = std::abs(p.pid());
1184 if (ap == K0S) { return 0; }
1185 if (ap == K0L) { return 0; }
1186 if (ap == MAVTOP) { return 1; } // TODO check this
1187 if (ap == DARKPHOTON) { return 2; } // TODO check this
1188 if (ap < TABLESIZE ) { return double_spin.at(ap); } // fundamental particles
1189 if (isHadron(p)) { return p.last()-1; } // Hadrons (p.last == 2J+1 - special cases handled above)
1190 if (isMonopole(p)) { return 0; } // PDG 11i - For now no spin information is provided. Also matches the definition in the G4Extensions/Monopole package.
1191 if (isGenericMultichargedParticle(p)) { return 0; } // APID Matches the definition in the G4Extensions/Monopole package.
1192 if (isNucleus(p)) { return 1; } // TODO need to explicitly deal with nuclei
1193 return p.last() > 0 ? 1 : 0; // Anything else - best guess
1194}
static const std::array< int, TABLESIZE > double_spin
Definition AtlasPID.h:59

◆ spin2() [2/3]

template<>
int spin2 ( const int & p)
inline

Definition at line 1195 of file AtlasPID.h.

1195{ auto value_digits = DecodedPID(p); return spin2(value_digits);}

◆ spin2() [3/3]

template<class T>
int spin2 ( const T & p)
inline

Definition at line 1157 of file AtlasPID.h.

1157{ return spin2(p->pdg_id()); }

◆ strangeness() [1/3]

template<>
int strangeness ( const DecodedPID & p)
inline

Definition at line 837 of file AtlasPID.h.

837 {
838 if (isNucleus(p) && p.ndigits() == 10) { return (p.pid() > 0) ? -p(2) : p(2); }
839 if (isStrange(p.pid())) { return (p.pid() > 0) ? -1 : 1; }
840 if (!hasStrange(p) && !hasSquark(p,SQUARK)) { return 0; }
841 if (std::abs(p.pid()) == K0) { return (p.pid() > 0) ? 1 : -1; }
842 size_t nq = 0;
843 int sign = 1;
844 int signmult = 1;
845 int result=0;
846 bool classified = false;
847 if (!classified && isMeson(p)) { classified = true; nq = 2; if ((*(p.second.rbegin()+2)) == 2||(*(p.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
848 if (!classified && isDiquark(p)) {return is_strange.at(p(0))+is_strange.at(p(1)); }
849 if (!classified && isBaryon(p)) { classified = true; nq = 3; }
850 if (!classified && isTetraquark(p)){ return is_strange.at(p(3)) + is_strange.at(p(4)) - is_strange.at(p(6)) - is_strange.at(p(7)); }
851 if (!classified && isPentaquark(p)){ return is_strange.at(p(3)) + is_strange.at(p(4)) + is_strange.at(p(5)) + is_strange.at(p(6)) - is_strange.at(p(7)); }
852 if (!classified && isSUSY(p)) {
853 nq = 0;
854 auto pp = p.shift(1);
855 if (pp.ndigits() < 3 ) { return strangeness(pp); } // super-partners of fundamental particles
856 if (pp(0) == COMPOSITEGLUON) {
857 if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
858 if ( pp.ndigits() == 4 || pp.ndigits() == 5) {
859 pp = pp.shift(1); // Remove gluino
860 }
861 }
862 if (pp.ndigits() == 3) { classified = true; nq = 2; if (p.last()%2==0) {sign = -1;} signmult = -1; } // states with quark-antiquark or squark-antiquark
863 if (pp.ndigits() == 4) { classified = true; nq = 3; } // states with quark-quark-quark or squark-quark-quark
864 }
865 for (auto r = p.second.rbegin() + 1; r != p.second.rbegin() + 1 + nq; ++r) {
866 result += is_strange.at(*r)*sign;
867 sign*=signmult;
868 }
869 return p.pid() > 0 ? result : -result;
870}
bool hasStrange(const T &p)
Definition AtlasPID.h:786
int strangeness(const T &p)
Definition AtlasPID.h:836
static const std::array< int, 10 > is_strange
Definition AtlasPID.h:834

◆ strangeness() [2/3]

template<>
int strangeness ( const int & p)
inline

Definition at line 871 of file AtlasPID.h.

871{ auto value_digits = DecodedPID(p); return strangeness(value_digits);}

◆ strangeness() [3/3]

template<class T>
int strangeness ( const T & p)
inline

Definition at line 836 of file AtlasPID.h.

836{return strangeness(p->pdg_id());}

◆ threeCharge()

template<class T>
double threeCharge ( const T & p)
inline

Definition at line 1049 of file AtlasPID.h.

1049{ return charge3(p);}

Variable Documentation

◆ ARGON

const int ARGON = 1000180400
static

Definition at line 160 of file AtlasPID.h.

◆ B0

const int B0 = 511
static

Definition at line 135 of file AtlasPID.h.

◆ BCPLUS

const int BCPLUS = 541
static

Definition at line 136 of file AtlasPID.h.

◆ BORON

const int BORON = 1000050110
static

Definition at line 164 of file AtlasPID.h.

◆ BPRIME

const int BPRIME = 7
static

PDG Rule 11a: The standard fourth generation of fermions is included by analogy with the first three.

Definition at line 83 of file AtlasPID.h.

◆ BQUARK

const int BQUARK = 5
static

Definition at line 79 of file AtlasPID.h.

◆ CALCIUM

const int CALCIUM = 1000200400
static

Definition at line 159 of file AtlasPID.h.

◆ COMPOSITEGLUON

const int COMPOSITEGLUON = 9
static

Definition at line 99 of file AtlasPID.h.

◆ CQUARK

const int CQUARK = 4
static

Definition at line 78 of file AtlasPID.h.

◆ D0

const int D0 = 421
static

Definition at line 132 of file AtlasPID.h.

◆ DARKPHOTON

const int DARKPHOTON = 60000
static

PDG Ids for Mavtop madgraph UFO model found under DarkX.

The mavtop is a vector-like top partner with coupling to a dark photon. Theory paper: https://arxiv.org/abs/1904.05893 Pheno paper: https://arxiv.org/abs/2112.08425

Definition at line 119 of file AtlasPID.h.

◆ double_spin

const std::array<int,TABLESIZE> double_spin
static
Initial value:
= {
+0, +1, +1, +1, +1, +1, +1, +1, +1, +0,
+0, +1, +1, +1, +1, +1, +1, +1, +1, +0,
+2, +2, +2, +2, +2, +0, +0, +0, +0, +0,
+0, +0, +2, +2, +2, +0, +0, +0, +0, +4,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +1, +2, +0, +2, +0, +1, +2, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0
}

Definition at line 59 of file AtlasPID.h.

59 {
60 +0, +1, +1, +1, +1, +1, +1, +1, +1, +0,
61 +0, +1, +1, +1, +1, +1, +1, +1, +1, +0,
62 +2, +2, +2, +2, +2, +0, +0, +0, +0, +0,
63 +0, +0, +2, +2, +2, +0, +0, +0, +0, +4,
64 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
65 +0, +0, +1, +2, +0, +2, +0, +1, +2, +0,
66 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
67 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
68 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
69 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0
70};

◆ DPLUS

const int DPLUS = 411
static

Definition at line 130 of file AtlasPID.h.

◆ DQUARK

const int DQUARK = 1
static

PDG Rule 1: Particles are given positive numbers, antiparticles negative numbers.

The PDG convention for mesons is used, so that K+ and B+ are particles.

Definition at line 75 of file AtlasPID.h.

◆ DSPLUS

const int DSPLUS = 431
static

Definition at line 133 of file AtlasPID.h.

◆ DSTAR

const int DSTAR = 413
static

Definition at line 131 of file AtlasPID.h.

◆ ELECTRON

const int ELECTRON = 11
static

Definition at line 87 of file AtlasPID.h.

◆ GEANTINO0

const int GEANTINO0 = 999
static

Definition at line 180 of file AtlasPID.h.

◆ GEANTINOPLUS

const int GEANTINOPLUS = 998
static

PDG rule 10: Codes 81–100 are reserved for generator-specific pseudoparticles and concepts.

Codes 901–930, 1901–1930, 2901–2930, and 3901–3930 are for additional components of Standard Model parton distribution functions, where the latter three ranges are intended to distinguish left/right/ longitudinal components. Codes 998 and 999 are reserved for GEANT tracking purposes.

Definition at line 179 of file AtlasPID.h.

◆ GLUON

const int GLUON = 21
static

Definition at line 97 of file AtlasPID.h.

◆ GRAVITON

const int GRAVITON = 39
static

Definition at line 111 of file AtlasPID.h.

◆ HELIUM

const int HELIUM = 1000020040
static

Definition at line 165 of file AtlasPID.h.

◆ HIGGS2

const int HIGGS2 = 35
static

Definition at line 107 of file AtlasPID.h.

◆ HIGGS3

const int HIGGS3 = 36
static

Definition at line 108 of file AtlasPID.h.

◆ HIGGS4

const int HIGGS4 = 40
static

Definition at line 112 of file AtlasPID.h.

◆ HIGGSBOSON

const int HIGGSBOSON = 25
static

Definition at line 103 of file AtlasPID.h.

◆ HIGGSPLUS

const int HIGGSPLUS = 37
static

Definition at line 109 of file AtlasPID.h.

◆ HIGGSPLUSPLUS

const int HIGGSPLUSPLUS = 38
static

Definition at line 110 of file AtlasPID.h.

◆ INDIUM

const int INDIUM = 1000491150
static

Definition at line 157 of file AtlasPID.h.

◆ is_strange

const std::array<int,10> is_strange
static
Initial value:
= {
+0, +0, +0, -1, +0, +0, +0, +0, +0, +0 }

Definition at line 834 of file AtlasPID.h.

834 {
835 +0, +0, +0, -1, +0, +0, +0, +0, +0, +0 };

◆ JPSI

const int JPSI = 443
static

Definition at line 134 of file AtlasPID.h.

◆ K0

const int K0 = 311
static

Definition at line 128 of file AtlasPID.h.

◆ K0L

const int K0L = 130
static

Definition at line 125 of file AtlasPID.h.

◆ K0S

const int K0S = 310
static

Definition at line 127 of file AtlasPID.h.

◆ KPLUS

const int KPLUS = 321
static

Definition at line 129 of file AtlasPID.h.

◆ KRYPTON

const int KRYPTON = 1000360840
static

Definition at line 158 of file AtlasPID.h.

◆ LAMBDA0

const int LAMBDA0 = 3122
static

Definition at line 139 of file AtlasPID.h.

◆ LAMBDAB0

const int LAMBDAB0 = 5122
static

Definition at line 141 of file AtlasPID.h.

◆ LAMBDACPLUS

const int LAMBDACPLUS = 4122
static

Definition at line 140 of file AtlasPID.h.

◆ LEAD

const int LEAD = 1000822080
static

Definition at line 156 of file AtlasPID.h.

◆ LEPTOQUARK

const int LEPTOQUARK = 42
static

Definition at line 113 of file AtlasPID.h.

◆ LPRIME

const int LPRIME = 17
static

Definition at line 94 of file AtlasPID.h.

◆ MAGNESIUM

const int MAGNESIUM = 1000120240
static

Definition at line 161 of file AtlasPID.h.

◆ MAVTOP

const int MAVTOP = 60001
static

Definition at line 120 of file AtlasPID.h.

◆ MAX_DIGIT

std::array<int, 9> MAX_DIGIT = {9, 99, 999, 9999, 99999, 999999, 9999999,99999999, 999999999}
constexpr

Definition at line 18 of file AtlasPID.h.

18{9, 99, 999, 9999, 99999, 999999, 9999999,99999999, 999999999};

◆ MIN_DIGIT

std::array<int, 9> MIN_DIGIT = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000}
constexpr

Implementation of classification functions according to PDG2022.

https://pdg.lbl.gov/2023/reviews/rpp2022-rev-monte-carlo-numbering.pdf This code is also available at https://gitlab.cern.ch/averbyts/atlaspid

Definition at line 17 of file AtlasPID.h.

17{1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000};

◆ MUON

const int MUON = 13
static

Definition at line 90 of file AtlasPID.h.

◆ NEON

const int NEON = 1000100200
static

Definition at line 162 of file AtlasPID.h.

◆ NEUTRON

const int NEUTRON = 2112
static

Definition at line 138 of file AtlasPID.h.

◆ NU_E

const int NU_E = 12
static

Definition at line 89 of file AtlasPID.h.

◆ NU_MU

const int NU_MU = 14
static

Definition at line 91 of file AtlasPID.h.

◆ NU_TAU

const int NU_TAU = 16
static

Definition at line 93 of file AtlasPID.h.

◆ NUPRIME

const int NUPRIME = 18
static

Definition at line 95 of file AtlasPID.h.

◆ ODDERON

const int ODDERON = 9990
static

Definition at line 171 of file AtlasPID.h.

◆ OXYGEN

const int OXYGEN = 1000080160
static

Definition at line 163 of file AtlasPID.h.

◆ PHOTON

const int PHOTON = 22
static

Definition at line 100 of file AtlasPID.h.

◆ PI0

const int PI0 = 111
static

Definition at line 124 of file AtlasPID.h.

◆ PIMINUS

const int PIMINUS = -PIPLUS
static

Definition at line 123 of file AtlasPID.h.

◆ PIPLUS

const int PIPLUS = 211
static

Definition at line 122 of file AtlasPID.h.

◆ POMERON

const int POMERON = 990
static

PDG rule 8: The pomeron and odderon trajectories and a generic reggeon trajectory of states in QCD are assigned codes 990, 9990, and 110 respectively.

Definition at line 170 of file AtlasPID.h.

◆ POSITRON

const int POSITRON = -ELECTRON
static

Definition at line 88 of file AtlasPID.h.

◆ PROTON

const int PROTON = 2212
static

Definition at line 137 of file AtlasPID.h.

◆ PSI2S

const int PSI2S = 20443
static

Definition at line 142 of file AtlasPID.h.

◆ QUARK_LIMIT

const int QUARK_LIMIT = BPRIME
static

Definition at line 85 of file AtlasPID.h.

◆ REGGEON

const int REGGEON = 110
static

Definition at line 172 of file AtlasPID.h.

◆ RH_NU_E

const int RH_NU_E = 9900012
static

PDG Rule 12: Occasionally program authors add their own states.

To avoid confusion, these should be flagged by setting nnr = 99. Generator defined PDG ID values for right handed neutrinos and corresponding W+ boson from a Left-Right symmetric Standard Model extension. (Defined for some MadGraph+Pythia8 samples and referenced in MCTruthClassifierGen.cxx)

Definition at line 151 of file AtlasPID.h.

◆ RH_NU_MU

const int RH_NU_MU = 9900014
static

Definition at line 152 of file AtlasPID.h.

◆ RH_NU_TAU

const int RH_NU_TAU = 9900016
static

Definition at line 153 of file AtlasPID.h.

◆ SQUARK

const int SQUARK = 3
static

Definition at line 77 of file AtlasPID.h.

◆ TABLESIZE

const int TABLESIZE = 100
static

Definition at line 43 of file AtlasPID.h.

◆ TAU

const int TAU = 15
static

Definition at line 92 of file AtlasPID.h.

◆ TPRIME

const int TPRIME = 8
static

Definition at line 84 of file AtlasPID.h.

◆ TQUARK

const int TQUARK = 6
static

Definition at line 80 of file AtlasPID.h.

◆ triple_charge

const std::array<int,TABLESIZE> triple_charge
static
Initial value:
= {
+0, -1, +2, -1, +2, -1, +2, -1, +2, +0,
+0, -3, +0, -3, +0, -3, +0, -3, +0, +0,
+0, +0, +0, +0, +3, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +3, +0, +0, +3, +6, +0,
+0, +0, -1, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
+0, +0, +0, +0, +0, +0, +0, +0, +0, +0
}

Definition at line 44 of file AtlasPID.h.

44 {
45 +0, -1, +2, -1, +2, -1, +2, -1, +2, +0,
46 +0, -3, +0, -3, +0, -3, +0, -3, +0, +0,
47 +0, +0, +0, +0, +3, +0, +0, +0, +0, +0,
48 +0, +0, +0, +0, +3, +0, +0, +3, +6, +0,
49 +0, +0, -1, +0, +0, +0, +0, +0, +0, +0,
50 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
51 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
52 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
53 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
54 +0, +0, +0, +0, +0, +0, +0, +0, +0, +0
55};

◆ UQUARK

const int UQUARK = 2
static

Definition at line 76 of file AtlasPID.h.

◆ WBOSON_LRSM

const int WBOSON_LRSM = 9900024
static

Definition at line 154 of file AtlasPID.h.

◆ WPLUSBOSON

const int WPLUSBOSON = 24
static

Definition at line 102 of file AtlasPID.h.

◆ WPLUSPRIME

const int WPLUSPRIME = 34
static

Definition at line 106 of file AtlasPID.h.

◆ Z0BOSON

const int Z0BOSON = 23
static

Definition at line 101 of file AtlasPID.h.

◆ ZDBLPRIME

const int ZDBLPRIME = 33
static

Definition at line 105 of file AtlasPID.h.

◆ ZPRIME

const int ZPRIME = 32
static

Definition at line 104 of file AtlasPID.h.