ParticleName.hh
Go to the documentation of this file.
00001 #ifndef RIVET_PARTICLENAME_HH 00002 #define RIVET_PARTICLENAME_HH 00003 00004 #include "Rivet/Particle.fhh" 00005 #include "Rivet/Exceptions.hh" 00006 00007 namespace Rivet { 00008 00009 namespace PID { 00010 00011 00012 /// Static const convenience particle ID names 00013 00014 /// Special wildcard particle name 00015 static const PdgId ANY = 10000; 00016 00017 /// @name Charged leptons 00018 //@{ 00019 static const PdgId ELECTRON = 11; 00020 static const PdgId POSITRON = -ELECTRON; 00021 static const PdgId EMINUS = ELECTRON; 00022 static const PdgId EPLUS = POSITRON; 00023 static const PdgId MUON = 13; 00024 static const PdgId ANTIMUON = -MUON; 00025 static const PdgId TAU = 15; 00026 static const PdgId ANTITAU = -TAU; 00027 //@} 00028 00029 /// @name Neutrinos 00030 //@{ 00031 static const PdgId NU_E = 12; 00032 static const PdgId NU_EBAR = -NU_E; 00033 static const PdgId NU_MU = 14; 00034 static const PdgId NU_MUBAR = -NU_MU; 00035 static const PdgId NU_TAU = 16; 00036 static const PdgId NU_TAUBAR = -NU_TAU; 00037 //@} 00038 00039 /// @name Bosons 00040 //@{ 00041 static const PdgId PHOTON = 22; 00042 static const PdgId GAMMA = PHOTON; 00043 static const PdgId GLUON = 21; 00044 static const PdgId WPLUSBOSON = 24; 00045 static const PdgId WMINUSBOSON = -WPLUSBOSON; 00046 static const PdgId WPLUS = WPLUSBOSON; 00047 static const PdgId WMINUS = WMINUSBOSON; 00048 static const PdgId Z0BOSON = 23; 00049 static const PdgId ZBOSON = Z0BOSON; 00050 static const PdgId Z0 = Z0BOSON; 00051 static const PdgId HIGGSBOSON = 25; 00052 static const PdgId HIGGS = HIGGSBOSON; 00053 //@} 00054 00055 /// @name Quarks 00056 //@{ 00057 static const PdgId DQUARK = 1; 00058 static const PdgId UQUARK = 2; 00059 static const PdgId SQUARK = 3; 00060 static const PdgId CQUARK = 4; 00061 static const PdgId BQUARK = 5; 00062 static const PdgId TQUARK = 6; 00063 //@} 00064 00065 /// @name Nucleons 00066 //@{ 00067 static const PdgId PROTON = 2212; 00068 static const PdgId ANTIPROTON = -PROTON; 00069 static const PdgId PBAR = ANTIPROTON; 00070 static const PdgId NEUTRON = 2112; 00071 static const PdgId ANTINEUTRON = -NEUTRON; 00072 //@} 00073 00074 /// @name Light mesons 00075 //@{ 00076 static const PdgId PI0 = 111; 00077 static const PdgId PIPLUS = 211; 00078 static const PdgId PIMINUS = -PIPLUS; 00079 static const PdgId K0L = 130; 00080 static const PdgId K0S = 310; 00081 static const PdgId KPLUS = 321; 00082 static const PdgId KMINUS = -KPLUS; 00083 static const PdgId ETA = 221; 00084 static const PdgId ETAPRIME = 331; 00085 static const PdgId PHI = 333; 00086 static const PdgId OMEGA = 223; 00087 //@} 00088 00089 /// @name Charmonia 00090 //@{ 00091 static const PdgId ETAC = 441; 00092 static const PdgId JPSI = 443; 00093 static const PdgId PSI2S = 100443; 00094 //@} 00095 00096 /// @name Charm mesons 00097 //@{ 00098 static const PdgId D0 = 421; 00099 static const PdgId DPLUS = 411; 00100 static const PdgId DMINUS = -DPLUS; 00101 static const PdgId DSPLUS = 431; 00102 static const PdgId DSMINUS = -DSPLUS; 00103 //@} 00104 00105 /// @name Bottomonia 00106 //@{ 00107 static const PdgId ETAB = 551; 00108 static const PdgId UPSILON1S = 553; 00109 static const PdgId UPSILON2S = 100553; 00110 static const PdgId UPSILON3S = 200553; 00111 static const PdgId UPSILON4S = 300553; 00112 //@} 00113 00114 /// @name b mesons 00115 //@{ 00116 static const PdgId B0 = 511; 00117 static const PdgId BPLUS = 521; 00118 static const PdgId BMINUS = -BPLUS; 00119 static const PdgId B0S = 531; 00120 static const PdgId BCPLUS = 541; 00121 static const PdgId BCMINUS = -BCPLUS; 00122 //@} 00123 00124 /// @name Baryons 00125 //@{ 00126 static const PdgId LAMBDA = 3122; 00127 static const PdgId SIGMA0 = 3212; 00128 static const PdgId SIGMAPLUS = 3222; 00129 static const PdgId SIGMAMINUS = 3112; 00130 static const PdgId LAMBDACPLUS = 4122; 00131 static const PdgId LAMBDACMINUS = 4122; 00132 static const PdgId LAMBDAB = 5122; 00133 static const PdgId XI0 = 3322; 00134 static const PdgId XIMINUS = 3312; 00135 static const PdgId XIPLUS = -XIMINUS; 00136 static const PdgId OMEGAMINUS = 3334; 00137 static const PdgId OMEGAPLUS = -OMEGAMINUS; 00138 //@} 00139 00140 /// @name Exotic/weird stuff 00141 //@{ 00142 static const PdgId REGGEON = 110; 00143 static const PdgId POMERON = 990; 00144 static const PdgId ODDERON = 9990; 00145 static const PdgId GRAVITON = 39; 00146 static const PdgId NEUTRALINO1 = 1000022; 00147 static const PdgId GRAVITINO = 1000039; 00148 static const PdgId GLUINO = 1000021; 00149 /// @todo Add axion, black hole remnant, etc. on demand 00150 //@} 00151 00152 00153 00154 /// Handler for particle name code <-> string conversion 00155 /// 00156 /// @todo Hide this utility class or equiv in an unnamed namespace in a .cc file. 00157 class ParticleNames { 00158 public: 00159 00160 static const std::string& particleName(PdgId pid) { 00161 /// @todo Isn't there a nicer, pointerless way to do singletons? 00162 if (!_instance) _instance = new ParticleNames(); 00163 return _instance->_particleName(pid); 00164 } 00165 00166 static PdgId particleId(const std::string& pname) { 00167 /// @todo Isn't there a nicer, pointerless way to do singletons? 00168 if (!_instance) _instance = new ParticleNames(); 00169 return _instance->_particleId(pname); 00170 } 00171 00172 const std::string& _particleName(PdgId pid); 00173 00174 PdgId _particleId(const std::string& pname); 00175 00176 00177 private: 00178 00179 ParticleNames() { 00180 _add_pid_name(ELECTRON, "ELECTRON"); 00181 _add_pid_name(POSITRON, "POSITRON"); 00182 _add_pid_name(PROTON, "PROTON"); 00183 _add_pid_name(ANTIPROTON, "ANTIPROTON"); 00184 _add_pid_name(PHOTON, "PHOTON"); 00185 _add_pid_name(NEUTRON, "NEUTRON"); 00186 _add_pid_name(ANTINEUTRON, "ANTINEUTRON"); 00187 _add_pid_name(MUON, "MUON"); 00188 _add_pid_name(ANTIMUON, "ANTIMUON"); 00189 _add_pid_name(NU_E, "NU_E"); 00190 _add_pid_name(NU_EBAR, "NU_EBAR"); 00191 _add_pid_name(NU_MU, "NU_MU"); 00192 _add_pid_name(NU_MUBAR, "NU_MUBAR"); 00193 _add_pid_name(NU_TAU, "NU_TAU"); 00194 _add_pid_name(NU_TAUBAR, "NU_TAUBAR"); 00195 _add_pid_name(PIPLUS, "PIPLUS"); 00196 _add_pid_name(PIMINUS, "PIMINUS"); 00197 _add_pid_name(TAU, "TAU"); 00198 _add_pid_name(WPLUSBOSON, "WPLUSBOSON"); 00199 _add_pid_name(WMINUSBOSON, "WMINUSBOSON"); 00200 _add_pid_name(ZBOSON, "ZBOSON"); 00201 _add_pid_name(HIGGS, "HIGGS"); 00202 _add_pid_name(ANTITAU, "ANTITAU"); 00203 _add_pid_name(ANY, "*"); 00204 } 00205 00206 void _add_pid_name(PdgId pid, const std::string& pname) { 00207 _ids_names[pid] = pname; 00208 _names_ids[pname] = pid; 00209 } 00210 00211 static ParticleNames* _instance; 00212 00213 std::map<PdgId, std::string> _ids_names; 00214 00215 std::map<std::string, PdgId> _names_ids; 00216 00217 }; 00218 00219 00220 /// Print a PdgId as a named string. 00221 inline const std::string& toParticleName(PdgId p) { 00222 return ParticleNames::particleName(p); 00223 } 00224 00225 00226 /// Print a PdgId as a named string. 00227 inline PdgId toParticleId(const std::string& pname) { 00228 return ParticleNames::particleId(pname); 00229 } 00230 00231 00232 /// Convenience maker of particle ID pairs from PdgIds. 00233 inline std::pair<PdgId,PdgId> make_pdgid_pair(PdgId a, PdgId b) { 00234 return make_pair(a, b); 00235 } 00236 00237 00238 /// Convenience maker of particle ID pairs from particle names. 00239 inline std::pair<PdgId,PdgId> make_pdgid_pair(const std::string& a, const std::string& b) { 00240 const PdgId pa = toParticleId(a); 00241 const PdgId pb = toParticleId(b); 00242 return make_pair(pa, pb); 00243 } 00244 00245 00246 /// Print a PdgIdPair as a string. 00247 inline std::string toBeamsString(const PdgIdPair& pair) { 00248 string out = "[" + 00249 toParticleName(pair.first) + ", " + 00250 toParticleName(pair.second) + "]"; 00251 return out; 00252 } 00253 00254 00255 } 00256 00257 } 00258 00259 #endif Generated on Wed Oct 7 2015 12:09:14 for The Rivet MC analysis system by ![]() |