rivet is hosted by Hepforge, IPPP Durham
ParticleUtils.hh
Go to the documentation of this file.
00001 #ifndef RIVET_PARTICLEUTILS_HH
00002 #define RIVET_PARTICLEUTILS_HH
00003 
00004 #include "Rivet/Particle.hh"
00005 #include "Rivet/Tools/ParticleIdUtils.hh"
00006 
00007 // Macros to map Rivet::Particle functions to PID:: functions of the same name
00008 /// @todo Can leave return type out of the macro and put that on each line where it's used?
00009 #define PARTICLE_TO_PID_BOOLFN(fname) inline bool fname (const Particle& p) { return PID:: fname (p.pid()); }
00010 #define PARTICLE_TO_PID_INTFN(fname) inline int fname (const Particle& p) { return PID:: fname (p.pid()); }
00011 #define PARTICLE_TO_PID_DBLFN(fname) inline double fname (const Particle& p) { return PID:: fname (p.pid()); }
00012 
00013 namespace Rivet {
00014 namespace PID {
00015 
00016 
00017   /// @name Particle classifier functions
00018   //@{
00019 
00020   /// Is this particle species charged?
00021   PARTICLE_TO_PID_BOOLFN(isCharged)
00022 
00023   /// Is this particle species neutral?
00024   PARTICLE_TO_PID_BOOLFN(isNeutral)
00025 
00026 
00027   /// Is this a neutrino?
00028   PARTICLE_TO_PID_BOOLFN(isNeutrino)
00029 
00030   /// Determine if the PID is that of a charged lepton
00031   PARTICLE_TO_PID_BOOLFN(isChLepton)
00032 
00033   /// Determine if the PID is that of a photon
00034   PARTICLE_TO_PID_BOOLFN(isPhoton)
00035 
00036   /// Determine if the PID is that of an electron or positron
00037   PARTICLE_TO_PID_BOOLFN(isElectron)
00038 
00039   /// Determine if the PID is that of an muon or antimuon
00040   PARTICLE_TO_PID_BOOLFN(isMuon)
00041 
00042   /// Determine if the PID is that of an tau or antitau
00043   PARTICLE_TO_PID_BOOLFN(isTau)
00044 
00045   /// Determine if the PID is that of a hadron
00046   PARTICLE_TO_PID_BOOLFN(isHadron)
00047 
00048   /// Determine if the PID is that of a meson
00049   PARTICLE_TO_PID_BOOLFN(isMeson)
00050 
00051   /// Determine if the PID is that of a baryon
00052   PARTICLE_TO_PID_BOOLFN(isBaryon)
00053 
00054   /// Determine if the PID is that of a quark
00055   PARTICLE_TO_PID_BOOLFN(isQuark)
00056 
00057   /// Determine if the PID is that of a parton (quark or gluon)
00058   PARTICLE_TO_PID_BOOLFN(isParton)
00059 
00060 
00061 
00062   /// Determine if the PID is that of a W+
00063   PARTICLE_TO_PID_BOOLFN(isWplus)
00064 
00065   /// Determine if the PID is that of a W-
00066   PARTICLE_TO_PID_BOOLFN(isWminus)
00067 
00068   /// Determine if the PID is that of a W+-
00069   PARTICLE_TO_PID_BOOLFN(isW)
00070 
00071   /// Determine if the PID is that of a Z0
00072   PARTICLE_TO_PID_BOOLFN(isZ)
00073 
00074   /// Determine if the PID is that of an SM/lightest SUSY Higgs
00075   PARTICLE_TO_PID_BOOLFN(isHiggs)
00076 
00077   /// Determine if the PID is that of a t/tbar
00078   PARTICLE_TO_PID_BOOLFN(isTop)
00079 
00080 
00081   /// Determine if the particle is a heavy flavour hadron or parton
00082   PARTICLE_TO_PID_BOOLFN(isHeavyFlavour)
00083 
00084   /// Determine if the PID is that of a heavy parton (c,b,t)
00085   PARTICLE_TO_PID_BOOLFN(isHeavyParton)
00086 
00087   /// Determine if the PID is that of a light parton (u,d,s)
00088   PARTICLE_TO_PID_BOOLFN(isLightParton)
00089 
00090 
00091   /// Determine if the PID is that of a heavy flavour (b or c) meson
00092   PARTICLE_TO_PID_BOOLFN(isHeavyMeson)
00093 
00094   /// Determine if the PID is that of a heavy flavour (b or c) baryon
00095   PARTICLE_TO_PID_BOOLFN(isHeavyBaryon)
00096 
00097   /// Determine if the PID is that of a heavy flavour (b or c) hadron
00098   PARTICLE_TO_PID_BOOLFN(isHeavyHadron)
00099 
00100 
00101   /// Determine if the PID is that of a light flavour (not b or c) meson
00102   PARTICLE_TO_PID_BOOLFN(isLightMeson)
00103 
00104   /// Determine if the PID is that of a light flavour (not b or c) baryon
00105   PARTICLE_TO_PID_BOOLFN(isLightBaryon)
00106 
00107   /// Determine if the PID is that of a light flavour (not b or c) hadron
00108   PARTICLE_TO_PID_BOOLFN(isLightHadron)
00109 
00110 
00111   /// Determine if the PID is that of a b-meson.
00112   PARTICLE_TO_PID_BOOLFN(isBottomMeson)
00113 
00114   /// Determine if the PID is that of a b-baryon.
00115   PARTICLE_TO_PID_BOOLFN(isBottomBaryon)
00116 
00117   /// Determine if the PID is that of a b-hadron.
00118   PARTICLE_TO_PID_BOOLFN(isBottomHadron)
00119 
00120 
00121   /// @brief Determine if the PID is that of a c-meson.
00122   ///
00123   /// Specifically, the _heaviest_ quark is a c: a B_c is a b-meson and NOT a c-meson.
00124   /// Charmonia (closed charm) are counted as c-mesons here.
00125   PARTICLE_TO_PID_BOOLFN(isCharmMeson)
00126 
00127   /// @brief Determine if the PID is that of a c-baryon.
00128   ///
00129   /// Specifically, the _heaviest_ quark is a c: a baryon containing a b & c
00130   /// is a b-baryon and NOT a c-baryon. To test for the simpler case, just use
00131   /// a combination of hasCharm() and isBaryon().
00132   PARTICLE_TO_PID_BOOLFN(isCharmBaryon)
00133 
00134   /// Determine if the PID is that of a c-hadron.
00135   PARTICLE_TO_PID_BOOLFN(isCharmHadron)
00136 
00137 
00138   /// Determine if the PID is that of a strange meson
00139   PARTICLE_TO_PID_BOOLFN(isStrangeMeson)
00140 
00141   /// Determine if the PID is that of a strange baryon
00142   PARTICLE_TO_PID_BOOLFN(isStrangeBaryon)
00143 
00144   /// Determine if the PID is that of a strange hadron
00145   PARTICLE_TO_PID_BOOLFN(isStrangeHadron)
00146 
00147 
00148 
00149   /// Is this a pomeron, odderon, or generic reggeon?
00150   PARTICLE_TO_PID_BOOLFN(isReggeon)
00151 
00152   /// Determine if the PID is that of a diquark (used in hadronization models)
00153   PARTICLE_TO_PID_BOOLFN(isDiquark)
00154 
00155   /// Determine if the PID is that of a pentaquark (hypothetical hadron)
00156   PARTICLE_TO_PID_BOOLFN(isPentaquark)
00157 
00158   /// Is this a fundamental SUSY particle?
00159   PARTICLE_TO_PID_BOOLFN(isSUSY)
00160 
00161   /// Is this an R-hadron?
00162   PARTICLE_TO_PID_BOOLFN(isRhadron)
00163 
00164   /// Is this a technicolor particle?
00165   PARTICLE_TO_PID_BOOLFN(isTechnicolor)
00166 
00167   /// Is this an excited (composite) quark or lepton?
00168   PARTICLE_TO_PID_BOOLFN(isExcited)
00169 
00170   /// Is this a Kaluza-Klein excitation?
00171   PARTICLE_TO_PID_BOOLFN(isKK)
00172 
00173   /// Is this a graviton?
00174   PARTICLE_TO_PID_BOOLFN(isGraviton)
00175 
00176   /// Is this a BSM particle (including graviton)?
00177   PARTICLE_TO_PID_BOOLFN(isBSM)
00178 
00179 
00180 
00181   /// Determine if the PID is in the generator-specific range
00182   PARTICLE_TO_PID_BOOLFN(isGenSpecific)
00183 
00184   /// Determine if the PID is that of an EW scale resonance
00185   PARTICLE_TO_PID_BOOLFN(isResonance)
00186 
00187   /// Check the PID for usability in transport codes like Geant4
00188   PARTICLE_TO_PID_BOOLFN(isTransportable)
00189 
00190 
00191 
00192   /// Does this particle contain an up quark?
00193   PARTICLE_TO_PID_BOOLFN(hasUp)
00194 
00195   /// Does this particle contain a down quark?
00196   PARTICLE_TO_PID_BOOLFN(hasDown)
00197 
00198   /// Does this particle contain a strange quark?
00199   PARTICLE_TO_PID_BOOLFN(hasStrange)
00200 
00201   /// Does this particle contain a charm quark?
00202   PARTICLE_TO_PID_BOOLFN(hasCharm)
00203 
00204   /// Does this particle contain a bottom quark?
00205   PARTICLE_TO_PID_BOOLFN(hasBottom)
00206 
00207   /// Does this particle contain a top quark?
00208   PARTICLE_TO_PID_BOOLFN(hasTop)
00209 
00210 
00211 
00212   /// jSpin returns 2J+1, where J is the total spin
00213   PARTICLE_TO_PID_INTFN(jSpin)
00214 
00215   /// sSpin returns 2S+1, where S is the spin
00216   PARTICLE_TO_PID_INTFN(sSpin)
00217 
00218   /// lSpin returns 2L+1, where L is the orbital angular momentum
00219   PARTICLE_TO_PID_INTFN(lSpin)
00220 
00221 
00222   /// Return 3 times the charge (3 x quark charge is an int)
00223   PARTICLE_TO_PID_INTFN(threeCharge)
00224 
00225   /// Return the charge
00226   PARTICLE_TO_PID_DBLFN(charge)
00227 
00228   //@}
00229 
00230 
00231 }
00232 }
00233 
00234 #endif