ATLAS Offline Software
Classes | Functions
AtlasPID.h File Reference
#include <vector>
#include <cmath>
#include <algorithm>
#include <array>
#include <cstdlib>
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
 Implementation of classification functions according to PDG2022. More...
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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? APID: 4th generation fermions are not standard model particles. More...
 
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. More...
 
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. More...
 
template<>
bool isMeson (const DecodedPID &p)
 
template<>
bool isMeson (const int &p)
 
template<class T >
bool isQuarkonium (const T &p)
 Is this a heavy-flavour quarkonium meson? More...
 
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. More...
 
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. More...
 
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. More...
 
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 areassigned codes 990, 9990, and 110 respectively. More...
 
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. More...
 
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) More...
 
template<>
bool isHeavyBoson (const int &p)
 
template<class T >
bool isHiggs (const T &p)
 APID: HIGGS boson is only one particle. More...
 
template<>
bool isHiggs (const int &p)
 
template<class T >
bool isMSSMHiggs (const T &p)
 APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier) More...
 
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. More...
 
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 isNeutrinoRH (const T &p)
 PDG Rule 12: APID: Helper function for right-handed neutrino states These are generator defined PDG ID values for right handed neutrinos. More...
 
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. More...
 
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)
 APID: Definition of Glueballs: SM glueballs 99X (X=1,5), 999Y (Y=3,7) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 classificationis too early. More...
 
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. More...
 
template<>
bool isHiddenValley (const DecodedPID &p)
 
template<>
bool isHiddenValley (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. More...
 
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. More...
 
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. More...
 
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-sepcific convention: all particles which are 99xxxxx are fine. More...
 
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)
 

Function Documentation

◆ baryonNumber() [1/3]

template<>
double baryonNumber ( const DecodedPID p)
inline

Definition at line 769 of file AtlasPID.h.

769 { return static_cast<double>(baryonNumber3(p))/3.0;}

◆ baryonNumber() [2/3]

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

Definition at line 770 of file AtlasPID.h.

