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::Attribute Class Referenceabstract

Base attribute class. More...

#include <Attribute.h>

Inheritance diagram for HepMC3::Attribute:
HepMC3::BoolAttribute HepMC3::CharAttribute HepMC3::DoubleAttribute HepMC3::FloatAttribute HepMC3::GenCrossSection HepMC3::GenHeavyIon HepMC3::GenPdfInfo HepMC3::IntAttribute HepMC3::LongAttribute HepMC3::LongDoubleAttribute HepMC3::LongLongAttribute HepMC3::StringAttribute HepMC3::UIntAttribute HepMC3::ULongAttribute HepMC3::ULongLongAttribute HepMC3::VectorCharAttribute HepMC3::VectorDoubleAttribute HepMC3::VectorFloatAttribute HepMC3::VectorIntAttribute HepMC3::VectorLongDoubleAttribute HepMC3::VectorLongIntAttribute HepMC3::VectorLongLongAttribute HepMC3::VectorStringAttribute HepMC3::VectorUIntAttribute HepMC3::VectorULongAttribute HepMC3::VectorULongLongAttribute

Public Member Functions

 Attribute ()
 Default constructor.
 
virtual ~Attribute ()
 Virtual destructor.
 
const GenEventevent () const
 
virtual bool from_string (const std::string &att)=0
 Fill class content from string.
 
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
 
virtual bool to_string (std::string &att) const =0
 Fill string from class content.
 
const std::string & unparsed_string () const
 Get unparsed string.
 
GenVertexPtr vertex ()
 
ConstGenVertexPtr vertex () const
 

Protected Member Functions

 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.
 

Friends

class GenEvent
 GenEvent is a friend.
 

Detailed Description

Base attribute class.

Base class for all attributes.

Contains virtual functions to_string and from_string that each attribute must implement, as well as init function that attributes should overload to initialize parsed attribute

Definition at line 44 of file Attribute.h.

Constructor & Destructor Documentation

◆ Attribute() [1/2]

HepMC3::Attribute::Attribute ( )
inline

Default constructor.

Definition at line 51 of file Attribute.h.

51:m_is_parsed(true) { m_event=nullptr; }

Referenced by HepMC3::BoolAttribute::BoolAttribute(), HepMC3::BoolAttribute::BoolAttribute(), HepMC3::CharAttribute::CharAttribute(), HepMC3::CharAttribute::CharAttribute(), HepMC3::DoubleAttribute::DoubleAttribute(), HepMC3::DoubleAttribute::DoubleAttribute(), HepMC3::FloatAttribute::FloatAttribute(), HepMC3::FloatAttribute::FloatAttribute(), HepMC3::IntAttribute::IntAttribute(), HepMC3::IntAttribute::IntAttribute(), HepMC3::LongAttribute::LongAttribute(), HepMC3::LongAttribute::LongAttribute(), HepMC3::LongDoubleAttribute::LongDoubleAttribute(), HepMC3::LongDoubleAttribute::LongDoubleAttribute(), HepMC3::LongLongAttribute::LongLongAttribute(), HepMC3::LongLongAttribute::LongLongAttribute(), HepMC3::StringAttribute::StringAttribute(), HepMC3::StringAttribute::StringAttribute(), HepMC3::UIntAttribute::UIntAttribute(), HepMC3::UIntAttribute::UIntAttribute(), HepMC3::ULongAttribute::ULongAttribute(), HepMC3::ULongAttribute::ULongAttribute(), HepMC3::ULongLongAttribute::ULongLongAttribute(), HepMC3::ULongLongAttribute::ULongLongAttribute(), HepMC3::VectorCharAttribute::VectorCharAttribute(), HepMC3::VectorCharAttribute::VectorCharAttribute(), HepMC3::VectorDoubleAttribute::VectorDoubleAttribute(), HepMC3::VectorDoubleAttribute::VectorDoubleAttribute(), HepMC3::VectorFloatAttribute::VectorFloatAttribute(), HepMC3::VectorFloatAttribute::VectorFloatAttribute(), HepMC3::VectorIntAttribute::VectorIntAttribute(), HepMC3::VectorIntAttribute::VectorIntAttribute(), HepMC3::VectorLongDoubleAttribute::VectorLongDoubleAttribute(), HepMC3::VectorLongDoubleAttribute::VectorLongDoubleAttribute(), HepMC3::VectorLongIntAttribute::VectorLongIntAttribute(), HepMC3::VectorLongIntAttribute::VectorLongIntAttribute(), HepMC3::VectorLongLongAttribute::VectorLongLongAttribute(), HepMC3::VectorLongLongAttribute::VectorLongLongAttribute(), HepMC3::VectorStringAttribute::VectorStringAttribute(), HepMC3::VectorStringAttribute::VectorStringAttribute(), HepMC3::VectorUIntAttribute::VectorUIntAttribute(), HepMC3::VectorUIntAttribute::VectorUIntAttribute(), HepMC3::VectorULongAttribute::VectorULongAttribute(), HepMC3::VectorULongAttribute::VectorULongAttribute(), HepMC3::VectorULongLongAttribute::VectorULongLongAttribute(), and HepMC3::VectorULongLongAttribute::VectorULongLongAttribute().

◆ ~Attribute()

virtual HepMC3::Attribute::~Attribute ( )
inlinevirtual

Virtual destructor.

Definition at line 54 of file Attribute.h.

54{}

◆ Attribute() [2/2]

HepMC3::Attribute::Attribute ( const std::string & st)
inlineexplicitprotected

Protected constructor that allows to set string.

Used when parsing attributes from file. An StringAttribute class object is made, which uses this constructor to signify that it just holds string without parsing it.

Note
There should be no need for user class to ever use this constructor

