HepMC Reference Documentation

HepMC

PdfInfo.h

Go to the documentation of this file.
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 namespace HepMC {
00012 
00014 
00037 class PdfInfo {
00038 
00039 public:
00040   // ---  birth/death:
00041   //
00043   PdfInfo()
00044     : m_id1(0), 
00045       m_id2(0),
00046       m_pdf_id1(0),
00047       m_pdf_id2(0),
00048       m_x1(0),
00049       m_x2(0),
00050       m_scalePDF(0),
00051       m_pdf1(0),
00052       m_pdf2(0)
00053     {}
00054 
00056   PdfInfo( int i1, int i2, double x1, double x2,
00057            double q, double p1, double p2,
00058            int pdf_id1 = 0, int pdf_id2 = 0 );
00059 
00060   ~PdfInfo() {}
00061     
00062   // ---  copying:
00063   //
00064   PdfInfo( PdfInfo const & orig );      
00065   PdfInfo &  operator = ( PdfInfo const & rhs ); 
00066   void swap( PdfInfo & other ); 
00067 
00068   // ---  equivalence:
00069   //
00070   bool    operator==( const PdfInfo& ) const; 
00071   bool    operator!=( const PdfInfo& ) const; 
00072 
00073   // ---  accessors:
00075     int   id1()                   const { return m_id1; }
00077     int   id2()                   const { return m_id2; }
00079     int   pdf_id1()                   const { return m_pdf_id1; }
00081     int   pdf_id2()                   const { return m_pdf_id2; }
00083     double x1()                   const { return m_x1; } 
00085     double x2()                   const { return m_x2; }
00087     double scalePDF()             const { return m_scalePDF;  }
00089     double pdf1()                 const { return m_pdf1; }
00091     double pdf2()                 const { return m_pdf2; }
00092 
00094     bool  is_valid()                     const;
00095 
00096   // ---  mutators:
00098     void   set_id1(const int &i)              { m_id1=i; }
00100     void   set_id2(const int &i)              { m_id2=i; }
00102     void   set_pdf_id1(const int &i)              { m_pdf_id1=i; }
00104     void   set_pdf_id2(const int &i)              { m_pdf_id2=i; }
00106     void   set_x1(const double &f)            { m_x1=f; }
00108     void   set_x2(const double &f)            { m_x2=f; }
00110     void   set_scalePDF(const double &f)      { m_scalePDF=f;  }
00112     void   set_pdf1(const double &f)          { m_pdf1=f; }
00114     void   set_pdf2(const double &f)          { m_pdf2=f; }
00115 
00116 private: // data members
00117     int   m_id1; 
00118     int   m_id2; 
00119     int   m_pdf_id1; 
00120     int   m_pdf_id2; 
00121     double m_x1;
00122     double m_x2;
00123     double m_scalePDF; 
00124     double m_pdf1;
00125     double m_pdf2;
00126 
00127 };
00128 
00129 // Free Functions
00130 
00131 // IO
00132 std::ostream & operator << (std::ostream &, PdfInfo const *);
00133 std::istream & operator >> (std::istream &, PdfInfo *);
00134 
00135 // inline operators
00136 inline PdfInfo::PdfInfo( int i1, int i2, double x1, double x2,
00137                          double q, double p1, double p2,
00138                          int pdf_id1, int pdf_id2 )
00139     : m_id1(i1), 
00140       m_id2(i2),
00141       m_pdf_id1(pdf_id1),
00142       m_pdf_id2(pdf_id2),
00143       m_x1(x1),
00144       m_x2(x2),
00145       m_scalePDF(q),
00146       m_pdf1(p1),
00147       m_pdf2(p2)
00148    {}
00149 
00150 inline PdfInfo::PdfInfo( PdfInfo const & orig )
00151     : m_id1(orig.m_id1), 
00152       m_id2(orig.m_id2),
00153       m_pdf_id1(orig.m_pdf_id1), 
00154       m_pdf_id2(orig.m_pdf_id2),
00155       m_x1(orig.m_x1),
00156       m_x2(orig.m_x2),
00157       m_scalePDF(orig.m_scalePDF),
00158       m_pdf1(orig.m_pdf1),
00159       m_pdf2(orig.m_pdf2)
00160    {}
00161 
00162 inline PdfInfo &  PdfInfo::operator = ( PdfInfo const & rhs ) 
00163 {
00164   PdfInfo temp( rhs );
00165   swap( temp );
00166   return *this;
00167 }
00168 
00169 inline void PdfInfo::swap( PdfInfo & other ) 
00170 {
00171   std::swap(m_id1, other.m_id1); 
00172   std::swap(m_id2, other.m_id2);
00173   std::swap(m_pdf_id1, other.m_pdf_id1); 
00174   std::swap(m_pdf_id2, other.m_pdf_id2);
00175   std::swap(m_x1, other.m_x1);
00176   std::swap(m_x2, other.m_x2);
00177   std::swap(m_scalePDF, other.m_scalePDF);
00178   std::swap(m_pdf1, other.m_pdf1);
00179   std::swap(m_pdf2, other.m_pdf2);
00180 }
00181 
00182 inline bool    PdfInfo::operator==( const PdfInfo& a ) const
00183 {
00185     return (    a.id1() == this->id1() 
00186              && a.id2() == this->id2() 
00187              && a.pdf_id1() == this->pdf_id1() 
00188              && a.pdf_id2() == this->pdf_id2() 
00189              && a.x1() == this->x1() 
00190              && a.x2() == this->x2()
00191              && a.scalePDF() == this->scalePDF() 
00192              && a.pdf1() == this->pdf1()
00193              && a.pdf2() == this->pdf2() );
00194 }
00195 
00196 inline bool    PdfInfo::operator!=( const PdfInfo& a ) const
00197 {
00199     return !( a == *this );
00200 }
00201 
00202 inline bool  PdfInfo::is_valid() const
00203 {
00204     if( m_id1 != 0 ) return true;
00205     if( m_id2 != 0 ) return true;
00206     if( m_pdf_id1 != 0 ) return true;
00207     if( m_pdf_id2 != 0 ) return true;
00208     if( m_x1 != 0 ) return true;
00209     if( m_x2 != 0 ) return true;
00210     if( m_scalePDF != 0 ) return true;
00211     if( m_pdf1 != 0 ) return true;
00212     if( m_pdf2 != 0 ) return true;
00213     return false;
00214 }
00215 
00216 } // HepMC
00217 
00218 #endif  // HEPMC_PDF_INFO_H

Generated on Thu Jan 7 13:10:16 2010 for HepMC by  doxygen 1.4.7