HepPDT Reference Documentation

HepPDT

ParticleData.hh

Go to the documentation of this file.
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(); }
00109   // has methods look at Constituents, not PID
00111   bool hasUp()      const;
00113   bool hasDown()    const;
00115   bool hasStrange() const;
00117   bool hasCharm()   const;
00119   bool hasBottom()  const;
00121   bool hasTop()     const;
00123   bool isStable() const;
00124 
00126   bool operator <  ( const ParticleData & other ) const;
00128   bool operator == ( const ParticleData & other ) const;
00129 
00130   // ---  mutators:
00131   //
00133   void  setCharge( double chg )            { itsCharge = chg; }
00135   void  setColor( double col )             { itsColorCharge = col; }
00137   void  setSpin( const SpinState & spin )  { itsSpin = spin; }
00139   void  addConstituent( Constituent c )    { itsQuarks.push_back( c ); }
00141   void  setMass( Measurement const & mass )        {  itsResonance.setMass(mass); }
00143   void  setTotalWidth( Measurement const & width ) {  itsResonance.setTotalWidth(width); }
00145   void  setTotalWidthFromLifetime( Measurement const & lt ) {  itsResonance.setTotalWidthFromLifetime(lt); }
00147   void  setLowerCutoff( double cut )               {  itsResonance.setLowerCutoff(cut); }
00149   void  setUpperCutoff( double cut )               {  itsResonance.setUpperCutoff(cut); }
00150 
00151 private:
00152 
00153   // default constructor not allowed
00154   ParticleData();
00155  
00156   // ---  class-specific data:
00157   //
00158   ParticleID                itsID;
00159   std::string               itsParticleName;
00160   std::string               itsSource;
00161   int                       itsOriginalID;
00162   double                    itsCharge;
00163   double                    itsColorCharge;
00164   SpinState                 itsSpin;
00165   std::vector<Constituent>  itsQuarks;
00166   ResonanceStructure        itsResonance;
00167 
00169   void getConstituentsFromPID( );
00170 
00171 };  // ParticleData
00172 
00173 inline void swap( ParticleData & first, ParticleData & second ) {
00174   first.swap( second );
00175 }
00176 
00177 }       // HepPDT
00178 
00179 #include "HepPDT/ParticleData.icc"
00180 
00181 #endif // PARTICLEDATA_HH

Generated on Fri Oct 24 13:41:36 2008 for HepPDT by  doxygen 1.5.1-3