MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
HepMC3::IntAttribute Class Reference

Attribute that holds an Integer implemented as an int. More...

#include <Attribute.h>

Inheritance diagram for HepMC3::IntAttribute:
HepMC3::Attribute

Public Member Functions

 IntAttribute ()
 Default constructor.
 
 IntAttribute (int val)
 Constructor initializing attribute value.
 
bool from_string (const std::string &att) override
 Implementation of Attribute::from_string.
 
void set_value (const int &i)
 set the value associated to this Attribute.
 
bool to_string (std::string &att) const override
 Implementation of Attribute::to_string.
 
int value () const
 get the value associated to this Attribute.
 
- Public Member Functions inherited from HepMC3::Attribute
 Attribute ()
 Default constructor.
 
virtual ~Attribute ()
 Virtual destructor.
 
const GenEventevent () const
 
virtual bool init ()
 Optionally initialize the attribute after from_string.
 
virtual bool init (const GenRunInfo &)
 Optionally initialize the attribute after from_string.
 
bool is_parsed () const
 Check if this attribute is parsed.
 
GenParticlePtr particle ()
 
ConstGenParticlePtr particle () const
 
const std::string & unparsed_string () const
 Get unparsed string.
 
GenVertexPtr vertex ()
 
ConstGenVertexPtr vertex () const
 

Additional Inherited Members

- Protected Member Functions inherited from HepMC3::Attribute
 Attribute (const std::string &st)
 Protected constructor that allows to set string.
 
void set_is_parsed (bool flag)
 Set is_parsed flag.
 
void set_unparsed_string (const std::string &st)
 Set unparsed string.
 

Detailed Description

Attribute that holds an Integer implemented as an int.

Definition at line 157 of file Attribute.h.

Constructor & Destructor Documentation

◆ IntAttribute() [1/2]

HepMC3::IntAttribute::IntAttribute ( )
inline

Default constructor.

Definition at line 161 of file Attribute.h.

161:Attribute(),m_val(0) {}
Attribute()
Default constructor.
Definition Attribute.h:51

References HepMC3::Attribute::Attribute().

◆ IntAttribute() [2/2]

HepMC3::IntAttribute::IntAttribute ( int val)
inline

Constructor initializing attribute value.

Definition at line 164 of file Attribute.h.

164:Attribute(),m_val(val) {}

References HepMC3::Attribute::Attribute().

Member Function Documentation

◆ from_string()

bool HepMC3::IntAttribute::from_string ( const std::string & att)
inlineoverridevirtual

Implementation of Attribute::from_string.

Implements HepMC3::Attribute.

Definition at line 167 of file Attribute.h.

167 {
168 m_val = atoi( att.c_str() );
169 set_is_parsed(true);
170 return true;
171 }
void set_is_parsed(bool flag)
Set is_parsed flag.
Definition Attribute.h:134

References HepMC3::Attribute::set_is_parsed().

◆ set_value()

void HepMC3::IntAttribute::set_value ( const int & i)
inline

set the value associated to this Attribute.

Definition at line 185 of file Attribute.h.

185 {
186 m_val = i;
187 set_is_parsed(true);
188 }

References HepMC3::Attribute::set_is_parsed().

◆ to_string()

bool HepMC3::IntAttribute::to_string ( std::string & att) const
inlineoverridevirtual

Implementation of Attribute::to_string.

Implements HepMC3::Attribute.

Definition at line 174 of file Attribute.h.

174 {
175 att = std::to_string(m_val);
176 return true;
177 }

◆ value()

int HepMC3::IntAttribute::value ( ) const
inline

get the value associated to this Attribute.

Definition at line 180 of file Attribute.h.

180 {
181 return m_val;
182 }

Referenced by marley::CommandHandler::cmd_reweight(), marley::OutputFile::merge_reweight_provenance_weights(), and marley::OMPWeightCalculator::weight().


The documentation for this class was generated from the following file: