HepMC3 event record library: GenPdfInfo Class Reference

HepMC3 event record library

Public Member Functions | Data Fields | Protected Member Functions | Private Attributes
GenPdfInfo Class Reference

## Detailed Description

Stores additional information about PDFs.

This is an example of event attribute used to store PDF-related information

Note
  Input parton flavour codes id1 & id2 are expected to obey the PDG code conventions, especially g = 21.
  The contents of pdf1 and pdf2 are expected to be x*f(x). The LHAPDF set ids are the entries in the first column of https://lhapdf.hepforge.org/pdfsets.html

Examples
  HepMC3_fileIO_example.cc.

Definition at line 32 of file GenPdfInfo.h.

`#include <GenPdfInfo.h>`

Inheritance diagram for GenPdfInfo:
[legend]
Collaboration diagram for GenPdfInfo:
[legend]

## Public Member Functions
bool | from_string (const std::string &att) override
| Implementation of Attribute::from_string.
bool | to_string (std::string &att) const override
| Implementation of Attribute::to_string.
void | set (const int &parton_id1, const int &parton_id2, const double &x1, const double &x2, const double &scale_in, const double &xf1, const double &xf2, const int &pdf_id1=0, const int &pdf_id2=0)
| Set all fields.
bool | operator== (const GenPdfInfo &) const
| Operator ==.
bool | operator!= (const GenPdfInfo &) const
| Operator !=.
bool | is_valid () const
| Verify that the instance contains non-zero information.
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.
const std::string & | unparsed_string () const
| Get unparsed string.
const GenEvent * | event () const
GenParticlePtr | particle ()
ConstGenParticlePtr | particle () const
GenVertexPtr | vertex ()
ConstGenVertexPtr | vertex () const

## Data Fields
int | parton_id [2]
| Parton PDG ID.
int | pdf_id [2]
| LHAPDF ID code.
double | scale
| Factorisation scale (in GEV).
double | x [2]
| Parton momentum fraction.
double | xf [2]
| PDF value.

## Protected Member Functions
void | set_is_parsed (bool flag)
| Set is_parsed flag.
void | set_unparsed_string (const std::string &st)
| Set unparsed string.

## Private Attributes
bool | m_is_parsed
| Is this attribute parsed?
std::string | m_string
| Raw (unparsed) string.
const GenEvent * | m_event
GenParticlePtr | m_particle
| controlling GenEvent object.
GenVertexPtr | m_vertex
| Vertex to which assigned.

## Member Function Documentation

## ◆ event()

const GenEvent * event | ( |  | ) | const
| inlineinherited

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

Definition at line 108 of file Attribute.h.

References GenEvent, and m_event.

## ◆ from_string()

bool from_string | ( | const std::string & | att | ) |
| overridevirtual

Implementation of Attribute::from_string.

Implements Attribute.

Definition at line 20 of file GenPdfInfo.cc.

References parton_id, pdf_id, scale, x, and xf.

## ◆ init() [1/2]

virtual bool init | ( |  | ) |
| inlinevirtualinherited

Optionally initialize the attribute after from_string.

Reimplemented in HEPEUPAttribute.

Definition at line 81 of file Attribute.h.

## ◆ init() [2/2]

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.

Definition at line 90 of file Attribute.h.

## ◆ is_parsed()

bool is_parsed | ( |  | ) | const
| inlineinherited

Check if this attribute is parsed.

Definition at line 102 of file Attribute.h.

References m_is_parsed.

## ◆ is_valid()

bool is_valid | ( |  | ) | const

Verify that the instance contains non-zero information.

Definition at line 93 of file GenPdfInfo.cc.

References parton_id, pdf_id, scale, x, and xf.

## ◆ operator!=()

bool operator!= | ( | const GenPdfInfo & | a | ) | const

Operator !=.

Definition at line 89 of file GenPdfInfo.cc.

## ◆ operator==()

bool operator== | ( | const GenPdfInfo & | a | ) | const

Operator ==.

Definition at line 85 of file GenPdfInfo.cc.

## ◆ particle() [1/2]

GenParticlePtr particle | ( |  | ) |
| inlineinherited

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

Definition at line 113 of file Attribute.h.

References m_particle.

## ◆ particle() [2/2]

ConstGenParticlePtr particle | ( |  | ) | const
| inlineinherited

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

Definition at line 118 of file Attribute.h.

References m_particle.

## ◆ set()

void set | ( | const int & | parton_id1,
|  | const int & | parton_id2,
|  | const double & | x1,
|  | const double & | x2,
|  | const double & | scale_in,
|  | const double & | xf1,
|  | const double & | xf2,
|  | const int & | pdf_id1 = 0,
|  | const int & | pdf_id2 = 0 )

Set all fields.

Definition at line 71 of file GenPdfInfo.cc.

References parton_id, pdf_id, scale, x, and xf.

## ◆ set_is_parsed()

void set_is_parsed | ( | bool | flag | ) |
| inlineprotectedinherited

Set is_parsed flag.

Definition at line 134 of file Attribute.h.

References m_is_parsed.

## ◆ set_unparsed_string()

void set_unparsed_string | ( | const std::string & | st | ) |
| inlineprotectedinherited

Set unparsed string.

Definition at line 137 of file Attribute.h.

References m_string.

## ◆ to_string()

bool to_string | ( | std::string & | att | ) | const
| overridevirtual

Implementation of Attribute::to_string.

Implements Attribute.

Definition at line 52 of file GenPdfInfo.cc.

References parton_id, pdf_id, scale, x, and xf.

## ◆ unparsed_string()

const std::string & unparsed_string | ( |  | ) | const
| inlineinherited

Get unparsed string.

Definition at line 105 of file Attribute.h.

References m_string.

## ◆ vertex() [1/2]

GenVertexPtr vertex | ( |  | ) |
| inlineinherited

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

Definition at line 123 of file Attribute.h.

References m_vertex.

## ◆ vertex() [2/2]

ConstGenVertexPtr vertex | ( |  | ) | const
| inlineinherited

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

Definition at line 128 of file Attribute.h.

References m_vertex.

## Field Documentation

## ◆ m_event

const GenEvent* m_event
| privateinherited

Possibility to be aware of the

Definition at line 145 of file Attribute.h.

## ◆ m_is_parsed

bool m_is_parsed
| privateinherited

Is this attribute parsed?

Definition at line 143 of file Attribute.h.

## ◆ m_particle

GenParticlePtr m_particle
| privateinherited

controlling GenEvent object.

Particle to which assigned.

Definition at line 147 of file Attribute.h.

## ◆ m_string

std::string m_string
| privateinherited

Raw (unparsed) string.

Definition at line 144 of file Attribute.h.

## ◆ m_vertex

GenVertexPtr m_vertex
| privateinherited

Vertex to which assigned.

Definition at line 148 of file Attribute.h.

## ◆ parton_id

int parton_id[2]

Parton PDG ID.

Definition at line 38 of file GenPdfInfo.h.

## ◆ pdf_id

int pdf_id[2]

LHAPDF ID code.

Definition at line 39 of file GenPdfInfo.h.

## ◆ scale

double scale

Factorisation scale (in GEV).

Definition at line 40 of file GenPdfInfo.h.

## ◆ x

double x[2]

Parton momentum fraction.

Definition at line 41 of file GenPdfInfo.h.

## ◆ xf

double xf[2]

PDF value.

Definition at line 42 of file GenPdfInfo.h.

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

- GenPdfInfo.h
- GenPdfInfo.cc