Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 dothis 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)
 
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 isDiquark (const T &p)
 PDG rule 4 Diquarks have 4-digit numbers with nq1 >= nq2 and nq3 = 0 APID: the diquarks with fourth generation 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 isBaryon (const T &p)
 Table 43.2. 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 thatnq1≥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 isSUSY (const T &p)
 PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particle number. More...
 
template<>
bool isSUSY (const DecodedPID &p)
 
template<>
bool isSUSY (const int &p)
 
template<class T >
bool isSquark (const T &p)
 
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 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 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 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 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 >
bool isRHadron (const T &p)
 
template<>
bool isRHadron (const DecodedPID &p)
 
template<>
bool isRHadron (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 711 of file AtlasPID.h.

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

◆ baryonNumber() [2/3]

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

Definition at line 712 of file AtlasPID.h.

712 { 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 710 of file AtlasPID.h.

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

◆ baryonNumber3() [1/3]

template<>
int baryonNumber3 ( const DecodedPID p)
inline

Definition at line 686 of file AtlasPID.h.

686  {
687  if (isQuark(p.pid())) { return (p.pid() > 0) ? 1 : - 1;}
688  if (isDiquark(p)) { return (p.pid() > 0) ? 2 : -2; }
689  if (isMeson(p) || isTetraquark(p)) { return 0; }
690  if (isBaryon(p) || isPentaquark(p)){ return (p.pid() > 0) ? 3 : -3; }
691  if (isNucleus(p)) {
692  const int result = 3*p(8) + 30*p(7) + 300*p(6);
693  return (p.pid() > 0) ? result : -result;
694  }
695  if (isSUSY(p)) {
696  auto pp = p.shift(1);
697  if (pp.ndigits() < 3 ) { return baryonNumber3(pp); } // super-partners of fundamental particles
698  if (pp(0) == COMPOSITEGLUON) {
699  if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
700  if ( pp.ndigits() == 4 ) { return 0; } // states with gluino-quark-antiquark
701  if ( pp.ndigits() == 5) { return (p.pid() > 0) ? 3 : -3; } // states with gluino-quark-quark-quark
702  }
703  if (pp.ndigits() == 3) { return 0; } // squark-antiquark
704  if (pp.ndigits() == 4) { return (p.pid() > 0) ? 3 : -3; } // states with squark-quark-quark
705  }
706  return 0;
707 }

◆ baryonNumber3() [2/3]

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

Definition at line 708 of file AtlasPID.h.

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

◆ baryonNumber3() [3/3]

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

Definition at line 685 of file AtlasPID.h.

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

◆ charge()

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

Definition at line 931 of file AtlasPID.h.

931  {
932  if (isGenericMultichargedParticle(p)) // BSM multi-charged particles might have a fractional charge that's not a multiple of 1/3
933  return fractionalCharge(p);
934  else
935  return 1.0*charge3(p)/3.0;
936 }

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

941  {
942  auto ap = std::abs(p.pid());
943  if (ap < TABLESIZE ) return p.pid() > 0 ? triple_charge.at(ap) : -triple_charge.at(ap);
944  if (ap == K0) return 0;
945  if (ap == GEANTINO0) return 0;
946  if (ap == GEANTINOPLUS) return p.pid() > 0 ? 3 : -3;
947  if (ap == MAVTOP) return p.pid() > 0 ? 2 : -2;
948  size_t nq = 0;
949  int sign = 1;
950  int signmult = 1;
951  int result=0;
952  bool classified = false;
953  if (!classified && isMeson(p)) { classified = true; nq = 2; if ((*(p.second.rbegin()+2)) == 2||(*(p.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
954  if (!classified && isDiquark(p)) {return triple_charge.at(p(0))+triple_charge.at(p(1)); }
955  if (!classified && isBaryon(p)) { classified = true; nq = 3; }
956  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)); }
957  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)); }
958  if (!classified && isNucleus(p)) { return 3*numberOfProtons(p);}
959  if (!classified && isSUSY(p)) {
960  nq = 0;
961  auto pp = p.shift(1);
962  if (pp.ndigits() < 3 ) { return charge3(pp); } // super-partners of fundamental particles
963  if (pp(0) == COMPOSITEGLUON) {
964  if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
965  if ( pp.ndigits() == 4 || pp.ndigits() == 5) {
966  pp = pp.shift(1); // Remove gluino
967  }
968  }
969  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
970  if (pp.ndigits() == 4) { classified = true; nq = 3; } // states with squark-quark-quark or quark-quark-quark
971  }
972  if (!classified && isMonopole(p)) {
975  result = 3*(p(3)*100 + p(4)*10 + p(5));
976  return ( (p.pid() > 0 && p(2) == 1) || (p.pid() < 0 && p(2) == 2) ) ? result : -result;
977  }
978  if (!classified && isGenericMultichargedParticle(p)) {
979  double abs_charge = 0.0;
980  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
981  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
982  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
983  return p.pid() > 0 ? abs_threecharge : -1 * abs_threecharge;
984  }
985  for (auto r = p.second.rbegin() + 1; r != p.second.rbegin() + 1 + nq; ++r) {
986  result += triple_charge.at(*r)*sign;
987  sign*=signmult;
988  }
989  return p.pid() > 0 ? result : -result;
990 }

◆ charge3() [2/3]

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

Definition at line 991 of file AtlasPID.h.

991  {
992  int ap = std::abs(p);
993  if (ap < TABLESIZE) return p > 0 ? triple_charge.at(ap):-triple_charge.at(ap);
994  auto value_digits = DecodedPID(p);
995  return charge3(value_digits);
996 }

◆ charge3() [3/3]

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

Definition at line 929 of file AtlasPID.h.

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

◆ containedQuarks() [1/3]

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

Definition at line 1076 of file AtlasPID.h.

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

◆ containedQuarks() [2/3]

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

Definition at line 1054 of file AtlasPID.h.

1054  {
1055  auto pp = DecodedPID(p);
1056  std::vector<int> quarks;
1057  if (isQuark(pp.pid())) { quarks.push_back(std::abs(pp.pid())); }
1058  else if (isDiquark(pp)) { quarks.push_back(pp(0)); quarks.push_back(pp(1)); }
1059  else if (isMeson(pp)) { quarks.push_back(*(pp.second.rbegin() + 1)); quarks.push_back(*(pp.second.rbegin()+2)); }
1060  else if (isBaryon(pp)) { for (size_t digit = 1; digit < 4; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1061  else if (isTetraquark(pp)) { for (size_t digit = 1; digit < 5; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1062  else if (isPentaquark(pp)) { for (size_t digit = 1; digit < 6; ++digit) { quarks.push_back(*(pp.second.rbegin() + digit)); } }
1063  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));
1064  const int n_uquarks = A + Z; const int n_dquarks = 2*A - Z - L; const int n_squarks = L;
1065  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); }
1066  else if (isSUSY(pp)) { // APID SUSY case
1067  pp = pp.shift(1);
1068  if ( pp.ndigits() > 1 ) { // skip squarks
1069  if ( pp.ndigits() == 3 ) { pp = DecodedPID(pp(1)); } // Handle ~q qbar pairs
1070  if ( pp.ndigits() > 3 ) { pp = pp.shift(1); } // Drop gluinos and squarks
1071  return containedQuarks(pp.pid());
1072  }
1073  }
1074  return quarks;
1075 }

