HepMC event record
Public Member Functions | Data Fields | Protected Member Functions
GenCrossSection Class Reference

Detailed Description

Stores additional information about cross-section.

This is an example of event attribute used to store cross-section information

This class is meant to be used to pass, on an event by event basis, the current best guess of the total cross section. It is expected that the final cross section will be stored elsewhere.

The units of cross_section and cross_section_error are expected to be pb.

Examples:
basic_tree.cc, and HepMC3_fileIO_example.cc.

Definition at line 35 of file build/outputs/include/HepMC/GenCrossSection.h.

#include <GenCrossSection.h>

+ Inheritance diagram for GenCrossSection:
+ Collaboration diagram for GenCrossSection:

Public Member Functions

bool from_string (const string &att)
 Implementation of Attribute::from_string. More...
 
bool to_string (string &att) const
 Implementation of Attribute::to_string. More...
 
void set_cross_section (double xs, double xs_err, long n_acc=-1, long n_att=-1)
 Set all fields. More...
 
bool operator== (const GenCrossSection &) const
 Operator ==. More...
 
bool operator!= (const GenCrossSection &) const
 Operator !=. More...
 
bool is_valid () const
 Verify that the instance contains non-zero information. More...
 
bool from_string (const string &att)
 Implementation of Attribute::from_string. More...
 
bool to_string (string &att) const
 Implementation of Attribute::to_string. More...
 
void set_cross_section (double xs, double xs_err, long n_acc=-1, long n_att=-1)
 Set all fields. More...
 
bool operator== (const GenCrossSection &) const
 Operator ==. More...
 
bool operator!= (const GenCrossSection &) const
 Operator !=. More...
 
bool is_valid () const
 Verify that the instance contains non-zero information. More...
 
virtual bool init (const GenEvent &)
 Optionally initialize the attribute after from_string. More...
 
virtual bool init (const GenRunInfo &)
 Optionally initialize the attribute after from_string. More...
 
virtual bool init (const GenEvent &)
 Optionally initialize the attribute after from_string. More...
 
virtual bool init (const GenRunInfo &)
 Optionally initialize the attribute after from_string. More...
 
bool is_parsed ()
 Check if this attribute is parsed. More...
 
bool is_parsed ()
 Check if this attribute is parsed. More...
 
const string & unparsed_string () const
 Get unparsed string. More...
 
const string & unparsed_string () const
 Get unparsed string. More...
 

Data Fields

double cross_section
 Generated cross-section. More...
 
double cross_section_error
 Generated cross-section error. More...
 
long accepted_events
 The number of events generated so far. More...
 
long attempted_events
 The number of events attempted so far. More...
 

Protected Member Functions

void set_is_parsed (bool flag)
 Set is_parsed flag. More...
 
void set_is_parsed (bool flag)
 Set is_parsed flag. More...
 
void set_unparsed_string (const string &st)
 Set unparsed string. More...
 
void set_unparsed_string (const string &st)
 Set unparsed string. More...
 

Member Function Documentation

◆ from_string() [1/2]

bool from_string ( const string &  att)
virtual

◆ from_string() [2/2]

bool from_string ( const string &  att)
virtual

Implementation of Attribute::from_string.

Implements Attribute.

◆ init() [1/4]

virtual bool init ( const GenEvent )
inlinevirtualinherited

Optionally initialize the attribute after from_string.

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

Reimplemented in HEPEUPAttribute, and HEPEUPAttribute.

Definition at line 73 of file build/outputs/include/HepMC/Attribute.h.

◆ init() [2/4]

virtual bool init ( const GenEvent )
inlinevirtualinherited

Optionally initialize the attribute after from_string.

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

Reimplemented in HEPEUPAttribute, and HEPEUPAttribute.

Definition at line 73 of file include/HepMC/Attribute.h.

◆ init() [3/4]

virtual bool init ( const GenRunInfo )
inlinevirtualinherited

Optionally initialize the attribute after from_string.

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

