File indexing completed on 2025-01-18 10:01:10
0001
0002 #ifndef HEPMC_PDF_INFO_H
0003 #define HEPMC_PDF_INFO_H
0004
0005
0006
0007
0008
0009
0010
0011 namespace HepMC {
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 class PdfInfo {
0038
0039 public:
0040
0041
0042
0043 PdfInfo()
0044 : m_id1(0),
0045 m_id2(0),
0046 m_pdf_id1(0),
0047 m_pdf_id2(0),
0048 m_x1(0),
0049 m_x2(0),
0050 m_scalePDF(0),
0051 m_pdf1(0),
0052 m_pdf2(0)
0053 {}
0054
0055
0056 PdfInfo( int i1, int i2, double x1, double x2,
0057 double q, double p1, double p2,
0058 int pdf_id1 = 0, int pdf_id2 = 0 );
0059
0060 ~PdfInfo() {}
0061
0062
0063
0064 PdfInfo( PdfInfo const & orig );
0065 PdfInfo & operator = ( PdfInfo const & rhs );
0066 void swap( PdfInfo & other );
0067
0068
0069
0070 bool operator==( const PdfInfo& ) const;
0071 bool operator!=( const PdfInfo& ) const;
0072
0073
0074
0075 int id1() const { return m_id1; }
0076
0077 int id2() const { return m_id2; }
0078
0079 int pdf_id1() const { return m_pdf_id1; }
0080
0081 int pdf_id2() const { return m_pdf_id2; }
0082
0083 double x1() const { return m_x1; }
0084
0085 double x2() const { return m_x2; }
0086
0087 double scalePDF() const { return m_scalePDF; }
0088
0089 double pdf1() const { return m_pdf1; }
0090
0091 double pdf2() const { return m_pdf2; }
0092
0093
0094 bool is_valid() const;
0095
0096
0097
0098 void set_id1(const int &i) { m_id1=i; }
0099
0100 void set_id2(const int &i) { m_id2=i; }
0101
0102 void set_pdf_id1(const int &i) { m_pdf_id1=i; }
0103
0104 void set_pdf_id2(const int &i) { m_pdf_id2=i; }
0105
0106 void set_x1(const double &f) { m_x1=f; }
0107
0108 void set_x2(const double &f) { m_x2=f; }
0109
0110 void set_scalePDF(const double &f) { m_scalePDF=f; }
0111
0112 void set_pdf1(const double &f) { m_pdf1=f; }
0113
0114 void set_pdf2(const double &f) { m_pdf2=f; }
0115
0116 private:
0117 int m_id1;
0118 int m_id2;
0119 int m_pdf_id1;
0120 int m_pdf_id2;
0121 double m_x1;
0122 double m_x2;
0123 double m_scalePDF;
0124 double m_pdf1;
0125 double m_pdf2;
0126
0127 };
0128
0129
0130
0131
0132 std::ostream & operator << (std::ostream &, PdfInfo const *);
0133 std::istream & operator >> (std::istream &, PdfInfo *);
0134
0135
0136 inline PdfInfo::PdfInfo( int i1, int i2, double xin1, double xin2,
0137 double q, double p1, double p2,
0138 int pid1, int pid2 )
0139 : m_id1(i1),
0140 m_id2(i2),
0141 m_pdf_id1(pid1),
0142 m_pdf_id2(pid2),
0143 m_x1(xin1),
0144 m_x2(xin2),
0145 m_scalePDF(q),
0146 m_pdf1(p1),
0147 m_pdf2(p2)
0148 {}
0149
0150 inline PdfInfo::PdfInfo( PdfInfo const & orig )
0151 : m_id1(orig.m_id1),
0152 m_id2(orig.m_id2),
0153 m_pdf_id1(orig.m_pdf_id1),
0154 m_pdf_id2(orig.m_pdf_id2),
0155 m_x1(orig.m_x1),
0156 m_x2(orig.m_x2),
0157 m_scalePDF(orig.m_scalePDF),
0158 m_pdf1(orig.m_pdf1),
0159 m_pdf2(orig.m_pdf2)
0160 {}
0161
0162 inline PdfInfo & PdfInfo::operator = ( PdfInfo const & rhs )
0163 {
0164 PdfInfo temp( rhs );
0165 swap( temp );
0166 return *this;
0167 }
0168
0169 inline void PdfInfo::swap( PdfInfo & other )
0170 {
0171 std::swap(m_id1, other.m_id1);
0172 std::swap(m_id2, other.m_id2);
0173 std::swap(m_pdf_id1, other.m_pdf_id1);
0174 std::swap(m_pdf_id2, other.m_pdf_id2);
0175 std::swap(m_x1, other.m_x1);
0176 std::swap(m_x2, other.m_x2);
0177 std::swap(m_scalePDF, other.m_scalePDF);
0178 std::swap(m_pdf1, other.m_pdf1);
0179 std::swap(m_pdf2, other.m_pdf2);
0180 }
0181
0182 inline bool PdfInfo::operator==( const PdfInfo& a ) const
0183 {
0184
0185 return ( a.id1() == this->id1()
0186 && a.id2() == this->id2()
0187 && a.pdf_id1() == this->pdf_id1()
0188 && a.pdf_id2() == this->pdf_id2()
0189 && a.x1() == this->x1()
0190 && a.x2() == this->x2()
0191 && a.scalePDF() == this->scalePDF()
0192 && a.pdf1() == this->pdf1()
0193 && a.pdf2() == this->pdf2() );
0194 }
0195
0196 inline bool PdfInfo::operator!=( const PdfInfo& a ) const
0197 {
0198
0199 return !( a == *this );
0200 }
0201
0202 inline bool PdfInfo::is_valid() const
0203 {
0204 if( m_id1 != 0 ) return true;
0205 if( m_id2 != 0 ) return true;
0206 if( m_pdf_id1 != 0 ) return true;
0207 if( m_pdf_id2 != 0 ) return true;
0208 if( m_x1 != 0 ) return true;
0209 if( m_x2 != 0 ) return true;
0210 if( m_scalePDF != 0 ) return true;
0211 if( m_pdf1 != 0 ) return true;
0212 if( m_pdf2 != 0 ) return true;
0213 return false;
0214 }
0215
0216 }
0217
0218 #endif