◆ containedQuarks() [3/3]

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

Definition at line 1053 of file AtlasPID.h.

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

◆ fractionalCharge() [1/3]

template<>
double fractionalCharge ( const DecodedPID p)
inline

Definition at line 1004 of file AtlasPID.h.

1004  {
1005  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
1006  double abs_charge = 0;
1007  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
1008  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
1009  return p.pid() > 0 ? abs_charge : -1 * abs_charge;
1010 }

◆ fractionalCharge() [2/3]

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

Definition at line 1011 of file AtlasPID.h.

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

◆ fractionalCharge() [3/3]

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

Definition at line 930 of file AtlasPID.h.

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

◆ hasBottom()

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

Definition at line 675 of file AtlasPID.h.

675 { return hasQuark(p,BQUARK); }

◆ hasCharm()

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

Definition at line 674 of file AtlasPID.h.

674 { return hasQuark(p,CQUARK); }

◆ hasQuark() [1/3]

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

Definition at line 653 of file AtlasPID.h.

653  {
654  if (isQuark(p.pid())) { return (std::abs(p.pid()) == q );}
655  if (isMeson(p)) { return *(p.second.rbegin() + 1) == q ||*(p.second.rbegin()+2) ==q;}
656  if (isDiquark(p)) { auto i = std::find(p.second.rbegin() + 2,p.second.rbegin()+4,q); return (i!=p.second.rbegin()+4);}
657  if (isBaryon(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+4,q); return (i!=p.second.rbegin()+4);}
658  if (isTetraquark(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+5,q); return (i!=p.second.rbegin()+5);}
659  if (isPentaquark(p)) { auto i = std::find(p.second.rbegin() + 1,p.second.rbegin()+6,q); return (i!=p.second.rbegin()+6);}
660  if (isNucleus(p) && std::abs(p.pid()) != PROTON) { return (q == 1 || q == 2 || (q==3 && p(2) > 0));}
661  if (isSUSY(p)) { // APID SUSY case
662  auto pp = p.shift(1);
663  if ( pp.ndigits() == 1 ) { return false; } // Handle squarks
664  if ( pp.ndigits() == 3 ) { return (pp(1) == q); } // Handle ~q qbar pairs
665  if ( pp.ndigits() == 4 ) { return (pp(1) == q || pp(2) == q); } // Ignore gluinos and squarks
666  if ( pp.ndigits() == 5 ) { return (pp(1) == q || pp(2) == q || pp(3) == q); } // Ignore gluinos and squarks
667  if ( pp.ndigits() > 5 ) { pp = pp.shift(1); } // Drop gluinos and squarks
668  return hasQuark(pp, q); }
669  return false;
670 }

◆ hasQuark() [2/3]

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

Definition at line 671 of file AtlasPID.h.

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

458  {
459  auto pp = p.shift(1); return isSUSY(p) && pp.ndigits() != 2 && pp(0) == q; // skip lepton and boson super-partners by vetoing ndigits==2
460 }

◆ hasSquark() [2/3]

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

Definition at line 461 of file AtlasPID.h.

