![]() |
HepPDT Reference DocumentationHepPDT |
00001 // ---------------------------------------------------------------------- 00002 // 00003 // Constituent.hh 00004 // Author: Lynn Garren 00005 // 00006 // Holds a particle constituent (e.g. ParticleID of the quark type) 00007 // ---------------------------------------------------------------------- 00008 #ifndef CONSTITUENT_HH 00009 #define CONSTITUENT_HH 00010 00011 #include <algorithm> // swap() 00012 00013 #include "HepPDT/ParticleID.hh" 00014 00015 namespace HepPDT { 00016 00018 00026 class Constituent { 00027 00028 public: 00029 // --- birth/death: 00030 // 00031 Constituent( ParticleID p = ParticleID(0), int m = -1 ) 00032 : itsPid(p), itsMultiplicity(m) {} 00033 00034 // --- copying: 00035 // 00036 Constituent( Constituent const & orig ) 00037 : itsPid(orig.itsPid), itsMultiplicity(orig.itsMultiplicity) {} 00038 Constituent & operator = ( Constituent const & rhs ) { 00039 Constituent temp( rhs ); 00040 swap( temp ); 00041 return *this; 00042 } 00043 void swap( Constituent & other ) { 00044 std::swap(itsPid, other.itsPid ); 00045 std::swap( itsMultiplicity, other.itsMultiplicity ); 00046 } 00047 00048 // --- accessors: 00050 int multiplicity() const { return itsMultiplicity; } 00052 ParticleID pid() const { return itsPid; } 00053 00054 // --- booleans: 00056 bool isUp() const; 00058 bool isDown() const; 00060 bool isStrange() const; 00062 bool isCharm() const; 00064 bool isBottom() const; 00066 bool isTop() const; 00067 00068 private: 00069 // -- data members 00070 ParticleID itsPid; 00071 int itsMultiplicity; 00072 00073 }; // Constituent 00074 00075 00076 inline 00077 void swap( Constituent & first, Constituent & second ) { first.swap( second ); } 00078 00079 } // HepPDT 00080 00081 #endif // CONSTITUENT_HH