ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AtlasPID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRUTHUTILS_ATLASPID_H
5 #define TRUTHUTILS_ATLASPID_H
6 #include <vector>
7 #include <cmath>
8 #include <algorithm>
9 #include <array>
10 #include <cstdlib>
16 class DecodedPID: public std::pair<int,std::vector<int>> {
17 public:
18  inline DecodedPID(const int& p){
19  this->first=p;
20  this->second.reserve(10);
21  int ap = std::abs(p);
22  for(; ap; ap/=10) this->second.push_back( ap%10 );
23  std::reverse(this->second.begin(), this->second.end());
24  }
25  inline DecodedPID shift(const size_t n) const { return DecodedPID(this->first%int(std::pow(10,ndigits()-n)));}
26  inline const int& operator()(const size_t n) const { return this->second.at(n);}
27  inline const int& last() const { return this->second.back();}
28  inline const int& pid() const { return this->first;}
29  inline int max_digit(const int m,const int n) const { return *std::max_element(second.rbegin() + m, second.rbegin() + n);}
30  inline int min_digit(const int m,const int n) const { return *std::min_element(second.rbegin() + m, second.rbegin() + n);}
31  inline size_t ndigits() const { return this->second.size();}
32 };
33 
34 static const int TABLESIZE = 100;
35 static const std::array<int,TABLESIZE> triple_charge = {
36  +0, -1, +2, -1, +2, -1, +2, -1, +2, +0,
37  +0, -3, +0, -3, +0, -3, +0, -3, +0, +0,
38  +0, +0, +0, +0, +3, +0, +0, +0, +0, +0,
39  +0, +0, +0, +0, +3, +0, +0, +3, +0, +0,
40  +0, +0, -1, +0, +0, +0, +0, +0, +0, +0,
41  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
42  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
43  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
44  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
45  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0
46 };
47 static const std::array<int,TABLESIZE> double_spin = {
48  +0, +1, +1, +1, +1, +1, +1, +1, +1, +0,
49  +0, +1, +1, +1, +1, +1, +1, +1, +1, +0,
50  +2, +2, +2, +2, +2, +0, +0, +0, +0, +0,
51  +0, +0, +2, +2, +2, +0, +0, +0, +0, +4,
52  +0, +0, -1, +0, +0, +0, +0, +0, +0, +0,
53  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
54  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
55  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
56  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0,
57  +0, +0, +0, +0, +0, +0, +0, +0, +0, +0
58 };
59 
60 
61 static const int DQUARK = 1;
62 static const int UQUARK = 2;
63 static const int SQUARK = 3;
64 static const int CQUARK = 4;
65 static const int BQUARK = 5;
66 static const int TQUARK = 6;
67 
68 static const int ELECTRON = 11;
69 static const int POSITRON = -ELECTRON;
70 static const int NU_E = 12;
71 static const int MUON = 13;
72 static const int NU_MU = 14;
73 static const int TAU = 15;
74 static const int NU_TAU = 16;
75 
76 static const int GLUON = 21;
77 // APID: 9 rather than 21 is used to denote a gluon/gluino in composite states. (From PDG 11g)
78 static const int COMPOSITEGLUON = 9;
79 static const int PHOTON = 22;
80 static const int Z0BOSON = 23;
81 static const int WPLUSBOSON = 24;
82 static const int HIGGSBOSON = 25;
83 static const int ZPRIME = 32; // Z′/Z^0_2
84 static const int ZDBLPRIME = 33; // Z′′/Z^0_3
85 static const int WPLUSPRIME = 34; // W ′/W^+_2
86 static const int HIGGS2 = 35; // H^0/H^0_2 FIXME Any better ideas?
87 static const int HIGGS3 = 36; // A^0/H^0_3 FIXME Any better ideas?
88 static const int HIGGSPLUS = 37; // H^+
89 static const int HIGGSPLUSPLUS = 38; // H^++
90 static const int GRAVITON = 39;
91 static const int HIGGS4 = 40; // a^0/H^0_4 FIXME Any better ideas?
92 static const int LEPTOQUARK = 42;
93 
98 static const int DARKPHOTON = 60000;
99 static const int MAVTOP = 60001;
100 
101 static const int PIPLUS = 211;
102 static const int PIMINUS = -PIPLUS;
103 static const int PI0 = 111;
104 static const int K0L = 130;
105 
106 static const int K0S = 310;
107 static const int K0 = 311;
108 static const int KPLUS = 321;
109 static const int DPLUS = 411;
110 static const int DSTAR = 413;
111 static const int D0 = 421;
112 static const int DSPLUS = 431;
113 static const int JPSI = 443;
114 static const int B0 = 511;
115 static const int BCPLUS = 541;
116 static const int PROTON = 2212;
117 static const int NEUTRON = 2112;
118 static const int LAMBDA0 = 3122;
119 static const int LAMBDACPLUS = 4122;
120 static const int LAMBDAB0 = 5122;
121 static const int PSI2S = 20443;
122 
128 static const int RH_NU_E = 9900012;
129 static const int RH_NU_MU = 9900014;
130 static const int RH_NU_TAU = 9900016;
131 static const int WBOSON_LRSM = 9900024;
132 
133 static const int LEAD = 1000822080;
134 static const int OXYGEN = 1000080160;
135 static const int NEON = 1000100200;
136 
140 static const int POMERON = 990;
141 static const int ODDERON = 9990;
142 static const int REGGEON = 110;
143 
149 static const int GEANTINOPLUS = 998;
150 static const int GEANTINO0 = 999;
151 
152 
158 template<class T> inline bool isQuark(const T& p) {return isQuark(p->pdg_id());}
159 template<> inline bool isQuark(const int& p) { return p != 0 && (std::abs(p) <= 8 || std::abs(p) == MAVTOP);}
160 template<> inline bool isQuark(const DecodedPID& p){ return isQuark(p.pid()); }
161 
162 template<class T> inline bool isSMQuark(const T& p) {return isSMQuark(p->pdg_id());}
163 template<> inline bool isSMQuark(const int& p) { return p != 0 && std::abs(p) <= TQUARK;}
164 template<> inline bool isSMQuark(const DecodedPID& p){ return isSMQuark(p.pid()); }
165 
166 template<class T> inline bool isStrange(const T& p) {return isStrange(p->pdg_id());}
167 template<> inline bool isStrange(const int& p){ return std::abs(p) == 3;}
168 
169 template<class T> inline bool isCharm(const T& p){return isCharm(p->pdg_id());}
170 template<> inline bool isCharm(const int& p){ return std::abs(p) == 4;}
171 
172 template<class T> inline bool isBottom(const T& p){return isBottom(p->pdg_id());}
173 template<> inline bool isBottom(const int& p){ return std::abs(p) == 5;}
174 
175 template<class T> inline bool isTop(const T& p){return isTop(p->pdg_id());}
176 template<> inline bool isTop(const int& p){ return std::abs(p) == 6;}
177 
179 template<class T> inline bool isLepton(const T& p){return isLepton(p->pdg_id());}
180 template<> inline bool isLepton(const int& p){ auto sp = std::abs(p); return sp >= 11 && sp <= 18; }
181 template<> inline bool isLepton(const DecodedPID& p){ return isLepton(p.pid()); }
182 
183 template<class T> inline bool isSMLepton(const T& p){return isSMLepton(p->pdg_id());}
184 template<> inline bool isSMLepton(const int& p){ auto sp = std::abs(p); return sp >= 11 && sp <= 16; }
185 template<> inline bool isSMLepton(const DecodedPID& p){ return isSMLepton(p.pid()); }
186 
188 template<class T> inline bool isChLepton(const T& p){return isChLepton(p->pdg_id());}
189 template<> inline bool isChLepton(const int& p){ auto sp = std::abs(p); return sp >= 11 && sp <= 18 && sp%2 == 1; }
190 
191 template<class T> inline bool isElectron(const T& p){return isElectron(p->pdg_id());}
192 template<> inline bool isElectron(const int& p){ return std::abs(p) == ELECTRON;}
193 
194 template<class T> inline bool isMuon(const T& p){return isMuon(p->pdg_id());}
195 template<> inline bool isMuon(const int& p){ return std::abs(p) == MUON;}
196 
197 template<class T> inline bool isTau(const T& p){return isTau(p->pdg_id());}
198 template<> inline bool isTau(const int& p){ return std::abs(p) == TAU;}
199 
201 template<class T> inline bool isNeutrino(const T& p){return isNeutrino(p->pdg_id());}
202 template<> inline bool isNeutrino(const int& p){ auto sp = std::abs(p); return sp == NU_E || sp == NU_MU || sp == NU_TAU || sp == 18; }
203 
204 template<class T> inline bool isSMNeutrino(const T& p){return isSMNeutrino(p->pdg_id());}
205 template<> inline bool isSMNeutrino(const int& p){ auto sp = std::abs(p); return sp == NU_E || sp == NU_MU || sp == NU_TAU; }
206 
210 template<class T> inline bool isDiquark(const T& p){return isDiquark(p->pdg_id());}
211 template<> inline bool isDiquark(const DecodedPID& p){
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 }
217 template<> inline bool isDiquark(const int& p){ auto value_digits = DecodedPID(p); return isDiquark(value_digits);}
218 
226 template<class T> inline bool isMeson(const T& p){return isMeson(p->pdg_id());}
227 template<> inline bool isMeson(const DecodedPID& p){
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 }
254 template<> inline bool isMeson(const int& p){ auto value_digits = DecodedPID(p); return isMeson(value_digits);}
255 
257 template<class T> inline bool isBaryon(const T& p){return isBaryon(p->pdg_id());}
258 template<> inline bool isBaryon(const DecodedPID& p){
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 }
292 template<> inline bool isBaryon(const int& p){ auto value_digits = DecodedPID(p); return isBaryon(value_digits);}
293 
300 template<class T> inline bool isTetraquark(const T& p){return isTetraquark(p->pdg_id());}
301 template<> inline bool isTetraquark(const DecodedPID& p){
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 }
308 template<> inline bool isTetraquark(const int& p){ auto value_digits = DecodedPID(p); return isTetraquark(value_digits);}
309 
315 template<class T> inline bool isPentaquark(const T& p){return isPentaquark(p->pdg_id());}
316 template<> inline bool isPentaquark(const DecodedPID& p){
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 }
321 template<> inline bool isPentaquark(const int& p){ auto value_digits = DecodedPID(p); return isPentaquark(value_digits);}
322 
323 // APID Mesons, Baryons, Tetraquarks and Pentaquarks are Hadrons
324 template<class T> inline bool isHadron(const T& p){return isHadron(p->pdg_id());}
325 template<> inline bool isHadron(const DecodedPID& p){ return isMeson(p) || isBaryon(p) || isTetraquark(p) || isPentaquark(p); }
326 template<> inline bool isHadron(const int& p){ auto value_digits = DecodedPID(p); return isHadron(value_digits);}
327 
328 
332 template<class T> inline bool isTrajectory(const T& p){return isTrajectory(p->pdg_id());}
333 template<> inline bool isTrajectory(const int& p){ return std::abs(p) == POMERON || std::abs(p) == ODDERON || std::abs(p) == REGGEON; }
334 
335 
342 template<class T> inline bool isBoson(const T& p){return isBoson(p->pdg_id());}
343 template<> inline bool isBoson(const int& p){ auto sp = std::abs(p); return sp > 20 && sp < 41; }
344 template<> inline bool isBoson(const DecodedPID& p){ return isBoson(p.pid()); }
345 
346 template<class T> inline bool isGluon(const T& p){return isGluon(p->pdg_id());}
347 template<> inline bool isGluon(const int& p){ return p == GLUON; }
348 
349 template<class T> inline bool isPhoton(const T& p){return isPhoton(p->pdg_id());}
350 template<> inline bool isPhoton(const int& p){ return p == PHOTON; }
351 
352 template<class T> inline bool isZ(const T& p){return isZ(p->pdg_id());}
353 template<> inline bool isZ(const int& p){ return p == Z0BOSON; }
354 
355 template<class T> inline bool isW(const T& p){return isW(p->pdg_id());}
356 template<> inline bool isW(const int& p){ return std::abs(p) == WPLUSBOSON; }
357 
359 template<class T> inline bool isHeavyBoson(const T& p){return isHeavyBoson(p->pdg_id());}
360 template<> inline bool isHeavyBoson(const int& p){ return p == ZPRIME || p == ZDBLPRIME || std::abs(p) == WPLUSPRIME; }
361 
363 template<class T> inline bool isHiggs(const T& p){return isHiggs(p->pdg_id());}
364 template<> inline bool isHiggs(const int& p){ return p == HIGGSBOSON; }
365 
367 template<class T> inline bool isMSSMHiggs(const T& p){return isMSSMHiggs(p->pdg_id());}
368 template<> inline bool isMSSMHiggs(const int& p){ return p == HIGGS2 || p == HIGGS3 || std::abs(p) == HIGGSPLUS; }
369 
370 template<class T> inline bool isGraviton(const T& p) {return isGraviton(p->pdg_id());}
371 template<> inline bool isGraviton(const int& p){ return p == GRAVITON; }
372 
373 template<class T> inline bool isResonance(const T& p) { return isZ(p) || isW(p) || isHiggs(p) || isTop(p); } // APID: not including t' (pdg_id=8)
374 
381 template<class T> inline bool isLeptoQuark(const T& p){return isLeptoQuark(p->pdg_id());}
382 template<> inline bool isLeptoQuark(const int& p){ return std::abs(p) == LEPTOQUARK; }
383 
384 template<class T> inline bool isPythia8Specific(const T& p){return isPythia8Specific(p->pdg_id());}
385 template<> inline bool isPythia8Specific(const DecodedPID& p){ return (p.ndigits() == 7 && p(0) == 9 && p(1) == 9);}
386 template<> inline bool isPythia8Specific(const int& p){ auto value_digits = DecodedPID(p); return isPythia8Specific(value_digits);}
387 
393 template<class T> inline bool isNeutrinoRH(const T& p){return isNeutrinoRH(p->pdg_id());}
394 template<> inline bool isNeutrinoRH(const int& p){ return (std::abs(p) == RH_NU_E || std::abs(p) == RH_NU_MU|| std::abs(p) == RH_NU_TAU);}
395 
398 template<class T> inline bool isGenSpecific(const T& p){return isGenSpecific(p->pdg_id());}
399 template<> inline bool isGenSpecific(const int& p){
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 }
408 
409 template<class T> inline bool isGeantino(const T& p){return isGeantino(p->pdg_id());}
410 template<> inline bool isGeantino(const int& p){ return (std::abs(p) == GEANTINO0 || std::abs(p) == GEANTINOPLUS);}
411 
413 template<class T> inline bool isGlueball(const T& p) { return isGlueball(p->pdg_id()); }
414 template<> inline bool isGlueball(const DecodedPID& p) {
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 }
420 template<> inline bool isGlueball(const int& p) { auto value_digits = DecodedPID(p); return isGlueball(value_digits); }
421 
422 
428 template<class T> inline bool isSUSY(const T& p){return isSUSY(p->pdg_id());}
429 template<> inline bool isSUSY(const DecodedPID& p){return (p.ndigits() == 7 && (p(0) == 1 || p(0) == 2) && !isGenSpecific(p.shift(2).pid()));}
430 template<> inline bool isSUSY(const int& p){ auto value_digits = DecodedPID(p); return isSUSY(value_digits);}
431 
432 
433 // APID: Super-partners of standard model quarks only
434 template<class T> inline bool isSquark(const T& p) { return isSquark(p->pdg_id()); }
435 template<> inline bool isSquark(const DecodedPID& p){
436  auto pp = p.shift(1); return isSUSY(p) && isSMQuark(pp);
437 }
438 template<> inline bool isSquark(const int& p){ auto value_digits = DecodedPID(p); return isSquark(value_digits);}
439 
440 
441 // APID: Super-partners of left-handed standard model quarks only
442 template<class T> inline bool isSquarkLH(const T& p) { return isSquarkLH(p->pdg_id()); }
443 template<> inline bool isSquarkLH(const DecodedPID& p){
444  return isSquark(p) && (p(0) == 1);
445 }
446 template<> inline bool isSquarkLH(const int& p){ auto value_digits = DecodedPID(p); return isSquarkLH(value_digits);}
447 
448 
449 // APID: Super-partners of right-handed standard model quarks only
450 template<class T> inline bool isSquarkRH(const T& p) { return isSquarkRH(p->pdg_id()); }
451 template<> inline bool isSquarkRH(const DecodedPID& p){
452  return isSquark(p) && (p(0) == 2);
453 }
454 template<> inline bool isSquarkRH(const int& p){ auto value_digits = DecodedPID(p); return isSquarkRH(value_digits);}
455 
456 
457 template<class T> inline bool hasSquark(const T& p, const int& q) { return hasSquark(p->pdg_id(), q); }
458 template<> inline bool hasSquark(const DecodedPID& p, const int& q){
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 }
461 template<> inline bool hasSquark(const int& p, const int& q){ auto value_digits = DecodedPID(p); return hasSquark(value_digits, q);}
462 
463 
464 // APID: Super-partners of standard model leptons only
465 template<class T> inline bool isSlepton(const T& p) { return isSlepton(p->pdg_id()); }
466 template<> inline bool isSlepton(const DecodedPID& p){ auto pp = p.shift(1); return isSUSY(p) && isSMLepton(pp);}
467 template<> inline bool isSlepton(const int& p){ auto value_digits = DecodedPID(p); return isSlepton(value_digits);}
468 
469 
470 // APID: Super-partners of left-handed standard model leptons only
471 template<class T> inline bool isSleptonLH(const T& p) { return isSleptonLH(p->pdg_id()); }
472 template<> inline bool isSleptonLH(const DecodedPID& p){ return isSlepton(p) && (p(0) == 1); }
473 template<> inline bool isSleptonLH(const int& p){ auto value_digits = DecodedPID(p); return isSleptonLH(value_digits);}
474 
475 
476 // APID: Super-partners of right-handed standard model leptons only
477 template<class T> inline bool isSleptonRH(const T& p) { return isSleptonRH(p->pdg_id()); }
478 template<> inline bool isSleptonRH(const DecodedPID& p){ return isSlepton(p) && (p(0) == 2); }
479 template<> inline bool isSleptonRH(const int& p){ auto value_digits = DecodedPID(p); return isSleptonRH(value_digits);}
480 
481 
482 // APID: Super-partners of gauge bosons including gravitons
483 template<class T> inline bool isGaugino(const T& p) { return isGaugino(p->pdg_id()); }
484 template<> inline bool isGaugino(const DecodedPID& p){
485  auto pp = p.shift(1); return isSUSY(p) && isBoson(pp.pid());
486 }
487 template<> inline bool isGaugino(const int& p){ auto value_digits = DecodedPID(p); return isGaugino(value_digits);}
488 
494 template<class T> inline bool isTechnicolor(const T& p){return isTechnicolor(p->pdg_id());}
495 template <>
496 inline bool isTechnicolor(const DecodedPID& p) {
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 }
502 template<> inline bool isTechnicolor(const int& p){ auto value_digits = DecodedPID(p); return isTechnicolor(value_digits);}
503 
506 template<class T> inline bool isExcited(const T& p){return isExcited(p->pdg_id());}
507 template <>
508 inline bool isExcited(const DecodedPID& p) {
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 }
513 template<> inline bool isExcited(const int& p){ auto value_digits = DecodedPID(p); return isExcited(value_digits);}
514 
527 
532 template<class T> inline bool isRGlueball(const T& p) { return isRGlueball(p->pdg_id()); }
533 template<> inline bool isRGlueball(const DecodedPID& p) {
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 }
540 template<> inline bool isRGlueball(const int& p) { auto value_digits = DecodedPID(p); return isRGlueball(value_digits); }
541 
542 // APID Define R-Mesons as gluino-quark-antiquark and squark-antiquark bound states (ignore 4th generation squarks/quarks)
543 // NB Current models only allow gluino-quark-antiquark, stop-antiquark and sbottom-antiquark states
544 template<class T> inline bool isRMeson(const T& p) { return isRMeson(p->pdg_id()); }
545 template<> inline bool isRMeson(const DecodedPID& p) {
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 }
555 template<> inline bool isRMeson(const int& p) { auto value_digits = DecodedPID(p); return isRMeson(value_digits); }
556 
557 // APID Define R-Baryons as gluino-quark-quark-quark and squark-quark-quark bound states (ignore 4th generation squarks/quarks)
558 // NB Current models only allow gluino-quark-quark-quark, stop-quark-quark and sbottom-quark-quark states
559 template<class T> inline bool isRBaryon(const T& p) { return isRBaryon(p->pdg_id()); }
560 template<> inline bool isRBaryon(const DecodedPID& p) {
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 }
570 template<> inline bool isRBaryon(const int& p) { auto value_digits = DecodedPID(p); return isRBaryon(value_digits); }
571 
579 template<class T> inline bool isKK(const T& p){return isKK(p->pdg_id());}
580 template<> inline bool isKK(const DecodedPID& p){return (p.ndigits() == 7 && (p(0) == 5 || p(0) == 6 ) );}
581 template<> inline bool isKK(const int& p){ auto value_digits = DecodedPID(p); return isKK(value_digits);}
582 
589 template<class T> inline bool isMonopole(const T& p){return isMonopole(p->pdg_id());}
590 template<> inline bool isMonopole(const DecodedPID& p){return (p.ndigits() == 7 && p(0) == 4 && p(1) == 1 && (p(2) == 1 || p(2) == 2 ) && p(6) == 0);}
591 template<> inline bool isMonopole(const int& p){ auto value_digits = DecodedPID(p); return isMonopole(value_digits);}
592 
603 template<class T> inline bool isDM(const T& p){return isDM(p->pdg_id());}
604 template<> inline bool isDM(const int& p){ auto sp = std::abs(p); return (sp >= 51 && sp <= 60) || sp == DARKPHOTON; }
605 
610 template<class T> inline bool isHiddenValley(const T& p){return isHiddenValley(p->pdg_id());}
611 template <>
612 inline bool isHiddenValley(const DecodedPID& p) {
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 }
618 template<> inline bool isHiddenValley(const int& p){ auto value_digits = DecodedPID(p); return isHiddenValley(value_digits);}
619 
626 template<class T> inline bool isGenericMultichargedParticle(const T& p){return isGenericMultichargedParticle(p->pdg_id());}
627 template<> inline bool isGenericMultichargedParticle(const DecodedPID& p){return (p.ndigits() == 8 && (p(0) == 1 || p(0) == 2) && p(1) == 0 && p(2) == 0 && p(7) == 0);}
628 template<> inline bool isGenericMultichargedParticle(const int& p){ auto value_digits = DecodedPID(p); return isGenericMultichargedParticle(value_digits);}
629 
644 template<class T> inline bool isNucleus(const T& p){return isNucleus(p->pdg_id());}
645 template<> inline bool isNucleus(const DecodedPID& p){
646  if (std::abs(p.pid()) == PROTON) return true;
647  return (p.ndigits() == 10 && p(0) == 1 && p(1) == 0 );
648 }
649 template<> inline bool isNucleus(const int& p){ auto value_digits = DecodedPID(p); return isNucleus(value_digits);}
650 
651 
652 template<class T> inline bool hasQuark(const T& p, const int& q);
653 template<> inline bool hasQuark(const DecodedPID& p, const int& q){
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 }
671 template<> inline bool hasQuark(const int& p, const int& q){ auto value_digits = DecodedPID(p); return hasQuark(value_digits, q);}
672 
673 template<class T> inline bool hasStrange(const T& p) { return hasQuark(p,SQUARK); }
674 template<class T> inline bool hasCharm(const T& p) { return hasQuark(p,CQUARK); }
675 template<class T> inline bool hasBottom(const T& p) { return hasQuark(p,BQUARK); }
676 template<class T> inline bool hasTop(const T& p) { return hasQuark(p,TQUARK); }
677 
678 
679 // APID: The baryon number is defined as:
680 // B = (1/3)*( n_q - n_{qbar} )
681 // where n_q⁠ is the number of quarks, and ⁠n_{qbar} is the number of
682 // antiquarks. By convention, squarks have the same quantum numbers as
683 // the corresponding quarks (modulo spin and R), so have baryon number
684 // 1/3.
685 template<class T> inline int baryonNumber3(const T& p) {return baryonNumber3(p->pdg_id());}
686 template<> inline int baryonNumber3(const DecodedPID& p){
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 }
708 template<> inline int baryonNumber3(const int& p){ auto value_digits = DecodedPID(p); return baryonNumber3(value_digits);}
709 
710 template<class T> inline double baryonNumber(const T& p) {return baryonNumber(p->pdg_id());}
711 template<> inline double baryonNumber(const DecodedPID& p){ return static_cast<double>(baryonNumber3(p))/3.0;}
712 template<> inline double baryonNumber(const int& p){ auto value_digits = DecodedPID(p); return static_cast<double>(baryonNumber3(value_digits))/3.0;}
713 
714 
715 // APID: The strangeness of a particle is defined as:
716 // S = − ( n_s − n_{sbar} )
717 // where n_s represents the number of strange quarks and n_{sbar}
718 // represents the number of strange antiquarks. By convention, strange
719 // squarks have the same quantum numbers as strange quarks (modulo
720 // spin and R), so have strangeness -1.
721 static const std::array<int,10> is_strange = {
722  +0, +0, +0, -1, +0, +0, +0, +0, +0, +0 };
723 template<class T> inline int strangeness(const T& p) {return strangeness(p->pdg_id());}
724 template<> inline int strangeness(const DecodedPID& p){
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 }
758 template<> inline int strangeness(const int& p){ auto value_digits = DecodedPID(p); return strangeness(value_digits);}
759 
760 
761 template<class T> inline int numberOfLambdas(const T& p) {return numberOfLambdas(p->pdg_id());}
762 template<> inline int numberOfLambdas(const DecodedPID& p){
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 }
767 template<> inline int numberOfLambdas(const int& p){ auto value_digits = DecodedPID(p); return numberOfLambdas(value_digits);}
768 
769 
770 template<class T> inline int numberOfProtons(const T& p) {return numberOfProtons(p->pdg_id());}
771 template<> inline int numberOfProtons(const DecodedPID& p){
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 }
779 template<> inline int numberOfProtons(const int& p){ auto value_digits = DecodedPID(p); return numberOfProtons(value_digits);}
780 
781 
783 template<class T> inline bool isBSM(const T& p){return isBSM(p->pdg_id());}
784 template<> inline bool isBSM(const DecodedPID& p){
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 }
798 template<> inline bool isBSM(const int& p){
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 }
806 
807 template<class T> inline bool isTransportable(const T& p){return isTransportable(p->pdg_id());}
808 template<> inline bool isTransportable(const DecodedPID& p){ return isPhoton(p.pid()) || isGeantino(p.pid()) || isHadron(p) || isLepton(p.pid()) || p.pid() == DARKPHOTON;}
809 template<> inline bool isTransportable(const int& p){ auto value_digits = DecodedPID(p); return isTransportable(value_digits);}
810 
812 template<class T> inline bool isValid(const T& p){return isValid(p->pdg_id());}
813 template<> inline bool isValid(const DecodedPID& p){
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) ); }
818 template<> inline bool isValid(const int& p){ 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 }
822 
823 template<class T> inline int leadingQuark(const T& p) {return leadingQuark(p->pdg_id());}
824 template<> inline int leadingQuark(const DecodedPID& p){
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 }
839 
840 template<> inline int leadingQuark(const int& p){ auto value_digits = DecodedPID(p); return leadingQuark(value_digits);}
841 
842 template<class T> inline bool isLightHadron(const T& p) { auto lq = leadingQuark(p); return (lq == DQUARK || lq == UQUARK||lq == SQUARK) && isHadron(p); }
843 template<class T> inline bool isHeavyHadron(const T& p) { auto lq = leadingQuark(p); return (lq == CQUARK || lq == BQUARK || lq == TQUARK ) && isHadron(p); }
844 template<class T> inline bool isStrangeHadron(const T& p) { return leadingQuark(p) == SQUARK && isHadron(p); }
845 template<class T> inline bool isCharmHadron(const T& p) { return leadingQuark(p) == CQUARK && isHadron(p); }
846 template<class T> inline bool isBottomHadron(const T& p) { return leadingQuark(p) == BQUARK && isHadron(p); }
847 template<class T> inline bool isTopHadron(const T& p) { return leadingQuark(p) == TQUARK && isHadron(p); }
848 
849 template<class T> inline bool isLightMeson(const T& p) { auto lq = leadingQuark(p); return (lq == DQUARK || lq == UQUARK||lq == SQUARK) && isMeson(p); }
850 template<class T> inline bool isHeavyMeson(const T& p) { auto lq = leadingQuark(p); return (lq == CQUARK || lq == BQUARK || lq == TQUARK) && isMeson(p); }
851 template<class T> inline bool isStrangeMeson(const T& p) { return leadingQuark(p) == SQUARK && isMeson(p); }
852 template<class T> inline bool isCharmMeson(const T& p) { return leadingQuark(p) == CQUARK && isMeson(p); }
853 template<class T> inline bool isBottomMeson(const T& p) { return leadingQuark(p) == BQUARK && isMeson(p); }
854 template<class T> inline bool isTopMeson(const T& p) { return leadingQuark(p) == TQUARK && isMeson(p); }
855 
856 template<class T> inline bool isCCbarMeson(const T& p) { return isCCbarMeson(p->pdg_id());}
857 template<> inline bool isCCbarMeson(const DecodedPID& p) { return leadingQuark(p) == CQUARK && isMeson(p) && (*(p.second.rbegin()+2)) == CQUARK && (*(p.second.rbegin()+1)) == CQUARK; }
858 template<> inline bool isCCbarMeson(const int& p) { return isCCbarMeson(DecodedPID(p)); }
859 
860 template<class T> inline bool isBBbarMeson(const T& p){ return isBBbarMeson(p->pdg_id());}
861 template<> inline bool isBBbarMeson(const DecodedPID& p) { return leadingQuark(p) == BQUARK && isMeson(p) && (*(p.second.rbegin()+2)) == BQUARK && (*(p.second.rbegin()+1)) == BQUARK; }
862 template<> inline bool isBBbarMeson(const int& p) { return isBBbarMeson(DecodedPID(p)); }
863 
864 
865 template<class T> inline bool isLightBaryon(const T& p) { auto lq = leadingQuark(p); return (lq == DQUARK || lq == UQUARK||lq == SQUARK) && isBaryon(p); }
866 template<class T> inline bool isHeavyBaryon(const T& p) { auto lq = leadingQuark(p); return (lq == CQUARK || lq == BQUARK || lq == TQUARK) && isBaryon(p); }
867 template<class T> inline bool isStrangeBaryon(const T& p) { return leadingQuark(p) == SQUARK && isBaryon(p); }
868 template<class T> inline bool isCharmBaryon(const T& p) { return leadingQuark(p) == CQUARK && isBaryon(p); }
869 template<class T> inline bool isBottomBaryon(const T& p) { return leadingQuark(p) == BQUARK && isBaryon(p); }
870 template<class T> inline bool isTopBaryon(const T& p) { return leadingQuark(p) == TQUARK && isBaryon(p); }
871 
872 
873 // APID: This function selects B-Hadrons which predominantly decay weakly. (Commonly used definition in GeneratorFilters package.)
874 // 5[1-4]1 L = J = 0, S = 0
875 // 5[1-5][1-4]2 J = 1/2, n_r = 0, n_L =0
876 template<class T> inline bool isWeaklyDecayingBHadron(const T& p) {return isWeaklyDecayingBHadron(p->pdg_id());}
877 template<> inline bool isWeaklyDecayingBHadron(const int& p) {
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 }
902 template<> inline bool isWeaklyDecayingBHadron(const DecodedPID& p){ return isWeaklyDecayingBHadron(p.pid()); }
903 
904 
905 // APID: This function selects C-Hadrons which predominantly decay weakly. (Commonly used definition in GeneratorFilters package.)
906 // 4[1-3]1 L = J = 0, S = 0
907 // 4[1-4][1-3]2 J = 1/2, n_r = 0, n_L =0
908 // NB Omitting pid = 4322 (Xi'_C+) a this undergoes an EM rather than
909 // weak decay. (There was an old version of Herwig that decayed it
910 // weakly, but this was fixed in Herwig 7.)
911 template<class T> inline bool isWeaklyDecayingCHadron(const T& p) {return isWeaklyDecayingCHadron(p->pdg_id());}
912 template<> inline bool isWeaklyDecayingCHadron(const int& p) {
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 }
926 template<> inline bool isWeaklyDecayingCHadron(const DecodedPID& p){ return isWeaklyDecayingCHadron(p.pid()); }
927 
928 
929 template<class T> inline int charge3( const T& p){return charge3(p->pdg_id());}
930 template<class T> inline double fractionalCharge(const T& p){return fractionalCharge(p->pdg_id());}
931 template<class T> inline double charge( const T& p){
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 }
937 template<class T> inline double threeCharge( const T& p){ return charge3(p);}
938 template<class T> inline bool isCharged( const T& p){ return charge3(p) != 0;}
939 
940 
941 template<> inline int charge3(const DecodedPID& p) {
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 }
991 template<> inline int charge3(const int& p){
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 }
997 
998 
999 template<class T> inline bool isNeutral( const T& p){ return p->pdg_id() != 0 && charge3(p) == 0;}
1000 template<> inline bool isNeutral(const DecodedPID& p){ return p.pid() != 0 && charge3(p) == 0;}
1001 template<> inline bool isNeutral(const int& p){ auto value_digits = DecodedPID(p); return isNeutral(value_digits);}
1002 
1003 
1004 template<> inline double fractionalCharge(const DecodedPID& p) {
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 }
1011 template<> inline double fractionalCharge(const int& p){auto value_digits = DecodedPID(p); return fractionalCharge(value_digits);}
1012 
1013 template<class T> inline bool isEMInteracting(const T& p){return isEMInteracting(p->pdg_id());}
1014 template<> inline bool isEMInteracting(const int& p) {return (isPhoton(p) || isZ(p) || std::abs(charge(p))>std::numeric_limits<double>::epsilon() || isMonopole(p));}
1015 
1016 template<class T> inline bool isParton(const T& p) { return isQuark(p)||isGluon(p);}
1017 
1018 // APID: Intended to return 2J
1019 // Useful for G4ParticleDefinition constructor
1020 template<class T> inline int spin2(const T& p) { return spin2(p->pdg_id()); }
1021 template<> inline int spin2(const DecodedPID& p) {
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 }
1040 template<> inline int spin2(const int& p){ auto value_digits = DecodedPID(p); return spin2(value_digits);}
1041 
1042 template<class T> inline double spin(const T& p) { return spin(p->pdg_id()); }
1043 template<> inline double spin(const DecodedPID& p) { return 1.0*spin2(p)/2.0; }
1044 template<> inline double spin(const int& p){ auto value_digits = DecodedPID(p); return spin(value_digits);}
1045 
1046 template<class T> inline bool isRHadron(const T& p) { return isRHadron(p->pdg_id()); }
1047 template<> inline bool isRHadron(const DecodedPID& p) {
1048  return (isRBaryon(p) || isRMeson(p) || isRGlueball(p));
1049 }
1050 template<> inline bool isRHadron(const int& p) { auto value_digits = DecodedPID(p); return isRHadron(value_digits); }
1051 
1052 // APID: Returns an unordered list of the quarks contained by the current particle
1053 template<class T> inline std::vector<int> containedQuarks(const T& p) { return containedQuarks(p->pdg_id()); }
1054 template<> inline std::vector<int> containedQuarks(const int& p) {
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 }
1076 template<> inline std::vector<int> containedQuarks(const DecodedPID& p) { return containedQuarks(p.pid()); }
1077 
1078 template<class T> inline bool isStrongInteracting(const T& p){return isStrongInteracting(p->pdg_id());}
1079 template<> inline bool isStrongInteracting(const int& p) { return (isGluon(p) || isQuark(p) || isDiquark(p) || isGlueball(p) || isLeptoQuark(p) || isHadron(p) || isRHadron(p));} // APID: Glueballs and R-Hadrons are also strong-interacting
1080 
1081 #endif
isStrange
bool isStrange(const T &p)
Definition: AtlasPID.h:166
isStrangeMeson
bool isStrangeMeson(const T &p)
Definition: AtlasPID.h:851
beamspotman.r
def r
Definition: beamspotman.py:676
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
isGaugino
bool isGaugino(const T &p)
Definition: AtlasPID.h:483
isBottomMeson
bool isBottomMeson(const T &p)
Definition: AtlasPID.h:853
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
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
isHeavyBoson
bool isHeavyBoson(const T &p)
APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier)
Definition: AtlasPID.h:359
isHeavyHadron
bool isHeavyHadron(const T &p)
Definition: AtlasPID.h:843
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
isBottomBaryon
bool isBottomBaryon(const T &p)
Definition: AtlasPID.h:869
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
isTopBaryon
bool isTopBaryon(const T &p)
Definition: AtlasPID.h:870
hasCharm
bool hasCharm(const T &p)
Definition: AtlasPID.h:674
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
DecodedPID::shift
DecodedPID shift(const size_t n) const
Definition: AtlasPID.h:25
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
threeCharge
double threeCharge(const T &p)
Definition: AtlasPID.h:937
isCharmMeson
bool isCharmMeson(const T &p)
Definition: AtlasPID.h:852
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
hasBottom
bool hasBottom(const T &p)
Definition: AtlasPID.h:675
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
isResonance
bool isResonance(const T &p)
Definition: AtlasPID.h:373
isParton
bool isParton(const T &p)
Definition: AtlasPID.h:1016
isSquark
bool isSquark(const T &p)
Definition: AtlasPID.h:434
isSleptonLH
bool isSleptonLH(const T &p)
Definition: AtlasPID.h:471
isHeavyBaryon
bool isHeavyBaryon(const T &p)
Definition: AtlasPID.h:866
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
isLightBaryon
bool isLightBaryon(const T &p)
Definition: AtlasPID.h:865
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
isBottomHadron
bool isBottomHadron(const T &p)
Definition: AtlasPID.h:846
isLightMeson
bool isLightMeson(const T &p)
Definition: AtlasPID.h:849
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
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
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
isLightHadron
bool isLightHadron(const T &p)
Definition: AtlasPID.h:842
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
isTopHadron
bool isTopHadron(const T &p)
Definition: AtlasPID.h:847
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
beamspotman.n
n
Definition: beamspotman.py:731
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
hasTop
bool hasTop(const T &p)
Definition: AtlasPID.h:676
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:352
DecodedPID::pid
const int & pid() const
Definition: AtlasPID.h:28
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
isCharmBaryon
bool isCharmBaryon(const T &p)
Definition: AtlasPID.h:868
isGlueball
bool isGlueball(const T &p)
APID: Definition of Glueballs: SM glueballs 99X (X=1,5), 999Y (Y=3,7)
Definition: AtlasPID.h:413
DecodedPID::max_digit
int max_digit(const int m, const int n) const
Definition: AtlasPID.h:29
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
DecodedPID::DecodedPID
DecodedPID(const int &p)
Definition: AtlasPID.h:18
DecodedPID::min_digit
int min_digit(const int m, const int n) const
Definition: AtlasPID.h:30
isStrangeHadron
bool isStrangeHadron(const T &p)
Definition: AtlasPID.h:844
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
isTopMeson
bool isTopMeson(const T &p)
Definition: AtlasPID.h:854
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
DecodedPID::ndigits
size_t ndigits() const
Definition: AtlasPID.h:31
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
isCharged
bool isCharged(const T &p)
Definition: AtlasPID.h:938
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
DeMoScan.first
bool first
Definition: DeMoScan.py:536
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
isCharmHadron
bool isCharmHadron(const T &p)
Definition: AtlasPID.h:845
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
isHeavyMeson
bool isHeavyMeson(const T &p)
Definition: AtlasPID.h:850
isStrangeBaryon
bool isStrangeBaryon(const T &p)
Definition: AtlasPID.h:867
DecodedPID::last
const int & last() const
Definition: AtlasPID.h:27
isElectron
bool isElectron(const T &p)
Definition: AtlasPID.h:191
DecodedPID::operator()
const int & operator()(const size_t n) const
Definition: AtlasPID.h:26
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
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
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
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
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