![]() |
HepMC Reference DocumentationHepMC |
00001 //-------------------------------------------------------------------------- 00002 #ifndef HEPMC_PDF_INFO_H 00003 #define HEPMC_PDF_INFO_H 00004 00006 // garren@fnal.gov, July 2006 00007 // 00008 // Additional PDF information 00010 // 00011 // int id1; // flavour code of first parton 00012 // int id2; // flavour code of second parton 00013 // double x1; // fraction of beam momentum carried by first parton ("beam side") 00014 // double x2; // fraction of beam momentum carried by second parton ("target side") 00015 // double scalePDF; // Q-scale used in evaluation of PDF's (in GeV) 00016 // double pdf1; // PDF (id1, x1, Q) 00017 // double pdf2; // PDF (id2, x2, Q) 00018 // 00020 00021 namespace HepMC { 00022 00024 00030 class PdfInfo { 00031 00032 public: 00033 // --- birth/death: 00034 // 00036 PdfInfo() 00037 : m_id1(0), 00038 m_id2(0), 00039 m_x1(0), 00040 m_x2(0), 00041 m_scalePDF(0), 00042 m_pdf1(0), 00043 m_pdf2(0) 00044 {} 00045 00047 PdfInfo( int i1, int i2, double x1, double x2, double q, double p1, double p2 ); 00048 00049 ~PdfInfo() {} 00050 00051 // --- copying: 00052 // 00053 PdfInfo( PdfInfo const & orig ); 00054 PdfInfo & operator = ( PdfInfo const & rhs ); 00055 void swap( PdfInfo & other ); 00056 00057 // --- equivalence: 00058 // 00059 bool operator==( const PdfInfo& ) const; 00060 bool operator!=( const PdfInfo& ) const; 00061 00062 // --- accessors: 00064 int id1() const { return m_id1; } 00066 int id2() const { return m_id2; } 00068 double x1() const { return m_x1; } 00070 double x2() const { return m_x2; } 00072 double scalePDF() const { return m_scalePDF; } 00074 double pdf1() const { return m_pdf1; } 00076 double pdf2() const { return m_pdf2; } 00077 00078 // --- mutators: 00080 void set_id1(const int &i) { m_id1=i; } 00082 void set_id2(const int &i) { m_id2=i; } 00084 void set_x1(const double &f) { m_x1=f; } 00086 void set_x2(const double &f) { m_x2=f; } 00088 void set_scalePDF(const double &f) { m_scalePDF=f; } 00090 void set_pdf1(const double &f) { m_pdf1=f; } 00092 void set_pdf2(const double &f) { m_pdf2=f; } 00093 00094 private: // data members 00095 int m_id1; 00096 int m_id2; 00097 double m_x1; 00098 double m_x2; 00099 double m_scalePDF; 00100 double m_pdf1; 00101 double m_pdf2; 00102 00103 }; 00104 00105 // inline operators 00106 inline PdfInfo::PdfInfo( int i1, int i2, double x1, double x2, double q, double p1, double p2 ) 00107 : m_id1(i1), 00108 m_id2(i2), 00109 m_x1(x1), 00110 m_x2(x2), 00111 m_scalePDF(q), 00112 m_pdf1(p1), 00113 m_pdf2(p2) 00114 {} 00115 00116 inline PdfInfo::PdfInfo( PdfInfo const & orig ) 00117 : m_id1(orig.m_id1), 00118 m_id2(orig.m_id2), 00119 m_x1(orig.m_x1), 00120 m_x2(orig.m_x2), 00121 m_scalePDF(orig.m_scalePDF), 00122 m_pdf1(orig.m_pdf1), 00123 m_pdf2(orig.m_pdf2) 00124 {} 00125 00126 inline PdfInfo & PdfInfo::operator = ( PdfInfo const & rhs ) 00127 { 00128 PdfInfo temp( rhs ); 00129 swap( temp ); 00130 return *this; 00131 } 00132 00133 inline void PdfInfo::swap( PdfInfo & other ) 00134 { 00135 std::swap(m_id1, other.m_id1); 00136 std::swap(m_id2, other.m_id2); 00137 std::swap(m_x1, other.m_x1); 00138 std::swap(m_x2, other.m_x2); 00139 std::swap(m_scalePDF, other.m_scalePDF); 00140 std::swap(m_pdf1, other.m_pdf1); 00141 std::swap(m_pdf2, other.m_pdf2); 00142 } 00143 00144 inline bool PdfInfo::operator==( const PdfInfo& a ) const 00145 { 00147 return ( a.id1() == this->id1() 00148 && a.id2() == this->id2() 00149 && a.x1() == this->x1() 00150 && a.x2() == this->x2() 00151 && a.scalePDF() == this->scalePDF() 00152 && a.pdf1() == this->pdf1() 00153 && a.pdf2() == this->pdf2() ); 00154 } 00155 00156 inline bool PdfInfo::operator!=( const PdfInfo& a ) const 00157 { 00159 return !( a == *this ); 00160 } 00161 00162 } // HepMC 00163 00164 #endif // HEPMC_PDF_INFO_H