|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Stores run-related information. More...
#include <GenRunInfo.h>
Classes | |
| struct | ToolInfo |
| Interrnal struct for keeping track of tools. More... | |
Public Member Functions | |
| GenRunInfo () | |
| Default constructor. | |
| GenRunInfo (const GenRunInfo &r) | |
| Copy constructor. | |
| void | add_attribute (const std::string &name, const std::shared_ptr< Attribute > &att) |
| add an attribute This will overwrite existing attribute if an attribute with the same name is present | |
| template<class T> | |
| std::shared_ptr< T > | attribute (const std::string &name) const |
| Get attribute of type T. | |
| std::string | attribute_as_string (const std::string &name) const |
| Get attribute of any type as string. | |
| std::vector< std::string > | attribute_names () const |
| Get list of attribute names. | |
| std::map< std::string, std::shared_ptr< Attribute > > | attributes () const |
| Get a copy of the list of attributes. | |
| bool | has_weight (const std::string &name) const |
| Check if a weight name is present. | |
| GenRunInfo & | operator= (const GenRunInfo &r) |
| Assignmet. | |
| void | remove_attribute (const std::string &name) |
| Remove attribute. | |
| void | set_weight_names (const std::vector< std::string > &names) |
| Set the names of the weights in this run. | |
| std::vector< ToolInfo > & | tools () |
| The vector of tools used to produce this run. | |
| const std::vector< ToolInfo > & | tools () const |
| The vector of tools used to produce this run. | |
| int | weight_index (const std::string &name) const |
| Return the index corresponding to a weight name. | |
| std::map< std::string, int > | weight_indices () const |
| Returns a copy of indices map. | |
| const std::vector< std::string > & | weight_names () const |
| Get the vector of weight names. | |
Methods to fill GenRunInfoData and to read it back | |
| void | write_data (GenRunInfoData &data) const |
| Fill GenRunInfoData object. | |
| void | read_data (const GenRunInfoData &data) |
| Fill GenRunInfo based on GenRunInfoData. | |
Stores run-related information.
Manages run-related information. Contains run-wide attributes
Definition at line 33 of file GenRunInfo.h.
| struct HepMC3::GenRunInfo::ToolInfo |
Interrnal struct for keeping track of tools.
Definition at line 38 of file GenRunInfo.h.
| Class Members | ||
|---|---|---|
| string | description | Other information about how the tool was used in the run. |
| string | name | The name of the tool. |
| string | version | The version of the tool. |
|
inline |
Default constructor.
Definition at line 54 of file GenRunInfo.h.
Referenced by GenRunInfo(), and operator=().
| HepMC3::GenRunInfo::GenRunInfo | ( | const GenRunInfo & | r | ) |
Copy constructor.
Definition at line 180 of file marley_hepmc3.cc.
References GenRunInfo(), read_data(), and write_data().
|
inline |
add an attribute This will overwrite existing attribute if an attribute with the same name is present
Definition at line 102 of file GenRunInfo.h.
Referenced by read_data().
| std::shared_ptr< T > HepMC3::GenRunInfo::attribute | ( | const std::string & | name | ) | const |
Get attribute of type T.
Definition at line 181 of file GenRunInfo.h.
Referenced by marley::EventFileReader::get_flux_averaged_xsec(), and marley::OutputFile::merge_reweight_provenance_weights().
| std::string HepMC3::GenRunInfo::attribute_as_string | ( | const std::string & | name | ) | const |
Get attribute of any type as string.
Definition at line 113 of file marley_hepmc3.cc.
Referenced by HepMC3::Print::line().
| std::vector< std::string > HepMC3::GenRunInfo::attribute_names | ( | ) | const |
Get list of attribute names.
Definition at line 150 of file marley_hepmc3.cc.
Referenced by HepMC3::Print::line().
|
inline |
Get a copy of the list of attributes.
Definition at line 126 of file GenRunInfo.h.
Referenced by HepMC3::Print::listing().
|
inline |
Check if a weight name is present.
Definition at line 72 of file GenRunInfo.h.
Referenced by set_weight_names().
| GenRunInfo & HepMC3::GenRunInfo::operator= | ( | const GenRunInfo & | r | ) |
Assignmet.
Definition at line 192 of file marley_hepmc3.cc.
References GenRunInfo(), read_data(), and write_data().
| void HepMC3::GenRunInfo::read_data | ( | const GenRunInfoData & | data | ) |
Fill GenRunInfo based on GenRunInfoData.
Definition at line 159 of file marley_hepmc3.cc.
References add_attribute(), HepMC3::GenRunInfoData::attribute_name, HepMC3::GenRunInfoData::attribute_string, HepMC3::GenRunInfo::ToolInfo::description, HepMC3::GenRunInfo::ToolInfo::name, set_weight_names(), HepMC3::GenRunInfoData::tool_description, HepMC3::GenRunInfoData::tool_name, HepMC3::GenRunInfoData::tool_version, tools(), HepMC3::GenRunInfo::ToolInfo::version, and HepMC3::GenRunInfoData::weight_names.
Referenced by GenRunInfo(), and operator=().
|
inline |
Remove attribute.
Definition at line 109 of file GenRunInfo.h.
| void HepMC3::GenRunInfo::set_weight_names | ( | const std::vector< std::string > & | names | ) |
Set the names of the weights in this run.
For consistency, the length of the vector should be the same as the number of weights in the events in the run.
Definition at line 93 of file marley_hepmc3.cc.
References has_weight().
Referenced by read_data().
|
inline |
The vector of tools used to produce this run.
Definition at line 67 of file GenRunInfo.h.
|
inline |
The vector of tools used to produce this run.
Definition at line 63 of file GenRunInfo.h.
Referenced by HepMC3::Print::line(), HepMC3::Print::listing(), read_data(), and write_data().
|
inline |
Return the index corresponding to a weight name.
Definition at line 83 of file GenRunInfo.h.
|
inline |
Returns a copy of indices map.
Definition at line 77 of file GenRunInfo.h.
|
inline |
Get the vector of weight names.
Definition at line 89 of file GenRunInfo.h.
Referenced by HepMC3::Print::listing(), and write_data().
| void HepMC3::GenRunInfo::write_data | ( | GenRunInfoData & | data | ) | const |
Fill GenRunInfoData object.
Definition at line 126 of file marley_hepmc3.cc.
References HepMC3::GenRunInfoData::attribute_name, HepMC3::GenRunInfoData::attribute_string, HepMC3::GenRunInfoData::tool_description, HepMC3::GenRunInfoData::tool_name, HepMC3::GenRunInfoData::tool_version, tools(), weight_names(), and HepMC3::GenRunInfoData::weight_names.
Referenced by GenRunInfo(), and operator=().