Definition at line 66 of file Attribute.h.

66:m_is_parsed(false),m_string(st) { m_event=nullptr; }

Member Function Documentation

◆ event()

const GenEvent * HepMC3::Attribute::event ( ) const
inline

return the GenEvent to which this Attribute belongs, if at all.

Definition at line 108 of file Attribute.h.

108 {
109 return m_event;
110 }

References GenEvent.

◆ from_string()

◆ init() [1/2]

virtual bool HepMC3::Attribute::init ( )
inlinevirtual

Optionally initialize the attribute after from_string.

Definition at line 81 of file Attribute.h.

81 {
82 return true;
83 }

◆ init() [2/2]

virtual bool HepMC3::Attribute::init ( const GenRunInfo & )
inlinevirtual

Optionally initialize the attribute after from_string.

Is passed a reference to the GenRunInfo object to which the Attribute belongs.

Definition at line 90 of file Attribute.h.

90 {
91 return true;
92 }

◆ is_parsed()

bool HepMC3::Attribute::is_parsed ( ) const
inline

Check if this attribute is parsed.

Definition at line 102 of file Attribute.h.

102{ return m_is_parsed; }

◆ particle() [1/2]

GenParticlePtr HepMC3::Attribute::particle ( )
inline

return the GenParticle to which this Attribute belongs, if at all.

Definition at line 113 of file Attribute.h.

113 {
114 return m_particle;
115 }

◆ particle() [2/2]

ConstGenParticlePtr HepMC3::Attribute::particle ( ) const
inline

return the GenParticle to which this Attribute belongs, if at all.

Definition at line 118 of file Attribute.h.

118 {
119 return std::const_pointer_cast<GenParticle>(m_particle);
120 }

◆ set_is_parsed()

void HepMC3::Attribute::set_is_parsed ( bool flag)
inlineprotected

Set is_parsed flag.

Definition at line 134 of file Attribute.h.

134{ m_is_parsed = flag; }

Referenced by HepMC3::BoolAttribute::from_string(), HepMC3::CharAttribute::from_string(), HepMC3::DoubleAttribute::from_string(), HepMC3::FloatAttribute::from_string(), HepMC3::IntAttribute::from_string(), HepMC3::LongAttribute::from_string(), HepMC3::LongDoubleAttribute::from_string(), HepMC3::LongLongAttribute::from_string(), HepMC3::UIntAttribute::from_string(), HepMC3::ULongAttribute::from_string(), HepMC3::ULongLongAttribute::from_string(), HepMC3::VectorCharAttribute::from_string(), HepMC3::VectorDoubleAttribute::from_string(), HepMC3::VectorFloatAttribute::from_string(), HepMC3::VectorIntAttribute::from_string(), HepMC3::VectorLongDoubleAttribute::from_string(), HepMC3::VectorLongIntAttribute::from_string(), HepMC3::VectorLongLongAttribute::from_string(), HepMC3::VectorStringAttribute::from_string(), HepMC3::VectorUIntAttribute::from_string(), HepMC3::VectorULongAttribute::from_string(), HepMC3::VectorULongLongAttribute::from_string(), HepMC3::BoolAttribute::set_value(), HepMC3::CharAttribute::set_value(), HepMC3::DoubleAttribute::set_value(), HepMC3::FloatAttribute::set_value(), HepMC3::IntAttribute::set_value(), HepMC3::LongAttribute::set_value(), HepMC3::LongDoubleAttribute::set_value(), HepMC3::LongLongAttribute::set_value(), HepMC3::UIntAttribute::set_value(), HepMC3::ULongAttribute::set_value(), HepMC3::ULongLongAttribute::set_value(), HepMC3::VectorCharAttribute::set_value(), HepMC3::VectorDoubleAttribute::set_value(), HepMC3::VectorFloatAttribute::set_value(), HepMC3::VectorIntAttribute::set_value(), HepMC3::VectorLongDoubleAttribute::set_value(), HepMC3::VectorLongIntAttribute::set_value(), HepMC3::VectorLongLongAttribute::set_value(), HepMC3::VectorStringAttribute::set_value(), HepMC3::VectorUIntAttribute::set_value(), HepMC3::VectorULongAttribute::set_value(), and HepMC3::VectorULongLongAttribute::set_value().

◆ set_unparsed_string()

void HepMC3::Attribute::set_unparsed_string ( const std::string & st)
inlineprotected

Set unparsed string.

Definition at line 137 of file Attribute.h.

137{ m_string = st; }

Referenced by HepMC3::StringAttribute::from_string(), and HepMC3::StringAttribute::set_value().

◆ to_string()

◆ unparsed_string()

const std::string & HepMC3::Attribute::unparsed_string ( ) const
inline

Get unparsed string.

Definition at line 105 of file Attribute.h.

105{ return m_string; }

Referenced by HepMC3::StringAttribute::to_string(), and HepMC3::StringAttribute::value().

◆ vertex() [1/2]

GenVertexPtr HepMC3::Attribute::vertex ( )
inline

return the GenVertex to which this Attribute belongs, if at all.

Definition at line 123 of file Attribute.h.

123 {
124 return m_vertex;
125 }

◆ vertex() [2/2]

ConstGenVertexPtr HepMC3::Attribute::vertex ( ) const
inline

return the GenVertex to which this Attribute belongs, if at all.

Definition at line 128 of file Attribute.h.

128 {
129 return std::const_pointer_cast<GenVertex>(m_vertex);
130 }

Friends And Related Symbol Documentation

◆ GenEvent

friend class GenEvent
friend

GenEvent is a friend.

Definition at line 69 of file Attribute.h.

References GenEvent.

Referenced by event(), and GenEvent.


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