HepMC event record
include/HepMC/GenPdfInfo.h
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2015 The HepMC collaboration (see AUTHORS for details)
5 //
6 #ifndef HEPMC_GENPDFINFO_H
7 #define HEPMC_GENPDFINFO_H
8 /**
9  * @file GenPdfInfo.h
10  * @brief Definition of event attribute \b class GenPdfInfo
11  *
12  * @class HepMC::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 "HepMC/Attribute.h"
29 
30 namespace HepMC {
31 
32 class GenPdfInfo : public Attribute {
33 
34 //
35 // Fields
36 //
37 public:
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 //
47 public:
48  /** @brief Implementation of Attribute::from_string */
49  bool from_string(const string &att);
50 
51  /** @brief Implementation of Attribute::to_string */
52  bool to_string(string &att) const;
53 
54  /** @brief Set all fields */
55  void set( int parton_id1, int parton_id2, double x1, double x2,
56  double scale_in, double xf1, double xf2,
57  int pdf_id1 = 0, 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 
65 #ifndef HEPMC_NO_DEPRECATED
66 typedef GenPdfInfo PdfInfo; ///< Backward compatibility typedef
67 #endif
68 
69 
70 } // namespace HepMC
71 
72 #endif
GenPdfInfo PdfInfo
Backward compatibility typedef.
bool to_string(string &att) const
Implementation of Attribute::to_string.
Definition: GenPdfInfo.cc:50
bool from_string(const string &att)
Implementation of Attribute::from_string.
Definition: GenPdfInfo.cc:18
bool operator!=(const GenPdfInfo &) const
Operator !=.
Definition: GenPdfInfo.cc:87
double scale
Factorisation scale (in GEV)
bool is_valid() const
Verify that the instance contains non-zero information.
Definition: GenPdfInfo.cc:91
double x[2]
Parton momentum fraction.
bool operator==(const GenPdfInfo &) const
Operator ==.
Definition: GenPdfInfo.cc:83
Definition of template class SmartPointer.