00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef PARTICLEID_HH
00017 #define PARTICLEID_HH
00018
00019 #include <string>
00020 #include <algorithm>
00021
00022
00023 #include "HepPID/ParticleName.hh"
00024
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
00041
00042 Quarks( ) : nq1(0), nq2(0), nq3(0) {}
00043 Quarks( short q1, short q2, short q3) : nq1(q1), nq2(q2), nq3(q3) {}
00044
00045
00046 short nq1;
00047 short nq2;
00048 short nq3;
00049 };
00050
00052
00064 class ParticleID {
00065
00066 public:
00067
00068
00069
00071 ParticleID( int pid = 0 );
00072
00073
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
00083
00085 int pid( ) const { return itsPID; }
00087 int abspid( ) const;
00088
00089
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;
00111
00113 bool hasUp( ) const;
00115 bool hasDown( ) const;
00117 bool hasStrange( ) const;
00119 bool hasCharm( ) const;
00121 bool hasBottom( ) const;
00123 bool hasTop( ) const;
00124
00126 int jSpin( ) const;
00128 int sSpin( ) const;
00130 int lSpin( ) const;
00132 int fundamentalID( ) const;
00135 int extraBits( ) const;
00137 Quarks quarks( ) const;
00140 int threeCharge( ) const;
00142 int A( ) const;
00144 int Z( ) const;
00146 int lambda( ) const;
00148 unsigned short digit(location) const;
00150 const std::string PDTname() const { return HepPID::particleName( itsPID ); }
00151
00152 private:
00153
00154 int itsPID;
00155
00156 };
00157
00158 inline
00159 void swap( ParticleID & first, ParticleID & second ) { first.swap( second ); }
00160
00161 }
00162
00163
00164
00165 #endif // PARTICLEID_HH