10#ifndef HEPMC3_GENRUNINFO_H
11#define HEPMC3_GENRUNINFO_H
62 const std::vector<ToolInfo> &
tools()
const {
66 std::vector<ToolInfo> &
tools() {
97 const shared_ptr<Attribute> &att) {
110 shared_ptr<T>
attribute(
const string &name)
const;
120 std::map< std::string, shared_ptr<Attribute> >
attributes()
const {
138 void Streamer(TBuffer &b);
147#if !defined(__CINT__)
168#if !defined(__CINT__)
177 std::map< std::string, shared_ptr<Attribute> >::iterator i =
181 if( !i->second->is_parsed() ) {
183 shared_ptr<T> att = make_shared<T>();
184 if ( att->from_string(i->second->unparsed_string()) &&
192 return shared_ptr<T>();
194 else return dynamic_pointer_cast<T>(i->second);
Definition of class Attribute, class IntAttribute and class StringAttribute.
Definition of class Units.
Stores run-related information.
std::recursive_mutex m_lock_attributes
Mutex lock for the m_attibutes map.
GenRunInfo & operator=(const GenRunInfo &r)
Assignmet.
std::map< std::string, shared_ptr< Attribute > > m_attributes
Map of attributes.
std::map< std::string, int > m_weight_indices
A map of weight names mapping to indices.
std::vector< ToolInfo > m_tools
The vector of tools used to produce this run.
shared_ptr< T > attribute(const string &name) const
Get attribute of type T.
void remove_attribute(const string &name)
Remove attribute.
string attribute_as_string(const string &name) const
Get attribute of any type as string.
std::vector< ToolInfo > & tools()
The vector of tools used to produce this run.
std::vector< string > attribute_names() const
Get list of attribute names.
void add_attribute(const string &name, const shared_ptr< Attribute > &att)
add an attribute This will overwrite existing attribute if an attribute with the same name is present
std::vector< std::string > m_weight_names
A vector of weight names.
void read_data(const GenRunInfoData &data)
Fill GenRunInfo based on GenRunInfoData.
GenRunInfo()
Default constructor.
const std::vector< std::string > & weight_names() const
Get the vector of weight names.
void write_data(GenRunInfoData &data) const
Fill GenRunInfoData object.
bool has_weight(const string &name) const
Check if a weight name is present.
const std::vector< ToolInfo > & tools() const
The vector of tools used to produce this run.
void set_weight_names(const std::vector< std::string > &names)
Set the names of the weights in this run.
std::map< std::string, shared_ptr< Attribute > > attributes() const
Get a copy of the list of attributes.
int weight_index(const string &name) const
Return the index corresponding to a weight name.
Stores serializable run information.