6 #ifndef HEPMC3_CROSS_SECTION_H
7 #define HEPMC3_CROSS_SECTION_H
59 bool from_string(
const std::string &att)
override;
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);
70 accepted_events=n_acc;
76 attempted_events=n_att;
82 return accepted_events;
88 return attempted_events;
94 void set_xsec(
const std::string& wName,
const double& xs) {
95 set_xsec(windx(wName), xs);
102 cross_sections[indx] = xs;
109 set_xsec_err(windx(wName), xs_err);
116 cross_section_errors[indx] = xs_err;
122 double xsec(
const std::string& wName)
const {
123 return xsec(windx(wName));
129 double xsec(
const int& indx = 0)
const {
130 return cross_sections[indx];
137 return xsec_err(windx(wName));
144 return cross_section_errors[indx];
149 bool is_valid()
const;
154 int windx(std::string wName)
const;
Forward declaration of GenParticle.
long get_attempted_events() const
Get the number of attempted events.
std::vector< double > cross_section_errors
Per-weight errors.
long get_accepted_events() const
Get the number of accepted events.
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_attempted_events(const long &n_att)
Set the number of attempted events.
double xsec(const std::string &wName) const
Get the cross section corresponding to the weight named wName.
long attempted_events
The number of events attempted so far.
void set_accepted_events(const long &n_acc)
Set the number of accepted events.
std::vector< double > cross_sections
Per-weight cross-section.
double xsec_err(const int &indx=0) const
Get the cross section error corresponding to the weight with index indx.
Definition of class Attribute, class IntAttribute and class StringAttribute.
long accepted_events
The number of events generated so far.
double xsec(const int &indx=0) const
Get the cross section corresponding to the weight with index indx.
double xsec_err(const std::string &wName) const
Get the cross section error corresponding to the weight named wName.
void set_xsec_err(const std::string &wName, const double &xs_err)
Set the cross section error corresponding to the weight named wName.
void set_xsec(const std::string &wName, const double &xs)
Set the cross section corresponding to the weight named wName.
Stores additional information about cross-section.
void set_xsec(const int &indx, const double &xs)
Set the cross section corresponding to the weight with index indx.