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 "CLHEP/config/CLHEP.h"
00020 #include <algorithm>
00021
00022 namespace HepPDT {
00023
00024
00025 double spinitod( int js );
00026 int spindtoi( double spin );
00027
00028
00029 int translatePythiatoPDT( const int pythiaID );
00030 int translateIsajettoPDT( const int isajetID );
00031 int translateHerwigtoPDT( const int herwigID);
00032 int translateQQtoPDT( const int qqID);
00033 int translateGeanttoPDT( const int geantID);
00034 int translatePDGtabletoPDT( const int pdgID);
00035 int translateEvtGentoPDT( const int evtGenID );
00036
00037 int translatePDTtoPythia( const int pid );
00038 int translatePDTtoIsajet( const int pid );
00039 int translatePDTtoHerwig( const int pid );
00040 int translatePDTtoQQ( const int pid );
00041 int translatePDTtoGeant( const int pid );
00042 int translatePDTtoPDGtable( const int pid );
00043 int translatePDTtoEvtGen( const int pid );
00044
00045
00046
00047 enum location { nj=1, nq3, nq2, nq1, nl, nr, n, n8, n9, n10 };
00048
00049
00054 struct Quarks {
00055
00056
00057 Quarks( ) : nq1(0), nq2(0), nq3(0) {}
00058 Quarks( short q1, short q2, short q3) : nq1(q1), nq2(q2), nq3(q3) {}
00059
00060
00061 short nq1;
00062 short nq2;
00063 short nq3;
00064 };
00065
00070 class ParticleID {
00071
00072 public:
00073
00074
00075
00076 inline ParticleID( int pid = 0 );
00077
00078
00079
00080 inline ParticleID( const ParticleID & orig );
00081 inline ParticleID& operator=( const ParticleID & );
00082 inline void swap( ParticleID & other );
00083
00084 inline bool operator < ( ParticleID const & other ) const;
00085 inline bool operator == ( ParticleID const & other ) const;
00086
00087
00088
00089 int pid( ) const { return itsPID; }
00090 inline int abspid( ) const;
00091
00092
00093
00094 bool isValid( ) const;
00095 bool isMeson( ) const;
00096 bool isBaryon( ) const;
00097 bool isDiQuark( ) const;
00098 bool isHadron( ) const;
00099 bool isLepton( ) const;
00100 bool isNucleus( ) const;
00101
00102 inline bool hasUp( ) const;
00103 inline bool hasDown( ) const;
00104 inline bool hasStrange( ) const;
00105 inline bool hasCharm( ) const;
00106 inline bool hasBottom( ) const;
00107 inline bool hasTop( ) const;
00108
00109
00110 int jSpin( ) const;
00111
00112 int sSpin( ) const;
00113
00114 int lSpin( ) const;
00115
00116 int fundamentalID( ) const;
00117
00118 int extraBits( ) const;
00119
00120 Quarks quarks( ) const;
00121
00122
00123 int threeCharge( ) const;
00124
00125 int A( ) const;
00126 int Z( ) const;
00127
00128 unsigned short digit(location) const;
00129
00130 private:
00131
00132 int itsPID;
00133
00134 };
00135
00136 inline
00137 void swap( ParticleID & first, ParticleID & second ) { first.swap( second ); }
00138
00139 }
00140
00141 #include "CLHEP/HepPDT/ParticleID.icc"
00142
00143 #endif // PARTICLEID_HH