rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.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  inline int abspid(int pid) { return abs(pid); }
28 
31  enum Location { nj=1, nq3, nq2, nq1, nl, nr, n, n8, n9, n10 };
32 
34  inline unsigned short _digit(Location loc, int pid) {
35  // PID digits (base 10) are: n nr nl nq1 nq2 nq3 nj (cf. Location)
36  int numerator = (int) std::pow(10.0, (loc-1));
37  return (abs(pid)/numerator) % 10;
38  }
39 
41  inline int _extraBits(int pid) {
42  return abs(pid)/10000000;
43  }
44 
47  inline int _fundamentalID(int pid) {
48  if (_extraBits(pid) > 0) return 0;
49  if (_digit(nq2,pid) == 0 && _digit(nq1,pid) == 0) {
50  return abs(pid) % 10000;
51  } else if (abs(pid) <= 100) {
52  return abs(pid);
53  } else {
54  return 0;
55  }
56  }
57 
59 
60 
62 
63 
72  inline bool isNucleus(int pid) {
73  // a proton can also be a Hydrogen nucleus
74  if (abs(pid) == 2212) return true;
75  // new standard: +/- 10LZZZAAAI
76  if ((_digit(n10,pid) == 1) && (_digit(n9,pid) == 0)) {
77  // charge should always be less than or equal to baryon number
78  // the following line is A >= Z
79  if ((abs(pid)/10)%1000 >= (abs(pid)/10000)%1000) return true;
80  }
81  return false;
82  }
83 
86  inline int nuclZ(int pid) {
87  // A proton can also be a Hydrogen nucleus
88  if (abs(pid) == 2212) { return 1; }
89  if (isNucleus(pid)) return (abs(pid)/10000) % 1000;
90  return 0;
91  }
94  inline int Z(int pid) { return nuclZ(pid); }
95 
98  inline int nuclA(int pid) {
99  // A proton can also be a Hydrogen nucleus, and we might as well also allow single neutrons
100  if (abs(pid) == 2212 || abs(pid) == 2112) { return 1; }
101  if (isNucleus(pid)) return (abs(pid)/10) % 1000;
102  return 0;
103  }
106  inline int A(int pid) { return nuclA(pid); }
107 
110  inline int nuclNlambda(int pid) {
111  // a proton can also be a Hydrogen nucleus
112  if (abs(pid) == 2212) { return 0; }
113  if (isNucleus(pid)) return _digit(n8,pid);
114  return 0;
115  }
118  inline int lambda(int pid) { return nuclNlambda(pid); }
119 
121 
122 
124 
125 
127  inline bool isReggeon(int pid) {
128  return pid == 110 || pid == 990 || pid == 9990;
129  }
130 
132  inline bool isMeson(int pid) {
133  if (_extraBits(pid) > 0) return false;
134  // exotica
135  if (_digit(n,pid) > 0 && _digit(n,pid) < 9) return false;
136  const int aid = abs(pid);
137  if (aid == 130 || aid == 310 || aid == 210) return true; //< special cases for kaons
138  if (aid <= 100) return false;
139  if (_digit(nq1,pid) != 0) return false;
140  if (_digit(nq2,pid) == 0) return false;
141  if (_digit(nq3,pid) == 0) return false;
142  if (_digit(nq2,pid) < _digit(nq3,pid)) return false;
143  // EvtGen uses some odd numbers
145  if (aid == 150 || aid == 350 || aid == 510 || aid == 530) return true;
146  // Pomeron, Reggeon, etc.
147  if (isReggeon(pid)) return false; //true; //< WTF?
148  // Check for illegal antiparticles
149  if (_digit(nj,pid) > 0 && _digit(nq3,pid) > 0 && _digit(nq2,pid) > 0 && _digit(nq1,pid) == 0) {
150  return !(_digit(nq3,pid) == _digit(nq2,pid) && pid < 0);
151  }
152  return false;
153  }
154 
156  inline bool isBaryon(int pid) {
157  if (_extraBits(pid) > 0) return false;
158  // exotica
159  if (_digit(n,pid) > 0 && _digit(n,pid) < 9) return false;
160  if (abs(pid) <= 100) return false;
161  if (_fundamentalID(pid) <= 100 && _fundamentalID(pid) > 0) return false;
162  if (abs(pid) == 2110 || abs(pid) == 2210) return true;
163  if (_digit(nj,pid) == 0) return false;
164  if (_digit(nq1,pid) == 0 || _digit(nq2,pid) == 0 || _digit(nq3,pid) == 0) return false;
165  return true;
167  // if ((_digit(nq1,pid) >= _digit(nq2,pid) && _digit(nq2,pid) >= _digit(nq3,pid)) ||
168  // (_digit(nq1,pid) > _digit(nq3,pid) && _digit(nq3,pid) > _digit(nq2,pid)) || //< case 6b for lighter quarks in J=1
169  // (_digit(nq3,pid) > _digit(nq1,pid) && _digit(nq1,pid) > _digit(nq2,pid))) //< case 6e for extra states in excited multiplets
170  // return true;
171  // return false;
172  }
173 
174  // Check to see if this is a valid diquark
175  inline bool isDiquark(int pid) {
176  if (_extraBits(pid) > 0) return false;
177  if (abs(pid) <= 100) return false;
178  if (_fundamentalID(pid) <= 100 && _fundamentalID(pid) > 0) return false;
179  if (_digit(nq1,pid) == 0) return false;
180  if (_digit(nq2,pid) == 0) return false;
181  if (_digit(nq3,pid) != 0) return false;
182  if (_digit(nq1,pid) < _digit(nq2,pid)) return false;
183  if (_digit(nj,pid) > 0 && _digit(nq3,pid) == 0 && _digit(nq2,pid) > 0 && _digit(nq1,pid) > 0) return true; // diquark signature
184  // EvtGen uses the diquarks for quark pairs, so, for instance, 5501 is a valid "diquark" for EvtGen
185  // if (_digit(nj) == 1 && _digit(nq2) == _digit(nq1)) { // illegal
186  // return false;
187  // } else {
188  // return true;
189  // }
190  return false;
191  }
193  inline bool isDiQuark(int pid) { return isDiquark(pid); }
194 
196  inline bool isPentaquark(int pid) {
197  // a pentaquark is of the form 9abcdej,
198  // where j is the spin and a, b, c, d, and e are quarks
199  if (_extraBits(pid) > 0) return false;
200  if (_digit(n,pid) != 9) return false;
201  if (_digit(nr,pid) == 9 || _digit(nr,pid) == 0) return false;
202  if (_digit(nj,pid) == 9 || _digit(nl,pid) == 0) return false;
203  if (_digit(nq1,pid) == 0) return false;
204  if (_digit(nq2,pid) == 0) return false;
205  if (_digit(nq3,pid) == 0) return false;
206  if (_digit(nj,pid) == 0) return false;
207  // check ordering
208  if (_digit(nq2,pid) > _digit(nq1,pid)) return false;
209  if (_digit(nq1,pid) > _digit(nl,pid)) return false;
210  if (_digit(nl,pid) > _digit(nr,pid)) return false;
211  return true;
212  }
213 
215  inline bool isHadron(int pid) {
216  if (_extraBits(pid) > 0) return false;
217  if (isMeson(pid)) return true;
218  if (isBaryon(pid)) return true;
219  if (isPentaquark(pid)) return true;
220  return false;
221  }
222 
224 
225 
227 
228 
230  inline bool isLepton(int pid) {
231  if (_extraBits(pid) > 0) return false;
232  if (_fundamentalID(pid) >= 11 && _fundamentalID(pid) <= 18) return true;
233  return false;
234  }
235 
237  inline bool isSUSY(int pid) {
238  // Fundamental SUSY particles have n = 1 or 2
239  if (_extraBits(pid) > 0) return false;
240  if (_digit(n,pid) != 1 && _digit(n,pid) != 2) return false;
241  if (_digit(nr,pid) != 0) return false;
242  // Check fundamental part for SM PID on which it is based
243  if (_fundamentalID(pid) == 0) return false;
244  return true;
245  }
246 
248  inline bool isRhadron(int pid) {
249  // An R-hadron is of the form 10abcdj,
250  // where j is the spin and a, b, c, and d are quarks or gluons
251  if (_extraBits(pid) > 0) return false;
252  if (_digit(n,pid) != 1) return false;
253  if (_digit(nr,pid) != 0) return false;
254  // Make sure this isn't a SUSY particle
255  if (isSUSY(pid)) return false;
256  // All R-hadrons have at least 3 core digits
257  if (_digit(nq2,pid) == 0) return false;
258  if (_digit(nq3,pid) == 0) return false;
259  if (_digit(nj,pid) == 0) return false;
260  return true;
261  }
262  inline bool isRHadron(int pid) { return isRhadron(pid); }
263 
265  inline bool isTechnicolor(int pid) {
266  if (_extraBits(pid) > 0) return false;
267  return _digit(n,pid) == 3;
268  }
269 
271  inline bool isExcited(int pid) {
272  if (_extraBits(pid) > 0) return false;
273  return _digit(n,pid) == 4;
274  }
275 
277  inline bool isKK(int pid) {
278  if (_extraBits(pid) > 0) return false;
279  const int ndigit = _digit(n,pid);
280  return ndigit == 5 || ndigit == 6;
281  }
282 
284  inline bool isGraviton(int pid) {
285  return pid == 39;
286  }
287 
289  inline bool isBSM(int pid) {
290  return isSUSY(pid) || isRhadron(pid) || isTechnicolor(pid) ||
291  isExcited(pid) || isKK(pid) || isGraviton(pid);
292  }
293 
295  inline bool _isValid(int pid) {
296  // Starting with 99 means anything goes (but nothing is known)
297  if (_digit(n,pid) == 9 && _digit(nr,pid) == 9) return true;
298  // Check that extra bits are only used for nuclei
299  if (_extraBits(pid) > 0) return isNucleus(pid);
300  // Check that it fits into a standard non-nucleus convention
301  if (isBSM(pid)) return true;
302  if (isHadron(pid)) return true;
303  if (_digit(n,pid) == 9 && _digit(nr,pid) == 0) return false; // could only have been a tentative hadron, but !isHadron
304  if (isDiquark(pid)) return true;
305  if (isReggeon(pid)) return true;
306  // // Quark digit orderings required by the standard
307  // if (_digit(nq1,pid) != 0 && _digit(nq1,pid) < _digit(nq2,pid)) return false;
308  // if (_digit(nq2,pid) != 0 && _digit(nq2,pid) < _digit(nq3,pid)) return false;
309  // Final check on fundamental ID
310  return (_fundamentalID(pid) > 0);
311  }
312  inline bool isValid(int pid) { return _isValid(pid); }
313 
315 
316 
318 
319 
320  inline bool _hasQ(int pid, int q) {
321  if (abs(pid) == q) return true; //< trivial case!
322  if (!_isValid(pid)) return false;
323  if (_extraBits(pid) > 0) return false;
324  if (_fundamentalID(pid) > 0) return false;
325  return _digit(nq3,pid) == q || _digit(nq2,pid) == q || _digit(nq1,pid) == q;
326  }
327 
329  inline bool hasDown(int pid) { return _hasQ(pid, 1); }
331  inline bool hasUp(int pid) { return _hasQ(pid, 2); }
333  inline bool hasStrange(int pid) { return _hasQ(pid, 3); }
335  inline bool hasCharm(int pid) { return _hasQ(pid, 4); }
337  inline bool hasBottom(int pid) { return _hasQ(pid, 5); }
339  inline bool hasTop(int pid) { return _hasQ(pid, 6); }
340 
342 
343 
345 
346 
348  inline int jSpin(int pid) {
349  const int fund = _fundamentalID(pid);
350  if (fund > 0) {
351  // some of these are known
352  if (fund > 0 && fund < 7) return 2;
353  if (fund == 9) return 3;
354  if (fund > 10 && fund < 17) return 2;
355  if (fund > 20 && fund < 25) return 3;
356  return 0;
357  } else if (_extraBits(pid) > 0) {
358  return 0;
359  }
360  return abs(pid) % 10;
361  }
362 
364  inline int sSpin(int pid) {
365  // Handle invalid cases first
366  if (!isMeson(pid)) return 0;
367  if (_digit(n,pid) == 9 && _digit(nr,pid) == 0) return 0; // tentative ID
368  // Special generic DM particles with defined spins
369  const int fund = _fundamentalID(pid);
370  if (fund == 51 || fund == 54) return 1;
371  if (fund == 52) return 2;
372  if (fund == 53 || fund == 55) return 3;
373  // Calculate from nl and nj digits
374  const int inl = _digit(nl,pid);
375  const int js = _digit(nj,pid);
376  if (inl == 0 && js >= 3) return 1;
377  else if (inl == 0 && js == 1) return 0;
378  else if (inl == 1 && js >= 3) return 0;
379  else if (inl == 2 && js >= 3) return 1;
380  else if (inl == 1 && js == 1) return 1;
381  else if (inl == 3 && js >= 3) return 1;
382  // Default to zero
383  return 0;
384  }
385 
387  inline int lSpin(int pid) {
388  // Handle invalid cases first
389  if (!isMeson(pid)) return 0;
390  if (_digit(n,pid) == 9 && _digit(nr,pid) == 0) return 0; // tentative ID
391  // Calculate from nl and nj digits
392  const int inl = _digit(nl,pid);
393  const int js = _digit(nj,pid);
394  if (inl == 0 && js == 3) return 0;
395  else if (inl == 0 && js == 5) return 1;
396  else if (inl == 0 && js == 7) return 2;
397  else if (inl == 0 && js == 9) return 3;
398  else if (inl == 0 && js == 1) return 0;
399  else if (inl == 1 && js == 3) return 1;
400  else if (inl == 1 && js == 5) return 2;
401  else if (inl == 1 && js == 7) return 3;
402  else if (inl == 1 && js == 9) return 4;
403  else if (inl == 2 && js == 3) return 1;
404  else if (inl == 2 && js == 5) return 2;
405  else if (inl == 2 && js == 7) return 3;
406  else if (inl == 2 && js == 9) return 4;
407  else if (inl == 1 && js == 1) return 1;
408  else if (inl == 3 && js == 3) return 2;
409  else if (inl == 3 && js == 5) return 3;
410  else if (inl == 3 && js == 7) return 4;
411  else if (inl == 3 && js == 9) return 5;
412  // Default to zero
413  return 0;
414  }
415 
417 
418 
420 
421 
423  inline int charge3(int pid) {
424  static int ch100[100] = { -1, 2,-1, 2,-1, 2,-1, 2, 0, 0,
425  -3, 0,-3, 0,-3, 0,-3, 0, 0, 0,
426  0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
427  0, 0, 0, 3, 0, 0, 3, 0, 0, 0,
428  0, -1, 0, 0, 0, 0, 0, 0, 0, 0,
429  0, 6, 3, 6, 0, 0, 0, 0, 0, 0,
430  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
432  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
433  0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
434  const unsigned short q1 = _digit(nq1,pid);
435  const unsigned short q2 = _digit(nq2,pid);
436  const unsigned short q3 = _digit(nq3,pid);
437  const int ida = abs(pid);
438  const int sid = _fundamentalID(pid);
439  int charge = 0;
440  if (ida == 0 || _extraBits(pid) > 0) {// ion or illegal
441  return 0;
442  } else if (sid > 0 && sid <= 100) {// use table
443  if (ida == 1000017 || ida == 1000018 || ida == 1000034) charge = 0;
444  else if (ida > 1000050 && ida <= 1000060) charge = 0; // ?
445  else if (ida > 50 && ida <= 60) charge = 0; // Generic DM
446  else if (ida == 5100061 || ida == 5100062) charge = 6;
447  else charge = ch100[sid-1];
448  } else if (_digit(nj,pid) == 0) {// KL, Ks, or undefined
449  return 0;
450  } else if (isMeson(pid)) {// mesons
451  if (q2 == 3 || q2 == 5) {
452  charge = ch100[q3-1] - ch100[q2-1];
453  } else {
454  charge = ch100[q2-1] - ch100[q3-1];
455  }
456  } else if (isDiQuark(pid)) {// diquarks
457  charge = ch100[q2-1] + ch100[q1-1];
458  } else if (isBaryon(pid)) {// baryons
459  charge = ch100[q3-1] + ch100[q2-1] + ch100[q1-1];
460  } else {// unknown
461  return 0;
462  }
463  if (pid < 0) charge *= -1;
464  return charge;
465  }
466 
469  inline int threeCharge(int pid) { return charge3(pid); }
470 
472  inline int abscharge3(int pid) { return std::abs(charge3(pid)); }
473 
475  inline double charge(int pid) { return charge3(pid)/3.0; }
476 
478  inline double abscharge(int pid) { return abscharge3(pid)/3.0; }
479 
481 
482 
484 
485 
487  inline bool isCharged(int pid) {
488  return charge3(pid) != 0;
489  }
490 
492  inline bool isNeutral(int pid) {
493  return charge3(pid) == 0;
494  }
495 
497 
498 
500 
501 
503  inline bool isQuark(int pid) {
504  return in_closed_range(abs(pid), 1, 6);
505  }
506 
508  inline bool isGluon(int pid) {
509  return pid == GLUON;
510  }
511 
513  inline bool isParton(int pid) {
514  return isGluon(pid) || isQuark(pid);
515  }
516 
518  inline bool isPhoton(int pid) {
519  return pid == PHOTON;
520  }
521 
523  inline bool isElectron(int pid) {
524  return abs(pid) == ELECTRON;
525  }
526 
528  inline bool isMuon(int pid) {
529  return abs(pid) == MUON;
530  }
531 
533  inline bool isTau(int pid) {
534  return abs(pid) == TAU;
535  }
536 
538  inline bool isChargedLepton(int pid) {
539  const long apid = abs(pid);
540  return apid == 11 || apid == 13 || apid == 15;
541  }
542  // Alias
543  inline bool isChLepton(int pid) { return isChargedLepton(pid); }
544 
546  inline bool isNeutrino(int pid) {
547  const long apid = abs(pid);
548  return apid == 12 || apid == 14 || apid == 16;
549  }
550 
551 
553  inline bool isWplus(int pid) {
554  return pid == WPLUSBOSON;
555  }
556 
558  inline bool isWminus(int pid) {
559  return pid == WMINUSBOSON;
560  }
561 
563  inline bool isW(int pid) {
564  return abs(pid) == WPLUSBOSON;
565  }
566 
568  inline bool isZ(int pid) {
569  return pid == Z0BOSON;
570  }
571 
573  inline bool isHiggs(int pid) {
574  return pid == HIGGSBOSON || pid == 26; //< @todo Check on 26 still needed? (used in HERWIG SUSY, for example)
575  }
576 
578 
579 
580  // /// Determine if the PID is that of a d/dbar
581  // inline bool isDown(int pid) { return abs(pid) == DQUARK; }
582 
583  // /// Determine if the PID is that of a u/ubar
584  // inline bool isUp(int pid) { return abs(pid) == UQUARK; }
585 
587  inline bool isStrange(int pid) { return abs(pid) == SQUARK; }
588 
590  inline bool isCharm(int pid) { return abs(pid) == CQUARK; }
591 
593  inline bool isBottom(int pid) { return abs(pid) == BQUARK; }
594 
596  inline bool isTop(int pid) { return abs(pid) == TQUARK; }
597 
599 
600 
602 
603 
605  inline bool isHeavyFlavour(int pid) {
606  return hasCharm(pid) || hasBottom(pid) || hasTop(pid);
607  }
608 
609  // /// Determine if the particle is a light-flavour flavour hadron or parton
610  // inline bool isLightFlavour(int pid) {
611  // return !isHeavyFlavour();
612  // }
613 
615  inline bool isHeavyParton(int pid) {
616  return isParton(pid) && isHeavyFlavour(pid);
617  }
618 
620  inline bool isLightParton(int pid) {
621  return isParton(pid) && !isHeavyFlavour(pid);
622  }
623 
624 
626  inline bool isHeavyMeson(int pid) {
627  return isMeson(pid) && isHeavyFlavour(pid);
628  }
629 
631  inline bool isHeavyBaryon(int pid) {
632  return isBaryon(pid) && isHeavyFlavour(pid);
633  }
634 
636  inline bool isHeavyHadron(int pid) {
637  return isHadron(pid) && isHeavyFlavour(pid);
638  }
639 
641  inline bool isLightMeson(int pid) {
642  return isMeson(pid) && !isHeavyFlavour(pid);
643  }
644 
646  inline bool isLightBaryon(int pid) {
647  return isBaryon(pid) && !isHeavyFlavour(pid);
648  }
649 
651  inline bool isLightHadron(int pid) {
652  return isHadron(pid) && !isHeavyFlavour(pid);
653  }
654 
655 
657  inline bool isBottomMeson(int pid) {
658  return hasBottom(pid) && isMeson(pid);
659  }
660 
662  inline bool isBottomBaryon(int pid) {
663  return hasBottom(pid) && isBaryon(pid);
664  }
665 
667  inline bool isBottomHadron(int pid) {
668  return hasBottom(pid) && isHadron(pid);
669  }
670 
671 
676  inline bool isCharmMeson(int pid) {
677  return isMeson(pid) && hasCharm(pid) &&
678  !hasBottom(pid);
679  }
680 
686  inline bool isCharmBaryon(int pid) {
687  return isBaryon(pid) && hasCharm(pid) &&
688  !hasBottom(pid);
689  }
690 
696  inline bool isCharmHadron(int pid) {
697  return isHadron(pid) && hasCharm(pid) &&
698  !hasBottom(pid);
699  }
700 
701 
706  inline bool isStrangeMeson(int pid) {
707  return isMeson(pid) && hasStrange(pid) &&
708  !(hasBottom(pid) || hasCharm(pid));
709  }
710 
715  inline bool isStrangeBaryon(int pid) {
716  return isBaryon(pid) && hasStrange(pid) &&
717  !(hasBottom(pid) || hasCharm(pid));
718  }
719 
724  inline bool isStrangeHadron(int pid) {
725  return isHadron(pid) && hasStrange(pid) &&
726  !(hasBottom(pid) || hasCharm(pid));
727  }
728 
730 
731 
733 
734 
736  inline bool isStrongInteracting(int pid) {
737  return isParton(pid) || isHadron(pid);
738  }
739 
741  inline bool isEMInteracting(int pid) {
742  return isCharged(pid) || isPhoton(pid);
743  }
744 
749  inline bool isWeakInteracting(int pid) {
750  return !isGluon(pid) && !isGraviton(pid);
751  }
752 
754 
755 
757 
758 
760  inline bool isGenSpecific(int pid) {
761  return in_range(pid, 80, 101);
762  }
763 
767  inline bool isResonance(int pid) {
768  return isW(pid) || isZ(pid) || isHiggs(pid) || isTop(pid);
769  }
770 
774  inline bool isTransportable(int pid) {
775  // return !isResonance(pid) && !isParton(pid) && !isGenSpecific(pid);
776  return isPhoton(pid) || isHadron(pid) || isLepton(pid);
777  }
778 
780 
781 
784 
785 
786  inline bool isSameSign(PdgId a, PdgId b) { return a*b >= 0; }
787  inline bool isOppSign(PdgId a, PdgId b) { return !isSameSign(a, b); }
788  inline bool isSameFlav(PdgId a, PdgId b) { return abs(a) == abs(b); }
789  inline bool isOppFlav(PdgId a, PdgId b) { return !isSameFlav(a, b); }
790 
791  inline bool isOSSF(PdgId a, PdgId b) { return isOppSign(a, b) && isSameFlav(a, b); }
792  inline bool isSSSF(PdgId a, PdgId b) { return isSameSign(a, b) && isSameFlav(a, b); }
793  inline bool isOSOF(PdgId a, PdgId b) { return isOppSign(a, b) && isOppFlav(a, b); }
794  inline bool isSSOF(PdgId a, PdgId b) { return isSameSign(a, b) && isOppFlav(a, b); }
795 
797 
798  }
799 }
800 
801 #endif
Definition: ALICE_2010_I880049.cc:13
int abspid(const Particle &p)
Unbound function access to abs 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_range(N1 val, N2 low, N3 high)
Boolean function to determine if value is within the given range.
Definition: MathUtils.hh:154
int pid(const Particle &p)
Unbound function access to PID code.
Definition: ParticleUtils.hh:20
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:164