hej is hosted by Hepforge, IPPP Durham
HEJ  2.3.0
High energy resummation for hadron colliders
PDG_codes.hh
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include <cstdlib>
16 #include <string>
17 
18 #include "boost/rational.hpp"
19 
20 namespace HEJ {
21 
23  namespace pid {
25  enum ParticleID: int{
28  d = 1,
29  down = d,
30  u = 2,
31  up = u,
32  s = 3,
33  strange = s,
34  c = 4,
35  charm = c,
36  b = 5,
37  bottom = b,
38  t = 6,
39  top = t,
40  e = 11,
41  electron = e,
42  nu_e = 12,
44  mu = 13,
45  muon = mu,
46  nu_mu = 14,
48  tau = 15,
49  nu_tau = 16,
51  d_bar = -d,
53  u_bar = -u,
54  antiup = -u,
55  s_bar = -s,
57  c_bar = -c,
58  anticharm = -c,
59  b_bar = -b,
61  t_bar = -t,
62  antitop = -t,
63  e_bar = -e,
68  mu_bar = -mu,
69  antimuon = -mu,
72  tau_bar = -tau,
76  gluon = 21,
77  g = gluon,
78  photon = 22,
80  Z = 23,
81  Z_photon_mix = 81,
83  Wp = 24,
84  Wm = -Wp,
85  h = 25,
86  Higgs = h,
87  higgs = h,
88  p = 2212,
89  proton = p,
90  p_bar = -p,
92  };
93 
95  std::string name(ParticleID id);
96 
99 
100  } // namespace pid
101 
103 
105  ParticleID to_ParticleID(std::string const & name);
106 
108  ParticleID to_ParticleID(std::string_view name);
109 
112 
118  inline
119  constexpr bool is_antiparticle(ParticleID id) {
120  return id < 0;
121  }
122 
128  inline
129  constexpr bool is_quark(ParticleID id){
130  return (id >= pid::down && id <= pid::top);
131  }
132 
138  inline
139  constexpr bool is_antiquark(ParticleID id){
140  return (id <= pid::d_bar && id >= pid::t_bar);
141  }
142 
148  inline
149  constexpr bool is_anyquark(ParticleID id){
150  return is_quark(id) || is_antiquark(id);
151  }
152 
158  inline
159  constexpr bool is_gluon(ParticleID id){
160  return id == pid::gluon;
161  }
167  inline
168  constexpr bool is_parton(ParticleID id){
169  return is_gluon(id)
170  || (is_anyquark(id) && std::abs(id) != pid::top);
171  }
172 
178  inline
179  constexpr bool is_AWZ_boson(ParticleID id){
180  return id == pid::Wm || (id >= pid::photon && id <= pid::Wp)
181  || id == pid::Z_photon_mix;
182  }
183 
190  inline
191  constexpr bool is_AWZH_boson(ParticleID id){
192  return is_AWZ_boson(id) || (id == pid::Higgs);
193  }
194 
200  inline
201  constexpr bool is_lepton(ParticleID id){
202  return (id >= pid::electron && id <= pid::tau_neutrino);
203  }
204 
210  inline
211  constexpr bool is_antilepton(ParticleID id){
212  return (id <= pid::positron && id >= pid::nu_tau_bar);
213  }
214 
221  inline
222  constexpr bool is_anylepton(ParticleID id){
223  return ( is_lepton(id) || is_antilepton(id));
224  }
225 
231  inline
232  constexpr bool is_neutrino(ParticleID id){
233  return (id == pid::nu_e || id == pid::tau_neutrino
234  || id == pid::muon_neutrino);
235  }
236 
242  inline
243  constexpr bool is_antineutrino(ParticleID id){
244  return (id == pid::nu_e_bar || id == pid::nu_tau_bar
245  || id == pid::nu_mu_bar);
246  }
247 
254  inline
255  constexpr bool is_anyneutrino(ParticleID id){
256  return ( is_neutrino(id) || is_antineutrino(id));
257  }
258 
260  inline
261  constexpr bool is_massless(ParticleID id){
262  // cannot use `std::abs` because it's not `constexpr`
263  const int abs_id = (id >= 0)?id:-id;
264  switch(abs_id){
265  case pid::bottom:
266  case pid::top:
267  case pid::tau:
268  case pid::Z:
269  case pid::Z_photon_mix:
270  case pid::Wp:
271  case pid::Higgs:
272  case pid::proton:
273  return false;
274  default:
275  return true;
276  }
277  }
278 
280  inline
281  constexpr bool is_massive(ParticleID id){
282  return !is_massless(id);
283  }
284 
290  inline
291  constexpr bool is_charged_lepton(ParticleID id){
292  return is_lepton(id) && !is_neutrino(id);
293  }
294 
300  inline
301  constexpr bool is_charged_antilepton(ParticleID id){
302  return is_antilepton(id) && !is_antineutrino(id);
303  }
304 
310  inline
311  constexpr bool is_charged_anylepton(ParticleID id){
312  return is_anylepton(id) && !is_anyneutrino(id);
313  }
314 
320  boost::rational<int> charge(ParticleID id);
321 
322 } // namespace HEJ
ParticleID anti(ParticleID id)
return the negative flavour of the given PDG ID
ParticleID
The possible particle identities. We use PDG IDs as standard.
Definition: PDG_codes.hh:25
@ Wp
Definition: PDG_codes.hh:83
@ unspecified
Unspecified type, should never be used!, debug only.
Definition: PDG_codes.hh:27
@ antibottom
Definition: PDG_codes.hh:60
@ muon_neutrino
Definition: PDG_codes.hh:47
@ nu_mu
Definition: PDG_codes.hh:46
@ t_bar
Definition: PDG_codes.hh:61
@ bottom
Definition: PDG_codes.hh:37
@ s
Definition: PDG_codes.hh:32
@ antitau
Definition: PDG_codes.hh:73
@ nu_e
Definition: PDG_codes.hh:42
@ d
Definition: PDG_codes.hh:28
@ d_bar
Definition: PDG_codes.hh:51
@ antiproton
Definition: PDG_codes.hh:91
@ Z_gamma_mix
Definition: PDG_codes.hh:82
@ g
Definition: PDG_codes.hh:77
@ s_bar
Definition: PDG_codes.hh:55
@ nu_mu_bar
Definition: PDG_codes.hh:70
@ p
Definition: PDG_codes.hh:88
@ tau_neutrino
Definition: PDG_codes.hh:50
@ antistrange
Definition: PDG_codes.hh:56
@ muon
Definition: PDG_codes.hh:45
@ electron_neutrino
Definition: PDG_codes.hh:43
@ top
Definition: PDG_codes.hh:39
@ nu_tau_bar
Definition: PDG_codes.hh:74
@ tau_antineutrino
Definition: PDG_codes.hh:75
@ tau_bar
Definition: PDG_codes.hh:72
@ nu_e_bar
Definition: PDG_codes.hh:66
@ nu_tau
Definition: PDG_codes.hh:49
@ positron
Definition: PDG_codes.hh:64
@ photon
Definition: PDG_codes.hh:78
@ electron
Definition: PDG_codes.hh:41
@ t
Definition: PDG_codes.hh:38
@ gamma
Definition: PDG_codes.hh:79
@ proton
Definition: PDG_codes.hh:89
@ h
Definition: PDG_codes.hh:85
@ Z_photon_mix
Definition: PDG_codes.hh:81
@ strange
Definition: PDG_codes.hh:33
@ b
Definition: PDG_codes.hh:36
@ Z
Definition: PDG_codes.hh:80
@ p_bar
Definition: PDG_codes.hh:90
@ c_bar
Definition: PDG_codes.hh:57
@ antidown
Definition: PDG_codes.hh:52
@ Wm
Definition: PDG_codes.hh:84
@ antiup
Definition: PDG_codes.hh:54
@ down
Definition: PDG_codes.hh:29
@ u
Definition: PDG_codes.hh:30
@ higgs
Definition: PDG_codes.hh:87
@ e
Definition: PDG_codes.hh:40
@ tau
Definition: PDG_codes.hh:48
@ antimuon
Definition: PDG_codes.hh:69
@ electron_antineutrino
Definition: PDG_codes.hh:67
@ anticharm
Definition: PDG_codes.hh:58
@ Higgs
Definition: PDG_codes.hh:86
@ antielectron
Definition: PDG_codes.hh:65
@ charm
Definition: PDG_codes.hh:35
@ antitop
Definition: PDG_codes.hh:62
@ mu_bar
Definition: PDG_codes.hh:68
@ u_bar
Definition: PDG_codes.hh:53
@ c
Definition: PDG_codes.hh:34
@ up
Definition: PDG_codes.hh:31
@ e_bar
Definition: PDG_codes.hh:63
@ gluon
Definition: PDG_codes.hh:76
@ mu
Definition: PDG_codes.hh:44
@ muon_antineutrino
Definition: PDG_codes.hh:71
@ b_bar
Definition: PDG_codes.hh:59
std::string name(ParticleID id)
Get the of the particle with the given PDG ID.
Main HEJ 2 Namespace.
Definition: mainpage.dox:1
constexpr bool is_antiparticle(Particle const &p)
Check if the argument is an antiparticle.
Definition: Particle.hh:120
constexpr bool is_antineutrino(Particle const &p)
Function to determine if particle is an antineutrino.
Definition: Particle.hh:194
constexpr bool is_parton(Particle const &p)
Check if a particle is a parton, i.e. quark, antiquark, or gluon.
Definition: Particle.hh:126
constexpr bool is_antiquark(Particle const &p)
Check if a particle is an anti-quark.
Definition: Particle.hh:138
constexpr bool is_lepton(Particle const &p)
Function to determine if particle is a lepton.
Definition: Particle.hh:154
ParticleID to_ParticleID(std::string const &name)
Convert a particle name to the corresponding PDG particle ID.
constexpr bool is_quark(Particle const &p)
Check if a particle is a quark.
Definition: Particle.hh:132
constexpr bool is_anylepton(Particle const &p)
Function to determine if particle is an (anti-)lepton.
Definition: Particle.hh:174
constexpr bool is_gluon(ParticleID id)
Function to determine if particle is a gluon.
Definition: PDG_codes.hh:159
constexpr bool is_anyneutrino(Particle const &p)
Function to determine if particle is an (anti-)neutrino.
Definition: Particle.hh:204
boost::rational< int > charge(Particle const &p)
Particle electric charge.
constexpr bool is_charged_antilepton(Particle const &p)
Function to determine if particle is a charged lepton.
Definition: Particle.hh:236
constexpr bool is_AWZH_boson(Particle const &particle)
Check if a particle is a photon, W, Z, or Higgs boson.
Definition: Particle.hh:258
constexpr bool is_charged_anylepton(Particle const &p)
Function to determine if particle is a charged lepton or charged antilepton.
Definition: Particle.hh:246
constexpr bool is_massless(Particle const &p)
Check if a particle is massless.
Definition: Particle.hh:210
constexpr bool is_antilepton(Particle const &p)
Function to determine if particle is an antilepton.
Definition: Particle.hh:164
constexpr bool is_charged_lepton(Particle const &p)
Function to determine if particle is a charged lepton.
Definition: Particle.hh:226
constexpr bool is_neutrino(Particle const &p)
Function to determine if particle is a neutrino.
Definition: Particle.hh:184
constexpr bool is_massive(Particle const &p)
Check if a particle is massive.
Definition: Particle.hh:216
constexpr bool is_anyquark(Particle const &p)
Check if a particle is a quark or anit-quark.
Definition: Particle.hh:144
constexpr bool is_AWZ_boson(Particle const &particle)
Check if a particle is a photon, W or Z boson.
Definition: Particle.hh:252