Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:34

0001 // ----------------------------------------------------------------------
0002 //
0003 // ParticleData.hh
0004 // Author: Lynn Garren
0005 //
0006 // This is a base class for particle data information
0007 // ----------------------------------------------------------------------
0008 #ifndef PARTICLEDATA_HH
0009 #define PARTICLEDATA_HH
0010 
0011 #include <algorithm>    // swap()
0012 #include <list>
0013 #include <string>
0014 
0015 #include "HepPDT/ParticleID.hh"
0016 #include "HepPDT/CommonParticleData.hh"
0017 #include "HepPDT/Measurement.hh"
0018 #include "HepPDT/SpinState.hh"
0019 #include "HepPDT/ResonanceStructure.hh"
0020 #include "HepPDT/Constituent.hh"
0021 #include "HepPDT/TempParticleData.hh"
0022 #include "HepPDT/DecayData.hh"
0023 #include "HepPDT/DecayChannel.hh"
0024 
0025 namespace HepPDT {
0026 
0027 //! The ParticleData class holds data for a single particle in the table.
0028 
0029 ///
0030 /// \class ParticleData
0031 /// \author Lynn Garren
0032 ///
0033 /// All the particle information is accessed via this class.
0034 ///
0035 class ParticleData {
0036 
0037 public:
0038   // --- useful typedef's
0039   //
0040   typedef  CommonParticleData  CPD;
0041 
0042   typedef  std::list<CPD>            CPDlist;
0043   typedef  std::list<DecayData>      DDlist;
0044  
0045   typedef  std::list<CPD>::const_iterator       CPDID;
0046   typedef  std::list<DecayData>::const_iterator DDID;
0047 
0048   // ---  birth/death:
0049   //
0050   /// create from a CommonParticleData and a DecayData
0051   inline ParticleData( const CPDID & cpdid, const DDID & ddid );
0052   /// destructor
0053   inline ~ParticleData();
0054 
0055   // ---  copying:
0056   //
0057   inline void  swap( ParticleData & other );
0058   inline ParticleData( const ParticleData & orig );
0059   inline ParticleData& operator = ( const ParticleData & rhs );
0060 
0061   // ---  ParticleData accessors:
0062   //
0063   /// return the name of this particle
0064   const std::string &         name()        const { return itsCPDID->name();      }
0065   /// return the ParticleID of this particle
0066   ParticleID                  ID()          const { return itsCPDID->ID();        }
0067   /// return the ID of this particle
0068   int                         pid( )        const { return itsCPDID->ID().pid(); }
0069   /// return the charge of this particle
0070   double                      charge()      const { return itsCPDID->charge();    }
0071   /// return the color information for this particle
0072   double                      color()       const { return itsCPDID->color();     }
0073   /// return the spin information for this particle
0074   SpinState                   spin()        const { return itsCPDID->spin();      }
0075   /// return the mass of this particle
0076   Measurement                 mass()        const { return itsCPDID->mass(); }
0077   /// return the total width of this particle
0078   Measurement                 totalWidth()  const { return itsCPDID->totalWidth();  }
0079   /// return the calculated lifetime of this particle
0080   Measurement                 lifetime()    const { return itsCPDID->lifetime();  }
0081   /// lower cutoff of allowed width values
0082   double                      lowerCutoff() const { return itsCPDID->lowerCutoff(); }
0083   /// upper cutoff of allowed width values
0084   double                      upperCutoff() const { return itsCPDID->upperCutoff(); }
0085   /// number of constituent particles (e.g., quarks)
0086   int                         numConstituents() const { return itsCPDID->numConstituents(); }
0087   /// constituent information
0088   inline Constituent          constituent( unsigned int i ) const 
0089                                            { return itsCPDID->constituent(i); }
0090   /// ParticleID for a constituent particle
0091   inline ParticleID           constituentParticle( unsigned int i ) const
0092                                             { return itsCPDID->constituentParticle(i); }
0093   /// resonance (width) information
0094   ResonanceStructure const    resonance()   const { return itsCPDID->resonance(); }
0095 
0096   // --- ParticleData booleans:
0097   //
0098   /// is this a valid meson?
0099   bool isMeson( )   const  { return itsCPDID->isMeson(); }
0100   /// is this a valid baryon?
0101   bool isBaryon( )  const  { return itsCPDID->isBaryon(); }
0102   /// is this a valid diquark?
0103   bool isDiQuark( ) const  { return itsCPDID->isDiQuark(); }
0104   /// is this a valid hadron?
0105   bool isHadron( )  const  { return itsCPDID->isHadron(); }
0106   /// is this a valid lepton?
0107   bool isLepton( )  const  { return itsCPDID->isLepton(); }
0108   /// is this a valid ion?
0109   bool isNucleus( ) const  { return itsCPDID->isNucleus(); }
0110   /// is this a valid pentaquark ID?
0111   bool isPentaquark( ) const { return itsCPDID->isPentaquark(); }
0112   /// is this a valid SUSY ID?
0113   bool isSUSY( ) const { return itsCPDID->isSUSY(); }
0114   /// is this a valid R-hadron ID?
0115   bool isRhadron( ) const { return itsCPDID->isRhadron(); }
0116   // has methods look at Constituents, not PID
0117   /// does this particle contain an up quark?
0118   bool hasUp()      const  { return itsCPDID->hasUp();      }
0119   /// does this particle contain a down quark?
0120   bool hasDown()    const  { return itsCPDID->hasDown();    }
0121   /// does this particle contain a strange quark?
0122   bool hasStrange() const  { return itsCPDID->hasStrange(); }
0123   /// does this particle contain a charm quark?
0124   bool hasCharm()   const  { return itsCPDID->hasCharm();   }
0125   /// does this particle contain a bottom quark?
0126   bool hasBottom()  const  { return itsCPDID->hasBottom();  }
0127   /// does this particle contain a top quark?
0128   bool hasTop()     const  { return itsCPDID->hasTop();     }
0129   /// is this particle allowed to decay?
0130   bool isStable() const;
0131 
0132   // ---  ParticleData mutators:
0133   //
0134   //void  setCharge( double chg )            { itsCPDID->setCharge(chg); }
0135   //void  setColor( double col )             { itsCPDID->setColor(col); }
0136   //void  setSpin( SpinState const & spin )  { itsCPDID->setSpin(spin); }
0137   //void  addConstituent( Constituent c )    { itsCPDID->addConstituent(c); }
0138   //void  setMass( Measurement const & mass )        {  itsCPDID->setMass(mass); }
0139   //void  setTotalWidth( Measurement const & width ) {  itsCPDID->setTotalWidth(width); }
0140   //void  setTotalWidthFromLifetime( Measurement const & lt ) {  itsCPDID->setTotalWidthFromLifetime(lt); }
0141   //void  setLowerCutoff( double cut )               {  itsCPDID->setLowerCutoff(cut); }
0142   //void  setUpperCutoff( double cut )               {  itsCPDID->setUpperCutoff(cut); }
0143 
0144   // ---  DecayData accessors:
0145   //
0146   /// how many decay channels does this particle have?
0147   int                  numDecayChannels() const { return itsDDID->size(); }
0148   /// is this a stable particle?
0149   bool                 hasDecayData()     const { return itsDDID->isStable(); }
0150   /// return this DecayChannel
0151   DecayChannel  channel( int i )    const { return itsDDID->channel(i); }
0152 
0153   // ---  DecayData mutators:
0154   //
0155   //void  appendMode( DecayChannel const & dcp)  { itsDDID->appendMode(dcp); }
0156   /// change the DecayData reference
0157   void  setDecayData( DDID dd )                { itsDDID = dd; }
0158 
0159   // ---  accessors:
0160   //
0161   /// get the DecayData 
0162   DDID   getDecayData()            const { return itsDDID; }
0163   /// get the CommonParticleData
0164   CPDID  getCommonParticleData()   const { return itsCPDID; }
0165   
0166   /// output all information about a particle INCLUDING its decays
0167   inline void write( std::ostream & os ) const;
0168   /// output all information about a particle EXCEPT its decays
0169   inline void writeParticleInfo( std::ostream & os ) const;
0170   /// output the translation information for this particle
0171   inline void writeParticleTranslation( std::ostream & os ) const;
0172 
0173   // ---  booleans:
0174   //
0175   //bool  operator <  ( ParticleData const & other ) const;
0176   //bool  operator == ( ParticleData const & other ) const;
0177 
0178 private:
0179 
0180   // ---  class-specific data:
0181   //
0182   CPDID  itsCPDID;  // pointer/iterator to ParticleData
0183   DDID   itsDDID;   // pointer/iterator to DecayData
0184 
0185   // default constructor not allowed
0186   ParticleData( );
0187 
0188 };  // ParticleData
0189 
0190 inline
0191 void  swap( ParticleData & first, ParticleData & second ) {
0192   first.swap( second );
0193 }
0194 
0195 }   // HepPDT
0196 
0197 #include "HepPDT/ParticleData.icc"
0198 
0199 #endif // PARTICLEDATA_HH