HackAnalysis  2
pdg.h
1 // Following contains some code from PIDCodes.h and PIDUtils.h from MCUtils (hence copyright notice below)
2 // with subtractions, modifications and additions by Mark Goodsell <goodsell@lpthe.jussieu.fr>
3 // In accordance with the licence, the namespace has been changed to HEP.
4 
5 // Notable changes include the full list of particle codes that exist within pythia so that
6 // the charge can be looked up.
7 // It is not necessarily especially efficient.
8 
9 // If you have a new particle not in the list below then you will need to add it for
10 // the HEPMC mode to work! (Especially if it is charged ... )
11 
12 
13 // -*- C++ -*-
14 //
15 // This file is part of MCUtils -- https://bitbucket.org/andybuckley/mcutils
16 // Copyright (C) 2013-2017 Andy Buckley <andy.buckley@cern.ch>
17 //
18 // Embedding of MCUtils code in other projects is permitted provided this
19 // notice is retained and the MCUtils namespace and include path are changed.
20 //
21 #pragma once
22 #include <algorithm>
23 #include <vector>
24 #include <iostream>
25 
26 using namespace std;
27 namespace PDG {
28 
29  // Global variables that can be modified by the user when we add particles:
30  extern std::vector<int> user_hadrons;
31  extern std::vector<int> user_invisibles;
32  extern std::vector<int> chargedps;
33  extern std::vector<int> charges;
34 
35 
36  // functions defined in pdg.cc
37  bool isHadron(int pid);
38  bool isInvisible(int pid);
39  int get3Q(int pid);
40  bool isCharged(int pid);
41  void AddParticle(int pid,int Q3, int colrep);
42 
43 
44 
45 
47 
48  static const int ELECTRON = 11;
49  static const int POSITRON = -ELECTRON;
50  static const int EMINUS = ELECTRON;
51  static const int EPLUS = POSITRON;
52  static const int MUON = 13;
53  static const int ANTIMUON = -MUON;
54  static const int TAU = 15;
55  static const int ANTITAU = -TAU;
57 
59 
60  static const int NU_E = 12;
61  static const int NU_EBAR = -NU_E;
62  static const int NU_MU = 14;
63  static const int NU_MUBAR = -NU_MU;
64  static const int NU_TAU = 16;
65  static const int NU_TAUBAR = -NU_TAU;
67 
69 
70  static const int PHOTON = 22;
71  static const int GAMMA = PHOTON;
72  static const int GLUON = 21;
73  static const int WPLUSBOSON = 24;
74  static const int WMINUSBOSON = -WPLUSBOSON;
75  static const int WPLUS = WPLUSBOSON;
76  static const int WMINUS = WMINUSBOSON;
77  static const int Z0BOSON = 23;
78  static const int ZBOSON = Z0BOSON;
79  static const int Z0 = Z0BOSON;
80  static const int HIGGSBOSON = 25;
81  static const int HIGGS = HIGGSBOSON;
83 
85 
86  static const int DQUARK = 1;
87  static const int UQUARK = 2;
88  static const int SQUARK = 3;
89  static const int CQUARK = 4;
90  static const int BQUARK = 5;
91  static const int TQUARK = 6;
93 
95 
96  static const int PROTON = 2212;
97  static const int ANTIPROTON = -PROTON;
98  static const int PBAR = ANTIPROTON;
99  static const int NEUTRON = 2112;
100  static const int ANTINEUTRON = -NEUTRON;
102 
104 
105  static const int PI0 = 111;
106  static const int PIPLUS = 211;
107  static const int PIMINUS = -PIPLUS;
108  static const int K0L = 130;
109  static const int K0S = 310;
110  static const int KPLUS = 321;
111  static const int KMINUS = -KPLUS;
112  static const int ETA = 221;
113  static const int ETAPRIME = 331;
114  static const int PHI = 333;
115  static const int OMEGA = 223;
117 
119 
120  static const int ETAC = 441;
121  static const int JPSI = 443;
122  static const int PSI2S = 100443;
124 
126 
127  static const int D0 = 421;
128  static const int DPLUS = 411;
129  static const int DMINUS = -DPLUS;
130  static const int DSPLUS = 431;
131  static const int DSMINUS = -DSPLUS;
133 
135 
136  static const int ETAB = 551;
137  static const int UPSILON1S = 553;
138  static const int UPSILON2S = 100553;
139  static const int UPSILON3S = 200553;
140  static const int UPSILON4S = 300553;
142 
144 
145  static const int B0 = 511;
146  static const int BPLUS = 521;
147  static const int BMINUS = -BPLUS;
148  static const int B0S = 531;
149  static const int BCPLUS = 541;
150  static const int BCMINUS = -BCPLUS;
152 
154 
155  static const int LAMBDA = 3122;
156  static const int SIGMA0 = 3212;
157  static const int SIGMAPLUS = 3222;
158  static const int SIGMAMINUS = 3112;
159  static const int LAMBDACPLUS = 4122;
160  static const int LAMBDACMINUS = 4122;
161  static const int LAMBDAB = 5122;
162  static const int XI0 = 3322;
163  static const int XIMINUS = 3312;
164  static const int XIPLUS = -XIMINUS;
165  static const int OMEGAMINUS = 3334;
166  static const int OMEGAPLUS = -OMEGAMINUS;
168 
170 
171  static const int REGGEON = 110;
172  static const int POMERON = 990;
173  static const int ODDERON = 9990;
174  static const int GRAVITON = 39;
175  static const int NEUTRALINO1 = 1000022;
176  static const int GRAVITINO = 1000039;
177  static const int GLUINO = 1000021;
178  static const int BPRIME = 7;
179  static const int TPRIME = 8;
180  static const int LPRIME = 17;
181  static const int NUPRIME = 18;
182  // static const int DARKMATTERSCALAR = 1000051;
183  // static const int DARKMATTERFERMION = 1000052;
184  // static const int DARKMATTERVECTOR = 1000053;
186 
187 
188 
190  inline bool isPhoton(int pid) {
191  return pid == PHOTON;
192  }
193 
195  inline bool isElectron(int pid) {
196  return abs(pid) == ELECTRON;
197  }
198 
200  inline bool isMuon(int pid) {
201  return abs(pid) == MUON;
202  }
203 
205  inline bool isTau(int pid) {
206  return abs(pid) == TAU;
207  }
208 
210  inline bool isChargedLepton(int pid) {
211  const long apid = abs(pid);
212  return apid == 11 || apid == 13 || apid == 15 || apid == 17;
213  }
214 
215 
217  inline bool isNeutrino(int pid) {
218  const long apid = abs(pid);
219  return apid == 12 || apid == 14 || apid == 16 || apid == 18;
220  }
221 
222  inline bool isLepton(int pid){
223  const long apid = abs(pid);
224  return (apid > 10) && (apid < 19);
225  }
226 
227 
228 
229  /*
230 
231  I think I don't use this one. In principle, this is a list of neutral particles that are mostly
232  hadrons that we could use in isHadron. Instead I use some proxy.
233 
234  */
235 
236 
237  //static const std::vector<int> neutrals={21,22,23,25,12,14,16,111,221,9000221,113,223,
238  static std::vector<int> neutrals={21,22,23,25,12,14,16,111,221,9000221,113,223,
239  331,9010221,9000111,333,10223,10113,20113,225,20223,100221,100111,
240  115,10221,9000113,9020221,10333,20333,1000223,10111,100113,100331,
241  9030221,335,9010113,9020113,10225,30223,227,10115,100333,117,30113,
242  9000115,10331,9010111,337,9050225,119,9060225,229,9080225,9090225,
243  311,310,130,9000311,313,10313,20313,100313,10311,315,30313,10315,
244  317,20315,319,421,423,10421,10423,425,511,513,515,531,533,535,441,
245  443,10441,20443,10443,445,100441,100443,30443,100445,9000443,9010443,
246  9020443,553,10551,20553,10553,555,100553,30553,110551,120553,100555,
247  200553,300553,9000553,9010553,2112,12112,1214,22112,32112,2116,12116,
248  21214,42112,31214,1218,2114,32114,1212,12114,11212,1216,21212,22114,
249  11216,2118,3122,13122,3124,23122,33122,13124,43122,53122,3126,13126,
250  23124,3128,23126,3212,3214,13212,13214,23212,3216,13216,23214,3218,
251  3322,3324,203322,13324,103326,203326,4112,4114,4132,4312,4314,104314,
252  104312,4332,4334,5122,5232};
253 
254 
255 }