File indexing completed on 2025-01-30 10:11:34
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef COMMONPARTICLEDATA_HH
0009 #define COMMONPARTICLEDATA_HH
0010
0011 #include <string>
0012 #include <vector>
0013
0014 #include "HepPDT/ParticleID.hh"
0015 #include "HepPDT/SpinState.hh"
0016 #include "HepPDT/Constituent.hh"
0017 #include "HepPDT/ResonanceStructure.hh"
0018 #include "HepPDT/TempParticleData.hh"
0019
0020 namespace HepPDT {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class CommonParticleData {
0032
0033 public:
0034
0035
0036
0037
0038 CommonParticleData( const TempParticleData & tpd );
0039 ~CommonParticleData();
0040
0041
0042
0043 void swap ( CommonParticleData & rhs );
0044 CommonParticleData( const CommonParticleData & orig );
0045 CommonParticleData & operator = ( const CommonParticleData & rhs );
0046
0047
0048
0049
0050 const std::string & name() const { return itsParticleName; }
0051
0052 const std::string PDTname() const { return itsID.PDTname(); }
0053
0054 const std::string & source() const { return itsSource; }
0055
0056 ParticleID ID() const { return itsID; }
0057
0058 int pid( ) const { return itsID.pid(); }
0059
0060 int originalID( ) const { return itsOriginalID; }
0061
0062 double charge() const { return itsCharge; }
0063
0064 double color() const { return itsColorCharge; }
0065
0066 SpinState spin() const { return itsSpin; }
0067
0068 Measurement mass() const { return itsResonance.mass(); }
0069
0070 Measurement totalWidth() const { return itsResonance.totalWidth(); }
0071
0072 double lowerCutoff() const { return itsResonance.lowerCutoff(); }
0073
0074 double upperCutoff() const { return itsResonance.upperCutoff(); }
0075
0076 Measurement lifetime() const { return itsResonance.lifetime(); }
0077
0078 int numConstituents() const { return itsQuarks.size(); }
0079
0080 Constituent constituent( unsigned int i ) const;
0081
0082 ParticleID constituentParticle( unsigned int i ) const;
0083
0084 ResonanceStructure const resonance() const { return itsResonance; }
0085
0086
0087 void write( std::ostream & os ) const;
0088
0089 void writeTranslation( std::ostream & os ) const;
0090
0091
0092
0093
0094 bool isMeson( ) const { return itsID.isMeson(); }
0095
0096 bool isBaryon( ) const { return itsID.isBaryon(); }
0097
0098 bool isDiQuark( ) const { return itsID.isDiQuark(); }
0099
0100 bool isHadron( ) const { return itsID.isHadron(); }
0101
0102 bool isLepton( ) const { return itsID.isLepton(); }
0103
0104 bool isNucleus( ) const { return itsID.isNucleus(); }
0105
0106 bool isPentaquark( ) const { return itsID.isPentaquark(); }
0107
0108 bool isSUSY( ) const { return itsID.isSUSY(); }
0109
0110 bool isRhadron( ) const { return itsID.isRhadron(); }
0111
0112 bool isDyon( ) const { return itsID.isDyon(); }
0113
0114
0115 bool isQBall( ) const { return itsID.isQBall(); }
0116
0117
0118 bool hasUp() const;
0119
0120 bool hasDown() const;
0121
0122 bool hasStrange() const;
0123
0124 bool hasCharm() const;
0125
0126 bool hasBottom() const;
0127
0128 bool hasTop() const;
0129
0130 bool operator < ( const CommonParticleData & other ) const;
0131
0132 bool operator == ( const CommonParticleData & other ) const;
0133
0134
0135
0136
0137 void setCharge( double chg ) { itsCharge = chg; }
0138
0139 void setColor( double col ) { itsColorCharge = col; }
0140
0141 void setSpin( const SpinState & spin ) { itsSpin = spin; }
0142
0143 void addConstituent( Constituent c ) { itsQuarks.push_back( c ); }
0144
0145 void setMass( Measurement const & mass ) { itsResonance.setMass(mass); }
0146
0147 void setTotalWidth( Measurement const & width ) { itsResonance.setTotalWidth(width); }
0148
0149 void setTotalWidthFromLifetime( Measurement const & lt ) { itsResonance.setTotalWidthFromLifetime(lt); }
0150
0151 void setLowerCutoff( double cut ) { itsResonance.setLowerCutoff(cut); }
0152
0153 void setUpperCutoff( double cut ) { itsResonance.setUpperCutoff(cut); }
0154
0155 private:
0156
0157
0158 CommonParticleData();
0159
0160
0161
0162 ParticleID itsID;
0163 std::string itsParticleName;
0164 std::string itsSource;
0165 int itsOriginalID;
0166 double itsCharge;
0167 double itsColorCharge;
0168 SpinState itsSpin;
0169 std::vector<Constituent> itsQuarks;
0170 ResonanceStructure itsResonance;
0171
0172
0173 void getConstituentsFromPID( );
0174
0175 };
0176
0177 inline void swap( CommonParticleData & first, CommonParticleData & second ) {
0178 first.swap( second );
0179 }
0180
0181 }
0182
0183 #include "HepPDT/CommonParticleData.icc"
0184
0185 #endif