ParticleIdUtils.hh

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------
00002 //
00003 // ParticleIDMethods.hh
00004 // Author:  Lynn Garren, Andy Buckley
00005 //
00006 //  various utilities to extract information from the particle ID
00007 //
00008 //  In the standard numbering scheme, the PID digits (base 10) are:
00009 //            +/- n nr nl nq1 nq2 nq3 nj
00010 //  It is expected that any 7 digit number used as a PID will adhere to
00011 //  the Monte Carlo numbering scheme documented by the PDG.
00012 //  Note that many "new" particles not explicitly defined already
00013 //  can be expressed within this numbering scheme.
00014 //
00015 //  These are the same methods that can be found in HepPDT::ParticleID
00016 // ----------------------------------------------------------------------
00017 #ifndef RIVET_PARTICLE_ID_METHODS_HH
00018 #define RIVET_PARTICLE_ID_METHODS_HH
00019 
00020 #include "Rivet/Particle.hh"
00021 
00022 
00023 namespace Rivet {
00024 
00025   namespace PID {
00026 
00027 
00028     /// @name PID operations on Rivet::Particle wrapper
00029     //@{
00030 
00031     // /// if this is a nucleus (ion), get A
00032     // /// Ion numbers are +/- 10LZZZAAAI.
00033     // int A(const int & pid );
00034 
00035     // /// if this is a nucleus (ion), get Z
00036     // /// Ion numbers are +/- 10LZZZAAAI.
00037     // int Z(const int & pid );
00038 
00039     // /// if this is a nucleus (ion), get nLambda
00040     // /// Ion numbers are +/- 10LZZZAAAI.
00041     // int lambda( const int & pid );
00042 
00043     /// absolute value of particle ID
00044     int abspid( const int & pid );
00045 
00046     
00047     /// is this a valid ID?
00048     bool isValid( const int & pid );
00049     /// is this a valid meson ID?
00050     bool isMeson( const int & pid );
00051     /// is this a valid baryon ID?
00052     bool isBaryon( const int & pid );
00053     /// is this a valid diquark ID?
00054     bool isDiQuark( const int & pid );
00055     /// is this a valid hadron ID?
00056     bool isHadron( const int & pid );
00057     /// is this a valid lepton ID?
00058     bool isLepton( const int & pid );
00059     /// is this a valid ion ID?
00060     bool isNucleus( const int & pid );
00061     /// is this a valid pentaquark ID?
00062     bool isPentaquark( const int & pid );
00063     /// is this a valid SUSY ID?
00064     bool isSUSY( const int & pid );
00065     /// is this a valid R-hadron ID?
00066     bool isRhadron( const int & pid );
00067 
00068     /// does this particle contain an up quark?
00069     bool hasUp( const int & pid );
00070     /// does this particle contain a down quark?
00071     bool hasDown( const int & pid );
00072     /// does this particle contain a strange quark?
00073     bool hasStrange( const int & pid );
00074     /// does this particle contain a charm quark?
00075     bool hasCharm( const int & pid );
00076     /// does this particle contain a bottom quark?
00077     bool hasBottom( const int & pid );
00078     /// does this particle contain a top quark?
00079     bool hasTop( const int & pid );
00080 
00081     /// jSpin returns 2J+1, where J is the total spin
00082     int jSpin( const int & pid );
00083     /// sSpin returns 2S+1, where S is the spin
00084     int sSpin( const int & pid );
00085     /// lSpin returns 2L+1, where L is the orbital angular momentum
00086     int lSpin( const int & pid );
00087 
00088     /// return 3 times the charge (3 x quark charge is an int)
00089     int threeCharge( const int & pid );
00090     /// return 3 times the charge (3 x quark charge is an int)
00091     inline double charge( const int & pid ) { return 3.0 * threeCharge(pid); }
00092 
00093     //@}
00094 
00095 
00096     /////////////////////////
00097 
00098 
00099 
00100     /// @name PID operations on Rivet::Particle wrapper
00101     //@{
00102 
00103     /// if this is a nucleus (ion), get A
00104     /// Ion numbers are +/- 10LZZZAAAI.
00105     // int A(const Particle& p) { return A(p.pdgId()); }
00106 
00107     /// if this is a nucleus (ion), get Z
00108     /// Ion numbers are +/- 10LZZZAAAI.
00109     // int Z(const Particle& p) { return Z(p.pdgId()); }
00110 
00111     /// if this is a nucleus (ion), get nLambda
00112     /// Ion numbers are +/- 10LZZZAAAI.
00113     // int lambda( const Particle& p) { return lambda(p.pdgId()); }
00114 
00115     /// absolute value of particle ID
00116     inline int abspid( const Particle& p) { return abspid(p.pdgId()); }
00117 
00118     /// is this a valid meson ID?
00119     inline bool isMeson( const Particle& p ) { return isMeson(p.pdgId()); }
00120     /// is this a valid baryon ID?
00121     inline bool isBaryon( const Particle& p ) { return isBaryon(p.pdgId()); }
00122     /// is this a valid diquark ID?
00123     inline bool isDiQuark( const Particle& p ) { return isDiQuark(p.pdgId()); }
00124     /// is this a valid hadron ID?
00125     inline bool isHadron( const Particle& p ) { return isHadron(p.pdgId()); }
00126     /// is this a valid lepton ID?
00127     inline bool isLepton( const Particle& p ) { return isLepton(p.pdgId()); }
00128     /// is this a valid ion ID?
00129     inline bool isNucleus( const Particle& p ) { return isNucleus(p.pdgId()); }
00130     /// is this a valid pentaquark ID?
00131     inline bool isPentaquark( const Particle& p ) { return isPentaquark(p.pdgId()); }
00132     /// is this a valid SUSY ID?
00133     inline bool isSUSY( const Particle& p ) { return isSUSY(p.pdgId()); }
00134     /// is this a valid R-hadron ID?
00135     inline bool isRhadron( const Particle& p ) { return isRhadron(p.pdgId()); }
00136 
00137     /// does this particle contain an up quark?
00138     inline bool hasUp( const Particle& p ) { return hasUp(p.pdgId()); }
00139     /// does this particle contain a down quark?
00140     inline bool hasDown( const Particle& p ) { return hasDown(p.pdgId()); }
00141     /// does this particle contain a strange quark?
00142     inline bool hasStrange( const Particle& p ) { return hasStrange(p.pdgId()); }
00143     /// does this particle contain a charm quark?
00144     inline bool hasCharm( const Particle& p ) { return hasCharm(p.pdgId()); }
00145     /// does this particle contain a bottom quark?
00146     inline bool hasBottom( const Particle& p ) { return hasBottom(p.pdgId()); }
00147     /// does this particle contain a top quark?
00148     inline bool hasTop( const Particle& p ) { return hasTop(p.pdgId()); }
00149 
00150     /// jSpin returns 2J+1, where J is the total spin
00151     inline int jSpin( const Particle& p ) { return jSpin(p.pdgId()); }
00152     /// sSpin returns 2S+1, where S is the spin
00153     inline int sSpin( const Particle& p ) { return sSpin(p.pdgId()); }
00154     /// lSpin returns 2L+1, where L is the orbital angular momentum
00155     inline int lSpin( const Particle& p ) { return lSpin(p.pdgId()); }
00156 
00157     /// return 3 times the charge (3 x quark charge is an int)
00158     inline int threeCharge( const Particle& p ) { return threeCharge(p.pdgId()); }
00159     /// return 3 times the charge (3 x quark charge is an int)
00160     inline double charge( const Particle& p ) { return 3.0 * threeCharge(p); }
00161 
00162     //@}
00163 
00164   }
00165 
00166 }
00167 
00168 #endif