Back to home page

EIC code displayed by LXR

 
 

    


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

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_LHEFATTRIBUTES_H
0007 #define HEPMC3_LHEFATTRIBUTES_H
0008 /**
0009  *  @file LHEFAttributes.h
0010  *  @brief Definition of \b class HEPRUPAttribute and \b class HEPEUAttribute
0011  *
0012  *  @ingroup attributes
0013  *
0014  */
0015 
0016 #include "HepMC3/Attribute.h"
0017 #include "LHEF.h"
0018 #include "FourVector.h"
0019 
0020 namespace HepMC3 {
0021 
0022 /**
0023  *  @class HepMC3::HEPRUPAttribute
0024  *  @brief Class for storing data for LHEF run information
0025  */
0026 class HEPRUPAttribute: public Attribute {
0027 
0028 public:
0029 
0030     /** @brief Default constructor */
0031     HEPRUPAttribute() {}
0032 
0033     /** @brief Constructor from string*/
0034     HEPRUPAttribute(std::string s): Attribute(s) {}
0035 
0036     /** @brief Virtual destructor */
0037     virtual ~HEPRUPAttribute() {
0038         clear();
0039     }
0040 
0041     //
0042     // Virtual Functions
0043     //
0044 public:
0045     /** @brief Fill class content from string */
0046     virtual bool from_string(const std::string &att) override;
0047 
0048     /** @brief Fill string from class content */
0049     virtual bool to_string(std::string &att) const override;
0050 
0051 public:
0052 
0053     /** @brief Clear this object. */
0054     void clear();
0055 
0056     /** @brief The actual HEPRUP object. */
0057     LHEF::HEPRUP heprup;
0058 
0059     /** @brief The parsed XML-tags. */
0060     std::vector<LHEF::XMLTag*> tags;
0061 
0062 };
0063 
0064 /**
0065  *  @class HepMC3::HEPEUPAttribute
0066  *  @brief Class for storing data for LHEF run information
0067  */
0068 class HEPEUPAttribute: public Attribute {
0069 
0070 public:
0071 
0072     /** @brief Default constructor */
0073     HEPEUPAttribute() {}
0074 
0075     /** @brief Constructor from string*/
0076     HEPEUPAttribute(std::string s): Attribute(s) {}
0077 
0078     /** @brief Virtual destructor */
0079     virtual ~HEPEUPAttribute() {
0080         clear();
0081     }
0082 
0083     //
0084     // Virtual Functions
0085     //
0086 public:
0087     /** @brief Fill class content from string */
0088     virtual bool from_string(const std::string &att)  override;
0089 
0090     /** @brief Parse the XML-tags. */
0091     virtual bool init() override;
0092 
0093     /** @brief Dummy function. */
0094     virtual bool init(const GenRunInfo & /*runinfo*/) override{
0095         return true;
0096     }
0097 
0098     /** @brief Fill string from class content */
0099     virtual bool to_string(std::string &att) const  override;
0100 
0101 public:
0102 
0103     /** @brief Get momentum */
0104     FourVector momentum(int i) const {
0105         return FourVector(hepeup.PUP[i][0], hepeup.PUP[i][1],
0106                           hepeup.PUP[i][2], hepeup.PUP[i][3]);
0107     }
0108 
0109     /** @brief Clear this object. */
0110     void clear();
0111 
0112     /** @brief The actual HEPEUP object. */
0113     LHEF::HEPEUP hepeup;
0114 
0115     /** @brief The parsed XML-tags. */
0116     std::vector<LHEF::XMLTag*> tags;
0117 
0118 
0119 };
0120 
0121 } // namespace HepMC3
0122 
0123 #endif
0124 
0125 
0126 
0127