File indexing completed on 2025-01-30 10:11:34
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CONSTITUENT_HH
0009 #define CONSTITUENT_HH
0010
0011 #include <algorithm> // swap()
0012
0013 #include "HepPDT/ParticleID.hh"
0014
0015 namespace HepPDT {
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 class Constituent {
0027
0028 public:
0029
0030
0031 Constituent( ParticleID p = ParticleID(0), int m = -1 )
0032 : itsPid(p), itsMultiplicity(m) {}
0033
0034
0035
0036 Constituent( Constituent const & orig )
0037 : itsPid(orig.itsPid), itsMultiplicity(orig.itsMultiplicity) {}
0038 Constituent & operator = ( Constituent const & rhs ) {
0039 Constituent temp( rhs );
0040 swap( temp );
0041 return *this;
0042 }
0043 void swap( Constituent & other ) {
0044 std::swap(itsPid, other.itsPid );
0045 std::swap( itsMultiplicity, other.itsMultiplicity );
0046 }
0047
0048
0049
0050 int multiplicity() const { return itsMultiplicity; }
0051
0052 ParticleID pid() const { return itsPid; }
0053
0054
0055
0056 bool isUp() const;
0057
0058 bool isDown() const;
0059
0060 bool isStrange() const;
0061
0062 bool isCharm() const;
0063
0064 bool isBottom() const;
0065
0066 bool isTop() const;
0067
0068 private:
0069
0070 ParticleID itsPid;
0071 int itsMultiplicity;
0072
0073 };
0074
0075
0076 inline
0077 void swap( Constituent & first, Constituent & second ) { first.swap( second ); }
0078
0079 }
0080
0081 #endif