Rivet  3.1.0
ParticleIdUtils.hh
1 // -*- C++ -*-
2 //
3 // This file is part of MCUtils -- https://bitbucket.org/andybuckley/mcutils
4 // Copyright (C) 2013-2016 Andy Buckley <andy.buckley@cern.ch>
5 //
6 // Embedding of MCUtils code in other projects is permitted provided this
7 // notice is retained and the MCUtils namespace and include path are changed.
8 //
9 #ifndef RIVET_PARTICLEIDUTILS_HH
10 #define RIVET_PARTICLEIDUTILS_HH
11 
14 
15 #include "Rivet/Tools/ParticleName.hh"
16 #include "Rivet/Math/MathUtils.hh"
17 
18 namespace Rivet {
19  namespace PID {
20 
21 
23 
24 
27  enum Location { nj=1, nq3, nq2, nq1, nl, nr, n, n8, n9, n10 };
28 
30  inline unsigned short _digit(Location loc, int pid) {
31  // PID digits (base 10) are: n nr nl nq1 nq2 nq3 nj (cf. Location)
32  int numerator = (int) std::pow(10.0, (loc-1));
33  return (abs(pid)/numerator) % 10;
34  }
35 
37  inline int _extraBits(int pid) {
38  return abs(pid)/10000000;
39  }
40 
43  inline int _fundamentalID(int pid) {
44  if (_extraBits(pid) > 0) return 0;
45  if (_digit(nq2,pid) == 0 && _digit(nq1,pid) == 0) {
46  return abs(pid) % 10000;
47  } else if (abs(pid) <= 100) {
48  return abs(pid);
49  } else {
50  return 0;
51  }
52  }
53 
55 
56 
58 
59 
68  inline bool isNucleus(int pid) {
69  // a proton can also be a Hydrogen nucleus
70  if (abs(pid) == 2212) return true;
71  // new standard: +/- 10LZZZAAAI
72  if ((_digit(n10,pid) == 1) && (_digit(n9,pid) == 0)) {
73  // charge should always be less than or equal to baryon number
74  // the following line is A >= Z
75  if ((abs(pid)/10)%1000 >= (abs(pid)/10000)%1000) return true;
76  }
77  return false;
78  }
79 
82  inline int nuclZ(int pid) {
83  // A proton can also be a Hydrogen nucleus
84  if (abs(pid) == 2212) { return 1; }
85  if (isNucleus(pid)) return (abs(pid)/10000) % 1000;
86  return 0;
87  }
88 
91  inline int nuclA(int pid) {
92  // A proton can also be a Hydrogen nucleus, and we might as well also allow single neutrons
93  if (abs(pid) == 2212 || abs(pid) == 2112) { return 1; }
94  if (isNucleus(pid)) return (abs(pid)/10) % 1000;
95  return 0;
96  }
97 
100  inline int nuclNlambda(int pid) {
101  // a proton can also be a Hydrogen nucleus
102  if (abs(pid) == 2212) { return 0; }
103  if (isNucleus(pid)) return _digit(n8,pid);
104  return 0;
105  }
106 
108 
109 
111 
112 
114  inline bool isReggeon(int pid) {
115  return pid == 110 || pid == 990 || pid == 9990;
116  }
117 
119  inline bool isMeson(int pid) {
120  if (_extraBits(pid) > 0) return false;
121  // exotica
122  if (_digit(n,pid) > 0 && _digit(n,pid) < 9) return false;
123  const int aid = abs(pid);
124  if (aid == 130 || aid == 310 || aid == 210) return true; //< special cases for kaons
125  if (aid <= 100) return false;
126  if (_digit(nq1,pid) != 0) return false;
127  if (_digit(nq2,pid) == 0) return false;
128  if (_digit(nq3,pid) == 0) return false;
129  if (_digit(nq2,pid) < _digit(nq3,pid)) return false;
130  // EvtGen uses some odd numbers
132  if (aid == 150 || aid == 350 || aid == 510 || aid == 530) return true;
133  // Pomeron, Reggeon, etc.
134  if (isReggeon(pid)) return false; //true; //< WTF?
135  // Check for illegal antiparticles
136  if (_digit(nj,pid) > 0 && _digit(nq3,pid) > 0 && _digit(nq2,pid) > 0 && _digit(nq1,pid) == 0) {
137  return !(_digit(nq3,pid) == _digit(nq2,pid) && pid < 0);
138  }
139  return false;
140  }
141 
143  inline bool isBaryon(int pid) {
144  if (_extraBits(pid) > 0) return false;
145  // exotica
146  if (_digit(n,pid) > 0 && _digit(n,pid) < 9) return false;
147  if (abs(pid) <= 100) return false;
148  if (_fundamentalID(pid) <= 100 && _fundamentalID(pid) > 0) return false;
149  if (abs(pid) == 2110 || abs(pid) == 2210) return true;
150  if (_digit(nj,pid) == 0) return false;
151  if (_digit(nq1,pid) == 0 || _digit(nq2,pid) == 0 || _digit(nq3,pid) == 0) return false;
152  return true;
154  // if ((_digit(nq1,pid) >= _digit(nq2,pid) && _digit(nq2,pid) >= _digit(nq3,pid)) ||
155  // (_digit(nq1,pid) > _digit(nq3,pid) && _digit(nq3,pid) > _digit(nq2,pid)) || //< case 6b for lighter quarks in J=1
156  // (_digit(nq3,pid) > _digit(nq1,pid) && _digit(nq1,pid) > _digit(nq2,pid))) //< case 6e for extra states in excited multiplets
157  // return true;
158  // return false;
159  }
160 
161  // Check to see if this is a valid diquark
162  inline bool isDiquark(int pid) {
163  if (_extraBits(pid) > 0) return false;
164  if (abs(pid) <= 100) return false;
165  if (_fundamentalID(pid) <= 100 && _fundamentalID(pid) > 0) return false;
166  if (_digit(nq1,pid) == 0) return false;
167  if (_digit(nq2,pid) == 0) return false;
168  if (_digit(nq3,pid) != 0) return false;
169  if (_digit(nq1,pid) < _digit(nq2,pid)) return false;
170  if (_digit(nj,pid) > 0 && _digit(nq3,pid) == 0 && _digit(nq2,pid) > 0 && _digit(nq1,pid) > 0) return true; // diquark signature
171  // EvtGen uses the diquarks for quark pairs, so, for instance, 5501 is a valid "diquark" for EvtGen
172  // if (_digit(nj) == 1 && _digit(nq2) == _digit(nq1)) { // illegal
173  // return false;
174  // } else {
175  // return true;
176  // }
177  return false;
178  }
179 
181  inline bool isPentaquark(int pid) {
182  // a pentaquark is of the form 9abcdej,
183  // where j is the spin and a, b, c, d, and e are quarks
184  if (_extraBits(pid) > 0) return false;
185  if (_digit(n,pid) != 9) return false;
186  if (_digit(nr,pid) == 9 || _digit(nr,pid) == 0) return false;
187  if (_digit(nj,pid) == 9 || _digit(nl,pid) == 0) return false;
188  if (_digit(nq1,pid) == 0) return false;
189  if (_digit(nq2,pid) == 0) return false;
190  if (_digit(nq3,pid) == 0) return false;
191  if (_digit(nj,pid) == 0) return false;
192  // check ordering
193  if (_digit(nq2,pid) > _digit(nq1,pid)) return false;
194  if (_digit(nq1,pid) > _digit(nl,pid)) return false;
195  if (_digit(nl,pid) > _digit(nr,pid)) return false;
196  return true;
197  }
198 
200  inline bool isHadron(int pid) {
201  if (_extraBits(pid) > 0) return false;
202  if (isMeson(pid)) return true;
203  if (isBaryon(pid)) return true;
204  if (isPentaquark(pid)) return true;
205  return false;
206  }
207 
209 
210 
212 
213 
215  inline bool isLepton(int pid) {
216  if (_extraBits(pid) > 0) return false;
217  if (_fundamentalID(pid) >= 11 && _fundamentalID(pid) <= 18) return true;
218  return false;
219  }
220 
222  inline bool isSUSY(int pid) {
223  // Fundamental SUSY particles have n = 1 or 2
224  if (_extraBits(pid) > 0) return false;
225  if (_digit(n,pid) != 1 && _digit(n,pid) != 2) return false;
226  if (_digit(nr,pid) != 0) return false;
227  // Check fundamental part for SM PID on which it is based
228  if (_fundamentalID(pid) == 0) return false;
229  return true;
230  }
231 
233  inline bool isRhadron(int pid) {
234  // An R-hadron is of the form 10abcdj,
235  // where j is the spin and a, b, c, and d are quarks or gluons
236  if (_extraBits(pid) > 0) return false;
237  if (_digit(n,pid) != 1) return false;
238  if (_digit(nr,pid) != 0) return false;
239  // Make sure this isn't a SUSY particle
240  if (isSUSY(pid)) return false;
241  // All R-hadrons have at least 3 core digits
242  if (_digit(nq2,pid) == 0) return false;
243  if (_digit(nq3,pid) == 0) return false;
244  if (_digit(nj,pid) == 0) return false;
245  return true;
246  }
247  inline bool isRHadron(int pid) { return isRhadron(pid); }
248 
250  inline bool isTechnicolor(int pid) {
251  if (_extraBits(pid) > 0) return false;
252  return _digit(n,pid) == 3;
253  }
254 
256  inline bool isExcited(int pid) {
257  if (_extraBits(pid) > 0) return false;
258  return _digit(n,pid) == 4;
259  }
260 
262  inline bool isKK(int pid) {
263  if (_extraBits(pid) > 0) return false;
264  const int ndigit = _digit(n,pid);
265  return ndigit == 5 || ndigit == 6;
266  }
267 
269  inline bool isGraviton(int pid) {
270  return pid == 39;
271  }
272 
274  inline bool isBSM(int pid) {
275  return isSUSY(pid) || isRhadron(pid) || isTechnicolor(pid) ||
276  isExcited(pid) || isKK(pid) || isGraviton(pid);
277  }
278 
280  inline bool _isValid(int pid) {
281  // Starting with 99 means anything goes (but nothing is known)
282  if (_digit(n,pid) == 9 && _digit(nr,pid) == 9) return true;
283  // Check that extra bits are only used for nuclei
284  if (_extraBits(pid) > 0) return isNucleus(pid);
285  // Check that it fits into a standard non-nucleus convention
286  if (isBSM(pid)) return true;
287  if (isHadron(pid)) return true;
288  if (_digit(n,pid) == 9 && _digit(nr,pid) == 0) return false; // could only have been a tentative hadron, but !isHadron
289  if (isDiquark(pid)) return true;
290  if (isReggeon(pid)) return true;
291  // // Quark digit orderings required by the standard
292  // if (_digit(nq1,pid) != 0 && _digit(nq1,pid) < _digit(nq2,pid)) return false;
293  // if (_digit(nq2,pid) != 0 && _digit(nq2,pid) < _digit(nq3,pid)) return false;
294  // Final check on fundamental ID
295  return (_fundamentalID(pid) > 0);
296  }
297  inline bool isValid(int pid) { return _isValid(pid); }
298 
300 
301 
303 
304 
305  inline bool _hasQ(int pid, int q) {
306  if (abs(pid) == q) return true; //< trivial case!
307  if (!_isValid(pid)) return false;
308  if (_extraBits(pid) > 0) return false;
309  if (_fundamentalID(pid) > 0) return false;
310  return _digit(nq3,pid) == q || _digit(nq2,pid) == q || _digit(nq1,pid) == q;
311  }
312 
314  inline bool hasDown(int pid) { return _hasQ(pid, 1); }
316  inline bool hasUp(int pid) { return _hasQ(pid, 2); }
318  inline bool hasStrange(int pid) { return _hasQ(pid, 3); }
320  inline bool hasCharm(int pid) { return _hasQ(pid, 4); }
322  inline bool hasBottom(int pid) { return _hasQ(pid, 5); }
324  inline bool hasTop(int pid) { return _hasQ(pid, 6); }
325 
327 
328 
330 
331 
333  inline int jSpin(int pid) {
334  const int fund = _fundamentalID(pid);
335  if (fund > 0) {
336  // some of these are known
337  if (fund > 0 && fund < 7) return 2;
338  if (fund == 9) return 3;
339  if (fund > 10 && fund < 17) return 2;
340  if (fund > 20 && fund < 25) return 3;
341  return 0;
342  } else if (_extraBits(pid) > 0) {
343  return 0;
344  }
345  return abs(pid) % 10;
346  }
347 
349  inline int sSpin(int pid) {
350  // Handle invalid cases first
351  if (!isMeson(pid)) return 0;
352  if (_digit(n,pid) == 9 && _digit(nr,pid) == 0) return 0; // tentative ID
353  // Special generic DM particles with defined spins
354  const int fund = _fundamentalID(pid);
355  if (fund == 51 || fund == 54) return 1;
356  if (fund == 52) return 2;
357  if (fund == 53 || fund == 55) return 3;
358  // Calculate from nl and nj digits
359  const int inl = _digit(nl,pid);
360  const int js = _digit(nj,pid);
361  if (inl == 0 && js >= 3) return 1;
362  else if (inl == 0 && js == 1) return 0;
363  else if (inl == 1 && js >= 3) return 0;
364  else if (inl == 2 && js >= 3) return 1;
365  else if (inl == 1 && js == 1) return 1;
366  else if (inl == 3 && js >= 3) return 1;
367  // Default to zero
368  return 0;
369  }
370 
372  inline int lSpin(int pid) {
373  // Handle invalid cases first
374  if (!isMeson(pid)) return 0;
375  if (_digit(n,pid) == 9 && _digit(nr,pid) == 0) return 0; // tentative ID
376  // Calculate from nl and nj digits
377  const int inl = _digit(nl,pid);
378  const int js = _digit(nj,pid);
379  if (inl == 0 && js == 3) return 0;
380  else if (inl == 0 && js == 5) return 1;
381  else if (inl == 0 && js == 7) return 2;
382  else if (inl == 0 && js == 9) return 3;
383  else if (inl == 0 && js == 1) return 0;
384  else if (inl == 1 && js == 3) return 1;
385  else if (inl == 1 && js == 5) return 2;
386  else if (inl == 1 && js == 7) return 3;
387  else if (inl == 1 && js == 9) return 4;
388  else if (inl == 2 && js == 3) return 1;
389  else if (inl == 2 && js == 5) return 2;
390  else if (inl == 2 && js == 7) return 3;
391  else if (inl == 2 && js == 9) return 4;
392  else if (inl == 1 && js == 1) return 1;
393  else if (inl == 3 && js == 3) return 2;
394  else if (inl == 3 && js == 5) return 3;
395  else if (inl == 3 && js == 7) return 4;
396  else if (inl == 3 && js == 9) return 5;
397  // Default to zero
398  return 0;
399  }
400 
402 
403 
405 
406 
408  inline int charge3(int pid) {
409  static int ch100[100] = { -1, 2,-1, 2,-1, 2,-1, 2, 0, 0,
410  -3, 0,-3, 0,-3, 0,-3, 0, 0, 0,
411  0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
412  0, 0, 0, 3, 0, 0, 3, 0, 0, 0,
413  0, -1, 0, 0, 0, 0, 0, 0, 0, 0,
414  0, 6, 3, 6, 0, 0, 0, 0, 0, 0,
415  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
416  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
417  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
418  0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
419  const unsigned short q1 = _digit(nq1,pid);
420  const unsigned short q2 = _digit(nq2,pid);
421  const unsigned short q3 = _digit(nq3,pid);
422  const int ida = abs(pid);
423  const int sid = _fundamentalID(pid);
424  int charge = 0;
425  if (ida == 0 || _extraBits(pid) > 0) {// ion or illegal
426  return 0;
427  } else if (sid > 0 && sid <= 100) {// use table
428  if (ida == 1000017 || ida == 1000018 || ida == 1000034) charge = 0;
429  else if (ida > 1000050 && ida <= 1000060) charge = 0; // ?
430  else if (ida > 50 && ida <= 60) charge = 0; // Generic DM
431  else if (ida == 5100061 || ida == 5100062) charge = 6;
432  else charge = ch100[sid-1];
433  } else if (_digit(nj,pid) == 0) {// KL, Ks, or undefined
434  return 0;
435  } else if (isMeson(pid)) {// mesons
436  if (q2 == 3 || q2 == 5) {
437  charge = ch100[q3-1] - ch100[q2-1];
438  } else {
439  charge = ch100[q2-1] - ch100[q3-1];
440  }
441  } else if (isDiquark(pid)) {// diquarks
442  charge = ch100[q2-1] + ch100[q1-1];
443  } else if (isBaryon(pid)) {// baryons
444  charge = ch100[q3-1] + ch100[q2-1] + ch100[q1-1];
445  } else {// unknown
446  return 0;
447  }
448  if (pid < 0) charge *= -1;
449  return charge;
450  }
451 
453  inline int abscharge3(int pid) { return std::abs(charge3(pid)); }
454 
456  inline double charge(int pid) { return charge3(pid)/3.0; }
457 
459  inline double abscharge(int pid) { return abscharge3(pid)/3.0; }
460 
462 
463 
465 
466 
468  inline bool isCharged(int pid) {
469  return charge3(pid) != 0;
470  }
471 
473  inline bool isNeutral(int pid) {
474  return charge3(pid) == 0;
475  }
476 
478 
479 
481 
482 
484  inline bool isQuark(int pid) {
485  return in_closed_range(abs(pid), 1, 6);
486  }
487 
489  inline bool isGluon(int pid) {
490  return pid == GLUON;
491  }
492 
494  inline bool isParton(int pid) {
495  return isGluon(pid) || isQuark(pid);
496  }
497 
499  inline bool isPhoton(int pid) {
500  return pid == PHOTON;
501  }
502 
504  inline bool isElectron(int pid) {
505  return abs(pid) == ELECTRON;
506  }
507 
509  inline bool isMuon(int pid) {
510  return abs(pid) == MUON;
511  }
512 
514  inline bool isTau(int pid) {
515  return abs(pid) == TAU;
516  }
517 
519  inline bool isChargedLepton(int pid) {
520  const long apid = abs(pid);
521  return apid == 11 || apid == 13 || apid == 15;
522  }
523  // Alias
524  inline bool isChLepton(int pid) { return isChargedLepton(pid); }
525 
527  inline bool isNeutrino(int pid) {
528  const long apid = abs(pid);
529  return apid == 12 || apid == 14 || apid == 16;
530  }
531 
532 
534  inline bool isWplus(int pid) {
535  return pid == WPLUSBOSON;
536  }
537 
539  inline bool isWminus(int pid) {
540  return pid == WMINUSBOSON;
541  }
542 
544  inline bool isW(int pid) {
545  return abs(pid) == WPLUSBOSON;
546  }
547 
549  inline bool isZ(int pid) {
550  return pid == Z0BOSON;
551  }
552 
554  inline bool isHiggs(int pid) {
555  return pid == HIGGSBOSON || pid == 26; //< @todo Check on 26 still needed? (used in HERWIG SUSY, for example)
556  }
557 
559 
560 
561  // /// Determine if the PID is that of a d/dbar
562  // inline bool isDown(int pid) { return abs(pid) == DQUARK; }
563 
564  // /// Determine if the PID is that of a u/ubar
565  // inline bool isUp(int pid) { return abs(pid) == UQUARK; }
566 
568  inline bool isStrange(int pid) { return abs(pid) == SQUARK; }
569 
571  inline bool isCharm(int pid) { return abs(pid) == CQUARK; }
572 
574  inline bool isBottom(int pid) { return abs(pid) == BQUARK; }
575 
577  inline bool isTop(int pid) { return abs(pid) == TQUARK; }
578 
580 
581 
583 
584 
586  inline bool isHeavyFlavour(int pid) {
587  return hasCharm(pid) || hasBottom(pid) || hasTop(pid);
588  }
589 
590  // /// Determine if the particle is a light-flavour flavour hadron or parton
591  // inline bool isLightFlavour(int pid) {
592  // return !isHeavyFlavour();
593  // }
594 
596  inline bool isHeavyParton(int pid) {
597  return isParton(pid) && isHeavyFlavour(pid);
598  }
599 
601  inline bool isLightParton(int pid) {
602  return isParton(pid) && !isHeavyFlavour(pid);
603  }
604 
605 
607  inline bool isHeavyMeson(int pid) {
608  return isMeson(pid) && isHeavyFlavour(pid);
609  }
610 
612  inline bool isHeavyBaryon(int pid) {
613  return isBaryon(pid) && isHeavyFlavour(pid);
614  }
615 
617  inline bool isHeavyHadron(int pid) {
618  return isHadron(pid) && isHeavyFlavour(pid);
619  }
620 
622  inline bool isLightMeson(int pid) {
623  return isMeson(pid) && !isHeavyFlavour(pid);
624  }
625 
627  inline bool isLightBaryon(int pid) {
628  return isBaryon(pid) && !isHeavyFlavour(pid);
629  }
630 
632  inline bool isLightHadron(int pid) {
633  return isHadron(pid) && !isHeavyFlavour(pid);
634  }
635 
636 
638  inline bool isBottomMeson(int pid) {
639  return hasBottom(pid) && isMeson(pid);
640  }
641 
643  inline bool isBottomBaryon(int pid) {
644  return hasBottom(pid) && isBaryon(pid);
645  }
646 
648  inline bool isBottomHadron(int pid) {
649  return hasBottom(pid) && isHadron(pid);
650  }
651 
652 
657  inline bool isCharmMeson(int pid) {
658  return isMeson(pid) && hasCharm(pid) &&
659  !hasBottom(pid);
660  }
661 
667  inline bool isCharmBaryon(int pid) {
668  return isBaryon(pid) && hasCharm(pid) &&
669  !hasBottom(pid);
670  }
671 
677  inline bool isCharmHadron(int pid) {
678  return isHadron(pid) && hasCharm(pid) &&
679  !hasBottom(pid);
680  }
681 
682 
687  inline bool isStrangeMeson(int pid) {
688  return isMeson(pid) && hasStrange(pid) &&
689  !(hasBottom(pid) || hasCharm(pid));
690  }
691 
696  inline bool isStrangeBaryon(int pid) {
697  return isBaryon(pid) && hasStrange(pid) &&
698  !(hasBottom(pid) || hasCharm(pid));
699  }
700 
705  inline bool isStrangeHadron(int pid) {
706  return isHadron(pid) && hasStrange(pid) &&
707  !(hasBottom(pid) || hasCharm(pid));
708  }
709 
711 
712 
714 
715 
717  inline bool isStrongInteracting(int pid) {
718  return isParton(pid) || isHadron(pid);
719  }
720 
722  inline bool isEMInteracting(int pid) {
723  return isCharged(pid) || isPhoton(pid);
724  }
725 
730  inline bool isWeakInteracting(int pid) {
731  return !isGluon(pid) && !isGraviton(pid);
732  }
733 
735 
736 
738 
739 
741  inline bool isGenSpecific(int pid) {
742  return in_range(pid, 80, 101);
743  }
744 
748  inline bool isResonance(int pid) {
749  return isW(pid) || isZ(pid) || isHiggs(pid) || isTop(pid);
750  }
751 
755  inline bool isTransportable(int pid) {
756  // return !isResonance(pid) && !isParton(pid) && !isGenSpecific(pid);
757  return isPhoton(pid) || isHadron(pid) || isLepton(pid);
758  }
759 
761 
762 
765 
766 
767  inline bool isSameSign(PdgId a, PdgId b) { return a*b >= 0; }
768  inline bool isOppSign(PdgId a, PdgId b) { return !isSameSign(a, b); }
769  inline bool isSameFlav(PdgId a, PdgId b) { return abs(a) == abs(b); }
770  inline bool isOppFlav(PdgId a, PdgId b) { return !isSameFlav(a, b); }
771 
772  inline bool isOSSF(PdgId a, PdgId b) { return isOppSign(a, b) && isSameFlav(a, b); }
773  inline bool isSSSF(PdgId a, PdgId b) { return isSameSign(a, b) && isSameFlav(a, b); }
774  inline bool isOSOF(PdgId a, PdgId b) { return isOppSign(a, b) && isOppFlav(a, b); }
775  inline bool isSSOF(PdgId a, PdgId b) { return isSameSign(a, b) && isOppFlav(a, b); }
776 
778 
779  }
780 }
781 
782 #endif
Definition: MC_Cent_pPb.hh:10
std::enable_if< std::is_arithmetic< N1 >::value &&std::is_arithmetic< N2 >::value &&std::is_arithmetic< N3 >::value, bool >::type in_range(N1 val, N2 low, N3 high)
Boolean function to determine if value is within the given range.
Definition: MathUtils.hh:163
int pid(const Particle &p)
Unbound function access to PID code.
Definition: ParticleUtils.hh:23
std::enable_if< std::is_arithmetic< N1 >::value &&std::is_arithmetic< N2 >::value &&std::is_arithmetic< N3 >::value, bool >::type in_closed_range(N1 val, N2 low, N3 high)
Boolean function to determine if value is within the given range.
Definition: MathUtils.hh:173