Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:12

0001 // -*- C++ -*-
0002 //
0003 // This file is part of HepMC
0004 // Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
0005 //
0006 #ifndef HEPMC3_GENPDFINFO_H
0007 #define HEPMC3_GENPDFINFO_H
0008 /**
0009  *  @file GenPdfInfo.h
0010  *  @brief Definition of event attribute \b class GenPdfInfo
0011  *
0012  *  @class HepMC3::GenPdfInfo
0013  *  @brief Stores additional information about PDFs
0014  *
0015  *  This is an example of event attribute used to store PDF-related information
0016  *
0017  *  @note Input parton flavour codes id1 & id2 are expected to obey the
0018  *        PDG code conventions, especially g = 21.
0019  *
0020  *  @note The contents of pdf1 and pdf2 are expected to be x*f(x).
0021  *        The LHAPDF set ids are the entries in the first column of
0022  *        https://lhapdf.hepforge.org/pdfsets.html
0023  *
0024  *  @ingroup attributes
0025  *
0026  */
0027 #include <iostream>
0028 #include "HepMC3/Attribute.h"
0029 
0030 namespace HepMC3 {
0031 
0032 class GenPdfInfo : public Attribute {
0033 
0034 //
0035 // Fields
0036 //
0037 public:
0038     int    parton_id[2]; ///< Parton PDG ID
0039     int    pdf_id[2];    ///< LHAPDF ID code
0040     double scale;        ///< Factorisation scale (in GEV)
0041     double x[2];         ///< Parton momentum fraction
0042     double xf[2];        ///< PDF value
0043 
0044 //
0045 // Functions
0046 //
0047 public:
0048     /** @brief Implementation of Attribute::from_string */
0049     bool from_string(const std::string &att)  override;
0050 
0051     /** @brief Implementation of Attribute::to_string */
0052     bool to_string(std::string &att) const  override;
0053 
0054     /** @brief Set all fields */
0055     void set( const int& parton_id1, const int& parton_id2, const double& x1, const double& x2,
0056               const double& scale_in, const double& xf1, const double& xf2,
0057               const int& pdf_id1 = 0, const int& pdf_id2 = 0 );
0058 
0059     bool operator==( const GenPdfInfo& ) const; ///< Operator ==
0060     bool operator!=( const GenPdfInfo& ) const; ///< Operator !=
0061     bool is_valid()                      const; ///< Verify that the instance contains non-zero information
0062 };
0063 
0064 } // namespace HepMC3
0065 
0066 #endif