461 { 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 457 of file AtlasPID.h.

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

◆ hasStrange()

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

Definition at line 673 of file AtlasPID.h.

673 { return hasQuark(p,SQUARK); }

◆ hasTop()

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

Definition at line 676 of file AtlasPID.h.

676 { return hasQuark(p,TQUARK); }

◆ isBaryon() [1/3]

template<>
bool isBaryon ( const DecodedPID p)
inline

Definition at line 258 of file AtlasPID.h.

258  {
259  if (p.ndigits() < 4 ) return false;
260  if (p.max_digit(1,4) >= 6 ) return false;
261  if (p.min_digit(1,4) == 0) return false;
262  if (p.ndigits() == 4 && (p.last() == 2 || p.last() == 4|| p.last() == 6|| p.last() == 8) ) return true;
263 
264  if (p.ndigits() == 5 && p(0) == 1 && (p.last() == 2 || p.last() == 4) ) return true;
265  if (p.ndigits() == 5 && p(0) == 3 && (p.last() == 2 || p.last() == 4) ) return true;
266 
267  if (p.ndigits() == 6 ) {
268  if (p(0) == 1 && p(1) == 0 && p.last() == 2 ) return true;
269  if (p(0) == 1 && p(1) == 1 && p.last() == 2 ) return true;
270  if (p(0) == 1 && p(1) == 2 && p.last() == 4 ) return true;
271 
272  if (p(0) == 2 && p(1) == 0 && p.last() == 2 ) return true;
273  if (p(0) == 2 && p(1) == 0 && p.last() == 4 ) return true;
274  if (p(0) == 2 && p(1) == 1 && p.last() == 2 ) return true;
275 
276  if (p(0) == 1 && p(1) == 0 && p.last() == 4 ) return true;
277  if (p(0) == 1 && p(1) == 0 && p.last() == 6 ) return true;
278  if (p(0) == 2 && p(1) == 0 && p.last() == 6 ) return true;
279  if (p(0) == 2 && p(1) == 0 && p.last() == 8 ) return true;
280  }
281 
282  if (p.ndigits() == 5 ) {
283  if (p(0) == 2 && p.last() == 2 ) return true;
284  if (p(0) == 2 && p.last() == 4 ) return true;
285  if (p(0) == 2 && p.last() == 6 ) return true;
286  if (p(0) == 5 && p.last() == 2 ) return true;
287  if (p(0) == 1 && p.last() == 6 ) return true;
288  if (p(0) == 4 && p.last() == 2 ) return true;
289  }
290  return false;
291 }

◆ isBaryon() [2/3]

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

Definition at line 292 of file AtlasPID.h.

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

◆ isBaryon() [3/3]

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

Table 43.2.

Definition at line 257 of file AtlasPID.h.

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

◆ isBBbarMeson() [1/3]

template<>
bool isBBbarMeson ( const DecodedPID p)
inline

Definition at line 861 of file AtlasPID.h.

861 { 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 862 of file AtlasPID.h.

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

◆ isBBbarMeson() [3/3]

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

Definition at line 860 of file AtlasPID.h.

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

◆ isBoson() [1/3]

template<>
bool isBoson ( const DecodedPID p)
inline

Definition at line 344 of file AtlasPID.h.

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

◆ isBoson() [2/3]

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

Definition at line 343 of file AtlasPID.h.

343 { 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 342 of file AtlasPID.h.

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

◆ isBottom() [1/2]

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

Definition at line 173 of file AtlasPID.h.

173 { return std::abs(p) == 5;}

◆ isBottom() [2/2]

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

Definition at line 172 of file AtlasPID.h.

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

◆ isBottomBaryon()

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

Definition at line 869 of file AtlasPID.h.

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

◆ isBottomHadron()

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

Definition at line 846 of file AtlasPID.h.

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

◆ isBottomMeson()

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

Definition at line 853 of file AtlasPID.h.

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

◆ isBSM() [1/3]

template<>
bool isBSM ( const DecodedPID p)
inline

Definition at line 784 of file AtlasPID.h.

784  {
785  if (p.pid() == GRAVITON || std::abs(p.pid()) == MAVTOP || p.pid() == DARKPHOTON) return true;
786  if (std::abs(p.pid()) > 16 && std::abs(p.pid()) < 19) return true;
787  if (std::abs(p.pid()) > 31 && std::abs(p.pid()) < 38) return true;
788  if (std::abs(p.pid()) > 39 && std::abs(p.pid()) < 81) return true;
789  if (std::abs(p.pid()) > 6 && std::abs(p.pid()) < 9) return true;
790  if (isSUSY(p)) return true;
791  if (isGenericMultichargedParticle(p)) return true;
792  if (isTechnicolor(p)) return true;
793  if (isExcited(p)) return true;
794  if (isKK(p)) return true;
795  if (isHiddenValley(p)) return true;
796  return false;
797 }

◆ isBSM() [2/3]

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

Definition at line 798 of file AtlasPID.h.

798  {
799  if (p == GRAVITON || std::abs(p) == MAVTOP || p == DARKPHOTON) return true;
800  if (std::abs(p) > 16 && std::abs(p) < 19) return true;
801  if (std::abs(p) > 31 && std::abs(p) < 38) return true;
802  if (std::abs(p) > 39 && std::abs(p) < 81) return true;
803  if (std::abs(p) > 6 && std::abs(p) < 9) return true;
804  auto value_digits = DecodedPID(p); return isBSM(value_digits);
805 }

◆ isBSM() [3/3]

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

APID: graviton and all Higgs extensions are BSM.

Definition at line 783 of file AtlasPID.h.

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

◆ isCCbarMeson() [1/3]

template<>
bool isCCbarMeson ( const DecodedPID p)
inline

Definition at line 857 of file AtlasPID.h.

857 { 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 858 of file AtlasPID.h.

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

◆ isCCbarMeson() [3/3]

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

Definition at line 856 of file AtlasPID.h.

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

◆ isCharged()

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

Definition at line 938 of file AtlasPID.h.

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

◆ isCharm() [1/2]

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

Definition at line 170 of file AtlasPID.h.

170 { return std::abs(p) == 4;}

◆ isCharm() [2/2]

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

Definition at line 169 of file AtlasPID.h.

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

◆ isCharmBaryon()

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

Definition at line 868 of file AtlasPID.h.

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

◆ isCharmHadron()

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

Definition at line 845 of file AtlasPID.h.

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

◆ isCharmMeson()

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

Definition at line 852 of file AtlasPID.h.

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

◆ isChLepton() [1/2]

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

Definition at line 189 of file AtlasPID.h.

189 { auto sp = std::abs(p); return sp >= 11 && sp <= 18 && 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 188 of file AtlasPID.h.

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

◆ isDiquark() [1/3]

template<>
bool isDiquark ( const DecodedPID p)
inline

Definition at line 211 of file AtlasPID.h.

211  {
212  if ( p.ndigits() == 4 && p(0) >= p(1) && p(2) == 0 && p.last() % 2 == 1
213  && p.max_digit(2,4) <= TQUARK
214  ) return true;
215  return false;
216 }

◆ isDiquark() [2/3]

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

Definition at line 217 of file AtlasPID.h.

217 { 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: the diquarks with fourth generation are not diquarks.

Definition at line 210 of file AtlasPID.h.

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

◆ isDM() [1/2]

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

Definition at line 604 of file AtlasPID.h.

604 { 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 annihilationcan 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 be existing.

Definition at line 603 of file AtlasPID.h.

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

◆ isElectron() [1/2]

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

Definition at line 192 of file AtlasPID.h.

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

◆ isElectron() [2/2]

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

Definition at line 191 of file AtlasPID.h.

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

◆ isEMInteracting() [1/2]

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

Definition at line 1014 of file AtlasPID.h.

1014 {return (isPhoton(p) || isZ(p) || 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 1013 of file AtlasPID.h.

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

◆ isExcited() [1/3]

template<>
bool isExcited ( const DecodedPID p)
inline

Definition at line 508 of file AtlasPID.h.

508  {
509  const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
510  return (p.ndigits() == 7 && (p(0) == 4 && p(1) == 0) &&
511  (isLepton(pp) || isQuark(pp)));
512 }

◆ isExcited() [2/3]

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

Definition at line 513 of file AtlasPID.h.

513 { 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 506 of file AtlasPID.h.

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

◆ isGaugino() [1/3]

template<>
bool isGaugino ( const DecodedPID p)
inline

Definition at line 484 of file AtlasPID.h.

484  {
485  auto pp = p.shift(1); return isSUSY(p) && isBoson(pp.pid());
486 }

◆ isGaugino() [2/3]

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

Definition at line 487 of file AtlasPID.h.

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

◆ isGaugino() [3/3]

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

Definition at line 483 of file AtlasPID.h.

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

◆ isGeantino() [1/2]

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

Definition at line 410 of file AtlasPID.h.

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

◆ isGeantino() [2/2]

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

Definition at line 409 of file AtlasPID.h.

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

◆ isGenericMultichargedParticle() [1/3]

template<>
bool isGenericMultichargedParticle ( const DecodedPID p)
inline

Definition at line 627 of file AtlasPID.h.

627 {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 628 of file AtlasPID.h.

628 { 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 626 of file AtlasPID.h.

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

◆ isGenSpecific() [1/2]

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

Definition at line 399 of file AtlasPID.h.

399  {
400  if (p >= 81 && p <= 100) return true;
401  if (p >= 901 && p <= 930) return true;
402  if (p >= 998 && p <= 999) return true;
403  if (p >= 1901 && p <= 1930) return true;
404  if (p >= 2901 && p <= 2930) return true;
405  if (p >= 3901 && p <= 3930) return true;
406  return false;
407 }

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

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

◆ isGlueball() [1/3]

template<>
bool isGlueball ( const DecodedPID p)
inline

Definition at line 414 of file AtlasPID.h.

414  {
415  if (p.ndigits() > 4) return false; // APID avoid classifying R-Glueballs as SM Glueballs
416  return
417  ( ( p.ndigits() == 3 && p(0) == COMPOSITEGLUON && p(1) == COMPOSITEGLUON && (p(2) == 1 || p(2) == 5) ) ||
418  ( p.ndigits() == 4 && p(0) == COMPOSITEGLUON && p(1) == COMPOSITEGLUON && p(2) == COMPOSITEGLUON && (p(3) == 3 || p(3) == 7) ) );
419 }

◆ isGlueball() [2/3]

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

Definition at line 420 of file AtlasPID.h.

420 { 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 413 of file AtlasPID.h.

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

◆ isGluon() [1/2]

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

Definition at line 347 of file AtlasPID.h.

347 { return p == GLUON; }

◆ isGluon() [2/2]

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

Definition at line 346 of file AtlasPID.h.

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

◆ isGraviton() [1/2]

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

Definition at line 371 of file AtlasPID.h.

371 { return p == GRAVITON; }

◆ isGraviton() [2/2]

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

Definition at line 370 of file AtlasPID.h.

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

◆ isHadron() [1/3]

template<>
bool isHadron ( const DecodedPID p)
inline

Definition at line 325 of file AtlasPID.h.

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

◆ isHadron() [2/3]

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

Definition at line 326 of file AtlasPID.h.

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

◆ isHadron() [3/3]

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

Definition at line 324 of file AtlasPID.h.

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

◆ isHeavyBaryon()

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

Definition at line 866 of file AtlasPID.h.

866 { 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 360 of file AtlasPID.h.

360 { 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 359 of file AtlasPID.h.

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

◆ isHeavyHadron()

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

Definition at line 843 of file AtlasPID.h.

843 { 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 850 of file AtlasPID.h.

850 { 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 612 of file AtlasPID.h.

612  {
613  const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
614  return (p.ndigits() == 7 && p(0) == 4 && p(1) == 9 &&
615  (isQuark(pp) || isLepton(pp) || isBoson(pp) || isGlueball(pp) ||
616  isDiquark(pp) || isHadron(pp)));
617 }

◆ isHiddenValley() [2/3]

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

Definition at line 618 of file AtlasPID.h.

618 { 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 610 of file AtlasPID.h.

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

◆ isHiggs() [1/2]

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

Definition at line 364 of file AtlasPID.h.

364 { 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 363 of file AtlasPID.h.

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

◆ isKK() [1/3]

template<>
bool isKK ( const DecodedPID p)
inline

Definition at line 580 of file AtlasPID.h.

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

◆ isKK() [2/3]

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

Definition at line 581 of file AtlasPID.h.

581 { 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 579 of file AtlasPID.h.

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

◆ isLepton() [1/3]

template<>
bool isLepton ( const DecodedPID p)
inline

Definition at line 181 of file AtlasPID.h.

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

◆ isLepton() [2/3]

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

Definition at line 180 of file AtlasPID.h.

180 { auto sp = std::abs(p); return sp >= 11 && sp <= 18; }

◆ isLepton() [3/3]

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

APID: the fourth generation leptons are leptons.

Definition at line 179 of file AtlasPID.h.

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

◆ isLeptoQuark() [1/2]

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

Definition at line 382 of file AtlasPID.h.

382 { 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 381 of file AtlasPID.h.

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

◆ isLightBaryon()

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

Definition at line 865 of file AtlasPID.h.

865 { 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 842 of file AtlasPID.h.

842 { 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 849 of file AtlasPID.h.

849 { 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 227 of file AtlasPID.h.

227  {
228  if (p.ndigits() < 3 ) return false;
229  if (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2)) return false; // APID don't match SUSY particles
230  if (std::abs(p.pid()) == K0S) return true;
231  if (std::abs(p.pid()) == K0L) return true;
232  if (std::abs(p.pid()) == K0) return true;
233  if (p.last() % 2 != 1 ) return false;
234  if (p.max_digit(1,3) >= 6 ) return false;
235  if (p.max_digit(1,3) == 0 ) return false;
236  if (p.ndigits() > 3 && *(p.second.rbegin() + 3) != 0 ) return false;
237 
238  if (p.ndigits() == 3 && p(0) == p(1) && p.pid() < 0 ) return false;
239  if (p.ndigits() == 5 && p(2) == p(3) && p.pid() < 0 ) return false;
240  if (p.ndigits() == 7 && p(4) == p(5) && p.pid() < 0 ) return false;
241 
242 
243  if (p.ndigits() == 3 && p(0) >= p(1) && p(1) != 0 ) return true;
244  if (p.ndigits() == 5 && p(2) >= p(3) && p(3) != 0 && p(0) == 1 && p(1) == 0) return true;
245  if (p.ndigits() == 5 && p(2) >= p(3) && p(3) != 0 && p(0) == 2 && p(1) == 0 && p.last() > 1 ) return true;
246  if (p.ndigits() == 5 && p(2) >= p(3) && p(3) != 0 && p(0) == 3 && p(1) == 0 && p.last() > 1 ) return true;
247 
248  if (p.ndigits() == 6 && p(3) >= p(4) && p(4) != 0 && p.last() % 2 == 1 ) return true;
249 
250  if (p.ndigits() == 7 && p(0) == 9 && p(1) == 0 && p(4) >= p(5) && p(5) != 0) return true;
251 
252  return false;
253 }

◆ isMeson() [2/3]

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

Definition at line 254 of file AtlasPID.h.

254 { 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

Definition at line 226 of file AtlasPID.h.

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

◆ isMonopole() [1/3]

template<>
bool isMonopole ( const DecodedPID p)
inline

Definition at line 590 of file AtlasPID.h.

590 {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 591 of file AtlasPID.h.

591 { 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 589 of file AtlasPID.h.

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

◆ isMSSMHiggs() [1/2]

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

Definition at line 368 of file AtlasPID.h.

368 { 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 367 of file AtlasPID.h.

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

◆ isMuon() [1/2]

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

Definition at line 195 of file AtlasPID.h.

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

◆ isMuon() [2/2]

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

Definition at line 194 of file AtlasPID.h.

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

◆ isNeutral() [1/3]

template<>
bool isNeutral ( const DecodedPID p)
inline

Definition at line 1000 of file AtlasPID.h.

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

◆ isNeutral() [2/3]

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

Definition at line 1001 of file AtlasPID.h.

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

◆ isNeutral() [3/3]

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

Definition at line 999 of file AtlasPID.h.

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

◆ isNeutrino() [1/2]

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

Definition at line 202 of file AtlasPID.h.

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

◆ isNeutrino() [2/2]

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

APID: the fourth generation neutrinos are neutrinos.

Definition at line 201 of file AtlasPID.h.

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

◆ isNeutrinoRH() [1/2]

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

Definition at line 394 of file AtlasPID.h.

394 { 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 393 of file AtlasPID.h.

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

◆ isNucleus() [1/3]

template<>
bool isNucleus ( const DecodedPID p)
inline

Definition at line 645 of file AtlasPID.h.

645  {
646  if (std::abs(p.pid()) == PROTON) return true;
647  return (p.ndigits() == 10 && p(0) == 1 && p(1) == 0 );
648 }

◆ isNucleus() [2/3]

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

Definition at line 649 of file AtlasPID.h.

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

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

◆ isParton()

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

Definition at line 1016 of file AtlasPID.h.

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

◆ isPentaquark() [1/3]

template<>
bool isPentaquark ( const DecodedPID p)
inline

Definition at line 316 of file AtlasPID.h.

316  {
317  return (p.ndigits() == 9 && p(0) == 1 &&
318  p.max_digit(1,6) <= 6 && p.min_digit(1,6) > 0 &&
319  ( p(3) >= p(4) && p(4) >= p(5) && p(5) >= p(6)) );
320 }

◆ isPentaquark() [2/3]

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

Definition at line 321 of file AtlasPID.h.

321 { 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 thatnq1≥nq2≥nq3≥nq4.

In the particle the first four are quarks and the fifth an antiquark while t heopposite holds in the antiparticle, which is given with a negative sign. Thenr,nL, andnJnumbers have the same meaning as for ordinary hadrons.

Definition at line 315 of file AtlasPID.h.

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

◆ isPhoton() [1/2]

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

Definition at line 350 of file AtlasPID.h.

350 { return p == PHOTON; }

◆ isPhoton() [2/2]

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

Definition at line 349 of file AtlasPID.h.

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

◆ isPythia8Specific() [1/3]

template<>
bool isPythia8Specific ( const DecodedPID p)
inline

Definition at line 385 of file AtlasPID.h.

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

◆ isPythia8Specific() [2/3]

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

Definition at line 386 of file AtlasPID.h.

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

◆ isPythia8Specific() [3/3]

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

Definition at line 384 of file AtlasPID.h.

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

◆ isQuark() [1/3]

template<>
bool isQuark ( const DecodedPID p)
inline

Definition at line 160 of file AtlasPID.h.

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

◆ isQuark() [2/3]

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

Definition at line 159 of file AtlasPID.h.

159 { return p != 0 && (std::abs(p) <= 8 || 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 dothis they are first ordered by family and within families by weak isospin.

APID: the fourth generation quarks are quarks.

Definition at line 158 of file AtlasPID.h.

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

◆ isRBaryon() [1/3]

template<>
bool isRBaryon ( const DecodedPID p)
inline

Definition at line 560 of file AtlasPID.h.

560  {
561  if (!(p.ndigits() == 7 && (p(0) == 1 || p(0) == 2))) return false;
562  auto pp = p.shift(1);
563  return (
564  // Handle ~gluino-quark-quark-quark states
565  (pp.ndigits() == 5 && pp(0) == COMPOSITEGLUON && pp.max_digit(1,4) < COMPOSITEGLUON && pp(2) <= pp(1) && pp(3) <= pp(2) && isSMQuark(pp(1)) && isSMQuark(pp(2)) && isSMQuark(pp(3)) && (pp.last() == 2 || pp.last() == 4)) ||
566  // Handle squark-quark-quark states (previously called Sbaryons)
567  (pp.ndigits() == 4 && pp.max_digit(1,4) < COMPOSITEGLUON && pp(1) <= pp(0) && pp(2) <= pp(1) && isSMQuark(pp(0)) && isSMQuark(pp(1)) && isSMQuark(pp(2)) && (pp.last() == 1 || pp.last() == 3))
568  );
569 }

◆ isRBaryon() [2/3]

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

Definition at line 570 of file AtlasPID.h.

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

◆ isRBaryon() [3/3]

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

Definition at line 559 of file AtlasPID.h.

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

◆ isResonance()

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

Definition at line 373 of file AtlasPID.h.

373 { return isZ(p) || isW(p) || isHiggs(p) || isTop(p); } // APID: not including t' (pdg_id=8)

◆ isRGlueball() [1/3]

template<>
bool isRGlueball ( const DecodedPID p)
inline

Definition at line 533 of file AtlasPID.h.

533  {
534  if (p.ndigits() != 7 || p(0) != 1) return false;
535  auto pp = p.shift(1);
536  return
537  ( ( pp.ndigits() == 3 && pp(0) == COMPOSITEGLUON && pp(1) == COMPOSITEGLUON && (pp(2) == 1 || pp(2) == 3) ) ||
538  ( pp.ndigits() == 4 && pp(0) == COMPOSITEGLUON && pp(1) == COMPOSITEGLUON && pp(2) == COMPOSITEGLUON && (pp(3) == 1 || pp(3) == 5) ) );
539 }

◆ isRGlueball() [2/3]

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

Definition at line 540 of file AtlasPID.h.

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

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

◆ isRHadron() [1/3]

template<>
bool isRHadron ( const DecodedPID p)
inline

Definition at line 1047 of file AtlasPID.h.

1047  {
1048  return (isRBaryon(p) || isRMeson(p) || isRGlueball(p));
1049 }

◆ isRHadron() [2/3]

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

Definition at line 1050 of file AtlasPID.h.

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

◆ isRHadron() [3/3]

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

Definition at line 1046 of file AtlasPID.h.

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

◆ isRMeson() [1/3]

template<>
bool isRMeson ( const DecodedPID p)
inline

Definition at line 545 of file AtlasPID.h.

545  {
546  if (!(p.ndigits() == 7 && (p(0) == 1 || p(0) == 2))) return false;
547  auto pp = p.shift(1);
548  return (
549  // Handle ~gluino-quark-antiquark states
550  (pp.ndigits() == 4 && pp(0) == COMPOSITEGLUON && pp.max_digit(1,3) < COMPOSITEGLUON && pp(2) <= pp(1) && isSMQuark(pp(1)) && isSMQuark(pp(2)) && (pp.last() == 1 || pp.last() == 3)) ||
551  // Handle squark-antiquark states (previously called Smeson/mesoninos)
552  (pp.ndigits() == 3 && pp.max_digit(1,3) < COMPOSITEGLUON && pp(1) <= pp(0) && isSMQuark(pp(0)) && isSMQuark(pp(1)) && pp.last() == 2)
553  );
554 }

◆ isRMeson() [2/3]

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

Definition at line 555 of file AtlasPID.h.

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

◆ isRMeson() [3/3]

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

Definition at line 544 of file AtlasPID.h.

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

◆ isSlepton() [1/3]

template<>
bool isSlepton ( const DecodedPID p)
inline

Definition at line 466 of file AtlasPID.h.

466 { auto pp = p.shift(1); return isSUSY(p) && isSMLepton(pp);}

◆ isSlepton() [2/3]

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

Definition at line 467 of file AtlasPID.h.

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

◆ isSlepton() [3/3]

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

Definition at line 465 of file AtlasPID.h.

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

◆ isSleptonLH() [1/3]

template<>
bool isSleptonLH ( const DecodedPID p)
inline

Definition at line 472 of file AtlasPID.h.

472 { return isSlepton(p) && (p(0) == 1); }

◆ isSleptonLH() [2/3]

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

Definition at line 473 of file AtlasPID.h.

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

◆ isSleptonLH() [3/3]

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

Definition at line 471 of file AtlasPID.h.

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

◆ isSleptonRH() [1/3]

template<>
bool isSleptonRH ( const DecodedPID p)
inline

Definition at line 478 of file AtlasPID.h.

478 { return isSlepton(p) && (p(0) == 2); }

◆ isSleptonRH() [2/3]

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

Definition at line 479 of file AtlasPID.h.

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

◆ isSleptonRH() [3/3]

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

Definition at line 477 of file AtlasPID.h.

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

◆ isSMLepton() [1/3]

template<>
bool isSMLepton ( const DecodedPID p)
inline

Definition at line 185 of file AtlasPID.h.

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

◆ isSMLepton() [2/3]

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

Definition at line 184 of file AtlasPID.h.

184 { auto sp = std::abs(p); return sp >= 11 && sp <= 16; }

◆ isSMLepton() [3/3]

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

Definition at line 183 of file AtlasPID.h.

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

◆ isSMNeutrino() [1/2]

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

Definition at line 205 of file AtlasPID.h.

205 { 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 204 of file AtlasPID.h.

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

◆ isSMQuark() [1/3]

template<>
bool isSMQuark ( const DecodedPID p)
inline

Definition at line 164 of file AtlasPID.h.

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

◆ isSMQuark() [2/3]

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

Definition at line 163 of file AtlasPID.h.

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

◆ isSMQuark() [3/3]

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

Definition at line 162 of file AtlasPID.h.

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

◆ isSquark() [1/3]

template<>
bool isSquark ( const DecodedPID p)
inline

Definition at line 435 of file AtlasPID.h.

435  {
436  auto pp = p.shift(1); return isSUSY(p) && isSMQuark(pp);
437 }

◆ isSquark() [2/3]

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

Definition at line 438 of file AtlasPID.h.

438 { auto value_digits = DecodedPID(p); return isSquark(value_digits);}

◆ isSquark() [3/3]

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

Definition at line 434 of file AtlasPID.h.

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

◆ isSquarkLH() [1/3]

template<>
bool isSquarkLH ( const DecodedPID p)
inline

Definition at line 443 of file AtlasPID.h.

443  {
444  return isSquark(p) && (p(0) == 1);
445 }

◆ isSquarkLH() [2/3]

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

Definition at line 446 of file AtlasPID.h.

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

◆ isSquarkLH() [3/3]

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

Definition at line 442 of file AtlasPID.h.

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

◆ isSquarkRH() [1/3]

template<>
bool isSquarkRH ( const DecodedPID p)
inline

Definition at line 451 of file AtlasPID.h.

451  {
452  return isSquark(p) && (p(0) == 2);
453 }

◆ isSquarkRH() [2/3]

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

Definition at line 454 of file AtlasPID.h.

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

◆ isSquarkRH() [3/3]

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

Definition at line 450 of file AtlasPID.h.

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

◆ isStrange() [1/2]

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

Definition at line 167 of file AtlasPID.h.

167 { return std::abs(p) == 3;}

◆ isStrange() [2/2]

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

Definition at line 166 of file AtlasPID.h.

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

◆ isStrangeBaryon()

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

Definition at line 867 of file AtlasPID.h.

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

◆ isStrangeHadron()

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

Definition at line 844 of file AtlasPID.h.

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

◆ isStrangeMeson()

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

Definition at line 851 of file AtlasPID.h.

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

◆ isStrongInteracting() [1/2]

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

Definition at line 1079 of file AtlasPID.h.

1079 { 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 1078 of file AtlasPID.h.

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

◆ isSUSY() [1/3]

template<>
bool isSUSY ( const DecodedPID p)
inline

Definition at line 429 of file AtlasPID.h.

429 {return (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2) && !isGenSpecific(p.shift(2).pid()));}

◆ isSUSY() [2/3]

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

Definition at line 430 of file AtlasPID.h.

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

◆ isSUSY() [3/3]

template<class T >
bool isSUSY ( 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 428 of file AtlasPID.h.

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

◆ isTau() [1/2]

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

Definition at line 198 of file AtlasPID.h.

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

◆ isTau() [2/2]

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

Definition at line 197 of file AtlasPID.h.

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

◆ isTechnicolor() [1/3]

template<>
bool isTechnicolor ( const DecodedPID p)
inline

Definition at line 496 of file AtlasPID.h.

496  {
497  const auto& pp = (p.ndigits() == 7) ? p.shift(2) : DecodedPID(0);
498  return (p.ndigits() == 7 && p(0) == 3 && (p(1) == 0 || p(0) == 1) &&
499  (isQuark(pp) || isLepton(pp) || isBoson(pp) || isGlueball(pp) ||
500  isDiquark(pp) || isHadron(pp)));
501 }

◆ isTechnicolor() [2/3]

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

Definition at line 502 of file AtlasPID.h.

502 { 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 494 of file AtlasPID.h.

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

◆ isTetraquark() [1/3]

template<>
bool isTetraquark ( const DecodedPID p)
inline

Definition at line 301 of file AtlasPID.h.

301  {
302  return (p.ndigits() == 9 && p(0) == 1 && p(5) == 0 &&
303  p.max_digit(1,3) <= 6 && p.min_digit(1,3) > 0 &&
304  p.max_digit(1+3,3+3) <= 6 && p.min_digit(1+3,3+3) > 0 &&
305  ( p(3) >= p(4) && p(6) >= p(7) ) && ( ( p(3) > p(6) ) || ( p(3) == p(6) && (p(4) >= p(7))))
306  );
307 }

◆ isTetraquark() [2/3]

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

Definition at line 308 of file AtlasPID.h.

308 { 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 particleq1q2is a diquarkand ̄q3 ̄q4an antidiquark, sorted such thatnq1≥nq2,nq3≥nq4,nq1≥nq3, andnq2≥nq4ifnq1=nq3. For the antiparticle, given with a negative sign, ̄q1 ̄q2is an antidiquark andq3q4a diquark, with the same sorting except that eithernq1> nq3ornq2> nq4(so thatflavour-diagonal states are particles). Thenr,nL, andnJnumbers have the same meaningas for ordinary hadrons.

Definition at line 300 of file AtlasPID.h.

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

◆ isTop() [1/2]

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

Definition at line 176 of file AtlasPID.h.

176 { return std::abs(p) == 6;}

◆ isTop() [2/2]

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

Definition at line 175 of file AtlasPID.h.

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

◆ isTopBaryon()

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

Definition at line 870 of file AtlasPID.h.

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

◆ isTopHadron()

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

Definition at line 847 of file AtlasPID.h.

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

◆ isTopMeson()

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

Definition at line 854 of file AtlasPID.h.

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

◆ isTrajectory() [1/2]

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

Definition at line 333 of file AtlasPID.h.

333 { 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 332 of file AtlasPID.h.

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

◆ isTransportable() [1/3]

template<>
bool isTransportable ( const DecodedPID p)
inline

Definition at line 808 of file AtlasPID.h.

808 { 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 809 of file AtlasPID.h.

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

◆ isTransportable() [3/3]

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

Definition at line 807 of file AtlasPID.h.

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

◆ isValid() [1/3]

template<>
bool isValid ( const DecodedPID p)
inline

Definition at line 813 of file AtlasPID.h.

813  {
814  return p.pid() !=0 && ( isQuark(p) || isLepton(p) || isBoson(p) || isGlueball(p) ||
815  isTrajectory(p.pid()) || isGenSpecific(p.pid()) || isDiquark(p) ||
816  isBSM(p) || isHadron(p) || isNucleus(p) || isGeantino(p.pid()) ||
817  isPythia8Specific(p) ); }

◆ isValid() [2/3]

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

Definition at line 818 of file AtlasPID.h.

818  { if (!p) return false; if (std::abs(p) < 42) return true;
819  if (isGenSpecific(p)) return true;
820  auto value_digits = DecodedPID(p); return isValid(value_digits);
821 }

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

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

◆ isW() [1/2]

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

Definition at line 356 of file AtlasPID.h.

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

◆ isW() [2/2]

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

Definition at line 355 of file AtlasPID.h.

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

◆ isWeaklyDecayingBHadron() [1/3]

template<>
bool isWeaklyDecayingBHadron ( const DecodedPID p)
inline

Definition at line 902 of file AtlasPID.h.

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

◆ isWeaklyDecayingBHadron() [2/3]

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

Definition at line 877 of file AtlasPID.h.

877  {
878  const int pid = std::abs(p);
879  return ( pid == 511 || // B0
880  pid == 521 || // B+
881  pid == 531 || // B_s0
882  pid == 541 || // B_c+
883  pid == 5122 || // Lambda_b0
884  pid == 5132 || // Xi_b-
885  pid == 5232 || // Xi_b0
886  pid == 5112 || // Sigma_b-
887  pid == 5212 || // Sigma_b0
888  pid == 5222 || // Sigma_b+
889  pid == 5332 || // Omega_b-
890  pid == 5142 || // Xi_bc0
891  pid == 5242 || // Xi_bc+
892  pid == 5412 || // Xi'_bc0
893  pid == 5422 || // Xi'_bc+
894  pid == 5342 || // Omega_bc0
895  pid == 5432 || // Omega'_bc0
896  pid == 5442 || // Omega_bcc+
897  pid == 5512 || // Xi_bb-
898  pid == 5522 || // Xi_bb0
899  pid == 5532 || // Omega_bb-
900  pid == 5542 ); // Omega_bbc0
901 }

◆ isWeaklyDecayingBHadron() [3/3]

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

Definition at line 876 of file AtlasPID.h.

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

◆ isWeaklyDecayingCHadron() [1/3]

template<>
bool isWeaklyDecayingCHadron ( const DecodedPID p)
inline

Definition at line 926 of file AtlasPID.h.

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

◆ isWeaklyDecayingCHadron() [2/3]

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

Definition at line 912 of file AtlasPID.h.

912  {
913  const int pid = std::abs(p);
914  return ( pid == 411 || // D+
915  pid == 421 || // D0
916  pid == 431 || // Ds+
917  pid == 4122 || // Lambda_c+
918  pid == 4132 || // Xi_c0
919  pid == 4232 || // Xi_c+
920  pid == 4212 || // Xi_c0
921  pid == 4332 || // Omega_c0
922  pid == 4412 || // Xi_cc+
923  pid == 4422 || // Xi_cc++
924  pid == 4432 ); // Omega_cc+
925 }

◆ isWeaklyDecayingCHadron() [3/3]

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

Definition at line 911 of file AtlasPID.h.

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

◆ isZ() [1/2]

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

Definition at line 353 of file AtlasPID.h.

353 { return p == Z0BOSON; }

◆ isZ() [2/2]

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

Definition at line 352 of file AtlasPID.h.

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

◆ leadingQuark() [1/3]

template<>
int leadingQuark ( const DecodedPID p)
inline

Definition at line 824 of file AtlasPID.h.

824  {
825  if (isQuark(p.pid())) { return std::abs(p.pid());}
826  if (isMeson(p)) { return p.max_digit(1,3);}
827  if (isDiquark(p)) { return p.max_digit(2,4);}
828  if (isBaryon(p)) { return p.max_digit(1,4);}
829  if (isTetraquark(p)) { return p.max_digit(1,5);}
830  if (isPentaquark(p)) { return p.max_digit(1,6);}
831  if (isSUSY(p)) { // APID SUSY case
832  auto pp = p.shift(1);
833  if ( pp.ndigits() == 1 ) { return 0; } // Handle squarks
834  if ( pp.ndigits() == 3 ) { pp = DecodedPID(pp(1)); } // Handle ~q qbar pairs
835  if ( pp.ndigits() > 3 ) { pp = pp.shift(1); } // Drop gluinos and squarks
836  return leadingQuark(pp); }
837  return 0;
838 }

◆ leadingQuark() [2/3]

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

Definition at line 840 of file AtlasPID.h.

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

◆ leadingQuark() [3/3]

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

Definition at line 823 of file AtlasPID.h.

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

◆ numberOfLambdas() [1/3]

template<>
int numberOfLambdas ( const DecodedPID p)
inline

Definition at line 762 of file AtlasPID.h.

762  {
763  if (std::abs(p.pid()) == LAMBDA0) { return (p.pid() > 0) ? 1 : -1; }
764  if (isNucleus(p) && p.ndigits() == 10) { return (p.pid() > 0) ? p(2) : -p(2); }
765  return 0;
766 }

◆ numberOfLambdas() [2/3]

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

Definition at line 767 of file AtlasPID.h.

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

◆ numberOfLambdas() [3/3]

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

Definition at line 761 of file AtlasPID.h.

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

◆ numberOfProtons() [1/3]

template<>
int numberOfProtons ( const DecodedPID p)
inline

Definition at line 771 of file AtlasPID.h.

771  {
772  if (std::abs(p.pid()) == PROTON) { return (p.pid() > 0) ? 1 : -1; }
773  if (isNucleus(p)) {
774  const int result = p(5) + 10*p(4) + 100*p(3);
775  return (p.pid() > 0) ? result : -result;
776  }
777  return 0;
778 }

◆ numberOfProtons() [2/3]

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

Definition at line 779 of file AtlasPID.h.

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

◆ numberOfProtons() [3/3]

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

Definition at line 770 of file AtlasPID.h.

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

◆ spin() [1/3]

template<>
double spin ( const DecodedPID p)
inline

Definition at line 1043 of file AtlasPID.h.

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

◆ spin() [2/3]

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

Definition at line 1044 of file AtlasPID.h.

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

◆ spin() [3/3]

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

Definition at line 1042 of file AtlasPID.h.

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

◆ spin2() [1/3]

template<>
int spin2 ( const DecodedPID p)
inline

Definition at line 1021 of file AtlasPID.h.

1021  {
1022  if (isSUSY(p)) {
1023  auto pp = p.shift(1);
1024  auto ap = std::abs(pp.pid());
1025  if (ap < TABLESIZE ) { return std::abs(double_spin.at(ap)-1); } // sparticles (0->1, 1 -> 0, 2->1, 4->3)
1026  return p.last()-1; // R-Hadrons (p.last() == 2J +1)
1027  }
1028  auto ap = std::abs(p.pid());
1029  if (ap == K0S) { return 0; }
1030  if (ap == K0L) { return 0; }
1031  if (ap == MAVTOP) { return 1; } // TODO check this
1032  if (ap == DARKPHOTON) { return 2; } // TODO check this
1033  if (ap < TABLESIZE ) { return double_spin.at(ap); } // fundamental particles
1034  if (isHadron(p)) { return p.last()-1; } // Hadrons (p.last == 2J+1 - special cases handled above)
1035  if (isMonopole(p)) { return 0; } // PDG 11i - For now no spin information is provided. Also matches the definition in the G4Extensions/Monopole package.
1036  if (isGenericMultichargedParticle(p)) { return 0; } // APID Matches the definition in the G4Extensions/Monopole package.
1037  if (isNucleus(p)) { return 1; } // TODO need to explicitly deal with nuclei
1038  return p.last() > 0 ? 1 : 0; // Anything else - best guess
1039 }

◆ spin2() [2/3]

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

Definition at line 1040 of file AtlasPID.h.

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

◆ spin2() [3/3]

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

Definition at line 1020 of file AtlasPID.h.

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

◆ strangeness() [1/3]

template<>
int strangeness ( const DecodedPID p)
inline

Definition at line 724 of file AtlasPID.h.

724  {
725  if (isNucleus(p) && p.ndigits() == 10) { return (p.pid() > 0) ? -p(2) : p(2); }
726  if (isStrange(p.pid())) { return (p.pid() > 0) ? -1 : 1; }
727  if (!hasStrange(p) && !hasSquark(p,SQUARK)) { return 0; }
728  if (std::abs(p.pid()) == K0) { return (p.pid() > 0) ? 1 : -1; }
729  size_t nq = 0;
730  int sign = 1;
731  int signmult = 1;
732  int result=0;
733  bool classified = false;
734  if (!classified && isMeson(p)) { classified = true; nq = 2; if ((*(p.second.rbegin()+2)) == 2||(*(p.second.rbegin()+2)) == 4 ) { sign=-1;} signmult =-1; }
735  if (!classified && isDiquark(p)) {return is_strange.at(p(0))+is_strange.at(p(1)); }
736  if (!classified && isBaryon(p)) { classified = true; nq = 3; }
737  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)); }
738  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)); }
739  if (!classified && isSUSY(p)) {
740  nq = 0;
741  auto pp = p.shift(1);
742  if (pp.ndigits() < 3 ) { return strangeness(pp); } // super-partners of fundamental particles
743  if (pp(0) == COMPOSITEGLUON) {
744  if (pp(1) == COMPOSITEGLUON) { return 0; } // R-Glueballs
745  if ( pp.ndigits() == 4 || pp.ndigits() == 5) {
746  pp = pp.shift(1); // Remove gluino
747  }
748  }
749  if (pp.ndigits() == 3) { classified = true; nq = 2; if (p.last()%2==0) {sign = -1;} signmult = -1; } // states with quark-antiquark or squark-antiquark
750  if (pp.ndigits() == 4) { classified = true; nq = 3; } // states with quark-quark-quark or squark-quark-quark
751  }
752  for (auto r = p.second.rbegin() + 1; r != p.second.rbegin() + 1 + nq; ++r) {
753  result += is_strange.at(*r)*sign;
754  sign*=signmult;
755  }
756  return p.pid() > 0 ? result : -result;
757 }

◆ strangeness() [2/3]

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

Definition at line 758 of file AtlasPID.h.

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

◆ strangeness() [3/3]

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

Definition at line 723 of file AtlasPID.h.

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

◆ threeCharge()

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

Definition at line 937 of file AtlasPID.h.

937 { return charge3(p);}
isStrange
bool isStrange(const T &p)
Definition: AtlasPID.h:166
beamspotman.r
def r
Definition: beamspotman.py:676
isGaugino
bool isGaugino(const T &p)
Definition: AtlasPID.h:483
isStrongInteracting
bool isStrongInteracting(const T &p)
Definition: AtlasPID.h:1078
isNucleus
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
Definition: AtlasPID.h:644
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:359
isTetraquark
bool isTetraquark(const T &p)
PDG rule 14 The 9-digit tetra-quark codes are±1nrnLnq1nq20nq3nq4nJ.
Definition: AtlasPID.h:300
isRMeson
bool isRMeson(const T &p)
Definition: AtlasPID.h:544
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:477
isBSM
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition: AtlasPID.h:783
baryonNumber
double baryonNumber(const T &p)
Definition: AtlasPID.h:710
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:610
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:342
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:398
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:226
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:579
isSquarkRH
bool isSquarkRH(const T &p)
Definition: AtlasPID.h:450
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:532
numberOfLambdas
int numberOfLambdas(const T &p)
Definition: AtlasPID.h:761
isNeutrino
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Definition: AtlasPID.h:201
isSquark
bool isSquark(const T &p)
Definition: AtlasPID.h:434
isSleptonLH
bool isSleptonLH(const T &p)
Definition: AtlasPID.h:471
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:812
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
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:626
isSMLepton
bool isSMLepton(const T &p)
Definition: AtlasPID.h:183
isSMQuark
bool isSMQuark(const T &p)
Definition: AtlasPID.h:162
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:346
isHiggs
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
Definition: AtlasPID.h:363
fractionalCharge
double fractionalCharge(const T &p)
Definition: AtlasPID.h:930
isQuark
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to dot...
Definition: AtlasPID.h:158
A
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
isCCbarMeson
bool isCCbarMeson(const T &p)
Definition: AtlasPID.h:856
strangeness
int strangeness(const T &p)
Definition: AtlasPID.h:723
isBottom
bool isBottom(const T &p)
Definition: AtlasPID.h:172
lumiFormat.i
int i
Definition: lumiFormat.py:85
leadingQuark
int leadingQuark(const T &p)
Definition: AtlasPID.h:823
isPythia8Specific
bool isPythia8Specific(const T &p)
Definition: AtlasPID.h:384
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:589
isWeaklyDecayingCHadron
bool isWeaklyDecayingCHadron(const T &p)
Definition: AtlasPID.h:911
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:352
isPentaquark
bool isPentaquark(const T &p)
PDG rule 15 The 9-digit penta-quark codes are±1nrnLnq1nq2nq3nq4nq5nJ, sorted such thatnq1≥nq2≥nq3≥nq4...
Definition: AtlasPID.h:315
isGlueball
bool isGlueball(const T &p)
APID: Definition of Glueballs: SM glueballs 99X (X=1,5), 999Y (Y=3,7)
Definition: AtlasPID.h:413
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
isBBbarMeson
bool isBBbarMeson(const T &p)
Definition: AtlasPID.h:860
isNeutral
bool isNeutral(const T &p)
Definition: AtlasPID.h:999
hasStrange
bool hasStrange(const T &p)
Definition: AtlasPID.h:673
isChLepton
bool isChLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition: AtlasPID.h:188
isSUSY
bool isSUSY(const T &p)
PDG rule 11d Fundamental supersymmetric particles are identified by adding a nonzero n to the particl...
Definition: AtlasPID.h:428
isTau
bool isTau(const T &p)
Definition: AtlasPID.h:197
isGraviton
bool isGraviton(const T &p)
Definition: AtlasPID.h:370
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:603
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:506
isHadron
bool isHadron(const T &p)
Definition: AtlasPID.h:324
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:393
charge
double charge(const T &p)
Definition: AtlasPID.h:931
isBaryon
bool isBaryon(const T &p)
Table 43.2.
Definition: AtlasPID.h:257
isGeantino
bool isGeantino(const T &p)
Definition: AtlasPID.h:409
isSlepton
bool isSlepton(const T &p)
Definition: AtlasPID.h:465
isWeaklyDecayingBHadron
bool isWeaklyDecayingBHadron(const T &p)
Definition: AtlasPID.h:876
spin2
int spin2(const T &p)
Definition: AtlasPID.h:1020
isW
bool isW(const T &p)
Definition: AtlasPID.h:355
isRBaryon
bool isRBaryon(const T &p)
Definition: AtlasPID.h:559
isTop
bool isTop(const T &p)
Definition: AtlasPID.h:175
isTransportable
bool isTransportable(const T &p)
Definition: AtlasPID.h:807
numberOfProtons
int numberOfProtons(const T &p)
Definition: AtlasPID.h:770
isLepton
bool isLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition: AtlasPID.h:179
isCharm
bool isCharm(const T &p)
Definition: AtlasPID.h:169
isPhoton
bool isPhoton(const T &p)
Definition: AtlasPID.h:349
charge3
int charge3(const T &p)
Definition: AtlasPID.h:929
hasSquark
bool hasSquark(const T &p, const int &q)
Definition: AtlasPID.h:457
isSquarkLH
bool isSquarkLH(const T &p)
Definition: AtlasPID.h:442
isSMNeutrino
bool isSMNeutrino(const T &p)
Definition: AtlasPID.h:204
isRHadron
bool isRHadron(const T &p)
Definition: AtlasPID.h:1046
extractSporadic.q
list q
Definition: extractSporadic.py:98
isTechnicolor
bool isTechnicolor(const T &p)
PDG rule 11e Technicolor states have n = 3, with technifermions treated like ordinary fermions.
Definition: AtlasPID.h:494
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:332
isElectron
bool isElectron(const T &p)
Definition: AtlasPID.h:191
isDiquark
bool isDiquark(const T &p)
PDG rule 4 Diquarks have 4-digit numbers with nq1 >= nq2 and nq3 = 0 APID: the diquarks with fourth g...
Definition: AtlasPID.h:210
baryonNumber3
int baryonNumber3(const T &p)
Definition: AtlasPID.h:685
isEMInteracting
bool isEMInteracting(const T &p)
Definition: AtlasPID.h:1013
containedQuarks
std::vector< int > containedQuarks(const T &p)
Definition: AtlasPID.h:1053
spin
double spin(const T &p)
Definition: AtlasPID.h:1042
isMSSMHiggs
bool isMSSMHiggs(const T &p)
APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier)
Definition: AtlasPID.h:367
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:194
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:381