14 #include "HepMC/GenCrossSection.h"
15 #include "HepMC/IO_Exception.h"
20 : m_cross_section( orig.cross_section() ),
21 m_cross_section_error( orig.cross_section_error() ),
22 m_is_set( orig.is_set() )
27 std::swap( m_cross_section, other.m_cross_section );
28 std::swap( m_cross_section_error, other.m_cross_section_error );
29 std::swap( m_is_set, other.m_is_set );
48 return !( rhs == *this );
54 m_cross_section = 0.0;
55 m_cross_section_error = 0.0;
63 std::cerr <<
"GenCrossSection::print !os, setting badbit" << std::endl;
64 os.clear(std::ios::badbit);
69 os <<
"C " << m_cross_section
70 <<
" " << m_cross_section_error
80 std::cerr <<
"GenCrossSection stream input setting badbit." << std::endl;
81 is.clear(std::ios::badbit);
86 if ( is.peek()!=
'C' ) {
90 std::string line, firstc;
91 std::getline(is,line);
92 std::istringstream iline(line);
96 double xs = 0., xserr = 0.;
98 if(!iline)
throw IO_Exception(
"GenCrossSection::read encounterd invalid data");
100 if(!iline)
throw IO_Exception(
"GenCrossSection::read encounterd invalid data");
void set_cross_section(double xs, double xs_err)
Set cross section and error in pb.
The GenCrossSection class stores the generated cross section.
bool operator==(const GenCrossSection &) const
check for equality
GenCrossSection & operator=(GenCrossSection const &rhs)
std::istream & read(std::istream &)
read from an input stream
bool operator!=(const GenCrossSection &) const
check for inequality
std::ostream & write(std::ostream &) const
write to an output stream
double cross_section_error() const
error associated with this cross section in pb
double cross_section() const
cross section in pb
bool is_set() const
True if the cross section has been set. False by default.
void swap(GenCrossSection &other)
swap