Rivet  3.1.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 
11 namespace Rivet {
12 
13  namespace PID {
14 
15 
17 
19  static const PdgId ANY = 10000;
20 
22 
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 
34 
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 
44 
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 Z0BOSON = 23;
53  static const PdgId ZBOSON = Z0BOSON;
54  static const PdgId Z0 = Z0BOSON;
55  static const PdgId HIGGSBOSON = 25;
56  static const PdgId HIGGS = HIGGSBOSON;
57  static const PdgId H0BOSON = HIGGSBOSON;
58  static const PdgId HBOSON = HIGGSBOSON;
60 
62 
63  static const PdgId DQUARK = 1;
64  static const PdgId UQUARK = 2;
65  static const PdgId SQUARK = 3;
66  static const PdgId CQUARK = 4;
67  static const PdgId BQUARK = 5;
68  static const PdgId TQUARK = 6;
70 
72 
73  static const PdgId PROTON = 2212;
74  static const PdgId ANTIPROTON = -PROTON;
75  static const PdgId PBAR = ANTIPROTON;
76  static const PdgId NEUTRON = 2112;
77  static const PdgId ANTINEUTRON = -NEUTRON;
79 
81 
82  static const PdgId PI0 = 111;
83  static const PdgId PIPLUS = 211;
84  static const PdgId PIMINUS = -PIPLUS;
85  static const PdgId RHO0 = 113;
86  static const PdgId RHOPLUS = 213;
87  static const PdgId RHOMINUS = -RHOPLUS;
88  static const PdgId K0L = 130;
89  static const PdgId K0S = 310;
90  static const PdgId KPLUS = 321;
91  static const PdgId KMINUS = -KPLUS;
92  static const PdgId ETA = 221;
93  static const PdgId ETAPRIME = 331;
94  static const PdgId PHI = 333;
95  static const PdgId OMEGA = 223;
97 
99 
100  static const PdgId ETAC = 441;
101  static const PdgId JPSI = 443;
102  static const PdgId PSI2S = 100443;
104 
106 
107  static const PdgId D0 = 421;
108  static const PdgId D0BAR = -421;
109  static const PdgId DPLUS = 411;
110  static const PdgId DMINUS = -DPLUS;
111  static const PdgId DSTARPLUS = 413;
112  static const PdgId DSTARMINUS = -DSTARPLUS;
113  static const PdgId DSPLUS = 431;
114  static const PdgId DSMINUS = -DSPLUS;
116 
118 
119  static const PdgId ETAB = 551;
120  static const PdgId UPSILON1S = 553;
121  static const PdgId UPSILON2S = 100553;
122  static const PdgId UPSILON3S = 200553;
123  static const PdgId UPSILON4S = 300553;
125 
127 
128  static const PdgId B0 = 511;
129  static const PdgId B0BAR = -511;
130  static const PdgId BPLUS = 521;
131  static const PdgId BMINUS = -BPLUS;
132  static const PdgId B0S = 531;
133  static const PdgId BCPLUS = 541;
134  static const PdgId BCMINUS = -BCPLUS;
136 
138 
139  static const PdgId LAMBDA = 3122;
140  static const PdgId SIGMA0 = 3212;
141  static const PdgId SIGMAPLUS = 3222;
142  static const PdgId SIGMAMINUS = 3112;
143  static const PdgId LAMBDACPLUS = 4122;
144  static const PdgId LAMBDACMINUS = 4122;
145  static const PdgId LAMBDAB = 5122;
146  static const PdgId XI0 = 3322;
147  static const PdgId XIMINUS = 3312;
148  static const PdgId XIPLUS = -XIMINUS;
149  static const PdgId OMEGAMINUS = 3334;
150  static const PdgId OMEGAPLUS = -OMEGAMINUS;
152 
154 
155  static const PdgId REGGEON = 110;
156  static const PdgId POMERON = 990;
157  static const PdgId ODDERON = 9990;
158  static const PdgId GRAVITON = 39;
159  static const PdgId NEUTRALINO1 = 1000022;
160  static const PdgId GRAVITINO = 1000039;
161  static const PdgId GLUINO = 1000021;
163 
164 
166 
167  static const PdgId DEUTERON = 1000010020;
168  static const PdgId ALUMINIUM = 1000130270;
169  static const PdgId COPPER = 1000290630;
170  static const PdgId XENON = 1000541290;
171  static const PdgId GOLD = 1000791970;
172  static const PdgId LEAD = 1000822080;
173  static const PdgId URANIUM = 1000922380;
175 
176 
177 
178 
182  class ParticleNames {
183  public:
184 
185  static std::string particleName(PdgId pid) {
186  if (!_instance) _instance = unique_ptr<ParticleNames>(new ParticleNames);
187  return _instance->_particleName(pid);
188  }
189 
190  static PdgId particleId(const std::string& pname) {
191  if (!_instance) _instance = unique_ptr<ParticleNames>(new ParticleNames);
192  return _instance->_particleId(pname);
193  }
194 
195  std::string _particleName(PdgId pid);
196 
197  PdgId _particleId(const std::string& pname);
198 
199 
200  private:
201 
202  ParticleNames() {
203  _add_pid_name(ELECTRON, "ELECTRON");
204  _add_pid_name(POSITRON, "POSITRON");
205  _add_pid_name(PROTON, "PROTON");
206  _add_pid_name(ANTIPROTON, "ANTIPROTON");
207  _add_pid_name(PHOTON, "PHOTON");
208  _add_pid_name(NEUTRON, "NEUTRON");
209  _add_pid_name(ANTINEUTRON, "ANTINEUTRON");
210  _add_pid_name(MUON, "MUON");
211  _add_pid_name(ANTIMUON, "ANTIMUON");
212  _add_pid_name(NU_E, "NU_E");
213  _add_pid_name(NU_EBAR, "NU_EBAR");
214  _add_pid_name(NU_MU, "NU_MU");
215  _add_pid_name(NU_MUBAR, "NU_MUBAR");
216  _add_pid_name(NU_TAU, "NU_TAU");
217  _add_pid_name(NU_TAUBAR, "NU_TAUBAR");
218  _add_pid_name(PIPLUS, "PIPLUS");
219  _add_pid_name(PIMINUS, "PIMINUS");
220  _add_pid_name(TAU, "TAU");
221  _add_pid_name(WPLUSBOSON, "WPLUSBOSON");
222  _add_pid_name(WMINUSBOSON, "WMINUSBOSON");
223  _add_pid_name(ZBOSON, "ZBOSON");
224  _add_pid_name(HIGGS, "HIGGS");
225  _add_pid_name(ANTITAU, "ANTITAU");
226  _add_pid_name(DEUTERON, "DEUTERON");
227  _add_pid_name(ALUMINIUM, "ALUMINIUM");
228  _add_pid_name(COPPER, "COPPER");
229  _add_pid_name(XENON, "XENON");
230  _add_pid_name(GOLD, "GOLD");
231  _add_pid_name(LEAD, "LEAD");
232  _add_pid_name(URANIUM, "URANIUM");
233  _add_pid_name(ANY, "*");
234  }
235 
236  void _add_pid_name(PdgId pid, const std::string& pname) {
237  _ids_names[pid] = pname;
238  _names_ids[pname] = pid;
239  }
240 
241  static unique_ptr<ParticleNames> _instance;
242 
243  std::map<PdgId, std::string> _ids_names;
244 
245  std::map<std::string, PdgId> _names_ids;
246 
247  };
248 
249 
251  inline std::string toParticleName(PdgId p) {
252  return ParticleNames::particleName(p);
253  }
254 
255 
257  inline PdgId toParticleId(const std::string& pname) {
258  return ParticleNames::particleId(pname);
259  }
260 
261 
263  inline std::pair<PdgId,PdgId> make_pdgid_pair(PdgId a, PdgId b) {
264  return make_pair(a, b);
265  }
266 
267 
269  inline std::pair<PdgId,PdgId> make_pdgid_pair(const std::string& a, const std::string& b) {
270  const PdgId pa = toParticleId(a);
271  const PdgId pb = toParticleId(b);
272  return make_pair(pa, pb);
273  }
274 
275 
277  inline std::string toBeamsString(const PdgIdPair& pair) {
278  string out = "[" +
279  toParticleName(pair.first) + ", " +
280  toParticleName(pair.second) + "]";
281  return out;
282  }
283 
284 
285  }
286 
287 }
288 
289 #endif
Definition: MC_Cent_pPb.hh:10
int pid(const Particle &p)
Unbound function access to PID code.
Definition: ParticleUtils.hh:23