Reimplemented in HEPEUPAttribute, and HEPEUPAttribute.

Definition at line 82 of file include/HepMC/Attribute.h.

◆ init() [4/4]

virtual bool init ( const GenRunInfo )
inlinevirtualinherited

Optionally initialize the attribute after from_string.

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

Reimplemented in HEPEUPAttribute, and HEPEUPAttribute.

Definition at line 82 of file build/outputs/include/HepMC/Attribute.h.

◆ is_parsed() [1/2]

bool is_parsed ( )
inlineinherited

Check if this attribute is parsed.

Definition at line 94 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ is_parsed() [2/2]

bool is_parsed ( )
inlineinherited

Check if this attribute is parsed.

Definition at line 94 of file include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ is_valid() [1/2]

bool is_valid ( ) const

Verify that the instance contains non-zero information.

◆ is_valid() [2/2]

bool is_valid ( ) const

Verify that the instance contains non-zero information.

Definition at line 57 of file GenCrossSection.cc.

References GenCrossSection::cross_section, and GenCrossSection::cross_section_error.

◆ operator!=() [1/2]

bool operator!= ( const GenCrossSection a) const

Operator !=.

Definition at line 53 of file GenCrossSection.cc.

◆ operator!=() [2/2]

bool operator!= ( const GenCrossSection ) const

Operator !=.

◆ operator==() [1/2]

bool operator== ( const GenCrossSection ) const

Operator ==.

◆ operator==() [2/2]

bool operator== ( const GenCrossSection a) const

Operator ==.

Definition at line 49 of file GenCrossSection.cc.

◆ set_cross_section() [1/2]

void set_cross_section ( double  xs,
double  xs_err,
long  n_acc = -1,
long  n_att = -1 
)
inline

◆ set_cross_section() [2/2]

void set_cross_section ( double  xs,
double  xs_err,
long  n_acc = -1,
long  n_att = -1 
)
inline

◆ set_is_parsed() [1/2]

void set_is_parsed ( bool  flag)
inlineprotectedinherited

Set is_parsed flag.

Definition at line 101 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ set_is_parsed() [2/2]

void set_is_parsed ( bool  flag)
inlineprotectedinherited

Set is_parsed flag.

Definition at line 101 of file include/HepMC/Attribute.h.

References Attribute::m_is_parsed.

◆ set_unparsed_string() [1/2]

void set_unparsed_string ( const string &  st)
inlineprotectedinherited

Set unparsed string.

Definition at line 104 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_string.

◆ set_unparsed_string() [2/2]

void set_unparsed_string ( const string &  st)
inlineprotectedinherited

Set unparsed string.

Definition at line 104 of file include/HepMC/Attribute.h.

References Attribute::m_string.

◆ to_string() [1/2]

bool to_string ( string &  att) const
virtual

Implementation of Attribute::to_string.

Implements Attribute.

◆ to_string() [2/2]

bool to_string ( string &  att) const
virtual

◆ unparsed_string() [1/2]

const string& unparsed_string ( ) const
inlineinherited

Get unparsed string.

Definition at line 97 of file build/outputs/include/HepMC/Attribute.h.

References Attribute::m_string.

◆ unparsed_string() [2/2]

const string& unparsed_string ( ) const
inlineinherited

Get unparsed string.

Definition at line 97 of file include/HepMC/Attribute.h.

References Attribute::m_string.

Field Documentation

◆ accepted_events

long accepted_events

The number of events generated so far.

Definition at line 44 of file build/outputs/include/HepMC/GenCrossSection.h.

◆ attempted_events

long attempted_events

The number of events attempted so far.

Definition at line 45 of file build/outputs/include/HepMC/GenCrossSection.h.

◆ cross_section

double cross_section

Generated cross-section.

Definition at line 42 of file build/outputs/include/HepMC/GenCrossSection.h.

◆ cross_section_error

double cross_section_error

Generated cross-section error.

Definition at line 43 of file build/outputs/include/HepMC/GenCrossSection.h.


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