HepMC3 event record library
GenPdfInfo.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2021 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef HEPMC3_GENPDFINFO_H
7#define HEPMC3_GENPDFINFO_H
8/**
9 * @file GenPdfInfo.h
10 * @brief Definition of event attribute \b class GenPdfInfo
11 *
12 * @class HepMC3::GenPdfInfo
13 * @brief Stores additional information about PDFs
14 *
15 * This is an example of event attribute used to store PDF-related information
16 *
17 * @note Input parton flavour codes id1 & id2 are expected to obey the
18 * PDG code conventions, especially g = 21.
19 *
20 * @note The contents of pdf1 and pdf2 are expected to be x*f(x).
21 * The LHAPDF set ids are the entries in the first column of
22 * http:///projects.hepforge.org/lhapdf/PDFsets.index
23 *
24 * @ingroup attributes
25 *
26 */
27#include <iostream>
28#include "HepMC3/Attribute.h"
29
30namespace HepMC3 {
31
32class GenPdfInfo : public Attribute {
33
34//
35// Fields
36//
37public:
38 int parton_id[2]; ///< Parton PDG ID
39 int pdf_id[2]; ///< LHAPDF ID code
40 double scale; ///< Factorisation scale (in GEV)
41 double x[2]; ///< Parton momentum fraction
42 double xf[2]; ///< PDF value
43
44//
45// Functions
46//
47public:
48 /** @brief Implementation of Attribute::from_string */
49 bool from_string(const std::string &att) override;
50
51 /** @brief Implementation of Attribute::to_string */
52 bool to_string(std::string &att) const override;
53
54 /** @brief Set all fields */
55 void set( const int& parton_id1, const int& parton_id2, const double& x1, const double& x2,
56 const double& scale_in, const double& xf1, const double& xf2,
57 const int& pdf_id1 = 0, const int& pdf_id2 = 0 );
58
59 bool operator==( const GenPdfInfo& ) const; ///< Operator ==
60 bool operator!=( const GenPdfInfo& ) const; ///< Operator !=
61 bool is_valid() const; ///< Verify that the instance contains non-zero information
62};
63
64} // namespace HepMC3
65
66#endif
Definition of class Attribute, class IntAttribute and class StringAttribute.
Base attribute class.
Definition: Attribute.h:44
Stores additional information about PDFs.
Definition: GenPdfInfo.h:32
int parton_id[2]
Parton PDG ID.
Definition: GenPdfInfo.h:38
double xf[2]
PDF value.
Definition: GenPdfInfo.h:42
double scale
Factorisation scale (in GEV)
Definition: GenPdfInfo.h:40
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: GenPdfInfo.cc:70
int pdf_id[2]
LHAPDF ID code.
Definition: GenPdfInfo.h:39
bool is_valid() const
Verify that the instance contains non-zero information.
Definition: GenPdfInfo.cc:92
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: GenPdfInfo.cc:19
double x[2]
Parton momentum fraction.
Definition: GenPdfInfo.h:41
bool operator==(const GenPdfInfo &) const
Operator ==.
Definition: GenPdfInfo.cc:84
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: GenPdfInfo.cc:51
bool operator!=(const GenPdfInfo &) const
Operator !=.
Definition: GenPdfInfo.cc:88
HepMC3 main namespace.