![]() |
HepPDT Reference DocumentationHepPDT |
00001 // ---------------------------------------------------------------------- 00002 // 00003 // ParticleID.hh 00004 // Author: Lynn Garren 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 // ---------------------------------------------------------------------- 00016 #ifndef PARTICLEID_HH 00017 #define PARTICLEID_HH 00018 00019 #include <string> 00020 #include <algorithm> // swap() 00021 00022 // Particle names 00023 #include "HepPID/ParticleName.hh" 00024 // Translation free functions 00025 #include "HepPID/ParticleIDTranslations.hh" 00026 00027 namespace HepPDT { 00028 00030 double spinitod( int js ); 00032 int spindtoi( double spin ); 00033 00036 enum location { nj=1, nq3, nq2, nq1, nl, nr, n, n8, n9, n10 }; 00037 00039 struct Quarks { 00040 // -- constructors 00041 // 00042 Quarks( ) : nq1(0), nq2(0), nq3(0) {} 00043 Quarks( short q1, short q2, short q3) : nq1(q1), nq2(q2), nq3(q3) {} 00044 // -- data members 00045 // 00046 short nq1; 00047 short nq2; 00048 short nq3; 00049 }; 00050 00052 00064 class ParticleID { 00065 00066 public: 00067 00068 // --- birth/death: 00069 // 00071 ParticleID( int pid = 0 ); 00072 00073 // --- copying: 00074 // 00075 ParticleID( const ParticleID & orig ); 00076 ParticleID& operator=( const ParticleID & ); 00077 void swap( ParticleID & other ); 00078 00079 bool operator < ( ParticleID const & other ) const; 00080 bool operator == ( ParticleID const & other ) const; 00081 00082 // --- accessors: 00083 // 00085 int pid( ) const { return itsPID; } 00087 int abspid( ) const; 00088 00089 // --- boolean methods: 00090 // 00092 bool isValid( ) const; 00094 bool isMeson( ) const; 00096 bool isBaryon( ) const; 00098 bool isDiQuark( ) const; 00100 bool isHadron( ) const; 00102 bool isLepton( ) const; 00104 bool isNucleus( ) const; 00106 bool isPentaquark( ) const; 00108 bool isSUSY( ) const; 00110 bool isRhadron( ) const; 00112 bool isDyon( ) const; 00115 bool isQBall( ) const; 00116 00118 bool hasUp( ) const; 00120 bool hasDown( ) const; 00122 bool hasStrange( ) const; 00124 bool hasCharm( ) const; 00126 bool hasBottom( ) const; 00128 bool hasTop( ) const; 00129 00131 int jSpin( ) const; 00133 int sSpin( ) const; 00135 int lSpin( ) const; 00137 int fundamentalID( ) const; 00140 int extraBits( ) const; 00142 Quarks quarks( ) const; 00145 int threeCharge( ) const; 00147 double charge() const; 00149 int A( ) const; 00151 int Z( ) const; 00153 int lambda( ) const; 00155 unsigned short digit(location) const; 00157 const std::string PDTname() const { return HepPID::particleName( itsPID ); } 00158 00159 private: 00160 00161 int itsPID; 00162 00163 }; // ParticleID 00164 00165 inline 00166 void swap( ParticleID & first, ParticleID & second ) { first.swap( second ); } 00167 00168 } // HepPDT 00169 00170 //#include "HepPDT/ParticleID.icc" 00171 00172 #endif // PARTICLEID_HH