rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
ParticleName.hh
1#ifndef RIVET_PARTICLENAME_HH
2#define RIVET_PARTICLENAME_HH
3
4#include "Rivet/Particle.fhh"
5#include "Rivet/Tools/Exceptions.hh"
6
7// cython includes termio.h on some systems,
8// which #defines a B0 = 0 macro
9#undef B0
10
11namespace Rivet {
12
13 namespace PID {
14
15
17
19 static const PdgId ANY = 10000;
20
23 static const PdgId ELECTRON = 11;
24 static const PdgId POSITRON = -ELECTRON;
25 static const PdgId EMINUS = ELECTRON;
26 static const PdgId EPLUS = POSITRON;
27 static const PdgId MUON = 13;
28 static const PdgId ANTIMUON = -MUON;
29 static const PdgId TAU = 15;
30 static const PdgId ANTITAU = -TAU;
32
35 static const PdgId NU_E = 12;
36 static const PdgId NU_EBAR = -NU_E;
37 static const PdgId NU_MU = 14;
38 static const PdgId NU_MUBAR = -NU_MU;
39 static const PdgId NU_TAU = 16;
40 static const PdgId NU_TAUBAR = -NU_TAU;
42
45 static const PdgId PHOTON = 22;
46 static const PdgId GAMMA = PHOTON;
47 static const PdgId GLUON = 21;
48 static const PdgId WPLUSBOSON = 24;
49 static const PdgId WMINUSBOSON = -WPLUSBOSON;
50 static const PdgId WPLUS = WPLUSBOSON;
51 static const PdgId WMINUS = WMINUSBOSON;
52 static const PdgId WBOSON = WPLUSBOSON;
53 static const PdgId Z0BOSON = 23;
54 static const PdgId ZBOSON = Z0BOSON;
55 static const PdgId Z0 = Z0BOSON;
56 static const PdgId HIGGSBOSON = 25;
57 static const PdgId HIGGS = HIGGSBOSON;
58 static const PdgId H0BOSON = HIGGSBOSON;
59 static const PdgId HBOSON = HIGGSBOSON;
61
64 static const PdgId DQUARK = 1;
65 static const PdgId UQUARK = 2;
66 static const PdgId SQUARK = 3;
67 static const PdgId CQUARK = 4;
68 static const PdgId BQUARK = 5;
69 static const PdgId TQUARK = 6;
71
74 static const PdgId PROTON = 2212;
75 static const PdgId ANTIPROTON = -PROTON;
76 static const PdgId PBAR = ANTIPROTON;
77 static const PdgId NEUTRON = 2112;
78 static const PdgId ANTINEUTRON = -NEUTRON;
80
83 static const PdgId PI0 = 111;
84 static const PdgId PIPLUS = 211;
85 static const PdgId PIMINUS = -PIPLUS;
86 static const PdgId RHO0 = 113;
87 static const PdgId RHOPLUS = 213;
88 static const PdgId RHOMINUS = -RHOPLUS;
89 static const PdgId K0L = 130;
90 static const PdgId K0S = 310;
91 static const PdgId K0 = 311;
92 static const PdgId KPLUS = 321;
93 static const PdgId KMINUS = -KPLUS;
94 static const PdgId ETA = 221;
95 static const PdgId ETAPRIME = 331;
96 static const PdgId PHI = 333;
97 static const PdgId OMEGA = 223;
99
102 static const PdgId ETAC = 441;
103 static const PdgId JPSI = 443;
104 static const PdgId PSI2S = 100443;
106
109 static const PdgId D0 = 421;
110 static const PdgId D0BAR = -421;
111 static const PdgId DPLUS = 411;
112 static const PdgId DMINUS = -DPLUS;
113 static const PdgId DSTARPLUS = 413;
114 static const PdgId DSTARMINUS = -DSTARPLUS;
115 static const PdgId DSPLUS = 431;
116 static const PdgId DSMINUS = -DSPLUS;
118
121 static const PdgId ETAB = 551;
122 static const PdgId UPSILON1S = 553;
123 static const PdgId UPSILON2S = 100553;
124 static const PdgId UPSILON3S = 200553;
125 static const PdgId UPSILON4S = 300553;
127
130 static const PdgId B0 = 511;
131 static const PdgId B0BAR = -511;
132 static const PdgId BPLUS = 521;
133 static const PdgId BMINUS = -BPLUS;
134 static const PdgId B0S = 531;
135 static const PdgId BCPLUS = 541;
136 static const PdgId BCMINUS = -BCPLUS;
138
141 static const PdgId LAMBDA = 3122;
142 static const PdgId SIGMA0 = 3212;
143 static const PdgId SIGMAPLUS = 3222;
144 static const PdgId SIGMAMINUS = 3112;
145 static const PdgId SIGMAB = 5212;
146 static const PdgId SIGMABPLUS = 5222;
147 static const PdgId SIGMABMINUS = 5112;
148 static const PdgId LAMBDACPLUS = 4122;
149 static const PdgId LAMBDACMINUS = -4122;
150 static const PdgId LAMBDAB = 5122;
151 static const PdgId XI0 = 3322;
152 static const PdgId XIMINUS = 3312;
153 static const PdgId XIPLUS = -XIMINUS;
154 static const PdgId XI0B = 5232;
155 static const PdgId XIBMINUS = 5132;
156 static const PdgId XI0C = 4132;
157 static const PdgId XICPLUS = 4232;
158 static const PdgId OMEGAMINUS = 3334;
159 static const PdgId OMEGAPLUS = -OMEGAMINUS;
160 static const PdgId OMEGABMINUS = 5332;
161 static const PdgId OMEGA0C = 4332;
163
166 static const PdgId REGGEON = 110;
167 static const PdgId POMERON = 990;
168 static const PdgId ODDERON = 9990;
169 static const PdgId GRAVITON = 39;
170 static const PdgId NEUTRALINO1 = 1000022;
171 static const PdgId GRAVITINO = 1000039;
172 static const PdgId GLUINO = 1000021;
173 static const int BPRIME = 7;
174 static const int TPRIME = 8;
175 static const int LPRIME = 17;
176 static const int NUPRIME = 18;
177 // static const int DARKMATTERSCALAR = 1000051;
178 // static const int DARKMATTERFERMION = 1000052;
179 // static const int DARKMATTERVECTOR = 1000053;
182
185 static const PdgId DEUTERON = 1000010020;
186 static const PdgId ALUMINIUM = 1000130270;
187 static const PdgId COPPER = 1000290630;
188 static const PdgId XENON = 1000541290;
189 static const PdgId GOLD = 1000791970;
190 static const PdgId LEAD = 1000822080;
191 static const PdgId URANIUM = 1000922380;
194
195
196
200 class ParticleNames {
201 public:
202
203 static std::string particleName(PdgId pid) {
204 if (!_instance) _instance = unique_ptr<ParticleNames>(new ParticleNames);
205 return _instance->_particleName(pid);
206 }
207
208 static PdgId particleID(const std::string& pname) {
209 if (!_instance) _instance = unique_ptr<ParticleNames>(new ParticleNames);
210 return _instance->_particleID(pname);
211 }
212
213 std::string _particleName(PdgId pid);
214
215 PdgId _particleID(const std::string& pname);
216
217
218 private:
219
220 ParticleNames() {
221 _add_pid_name(ELECTRON, "ELECTRON");
222 _add_pid_name(POSITRON, "POSITRON");
223 _add_pid_name(PROTON, "PROTON");
224 _add_pid_name(ANTIPROTON, "ANTIPROTON");
225 _add_pid_name(PHOTON, "PHOTON");
226 _add_pid_name(NEUTRON, "NEUTRON");
227 _add_pid_name(ANTINEUTRON, "ANTINEUTRON");
228 _add_pid_name(MUON, "MUON");
229 _add_pid_name(ANTIMUON, "ANTIMUON");
230 _add_pid_name(NU_E, "NU_E");
231 _add_pid_name(NU_EBAR, "NU_EBAR");
232 _add_pid_name(NU_MU, "NU_MU");
233 _add_pid_name(NU_MUBAR, "NU_MUBAR");
234 _add_pid_name(NU_TAU, "NU_TAU");
235 _add_pid_name(NU_TAUBAR, "NU_TAUBAR");
236 _add_pid_name(PIPLUS, "PIPLUS");
237 _add_pid_name(PIMINUS, "PIMINUS");
238 _add_pid_name(TAU, "TAU");
239 _add_pid_name(WPLUSBOSON, "WPLUSBOSON");
240 _add_pid_name(WMINUSBOSON, "WMINUSBOSON");
241 _add_pid_name(ZBOSON, "ZBOSON");
242 _add_pid_name(HIGGS, "HIGGS");
243 _add_pid_name(ANTITAU, "ANTITAU");
244 _add_pid_name(DEUTERON, "DEUTERON");
245 _add_pid_name(ALUMINIUM, "ALUMINIUM");
246 _add_pid_name(COPPER, "COPPER");
247 _add_pid_name(XENON, "XENON");
248 _add_pid_name(GOLD, "GOLD");
249 _add_pid_name(LEAD, "LEAD");
250 _add_pid_name(URANIUM, "URANIUM");
251 _add_pid_name(ANY, "*");
252 }
253
254 void _add_pid_name(PdgId pid, const std::string& pname) {
255 _ids_names[pid] = pname;
256 _names_ids[pname] = pid;
257 }
258
259 static unique_ptr<ParticleNames> _instance;
260
261 std::map<PdgId, std::string> _ids_names;
262
263 std::map<std::string, PdgId> _names_ids;
264
265 };
266
267
269 inline std::string toParticleName(PdgId p) {
270 return ParticleNames::particleName(p);
271 }
272
273
275 inline PdgId toParticleID(const std::string& pname) {
276 return ParticleNames::particleID(pname);
277 }
278
279
281 inline std::pair<PdgId,PdgId> make_pdgid_pair(PdgId a, PdgId b) {
282 return make_pair(a, b);
283 }
284
285
287 inline std::pair<PdgId,PdgId> make_pdgid_pair(const std::string& a, const std::string& b) {
288 const PdgId pa = toParticleID(a);
289 const PdgId pb = toParticleID(b);
290 return make_pair(pa, pb);
291 }
292
293
295 inline std::string toBeamsString(const PdgIdPair& pair) {
296 string out = "[" +
297 toParticleName(pair.first) + ", " +
298 toParticleName(pair.second) + "]";
299 return out;
300 }
301
302
303 }
304
305}
306
307#endif
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
Definition MC_CENT_PPB_Projections.hh:10