770 { 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 768 of file AtlasPID.h.

768 {return baryonNumber(p->pdg_id());}

◆ baryonNumber3() [1/3]

template<>
int baryonNumber3 ( const DecodedPID p)
inline

Definition at line 744 of file AtlasPID.h.

744  {
745  if (isQuark(p.pid())) { return (p.pid() > 0) ? 1 : - 1;}
746  if (isDiquark(p)) { return (p.pid() > 0) ? 2 : -2; }
747  if (isMeson(p) || isTetraquark(p)) { return 0; }
748  if (isBaryon(p) || isPentaquark(p)){ return (p.pid() > 0) ? 3 : -3; }
749  if (isNucleus(p)) {
750  const int result = 3*p(8) + 30*p(7) + 300*p(6);
751  return (p.pid() > 0) ? result : -result;
752  }
753  if (isSUSY(p)) {
754  auto pp = p.shift(1);
755  if (pp.ndigits() < 3 ) { return baryonNumber3(pp); } // super-partners of fundamental particles
756  if (pp(0) == COMPOSITEGLUON) {
757  if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
758  if ( pp.ndigits() == 4 ) { return 0; } // states with gluino-quark-antiquark
759  if ( pp.ndigits() == 5) { return (p.pid() > 0) ? 3 : -3; } // states with gluino-quark-quark-quark
760  }
761  if (pp.ndigits() == 3) { return 0; } // squark-antiquark
762  if (pp.ndigits() == 4) { return (p.pid() > 0) ? 3 : -3; } // states with squark-quark-quark
763  }
764  return 0;
765 }

◆ baryonNumber3() [2/3]

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

Definition at line 766 of file AtlasPID.h.

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

◆ baryonNumber3() [3/3]

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

Definition at line 743 of file AtlasPID.h.

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

◆ charge()

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

Definition at line 991 of file AtlasPID.h.

991  {
992  if (isGenericMultichargedParticle(p)) // BSM multi-charged particles might have a fractional charge that's not a multiple of 1/3
993  return fractionalCharge(p);
994  else
995  return 1.0*charge3(p)/3.0;
996 }

◆ 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 1001 of file AtlasPID.h.

1001  {
1002  auto ap = std::abs(p.pid());
1003  if (ap < TABLESIZE ) return p.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
1004  if (ap == K0) return 0;
1005  if (ap == GEANTINO0) return 0;
1006  if (ap == GEANTINOPLUS) return p.pid() > 0 ? 3 : -3;
1007  if (ap == MAVTOP) return p.pid() > 0 ? 2 : -2;
1008  size_t nq = 0;
1009  int sign = 1;
1010  int signmult = 1;
1011  int result=0;
1012  bool classified = false;
1013  if (!classified && isMeson(p)) { classified = true; nq = 2; if ((*(p.second.rbegin()+2)) == 2||(*(p.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
1014  if (!classified && isDiquark(p)) {return triple_charge.at(p(0))+triple_charge.at(p(1)); }
1015  if (!classified && isBaryon(p)) { classified = true; nq = 3; }
1016  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)); }
1017  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)); }
1018  if (!classified && isNucleus(p)) { return 3*numberOfProtons(p);}
1019  if (!classified && isSUSY(p)) {
1020  nq = 0;
1021  auto pp = p.shift(1);
1022  if (pp.ndigits() < 3 ) { return charge3(pp); } // super-partners of fundamental particles
1023  if (pp(0) == COMPOSITEGLUON) {
1024  if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
1025  if ( pp.ndigits() == 4 || pp.ndigits() == 5) {
1026  pp = pp.shift(1); // Remove gluino
1027  }
1028  }
1029  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
1030  if (pp.ndigits() == 4) { classified = true; nq = 3; } // states with squark-quark-quark or quark-quark-quark
1031  }
1032  if (!classified && isHiddenValley(p)) { // Hidden Valley particles
1033  auto pp = p.shift(2);
1034  if (!classified && isMeson(pp)) { classified = true; nq = 2; if ((*(pp.second.rbegin()+2)) == 2||(*(pp.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
1035  if (!classified && isDiquark(pp)) {return triple_charge.at(pp(0))+triple_charge.at(pp(1)); }
1036  if (!classified && isBaryon(pp)) { classified = true; nq = 3; }
1037 
1038  }
1039  if (!classified && isKK(p)) { // Kaluza-Klein particles
1040  auto pp = p.shift(2);
1041  auto ap = std::abs(pp.pid());
1042  if (ap < TABLESIZE ) return pp.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
1043 
1044  }
1045  if (!classified && isMonopole(p)) {
1048  result = 3*(p(3)*100 + p(4)*10 + p(5));
1049  return ( (p.pid() > 0 && p(2) == 1) || (p.pid() < 0 && p(2) == 2) ) ? result : -result;
1050  }
1051  if (!classified && isGenericMultichargedParticle(p)) {
1052  double abs_charge = 0.0;
1053  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
1054  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
1055  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
1056  return p.pid() > 0 ? abs_threecharge : -1 * abs_threecharge;
1057  }
1058  for (auto r = p.second.rbegin() + 1; r != p.second.rbegin() + 1 + nq; ++r) {
1059  result += triple_charge.at(*r)*sign;
1060  sign*=signmult;
1061  }
1062  return p.pid() > 0 ? result : -result;
1063 }

◆ charge3() [2/3]

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

Definition at line 1064 of file AtlasPID.h.

1064  {
1065  int ap = std::abs(p);
1066  if (ap < TABLESIZE) return p > 0 ? triple_charge.at(ap):-triple_charge.at(ap);
1067  auto value_digits = DecodedPID(p);
1068  return charge3(value_digits);
1069 }

◆ charge3() [3/3]

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

Definition at line 989 of file AtlasPID.h.

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

◆ containedQuarks() [1/3]

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

Definition at line 1154 of file AtlasPID.h.

1154 { return containedQuarks(p.pid()); }

◆ containedQuarks() [2/3]

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

Definition at line 1132 of file AtlasPID.h.

1132  {
1133  auto pp = DecodedPID(p);
1134  std::vector<int> quarks;
1135  if (isQuark(pp.pid())) { quarks.push_back(std::abs(pp.pid())); }
1136  else if (isDiquark(pp)) { quarks.push_back(pp(0)); quarks.push_back(pp(1)); }
1137  else if (isMeson(pp)) { quarks.push_back(*(pp.second.rbegin() + 1)); quarks.push_back(*(pp.second.rbegin()+2)); }
1138  else if (isBaryon(pp)) { for (size_t digit = 1; digit < 4; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1139  else if (isTetraquark(pp)) { for (size_t digit = 1; digit < 5; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1140  else if (isPentaquark(pp)) { for (size_t digit = 1; digit < 6; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1141  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));
1142  const int n_uquarks = A + Z; const int n_dquarks = 2*A - Z - L; const int n_squarks = L;
1143  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); }
1144  else if (isSUSY(pp)) { // APID SUSY case
1145  pp = pp.shift(1);
1146  if ( pp.ndigits() > 1 ) { // skip squarks
1147  if ( pp.ndigits() == 3 ) { pp = DecodedPID(pp(1)); } // Handle ~q qbar pairs
1148  if ( pp.ndigits() > 3 ) { pp = pp.shift(1); } // Drop gluinos and squarks
1149  return containedQuarks(pp.pid());
1150  }
1151  }
1152  return quarks;
1153 }

◆ containedQuarks() [3/3]

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

Definition at line 1131 of file AtlasPID.h.

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

◆ fractionalCharge() [1/3]

template<>
double fractionalCharge ( const DecodedPID p)
inline

Definition at line 1077 of file AtlasPID.h.

1077  {
1078  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
1079  double abs_charge = 0;
1080  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
1081  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
1082  return p.pid() > 0 ? abs_charge : -1 * abs_charge;
1083 }

◆ fractionalCharge() [2/3]

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

Definition at line 1084 of file AtlasPID.h.

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

◆ fractionalCharge() [3/3]

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

Definition at line 990 of file AtlasPID.h.

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

◆ hasBottom()

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

Definition at line 733 of file AtlasPID.h.

733 { return hasQuark(p,BQUARK); }

◆ hasCharm()

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

Definition at line 732 of file AtlasPID.h.

732 { return hasQuark(p,CQUARK); }

◆ hasQuark() [1/3]

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

Definition at line 711 of file AtlasPID.h.

711  {
712  if (isQuark(p.pid())) { return (std::abs(p.pid()) == q );}
713  if (isMeson(p)) { return *(p.second.rbegin() + 1) == q ||*(p.second.rbegin()+2) ==q;}
714  if (isDiquark(p)) { auto i = std::find(p.second.rbegin() + 2,p.second.rbegin()+4,q); return (i!=p.second.rbegin()+4);}
715  if (isBaryon(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+4,q); return (i!=p.second.rbegin()+4);}
716  if (isTetraquark(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+5,q); return (i!=p.second.rbegin()+5);}
717  if (isPentaquark(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+6,q); return (i!=p.second.rbegin()+6);}
718  if (isNucleus(p) && std::abs(p.pid()) != PROTON) { return (q == 1 || q == 2 || (q==3 && p(2) > 0));}
719  if (isSUSY(p)) { // APID SUSY case
720  auto pp = p.shift(1);
721  if ( pp.ndigits() == 1 ) { return false; } // Handle squarks
722  if ( pp.ndigits() == 3 ) { return (pp(1) == q); } // Handle ~q qbar pairs
723  if ( pp.ndigits() == 4 ) { return (pp(1) == q || pp(2) == q); } // Ignore gluinos and squarks
724  if ( pp.ndigits() == 5 ) { return (pp(1) == q || pp(2) == q || pp(3) == q); } // Ignore gluinos and squarks
725  if ( pp.ndigits() > 5 ) { pp = pp.shift(1); } // Drop gluinos and squarks
726  return hasQuark(pp, q); }
727  return false;
728 }

◆ hasQuark() [2/3]

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

Definition at line 729 of file AtlasPID.h.

729 { 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 608 of file AtlasPID.h.

608  {
609  auto pp = p.shift(1); return (
610  (isSquark(p) || isRHadron(p))
611  && pp.ndigits() != 2 // skip lepton and boson super-partners by vetoing ndigits==2
612  && pp(0) == q // After shifting, the first digit will always represent the squark in R-Hadron (and squark) PIDs
613  );
614 }

◆ hasSquark() [2/3]

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

Definition at line 615 of file AtlasPID.h.

615 { auto value_digits = DecodedPID(p); return hasSquark(value_digits, q);}

◆ hasSquark() [3/3]

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

Definition at line 607 of file AtlasPID.h.

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

◆ hasStrange()

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

Definition at line 731 of file AtlasPID.h.

731 { return hasQuark(p,SQUARK); }

◆ hasTop()

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

Definition at line 734 of file AtlasPID.h.

734 { return hasQuark(p,TQUARK); }

◆ isBaryon() [1/3]

template<>
bool isBaryon ( const DecodedPID p)
inline

Definition at line 280 of file AtlasPID.h.

280  {
281  if (p.ndigits() < 4 ) return false;
282  if (p.max_digit(1,4) >= QUARK_LIMIT ) return false; // Ignore pdg_ids which would describe states including fourth generation quarks
283  if (p.min_digit(1,4) == 0) return false; // Ignore pdg_ids with zero for nq1, nq2, nq3
284  if (p.ndigits() == 4 && (p.last() == 2 || p.last() == 4|| p.last() == 6|| p.last() == 8) ) return true;
285 
286  if (p.ndigits() == 5 && p(0) == 1 && (p.last() == 2 || p.last() == 4) ) return true;
287  if (p.ndigits() == 5 && p(0) == 3 && (p.last() == 2 || p.last() == 4) ) return true;
288 
289  if (p.ndigits() == 6 ) {
290  if (p(0) == 1 && p(1) == 0 && p.last() == 2 ) return true;
291  if (p(0) == 1 && p(1) == 0 && p.last() == 4 ) return true;
292  if (p(0) == 1 && p(1) == 0 && p.last() == 6 ) return true;
293  if (p(0) == 1 && p(1) == 1 && p.last() == 2 ) return true;
294  if (p(0) == 1 && p(1) == 2 && p.last() == 4 ) return true;
295 
296  if (p(0) == 2 && p(1) == 0 && p.last() == 2 ) return true;
297  if (p(0) == 2 && p(1) == 0 && p.last() == 4 ) return true;
298  if (p(0) == 2 && p(1) == 0 && p.last() == 6 ) return true;
299  if (p(0) == 2 && p(1) == 0 && p.last() == 8 ) return true;
300  if (p(0) == 2 && p(1) == 1 && p.last() == 2 ) return true;
301  }
302 
303  if (p.ndigits() == 5 ) {
304  if (p(0) == 2 && p.last() == 2 ) return true;
305  if (p(0) == 2 && p.last() == 4 ) return true;
306  if (p(0) == 2 && p.last() == 6 ) return true;
307  if (p(0) == 5 && p.last() == 2 ) return true;
308  if (p(0) == 1 && p.last() == 6 ) return true;
309  if (p(0) == 4 && p.last() == 2 ) return true;
310  }
311  return false;
312 }

◆ isBaryon() [2/3]

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

Definition at line 313 of file AtlasPID.h.

313 { auto value_digits = DecodedPID(p); return isBaryon(value_digits);}

◆ 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 279 of file AtlasPID.h.

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

◆ isBBbarMeson() [1/3]

template<>
bool isBBbarMeson ( const DecodedPID p)
inline

Definition at line 921 of file AtlasPID.h.

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

◆ isBBbarMeson() [2/3]

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

Definition at line 922 of file AtlasPID.h.

922 { return isBBbarMeson(DecodedPID(p)); }

◆ isBBbarMeson() [3/3]

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

Definition at line 920 of file AtlasPID.h.

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

◆ isBoson() [1/3]

template<>
bool isBoson ( const DecodedPID p)
inline

Definition at line 368 of file AtlasPID.h.

368 { return isBoson(p.pid()); }

◆ isBoson() [2/3]

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

Definition at line 367 of file AtlasPID.h.

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

◆ 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 366 of file AtlasPID.h.

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

◆ isBottom() [1/2]

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

Definition at line 180 of file AtlasPID.h.

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

◆ isBottom() [2/2]

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

Definition at line 179 of file AtlasPID.h.

179 {return isBottom(p->pdg_id());}

◆ isBottomBaryon()

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

Definition at line 929 of file AtlasPID.h.

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

◆ isBottomHadron()

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

Definition at line 906 of file AtlasPID.h.

906 { return leadingQuark(p) == BQUARK && isHadron(p); }

◆ isBottomMeson()

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

Definition at line 913 of file AtlasPID.h.

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

◆ isBSM() [1/3]

template<>
bool isBSM ( const DecodedPID p)
inline

Definition at line 842 of file AtlasPID.h.

842  {
843  if (p.pid() == GRAVITON || std::abs(p.pid()) == MAVTOP || p.pid() == DARKPHOTON) return true;
844  if (std::abs(p.pid()) > 16 && std::abs(p.pid()) < 19) return true;
845  if (std::abs(p.pid()) > 31 && std::abs(p.pid()) < 39) return true;
846  if (std::abs(p.pid()) > 39 && std::abs(p.pid()) < 81) return true;
847  if (std::abs(p.pid()) > 6 && std::abs(p.pid()) < 9) return true;
848  if (isSUSY(p)) return true;
849  if (isNeutrinoRH(p.pid())) return true;
850  if (isGenericMultichargedParticle(p)) return true;
851  if (isTechnicolor(p)) return true;
852  if (isExcited(p)) return true;
853  if (isKK(p)) return true;
854  if (isHiddenValley(p)) return true;
855  if (isMonopole(p)) return true;
856  return false;
857 }

◆ isBSM() [2/3]

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

Definition at line 858 of file AtlasPID.h.

858  {
859  if (p == GRAVITON || std::abs(p) == MAVTOP || p == DARKPHOTON) return true;
860  if (std::abs(p) > 16 && std::abs(p) < 19) return true;
861  if (std::abs(p) > 31 && std::abs(p) < 38) return true;
862  if (std::abs(p) > 39 && std::abs(p) < 81) return true;
863  if (std::abs(p) > 6 && std::abs(p) < 9) return true;
864  auto value_digits = DecodedPID(p); return isBSM(value_digits);
865 }

◆ isBSM() [3/3]

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

APID: graviton and all Higgs extensions are BSM.

Definition at line 841 of file AtlasPID.h.

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

◆ isCCbarMeson() [1/3]

template<>
bool isCCbarMeson ( const DecodedPID p)
inline

Definition at line 917 of file AtlasPID.h.

917 { 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 918 of file AtlasPID.h.

918 { return isCCbarMeson(DecodedPID(p)); }

◆ isCCbarMeson() [3/3]

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

Definition at line 916 of file AtlasPID.h.

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

◆ isCharged()

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

Definition at line 998 of file AtlasPID.h.

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

◆ isCharm() [1/2]

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

Definition at line 177 of file AtlasPID.h.

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

◆ isCharm() [2/2]

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

Definition at line 176 of file AtlasPID.h.

176 {return isCharm(p->pdg_id());}

◆ isCharmBaryon()

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

Definition at line 928 of file AtlasPID.h.

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

◆ isCharmHadron()

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

Definition at line 905 of file AtlasPID.h.

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

◆ isCharmMeson()

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

Definition at line 912 of file AtlasPID.h.

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

◆ isChLepton() [1/2]

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

Definition at line 197 of file AtlasPID.h.

197 { auto sp = std::abs(p); return sp >= ELECTRON && sp <= LPRIME && sp%2 == 1; }

◆ isChLepton() [2/2]

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

APID: the fourth generation leptons are leptons.

Definition at line 196 of file AtlasPID.h.

196 {return isChLepton(p->pdg_id());}

◆ isDiquark() [1/3]

template<>
bool isDiquark ( const DecodedPID p)
inline

Definition at line 225 of file AtlasPID.h.

225  {
226  if ( p.ndigits() == 4 && p(0) >= p(1) && p(1) !=0 && p(2) == 0 && (p.last() == 1 || p.last() == 3)
227  && p.max_digit(2,4) < QUARK_LIMIT
228  ) return true;
229  return false;
230 }

◆ isDiquark() [2/3]

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

Definition at line 231 of file AtlasPID.h.

231 { 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 224 of file AtlasPID.h.

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

◆ isDM() [1/2]

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

Definition at line 657 of file AtlasPID.h.

657 { auto sp = std::abs(p); return (sp >= 51 && sp <= 60) || 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 classificationis 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 negativecodes, may or may not exist. More elaborate new scenarios should be constructed with n= 5 and nr = 9. APID: Only the 51-60 range is considered DM. The antiparticles are assumed to exist.

Definition at line 656 of file AtlasPID.h.

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

◆ isElectron() [1/2]

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

Definition at line 200 of file AtlasPID.h.

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

◆ isElectron() [2/2]

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

Definition at line 199 of file AtlasPID.h.

199 {return isElectron(p->pdg_id());}

◆ isEMInteracting() [1/2]

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

Definition at line 1088 of file AtlasPID.h.

1088 {return (isPhoton(p) || isZ(p) || p == ZPRIME || p == ZDBLPRIME || std::abs(charge(p))>std::numeric_limits<double>::epsilon() || isMonopole(p));}

◆ isEMInteracting() [2/2]

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

Definition at line 1087 of file AtlasPID.h.

1087 {return isEMInteracting(p->pdg_id());}

◆ isExcited() [1/3]

template<>
bool isExcited ( const DecodedPID p)
inline

Definition at line 535 of file AtlasPID.h.

535  {
536  const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
537  return (p.ndigits() == 7 && (p(0) == 4 && p(1) == 0) &&
538  (isLepton(pp) || isQuark(pp)));
539 }

◆ isExcited() [2/3]

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

Definition at line 540 of file AtlasPID.h.

540 { 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 533 of file AtlasPID.h.

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

◆ isFourthGeneration() [1/2]

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

Definition at line 218 of file AtlasPID.h.

218 {return std::abs(p) == BPRIME || std::abs(p) == TPRIME || std::abs(p) == LPRIME || std::abs(p) == NUPRIME;}

◆ 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 217 of file AtlasPID.h.

217 {return isFourthGeneration(p->pdg_id());}

◆ isGaugino() [1/3]

template<>
bool isGaugino ( const DecodedPID p)
inline

Definition at line 502 of file AtlasPID.h.

502  {
503  auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 1 && isBoson(pp.pid()));
504 }

◆ isGaugino() [2/3]

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

Definition at line 505 of file AtlasPID.h.

505 { auto value_digits = DecodedPID(p); return isGaugino(value_digits);}

◆ isGaugino() [3/3]

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

Definition at line 501 of file AtlasPID.h.

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

◆ isGeantino() [1/2]

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

Definition at line 435 of file AtlasPID.h.

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

◆ isGeantino() [2/2]

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

Definition at line 434 of file AtlasPID.h.

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

◆ isGenericMultichargedParticle() [1/3]

template<>
bool isGenericMultichargedParticle ( const DecodedPID p)
inline

Definition at line 680 of file AtlasPID.h.

680 {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 681 of file AtlasPID.h.

681 { 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 (1301.5272,1504.04188) and Run-2 (1812.03673,2303.13613) ATLAS searches.

Definition at line 679 of file AtlasPID.h.

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

◆ isGenSpecific() [1/2]

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

Definition at line 423 of file AtlasPID.h.

423  {
424  int ap = std::abs(p);
425  if (ap >= 81 && ap <= 100) return true;
426  if (ap >= 901 && ap <= 930) return true;
427  if (ap >= 998 && ap <= 999) return true;
428  if (ap >= 1901 && ap <= 1930) return true;
429  if (ap >= 2901 && ap <= 2930) return true;
430  if (ap >= 3901 && ap <= 3930) return true;
431  return false;
432 }

◆ 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 422 of file AtlasPID.h.

422 {return isGenSpecific(p->pdg_id());}

◆ isGlueball() [1/3]

template<>
bool isGlueball ( const DecodedPID p)
inline

Definition at line 439 of file AtlasPID.h.

439  {
440  if (p.ndigits() > 4) return false; // APID avoid classifying R-Glueballs as SM Glueballs
441  return
442  ( ( p.ndigits() == 3 && p(0) == COMPOSITEGLUON && p(1) == COMPOSITEGLUON && (p.last() == 1 || p.last() == 5) ) ||
443  ( p.ndigits() == 4 && p(0) == COMPOSITEGLUON && p(1) == COMPOSITEGLUON && p(2) == COMPOSITEGLUON && (p.last() == 3 || p.last() == 7) ) );
444 }

◆ isGlueball() [2/3]

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

Definition at line 445 of file AtlasPID.h.

445 { auto value_digits = DecodedPID(p); return isGlueball(value_digits); }

◆ isGlueball() [3/3]

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

APID: Definition of Glueballs: SM glueballs 99X (X=1,5), 999Y (Y=3,7)

Definition at line 438 of file AtlasPID.h.

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

◆ isGluon() [1/2]

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

Definition at line 371 of file AtlasPID.h.

371 { return p == GLUON; }

◆ isGluon() [2/2]

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

Definition at line 370 of file AtlasPID.h.

370 {return isGluon(p->pdg_id());}

◆ isGraviton() [1/2]

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

Definition at line 395 of file AtlasPID.h.

395 { return p == GRAVITON; }

◆ isGraviton() [2/2]

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

Definition at line 394 of file AtlasPID.h.

394 {return isGraviton(p->pdg_id());}

◆ isHadron() [1/3]

template<>
bool isHadron ( const DecodedPID p)
inline

Definition at line 349 of file AtlasPID.h.

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

◆ isHadron() [2/3]

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

Definition at line 350 of file AtlasPID.h.

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

◆ isHadron() [3/3]

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

Definition at line 348 of file AtlasPID.h.

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

◆ isHeavyBaryon()

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

Definition at line 926 of file AtlasPID.h.

926 { 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 384 of file AtlasPID.h.

384 { return p == ZPRIME || p == ZDBLPRIME || std::abs(p) == WPLUSPRIME; }

◆ 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 383 of file AtlasPID.h.

383 {return isHeavyBoson(p->pdg_id());}

◆ isHeavyHadron()

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

Definition at line 903 of file AtlasPID.h.

903 { 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 910 of file AtlasPID.h.

910 { 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 665 of file AtlasPID.h.

665  {
666  const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
667  return (p.ndigits() == 7 && p(0) == 4 && p(1) == 9 &&
668  (isQuark(pp) || isLepton(pp) || isBoson(pp) || isGlueball(pp) ||
669  isDiquark(pp) || isHadron(pp)));
670 }

◆ isHiddenValley() [2/3]

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

Definition at line 671 of file AtlasPID.h.

671 { 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 663 of file AtlasPID.h.

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

◆ isHiggs() [1/2]

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

Definition at line 388 of file AtlasPID.h.

388 { return p == HIGGSBOSON; }

◆ isHiggs() [2/2]

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

APID: HIGGS boson is only one particle.

Definition at line 387 of file AtlasPID.h.

387 {return isHiggs(p->pdg_id());}

◆ isKK() [1/3]

template<>
bool isKK ( const DecodedPID p)
inline

Definition at line 633 of file AtlasPID.h.

633 {return (p.ndigits() == 7 && (p(0) == 5 || p(0) == 6 ) );}

◆ isKK() [2/3]

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

Definition at line 634 of file AtlasPID.h.

634 { 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 632 of file AtlasPID.h.

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

◆ isLepton() [1/3]

template<>
bool isLepton ( const DecodedPID p)
inline

Definition at line 188 of file AtlasPID.h.

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

◆ isLepton() [2/3]

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

Definition at line 187 of file AtlasPID.h.

187 { 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 186 of file AtlasPID.h.

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

◆ isLeptoQuark() [1/2]

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

Definition at line 406 of file AtlasPID.h.

406 { return std::abs(p) == LEPTOQUARK; }

◆ 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 405 of file AtlasPID.h.

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

◆ isLightBaryon()

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

Definition at line 925 of file AtlasPID.h.

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

◆ isLightHadron()

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

Definition at line 902 of file AtlasPID.h.

902 { 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 909 of file AtlasPID.h.

909 { 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 242 of file AtlasPID.h.

242  {
243  if (p.ndigits() < 3 ) return false;
244  if (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2)) return false; // APID don't match SUSY particles
245  if (std::abs(p.pid()) == K0S) return true;
246  if (std::abs(p.pid()) == K0L) return true;
247  if (std::abs(p.pid()) == K0) return true;
248  if (p.last() % 2 != 1 ) return false;
249  if (p.max_digit(1,3) >= QUARK_LIMIT ) return false; // Ignore pdg_ids which would describe states including fourth generation quarks
250  if (p.min_digit(1,3) == 0 ) return false;
251  if (*(p.second.rbegin() + 2) < *(p.second.rbegin() + 1) ) return false; // Quark ordering (nq2 >= nq3)
252  if (*(p.second.rbegin() + 2) == *(p.second.rbegin() + 1) && p.pid() < 0 ) return false; // Illegal antiparticle check (nq2 == nq3)
253  if (p.ndigits() == 3 ) return true;
254  if (*(p.second.rbegin() + 3) != 0 ) return false; // Only two quarks! (nq1 == 0)
255  if (p.ndigits() == 5 && p(0) == 1 ) return true;
256  if (p.ndigits() == 5 && p(0) == 2 && p.last() > 1 ) return true;
257  if (p.ndigits() == 5 && p(0) == 3 && p.last() > 1 ) return true;
258  if (p.ndigits() == 6 && p.last() % 2 == 1 ) return true;
259  if (p.ndigits() == 7 && p(0) == 9 && p(1) == 0 ) return true;
260 
261  return false;
262 }

◆ isMeson() [2/3]

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

Definition at line 263 of file AtlasPID.h.

263 { 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 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 241 of file AtlasPID.h.

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

◆ isMonopole() [1/3]

template<>
bool isMonopole ( const DecodedPID p)
inline

Definition at line 643 of file AtlasPID.h.

643 {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 644 of file AtlasPID.h.

644 { 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 642 of file AtlasPID.h.

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

◆ isMSSMHiggs() [1/2]

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

Definition at line 392 of file AtlasPID.h.

392 { return p == HIGGS2 || p == HIGGS3 || std::abs(p) == HIGGSPLUS; }

◆ isMSSMHiggs() [2/2]

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

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

Definition at line 391 of file AtlasPID.h.

391 {return isMSSMHiggs(p->pdg_id());}

◆ isMuon() [1/2]

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

Definition at line 203 of file AtlasPID.h.

203 { return std::abs(p) == MUON;}

◆ isMuon() [2/2]

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

Definition at line 202 of file AtlasPID.h.

202 {return isMuon(p->pdg_id());}

◆ isNeutral() [1/3]

template<>
bool isNeutral ( const DecodedPID p)
inline

Definition at line 1073 of file AtlasPID.h.

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

◆ isNeutral() [2/3]

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

Definition at line 1074 of file AtlasPID.h.

1074 { auto value_digits = DecodedPID(p); return isNeutral(value_digits);}

◆ isNeutral() [3/3]

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

Definition at line 1072 of file AtlasPID.h.

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

◆ isNeutrino() [1/2]

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

Definition at line 210 of file AtlasPID.h.

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

◆ isNeutrino() [2/2]

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

APID: the fourth generation neutrinos are neutrinos.

Definition at line 209 of file AtlasPID.h.

209 {return isNeutrino(p->pdg_id());}

◆ isNeutrinoRH() [1/2]

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

Definition at line 418 of file AtlasPID.h.

418 { return (std::abs(p) == RH_NU_E || std::abs(p) == RH_NU_MU|| std::abs(p) == RH_NU_TAU);}

◆ isNeutrinoRH() [2/2]

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

PDG Rule 12: 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 417 of file AtlasPID.h.

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

◆ isNucleus() [1/3]

template<>
bool isNucleus ( const DecodedPID p)
inline

Definition at line 698 of file AtlasPID.h.

698  {
699  if (std::abs(p.pid()) == PROTON) return true;
700  if (p.ndigits() != 10) return false;
701  // charge should always be less than or equal to baryon number
702  // the following line is A >= Z
703  const int A = p(8) + 10*p(7) + 100*p(6);
704  const int Z = p(5) + 10*p(4) + 100*p(3);
705  return ( A >= Z && p(0) == 1 && p(1) == 0 );
706 }

◆ isNucleus() [2/3]

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

Definition at line 707 of file AtlasPID.h.

707 { 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 697 of file AtlasPID.h.

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

◆ isParton()

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

Definition at line 1090 of file AtlasPID.h.

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

◆ isPentaquark() [1/3]

template<>
bool isPentaquark ( const DecodedPID p)
inline

Definition at line 340 of file AtlasPID.h.

340  {
341  return (p.ndigits() == 9 && p(0) == 1 &&
342  p.max_digit(1,6) < QUARK_LIMIT && p.min_digit(1,6) > 0 && // ignore 4th generation (anti-)quarks
343  ( p(3) >= p(4) && p(4) >= p(5) && p(5) >= p(6)) );
344 }

◆ isPentaquark() [2/3]

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

Definition at line 345 of file AtlasPID.h.

345 { 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 339 of file AtlasPID.h.

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

◆ isPhoton() [1/2]

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

Definition at line 374 of file AtlasPID.h.

374 { return p == PHOTON; }

◆ isPhoton() [2/2]

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

Definition at line 373 of file AtlasPID.h.

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

◆ isPythia8Specific() [1/3]

template<>
bool isPythia8Specific ( const DecodedPID p)
inline

Definition at line 409 of file AtlasPID.h.

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

◆ isPythia8Specific() [2/3]

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

Definition at line 410 of file AtlasPID.h.

410 { auto value_digits = DecodedPID(p); return isPythia8Specific(value_digits);}

◆ isPythia8Specific() [3/3]

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

Definition at line 408 of file AtlasPID.h.

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

◆ isQuark() [1/3]

template<>
bool isQuark ( const DecodedPID p)
inline

Definition at line 166 of file AtlasPID.h.

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

◆ isQuark() [2/3]

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

Definition at line 165 of file AtlasPID.h.

165 { 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 164 of file AtlasPID.h.

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

◆ isQuarkonium() [1/3]

template<>
bool isQuarkonium ( const DecodedPID p)
inline

Definition at line 271 of file AtlasPID.h.

271  {
272  if (!isMeson(p)) return false; //< all quarkonia are mesons
273  return (*(p.second.rbegin() + 2) > SQUARK && p.last() > 0 && *(p.second.rbegin() + 1) == *(p.second.rbegin() + 2));
274 }

◆ isQuarkonium() [2/3]

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

Definition at line 275 of file AtlasPID.h.

275 { auto value_digits = DecodedPID(p); return isQuarkonium(value_digits);}

◆ isQuarkonium() [3/3]

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

Is this a heavy-flavour quarkonium meson?

Note
Original by LHCb in Rivet analysis LHCB_2016_I1504058
phi = s,sbar is not considered quarkonium

Definition at line 270 of file AtlasPID.h.

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

◆ isRBaryon() [1/3]

template<>
bool isRBaryon ( const DecodedPID p)
inline

Definition at line 587 of file AtlasPID.h.

587  {
588  if (!(p.ndigits() == 7 && (p(0) == 1 || p(0) == 2))) return false;
589  auto pp = p.shift(1);
590  return (
591  // Handle ~gluino-quark-quark-quark states
592  (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)) ||
593  // Handle squark-quark-quark states (previously called Sbaryons)
594  (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))
595  );
596 }

◆ isRBaryon() [2/3]

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

Definition at line 597 of file AtlasPID.h.

597 { auto value_digits = DecodedPID(p); return isRBaryon(value_digits); }

◆ isRBaryon() [3/3]

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

Definition at line 586 of file AtlasPID.h.

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

◆ isResonance()

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

Definition at line 397 of file AtlasPID.h.

397 { return isZ(p) || isW(p) || isHiggs(p) || isTop(p); } // APID: not including t' (pdg_id=8), Z', Z'' and W'+ or BSM Higgs bosons

◆ isRGlueball() [1/3]

template<>
bool isRGlueball ( const DecodedPID p)
inline

Definition at line 560 of file AtlasPID.h.

560  {
561  if (p.ndigits() != 7 || p(0) != 1) return false;
562  auto pp = p.shift(1);
563  return
564  ( ( pp.ndigits() == 3 && pp(0) == COMPOSITEGLUON && pp(1) == COMPOSITEGLUON && (pp.last() == 1 || pp.last() == 3) ) ||
565  ( pp.ndigits() == 4 && pp(0) == COMPOSITEGLUON && pp(1) == COMPOSITEGLUON && pp(2) == COMPOSITEGLUON && (pp.last() == 1 || pp.last() == 5) ) );
566 }

◆ isRGlueball() [2/3]

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

Definition at line 567 of file AtlasPID.h.

567 { auto value_digits = DecodedPID(p); return isRGlueball(value_digits); }

◆ 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 559 of file AtlasPID.h.

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

◆ isRHadron() [1/3]

template<>
bool isRHadron ( const DecodedPID p)
inline

Definition at line 601 of file AtlasPID.h.

601  {
602  return (isRBaryon(p) || isRMeson(p) || isRGlueball(p));
603 }

◆ isRHadron() [2/3]

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

Definition at line 604 of file AtlasPID.h.

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

◆ isRHadron() [3/3]

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

Definition at line 600 of file AtlasPID.h.

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

◆ isRMeson() [1/3]

template<>
bool isRMeson ( const DecodedPID p)
inline

Definition at line 572 of file AtlasPID.h.

572  {
573  if (!(p.ndigits() == 7 && (p(0) == 1 || p(0) == 2))) return false;
574  auto pp = p.shift(1);
575  return (
576  // Handle ~gluino-quark-antiquark states
577  (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)) ||
578  // Handle squark-antiquark states (previously called Smeson/mesoninos)
579  (pp.ndigits() == 3 && pp.min_digit(1,3) > 0 && pp.max_digit(1,3) < QUARK_LIMIT && pp(1) <= pp(0) && pp.last() == 2)
580  );
581 }

◆ isRMeson() [2/3]

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

Definition at line 582 of file AtlasPID.h.

582 { auto value_digits = DecodedPID(p); return isRMeson(value_digits); }

◆ isRMeson() [3/3]

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

Definition at line 571 of file AtlasPID.h.

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

◆ isSlepton() [1/3]

template<>
bool isSlepton ( const DecodedPID p)
inline

Definition at line 480 of file AtlasPID.h.

480 { auto pp = p.shift(1); return (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2) && isSMLepton(pp));}

◆ isSlepton() [2/3]

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

Definition at line 481 of file AtlasPID.h.

481 { auto value_digits = DecodedPID(p); return isSlepton(value_digits);}

◆ isSlepton() [3/3]

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

Definition at line 479 of file AtlasPID.h.

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

◆ isSleptonLH() [1/3]

template<>
bool isSleptonLH ( const DecodedPID p)
inline

Definition at line 486 of file AtlasPID.h.

486  {
487  auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 1 && isSMLepton(pp));
488 }

◆ isSleptonLH() [2/3]

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

Definition at line 489 of file AtlasPID.h.

489 { auto value_digits = DecodedPID(p); return isSleptonLH(value_digits);}

◆ isSleptonLH() [3/3]

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

Definition at line 485 of file AtlasPID.h.

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

◆ isSleptonRH() [1/3]

template<>
bool isSleptonRH ( const DecodedPID p)
inline

Definition at line 494 of file AtlasPID.h.

494  {
495  auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 2 && isSMLepton(pp));
496 }

◆ isSleptonRH() [2/3]

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

Definition at line 497 of file AtlasPID.h.

497 { auto value_digits = DecodedPID(p); return isSleptonRH(value_digits);}

◆ isSleptonRH() [3/3]

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

Definition at line 493 of file AtlasPID.h.

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

◆ isSMLepton() [1/3]

template<>
bool isSMLepton ( const DecodedPID p)
inline

Definition at line 193 of file AtlasPID.h.

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

◆ isSMLepton() [2/3]

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

Definition at line 192 of file AtlasPID.h.

192 { 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 191 of file AtlasPID.h.

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

◆ isSMNeutrino() [1/2]

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

Definition at line 213 of file AtlasPID.h.

213 { 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 212 of file AtlasPID.h.

212 {return isSMNeutrino(p->pdg_id());}

◆ isSMQuark() [1/3]

template<>
bool isSMQuark ( const DecodedPID p)
inline

Definition at line 171 of file AtlasPID.h.

171 { return isSMQuark(p.pid()); }

◆ isSMQuark() [2/3]

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

Definition at line 170 of file AtlasPID.h.

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

◆ isSMQuark() [3/3]

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

Definition at line 169 of file AtlasPID.h.

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

◆ isSquark() [1/3]

template<>
bool isSquark ( const DecodedPID p)
inline

Definition at line 456 of file AtlasPID.h.

456  {
457  auto pp = p.shift(1); return (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2) && isSMQuark(pp));
458 }

◆ isSquark() [2/3]

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

Definition at line 459 of file AtlasPID.h.

459 { 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 455 of file AtlasPID.h.

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

◆ isSquarkLH() [1/3]

template<>
bool isSquarkLH ( const DecodedPID p)
inline

Definition at line 464 of file AtlasPID.h.

464  {
465  auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 1 && isSMQuark(pp));
466 }

◆ isSquarkLH() [2/3]

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

Definition at line 467 of file AtlasPID.h.

467 { auto value_digits = DecodedPID(p); return isSquarkLH(value_digits);}

◆ isSquarkLH() [3/3]

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

Definition at line 463 of file AtlasPID.h.

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

◆ isSquarkRH() [1/3]

template<>
bool isSquarkRH ( const DecodedPID p)
inline

Definition at line 472 of file AtlasPID.h.

472  {
473  auto pp = p.shift(1); return (p.ndigits() == 7 && p(0) == 2 && isSMQuark(pp));
474 }

◆ isSquarkRH() [2/3]

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

Definition at line 475 of file AtlasPID.h.

475 { auto value_digits = DecodedPID(p); return isSquarkRH(value_digits);}

◆ isSquarkRH() [3/3]

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

Definition at line 471 of file AtlasPID.h.

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

◆ isStrange() [1/2]

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

Definition at line 174 of file AtlasPID.h.

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

◆ isStrange() [2/2]

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

Definition at line 173 of file AtlasPID.h.

173 {return isStrange(p->pdg_id());}

◆ isStrangeBaryon()

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

Definition at line 927 of file AtlasPID.h.

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

◆ isStrangeHadron()

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

Definition at line 904 of file AtlasPID.h.

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

◆ isStrangeMeson()

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

Definition at line 911 of file AtlasPID.h.

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

◆ isStrongInteracting() [1/2]

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

Definition at line 1157 of file AtlasPID.h.

1157 { 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 1156 of file AtlasPID.h.

1156 {return isStrongInteracting(p->pdg_id());}

◆ isSuperpartner() [1/3]

template<>
bool isSuperpartner ( const DecodedPID p)
inline

Definition at line 510 of file AtlasPID.h.

510  {
511  return isSlepton(p) || isSquark(p) || isGaugino(p);
512 }

◆ isSuperpartner() [2/3]

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

Definition at line 513 of file AtlasPID.h.

513 { auto value_digits = DecodedPID(p); return isSuperpartner(value_digits);}

◆ isSuperpartner() [3/3]

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

Definition at line 509 of file AtlasPID.h.

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

◆ isSUSY() [1/3]

template<>
bool isSUSY ( const DecodedPID p)
inline

Definition at line 621 of file AtlasPID.h.

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

◆ isSUSY() [2/3]

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

Definition at line 622 of file AtlasPID.h.

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

◆ isSUSY() [3/3]

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

Definition at line 620 of file AtlasPID.h.

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

◆ isTau() [1/2]

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

Definition at line 206 of file AtlasPID.h.

206 { return std::abs(p) == TAU;}

◆ isTau() [2/2]

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

Definition at line 205 of file AtlasPID.h.

205 {return isTau(p->pdg_id());}

◆ isTechnicolor() [1/3]

template<>
bool isTechnicolor ( const DecodedPID p)
inline

Definition at line 523 of file AtlasPID.h.

523  {
524  const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
525  return (p.ndigits() == 7 && p(0) == 3 && (p(1) == 0 || p(1) == 1) &&
526  (isQuark(pp) || isLepton(pp) || isBoson(pp) || isGlueball(pp) ||
527  isDiquark(pp) || isHadron(pp)));
528 }

◆ isTechnicolor() [2/3]

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

Definition at line 529 of file AtlasPID.h.

529 { 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 521 of file AtlasPID.h.

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

◆ isTetraquark() [1/3]

template<>
bool isTetraquark ( const DecodedPID p)
inline

Definition at line 323 of file AtlasPID.h.

323  {
324  return (p.ndigits() == 9 && p(0) == 1 && p(5) == 0 &&
325  p.max_digit(1,3) < QUARK_LIMIT && p.min_digit(1,3) > 0 && // ignore 4th generation quarks for nq3 and nq4
326  p.max_digit(4,6) < QUARK_LIMIT && p.min_digit(4,6) > 0 && // ignore 4th generation quarks for nq1 and nq2
327  ( p(3) >= p(4) && p(6) >= p(7) ) && ( ( p(3) > p(6) ) || ( p(3) == p(6) && (p(4) >= p(7))))
328  );
329 }

◆ isTetraquark() [2/3]

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

Definition at line 330 of file AtlasPID.h.

330 { 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 322 of file AtlasPID.h.

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

◆ isTop() [1/2]

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

Definition at line 183 of file AtlasPID.h.

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

◆ isTop() [2/2]

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

Definition at line 182 of file AtlasPID.h.

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

◆ isTopBaryon()

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

Definition at line 930 of file AtlasPID.h.

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

◆ isTopHadron()

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

Definition at line 907 of file AtlasPID.h.

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

◆ isTopMeson()

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

Definition at line 914 of file AtlasPID.h.

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

◆ isTrajectory() [1/2]

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

Definition at line 357 of file AtlasPID.h.

357 { return std::abs(p) == POMERON || std::abs(p) == ODDERON || std::abs(p) == REGGEON; }

◆ 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 areassigned codes 990, 9990, and 110 respectively.

Definition at line 356 of file AtlasPID.h.

356 {return isTrajectory(p->pdg_id());}

◆ isTransportable() [1/3]

template<>
bool isTransportable ( const DecodedPID p)
inline

Definition at line 868 of file AtlasPID.h.

868 { 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 869 of file AtlasPID.h.

869 { auto value_digits = DecodedPID(p); return isTransportable(value_digits);}

◆ isTransportable() [3/3]

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

Definition at line 867 of file AtlasPID.h.

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

◆ isValid() [1/3]

template<>
bool isValid ( const DecodedPID p)
inline

Definition at line 873 of file AtlasPID.h.

873  {
874  return p.pid() !=0 && ( isQuark(p) || isLepton(p) || isBoson(p) || isGlueball(p) ||
875  isTrajectory(p.pid()) || isGenSpecific(p.pid()) || isDiquark(p) ||
876  isBSM(p) || isHadron(p) || isNucleus(p) || isGeantino(p.pid()) ||
877  isPythia8Specific(p) ); }

◆ isValid() [2/3]

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

Definition at line 878 of file AtlasPID.h.

878  { if (!p) return false; if (std::abs(p) < 42) return true;
879  if (isGenSpecific(p)) return true;
880  auto value_digits = DecodedPID(p); return isValid(value_digits);
881 }

◆ isValid() [3/3]

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

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

Definition at line 872 of file AtlasPID.h.

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

◆ isW() [1/2]

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

Definition at line 380 of file AtlasPID.h.

380 { return std::abs(p) == WPLUSBOSON; }

◆ isW() [2/2]

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

Definition at line 379 of file AtlasPID.h.

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

◆ isWeaklyDecayingBHadron() [1/3]

template<>
bool isWeaklyDecayingBHadron ( const DecodedPID p)
inline

Definition at line 962 of file AtlasPID.h.

962 { return isWeaklyDecayingBHadron(p.pid()); }

◆ isWeaklyDecayingBHadron() [2/3]

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

Definition at line 937 of file AtlasPID.h.

937  {
938  const int pid = std::abs(p);
939  return ( pid == 511 || // B0
940  pid == 521 || // B+
941  pid == 531 || // B_s0
942  pid == 541 || // B_c+
943  pid == 5122 || // Lambda_b0
944  pid == 5132 || // Xi_b-
945  pid == 5232 || // Xi_b0
946  pid == 5112 || // Sigma_b-
947  pid == 5212 || // Sigma_b0
948  pid == 5222 || // Sigma_b+
949  pid == 5332 || // Omega_b-
950  pid == 5142 || // Xi_bc0
951  pid == 5242 || // Xi_bc+
952  pid == 5412 || // Xi'_bc0
953  pid == 5422 || // Xi'_bc+
954  pid == 5342 || // Omega_bc0
955  pid == 5432 || // Omega'_bc0
956  pid == 5442 || // Omega_bcc+
957  pid == 5512 || // Xi_bb-
958  pid == 5522 || // Xi_bb0
959  pid == 5532 || // Omega_bb-
960  pid == 5542 ); // Omega_bbc0
961 }

◆ isWeaklyDecayingBHadron() [3/3]

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

Definition at line 936 of file AtlasPID.h.

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

◆ isWeaklyDecayingCHadron() [1/3]

template<>
bool isWeaklyDecayingCHadron ( const DecodedPID p)
inline

Definition at line 986 of file AtlasPID.h.

986 { return isWeaklyDecayingCHadron(p.pid()); }

◆ isWeaklyDecayingCHadron() [2/3]

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

Definition at line 972 of file AtlasPID.h.

972  {
973  const int pid = std::abs(p);
974  return ( pid == 411 || // D+
975  pid == 421 || // D0
976  pid == 431 || // Ds+
977  pid == 4122 || // Lambda_c+
978  pid == 4132 || // Xi_c0
979  pid == 4232 || // Xi_c+
980  pid == 4212 || // Xi_c0
981  pid == 4332 || // Omega_c0
982  pid == 4412 || // Xi_cc+
983  pid == 4422 || // Xi_cc++
984  pid == 4432 ); // Omega_cc+
985 }

◆ isWeaklyDecayingCHadron() [3/3]

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

Definition at line 971 of file AtlasPID.h.

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

◆ isZ() [1/2]

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

Definition at line 377 of file AtlasPID.h.

377 { return p == Z0BOSON; }

◆ isZ() [2/2]

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

Definition at line 376 of file AtlasPID.h.

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

◆ leadingQuark() [1/3]

template<>
int leadingQuark ( const DecodedPID p)
inline

Definition at line 884 of file AtlasPID.h.

884  {
885  if (isQuark(p.pid())) { return std::abs(p.pid());}
886  if (isMeson(p)) { return p.max_digit(1,3);}
887  if (isDiquark(p)) { return p.max_digit(2,4);}
888  if (isBaryon(p)) { return p.max_digit(1,4);}
889  if (isTetraquark(p)) { return p.max_digit(1,5);}
890  if (isPentaquark(p)) { return p.max_digit(1,6);}
891  if (isSUSY(p)) { // APID SUSY case
892  auto pp = p.shift(1);
893  if ( pp.ndigits() == 1 ) { return 0; } // Handle squarks
894  if ( pp.ndigits() == 3 ) { pp = DecodedPID(pp(1)); } // Handle ~q qbar pairs
895  if ( pp.ndigits() > 3 ) { pp = pp.shift(1); } // Drop gluinos and squarks
896  return leadingQuark(pp); }
897  return 0;
898 }

◆ leadingQuark() [2/3]

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

Definition at line 900 of file AtlasPID.h.

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

◆ leadingQuark() [3/3]

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

Definition at line 883 of file AtlasPID.h.

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

◆ numberOfLambdas() [1/3]

template<>
int numberOfLambdas ( const DecodedPID p)
inline

Definition at line 820 of file AtlasPID.h.

820  {
821  if (std::abs(p.pid()) == LAMBDA0) { return (p.pid() > 0) ? 1 : -1; }
822  if (isNucleus(p) && p.ndigits() == 10) { return (p.pid() > 0) ? p(2) : -p(2); }
823  return 0;
824 }

◆ numberOfLambdas() [2/3]

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

Definition at line 825 of file AtlasPID.h.

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

◆ numberOfLambdas() [3/3]

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

Definition at line 819 of file AtlasPID.h.

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

◆ numberOfProtons() [1/3]

template<>
int numberOfProtons ( const DecodedPID p)
inline

Definition at line 829 of file AtlasPID.h.

829  {
830  if (std::abs(p.pid()) == PROTON) { return (p.pid() > 0) ? 1 : -1; }
831  if (isNucleus(p)) {
832  const int result = p(5) + 10*p(4) + 100*p(3);
833  return (p.pid() > 0) ? result : -result;
834  }
835  return 0;
836 }

◆ numberOfProtons() [2/3]

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

Definition at line 837 of file AtlasPID.h.

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

◆ numberOfProtons() [3/3]

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

Definition at line 828 of file AtlasPID.h.

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

◆ spin() [1/3]

template<>
double spin ( const DecodedPID p)
inline

Definition at line 1126 of file AtlasPID.h.

1126 { return 1.0*spin2(p)/2.0; }

◆ spin() [2/3]

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

Definition at line 1127 of file AtlasPID.h.

1127 { auto value_digits = DecodedPID(p); return spin(value_digits);}

◆ spin() [3/3]

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

Definition at line 1125 of file AtlasPID.h.

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

◆ spin2() [1/3]

template<>
int spin2 ( const DecodedPID p)
inline

Definition at line 1095 of file AtlasPID.h.

1095  {
1096  if (isSUSY(p)) {
1097  auto pp = p.shift(1);
1098  auto ap = std::abs(pp.pid());
1099  if (ap < TABLESIZE ) { return std::abs(double_spin.at(ap)-1); } // sparticles (0->1, 1 -> 0, 2->1, 4->3)
1100  return p.last()-1; // R-Hadrons (p.last() == 2J +1)
1101  }
1102  if (isHiddenValley(p)) { //Hidden Valley spins
1103  auto pp = p.shift(2);
1104  if (isHadron(pp)) { return pp.last()-1; } // Hadrons (p.last == 2J+1 - special cases handled above)
1105  }
1106  if (isKK(p)) { // Kaluza-Klein spins
1107  auto pp = p.shift(2);
1108  auto ap = std::abs(pp.pid());
1109  if (ap < TABLESIZE ) { return double_spin.at(ap); } // fundamental particles
1110  }
1111  auto ap = std::abs(p.pid());
1112  if (ap == K0S) { return 0; }
1113  if (ap == K0L) { return 0; }
1114  if (ap == MAVTOP) { return 1; } // TODO check this
1115  if (ap == DARKPHOTON) { return 2; } // TODO check this
1116  if (ap < TABLESIZE ) { return double_spin.at(ap); } // fundamental particles
1117  if (isHadron(p)) { return p.last()-1; } // Hadrons (p.last == 2J+1 - special cases handled above)
1118  if (isMonopole(p)) { return 0; } // PDG 11i - For now no spin information is provided. Also matches the definition in the G4Extensions/Monopole package.
1119  if (isGenericMultichargedParticle(p)) { return 0; } // APID Matches the definition in the G4Extensions/Monopole package.
1120  if (isNucleus(p)) { return 1; } // TODO need to explicitly deal with nuclei
1121  return p.last() > 0 ? 1 : 0; // Anything else - best guess
1122 }

◆ spin2() [2/3]

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

Definition at line 1123 of file AtlasPID.h.

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

◆ spin2() [3/3]

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

Definition at line 1094 of file AtlasPID.h.

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

◆ strangeness() [1/3]

template<>
int strangeness ( const DecodedPID p)
inline

Definition at line 782 of file AtlasPID.h.

782  {
783  if (isNucleus(p) && p.ndigits() == 10) { return (p.pid() > 0) ? -p(2) : p(2); }
784  if (isStrange(p.pid())) { return (p.pid() > 0) ? -1 : 1; }
785  if (!hasStrange(p) && !hasSquark(p,SQUARK)) { return 0; }
786  if (std::abs(p.pid()) == K0) { return (p.pid() > 0) ? 1 : -1; }
787  size_t nq = 0;
788  int sign = 1;
789  int signmult = 1;
790  int result=0;
791  bool classified = false;
792  if (!classified && isMeson(p)) { classified = true; nq = 2; if ((*(p.second.rbegin()+2)) == 2||(*(p.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
793  if (!classified && isDiquark(p)) {return is_strange.at(p(0))+is_strange.at(p(1)); }
794  if (!classified && isBaryon(p)) { classified = true; nq = 3; }
795  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)); }
796  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)); }
797  if (!classified && isSUSY(p)) {
798  nq = 0;
799  auto pp = p.shift(1);
800  if (pp.ndigits() < 3 ) { return strangeness(pp); } // super-partners of fundamental particles
801  if (pp(0) == COMPOSITEGLUON) {
802  if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
803  if ( pp.ndigits() == 4 || pp.ndigits() == 5) {
804  pp = pp.shift(1); // Remove gluino
805  }
806  }
807  if (pp.ndigits() == 3) { classified = true; nq = 2; if (p.last()%2==0) {sign = -1;} signmult = -1; } // states with quark-antiquark or squark-antiquark
808  if (pp.ndigits() == 4) { classified = true; nq = 3; } // states with quark-quark-quark or squark-quark-quark
809  }
810  for (auto r = p.second.rbegin() + 1; r != p.second.rbegin() + 1 + nq; ++r) {
811  result += is_strange.at(*r)*sign;
812  sign*=signmult;
813  }
814  return p.pid() > 0 ? result : -result;
815 }

◆ strangeness() [2/3]

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

Definition at line 816 of file AtlasPID.h.

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

◆ strangeness() [3/3]

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

Definition at line 781 of file AtlasPID.h.

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

◆ threeCharge()

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

Definition at line 997 of file AtlasPID.h.

997 { return charge3(p);}
isStrange
bool isStrange(const T &p)
Definition: AtlasPID.h:173
beamspotman.r
def r
Definition: beamspotman.py:672
isGaugino
bool isGaugino(const T &p)
Definition: AtlasPID.h:501
isStrongInteracting
bool isStrongInteracting(const T &p)
Definition: AtlasPID.h:1156
isNucleus
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
Definition: AtlasPID.h:697
get_generator_info.result
result
Definition: get_generator_info.py:21
isHeavyBoson
bool isHeavyBoson(const T &p)
APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier)
Definition: AtlasPID.h:383
isTetraquark
bool isTetraquark(const T &p)
PDG rule 14 The 9-digit tetra-quark codes are ±1nrnLnq1nq20nq3nq4nJ.
Definition: AtlasPID.h:322
isRMeson
bool isRMeson(const T &p)
Definition: AtlasPID.h:571
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
isSleptonRH
bool isSleptonRH(const T &p)
Definition: AtlasPID.h:493
isBSM
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition: AtlasPID.h:841
baryonNumber
double baryonNumber(const T &p)
Definition: AtlasPID.h:768
isHiddenValley
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:663
isBoson
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:366
isGenSpecific
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:422
Monitored::Z
@ Z
Definition: HistogramFillerUtils.h:24
isMeson
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:241
hasQuark
bool hasQuark(const T &p, const int &q)
isKK
bool isKK(const T &p)
PDG rule 11h A black hole in models with extra dimensions has code 5000040.
Definition: AtlasPID.h:632
isSquarkRH
bool isSquarkRH(const T &p)
Definition: AtlasPID.h:471
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
isRGlueball
bool isRGlueball(const T &p)
PDG rule 11g: Within several scenarios of new physics, it is possible to have colored particles suffici...
Definition: AtlasPID.h:559
CaloClusterMLCalib::epsilon
constexpr float epsilon
Definition: CaloClusterMLGaussianMixture.h:16
numberOfLambdas
int numberOfLambdas(const T &p)
Definition: AtlasPID.h:819
isNeutrino
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Definition: AtlasPID.h:209
isSquark
bool isSquark(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition: AtlasPID.h:455
isSleptonLH
bool isSleptonLH(const T &p)
Definition: AtlasPID.h:485
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:872
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:825
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
isGenericMultichargedParticle
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:679
isSMQuark
bool isSMQuark(const T &p)
Definition: AtlasPID.h:169
isSMLepton
bool isSMLepton(const T &p)
APID: the fourth generation leptons are not standard model leptons.
Definition: AtlasPID.h:191
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:370
isHiggs
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
Definition: AtlasPID.h:387
fractionalCharge
double fractionalCharge(const T &p)
Definition: AtlasPID.h:990
isQuark
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:164
A
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
isCCbarMeson
bool isCCbarMeson(const T &p)
Definition: AtlasPID.h:916
strangeness
int strangeness(const T &p)
Definition: AtlasPID.h:781
isBottom
bool isBottom(const T &p)
Definition: AtlasPID.h:179
lumiFormat.i
int i
Definition: lumiFormat.py:85
leadingQuark
int leadingQuark(const T &p)
Definition: AtlasPID.h:883
isPythia8Specific
bool isPythia8Specific(const T &p)
Definition: AtlasPID.h:408
isMonopole
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:642
isWeaklyDecayingCHadron
bool isWeaklyDecayingCHadron(const T &p)
Definition: AtlasPID.h:971
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:376
isPentaquark
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:339
isGlueball
bool isGlueball(const T &p)
APID: Definition of Glueballs: SM glueballs 99X (X=1,5), 999Y (Y=3,7)
Definition: AtlasPID.h:438
isSuperpartner
bool isSuperpartner(const T &p)
Definition: AtlasPID.h:509
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:108
isBBbarMeson
bool isBBbarMeson(const T &p)
Definition: AtlasPID.h:920
isNeutral
bool isNeutral(const T &p)
Definition: AtlasPID.h:1072
hasStrange
bool hasStrange(const T &p)
Definition: AtlasPID.h:731
isChLepton
bool isChLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition: AtlasPID.h:196
isSUSY
bool isSUSY(const T &p)
Definition: AtlasPID.h:620
isTau
bool isTau(const T &p)
Definition: AtlasPID.h:205
isGraviton
bool isGraviton(const T &p)
Definition: AtlasPID.h:394
isDM
bool isDM(const T &p)
PDG rule 11j: The nature of Dark Matter (DM) is not known, and therefore a definitive classificationi...
Definition: AtlasPID.h:656
DecodedPID
Implementation of classification functions according to PDG2022.
Definition: AtlasPID.h:16
isExcited
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:533
isHadron
bool isHadron(const T &p)
Definition: AtlasPID.h:348
isNeutrinoRH
bool isNeutrinoRH(const T &p)
PDG Rule 12: APID: Helper function for right-handed neutrino states These are generator defined PDG I...
Definition: AtlasPID.h:417
charge
double charge(const T &p)
Definition: AtlasPID.h:991
isBaryon
bool isBaryon(const T &p)
Table 43.2 APID: states with fourth generation quarks are not baryons.
Definition: AtlasPID.h:279
isGeantino
bool isGeantino(const T &p)
Definition: AtlasPID.h:434
isSlepton
bool isSlepton(const T &p)
Definition: AtlasPID.h:479
isWeaklyDecayingBHadron
bool isWeaklyDecayingBHadron(const T &p)
Definition: AtlasPID.h:936
isFourthGeneration
bool isFourthGeneration(const T &p)
Is this a 4th generation fermion? APID: 4th generation fermions are not standard model particles.
Definition: AtlasPID.h:217
spin2
int spin2(const T &p)
Definition: AtlasPID.h:1094
isW
bool isW(const T &p)
Definition: AtlasPID.h:379
isRBaryon
bool isRBaryon(const T &p)
Definition: AtlasPID.h:586
isTop
bool isTop(const T &p)
Definition: AtlasPID.h:182
isTransportable
bool isTransportable(const T &p)
Definition: AtlasPID.h:867
numberOfProtons
int numberOfProtons(const T &p)
Definition: AtlasPID.h:828
isLepton
bool isLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition: AtlasPID.h:186
isCharm
bool isCharm(const T &p)
Definition: AtlasPID.h:176
isPhoton
bool isPhoton(const T &p)
Definition: AtlasPID.h:373
charge3
int charge3(const T &p)
Definition: AtlasPID.h:989
hasSquark
bool hasSquark(const T &p, const int &q)
Definition: AtlasPID.h:607
isSquarkLH
bool isSquarkLH(const T &p)
Definition: AtlasPID.h:463
isSMNeutrino
bool isSMNeutrino(const T &p)
Definition: AtlasPID.h:212
isRHadron
bool isRHadron(const T &p)
Definition: AtlasPID.h:600
extractSporadic.q
list q
Definition: extractSporadic.py:97
isQuarkonium
bool isQuarkonium(const T &p)
Is this a heavy-flavour quarkonium meson?
Definition: AtlasPID.h:270
isTechnicolor
bool isTechnicolor(const T &p)
PDG rule 11e Technicolor states have n = 3, with technifermions treated like ordinary fermions.
Definition: AtlasPID.h:521
isTrajectory
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:356
isElectron
bool isElectron(const T &p)
Definition: AtlasPID.h:199
isDiquark
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:224
baryonNumber3
int baryonNumber3(const T &p)
Definition: AtlasPID.h:743
isEMInteracting
bool isEMInteracting(const T &p)
Definition: AtlasPID.h:1087
containedQuarks
std::vector< int > containedQuarks(const T &p)
Definition: AtlasPID.h:1131
spin
double spin(const T &p)
Definition: AtlasPID.h:1125
isMSSMHiggs
bool isMSSMHiggs(const T &p)
APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier)
Definition: AtlasPID.h:391
python.SystemOfUnits.L
float L
Definition: SystemOfUnits.py:92
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:202
isLeptoQuark
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:405