![]() |
HepPDT Reference DocumentationHepPDT |
00001 // ---------------------------------------------------------------------- 00002 // 00003 // ParticleData.hh 00004 // Author: Lynn Garren 00005 // 00006 // This is a base class for particle data information 00007 // ---------------------------------------------------------------------- 00008 #ifndef PARTICLEDATA_HH 00009 #define PARTICLEDATA_HH 00010 00011 #include <string> 00012 #include <vector> 00013 00014 #include "HepPDT/ParticleID.hh" 00015 #include "HepPDT/SpinState.hh" 00016 #include "HepPDT/Constituent.hh" 00017 #include "HepPDT/ResonanceStructure.hh" 00018 #include "HepPDT/TempParticleData.hh" 00019 00020 namespace HepPDT { 00021 00023 00032 class ParticleData { 00033 00034 public: 00035 00036 // --- birth/death: 00037 // 00039 ParticleData( const TempParticleData & tpd ); 00040 ~ParticleData(); 00041 00042 // --- copying: 00043 // 00044 void swap ( ParticleData & rhs ); 00045 ParticleData( const ParticleData & orig ); 00046 ParticleData & operator = ( const ParticleData & rhs ); 00047 00048 // --- accessors: 00049 // 00051 const std::string & name() const { return itsParticleName; } 00053 const std::string PDTname() const { return itsID.PDTname(); } 00055 const std::string & source() const { return itsSource; } 00057 ParticleID ID() const { return itsID; } 00059 int pid( ) const { return itsID.pid(); } 00061 int originalID( ) const { return itsOriginalID; } 00063 double charge() const { return itsCharge; } 00065 double color() const { return itsColorCharge; } 00067 SpinState spin() const { return itsSpin; } 00069 Measurement mass() const { return itsResonance.mass(); } 00071 Measurement totalWidth() const { return itsResonance.totalWidth(); } 00073 double lowerCutoff() const { return itsResonance.lowerCutoff(); } 00075 double upperCutoff() const { return itsResonance.upperCutoff(); } 00077 Measurement lifetime() const { return itsResonance.lifetime(); } 00079 int numConstituents() const { return itsQuarks.size(); } 00081 Constituent constituent( unsigned int i ) const; 00083 ParticleID constituentParticle( unsigned int i ) const; 00085 ResonanceStructure const resonance() const { return itsResonance; } 00086 00088 void write( std::ostream & os ) const; 00091 void writeParticleInfo( std::ostream & os ) const; 00093 void writeParticleTranslation( std::ostream & os ) const; 00094 00095 // --- booleans: 00096 // 00098 bool isMeson( ) const { return itsID.isMeson(); } 00100 bool isBaryon( ) const { return itsID.isBaryon(); } 00102 bool isDiQuark( ) const { return itsID.isDiQuark(); } 00104 bool isHadron( ) const { return itsID.isHadron(); } 00106 bool isLepton( ) const { return itsID.isLepton(); } 00108 bool isNucleus( ) const { return itsID.isNucleus(); } 00110 bool isPentaquark( ) const { return itsID.isPentaquark(); } 00112 bool isSUSY( ) const { return itsID.isSUSY(); } 00114 bool isRhadron( ) const { return itsID.isRhadron(); } 00116 bool isDyon( ) const { return itsID.isDyon(); } 00119 bool isQBall( ) const { return itsID.isQBall(); } 00120 // has methods look at Constituents, not PID 00122 bool hasUp() const; 00124 bool hasDown() const; 00126 bool hasStrange() const; 00128 bool hasCharm() const; 00130 bool hasBottom() const; 00132 bool hasTop() const; 00134 bool isStable() const; 00135 00137 bool operator < ( const ParticleData & other ) const; 00139 bool operator == ( const ParticleData & other ) const; 00140 00141 // --- mutators: 00142 // 00144 void setCharge( double chg ) { itsCharge = chg; } 00146 void setColor( double col ) { itsColorCharge = col; } 00148 void setSpin( const SpinState & spin ) { itsSpin = spin; } 00150 void addConstituent( Constituent c ) { itsQuarks.push_back( c ); } 00152 void setMass( Measurement const & mass ) { itsResonance.setMass(mass); } 00154 void setTotalWidth( Measurement const & width ) { itsResonance.setTotalWidth(width); } 00156 void setTotalWidthFromLifetime( Measurement const & lt ) { itsResonance.setTotalWidthFromLifetime(lt); } 00158 void setLowerCutoff( double cut ) { itsResonance.setLowerCutoff(cut); } 00160 void setUpperCutoff( double cut ) { itsResonance.setUpperCutoff(cut); } 00161 00162 private: 00163 00164 // default constructor not allowed 00165 ParticleData(); 00166 00167 // --- class-specific data: 00168 // 00169 ParticleID itsID; 00170 std::string itsParticleName; 00171 std::string itsSource; 00172 int itsOriginalID; 00173 double itsCharge; 00174 double itsColorCharge; 00175 SpinState itsSpin; 00176 std::vector<Constituent> itsQuarks; 00177 ResonanceStructure itsResonance; 00178 00180 void getConstituentsFromPID( ); 00181 00182 }; // ParticleData 00183 00184 inline void swap( ParticleData & first, ParticleData & second ) { 00185 first.swap( second ); 00186 } 00187 00188 } // HepPDT 00189 00190 #include "HepPDT/ParticleData.icc" 00191 00192 #endif // PARTICLEDATA_HH