6#ifndef HEPMC3_CROSS_SECTION_H
7#define HEPMC3_CROSS_SECTION_H
62 bool to_string(std::string &att)
const override;
65 void set_cross_section(
const double& xs,
const double& xs_err,
const long& n_acc = -1,
const long& n_att = -1);
94 void set_xsec(
const std::string& wName,
const double& xs) {
122 double xsec(
const std::string& wName)
const {
129 double xsec(
const int& indx = 0)
const {
154 int windx(std::string wName)
const;
Definition of class Attribute, class IntAttribute and class StringAttribute.
Stores additional information about cross-section.
double xsec(const std::string &wName) const
Get the cross section corresponding to the weight named wName.
double xsec_err(const int &indx=0) const
Get the cross section error corresponding to the weight with index indx.
double xsec(const int &indx=0) const
Get the cross section corresponding to the weight with index indx.
long get_accepted_events() const
Get the number of accepted events.
long attempted_events
The number of events attempted so far.
std::vector< double > cross_section_errors
Per-weight errors.
void set_attempted_events(const long &n_att)
Set the number of attempted events.
void set_cross_section(const double &xs, const double &xs_err, const long &n_acc=-1, const long &n_att=-1)
Set all fields.
void set_xsec(const int &indx, const double &xs)
Set the cross section corresponding to the weight with index indx.
void set_accepted_events(const long &n_acc)
Set the number of accepted events.
std::vector< double > cross_sections
Per-weight cross-section.
bool is_valid() const
Verify that the instance contains non-zero information.
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
double xsec_err(const std::string &wName) const
Get the cross section error corresponding to the weight named wName.
bool operator==(const GenCrossSection &) const
Operator ==.
bool operator!=(const GenCrossSection &) const
Operator !=.
long get_attempted_events() const
Get the number of attempted events.
void set_xsec(const std::string &wName, const double &xs)
Set the cross section corresponding to the weight named wName.
int windx(std::string wName) const
get the weight index given a weight name.
void set_xsec_err(const int &indx, const double &xs_err)
Set the cross section error corresponding to the weight with index indx.
void set_xsec_err(const std::string &wName, const double &xs_err)
Set the cross section error corresponding to the weight named wName.
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
long accepted_events
The number of events generated so far.