Debian Codegraph @

include/HepMC3/LHEFAttributes.h

raw
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5 //
6 #ifndef HEPMC3_LHEFATTRIBUTES_H
7 #define HEPMC3_LHEFATTRIBUTES_H
8 /**
9 * @file LHEFAttributes.h
10 * @brief Definition of \b class HEPRUPAttribute and \b class HEPEUAttribute
11 *
12 * @ingroup attributes
13 *
14 */
15
16 #include "HepMC3/Attribute.h"
17 #include "LHEF.h"
18 #include "FourVector.h"
19
20 namespace HepMC3 {
21
22 /**
23 * @class HepMC3::HEPRUPAttribute
24 * @brief Class for storing data for LHEF run information
25 */
26 class HEPRUPAttribute: public Attribute {
27
28 public:
29
30 /** @brief Default constructor */
31 HEPRUPAttribute() {}
32
33 /** @brief Constructor from string*/
34 HEPRUPAttribute(std::string s): Attribute(s) {}
35
36 /** @brief Virtual destructor */
37 virtual ~HEPRUPAttribute() {
38 clear();
39 }
40
41 //
42 // Virtual Functions
43 //
44 public:
45 /** @brief Fill class content from string */
46 virtual bool from_string(const string &att);
47
48 /** @brief Fill string from class content */
49 virtual bool to_string(string &att) const;
50
51 public:
52
53 /** @brief Clear this object. */
54 void clear();
55
56 /** @brief The actual HEPRUP object. */
57 LHEF::HEPRUP heprup;
58
59 /** @brief The parsed XML-tags. */
60 std::vector<LHEF::XMLTag*> tags;
61
62 };
63
64 /**
65 * @class HepMC3::HEPEUPAttribute
66 * @brief Class for storing data for LHEF run information
67 */
68 class HEPEUPAttribute: public Attribute {
69
70 public:
71
72 /** @brief Default constructor */
73 HEPEUPAttribute() {}
74
75 /** @brief Constructor from string*/
76 HEPEUPAttribute(std::string s): Attribute(s) {}
77
78 /** @brief Virtual destructor */
79 virtual ~HEPEUPAttribute() {
80 clear();
81 }
82
83 //
84 // Virtual Functions
85 //
86 public:
87 /** @brief Fill class content from string */
88 virtual bool from_string(const string &att);
89
90 /** @brief Parse the XML-tags. */
91 virtual bool init();
92
93 /** @brief Dummy function. */
94 virtual bool init(const GenRunInfo & /*runinfo*/) {
95 return true;
96 }
97
98 /** @brief Fill string from class content */
99 virtual bool to_string(string &att) const;
100
101 public:
102
103 /** @brief Get momentum */
104 FourVector momentum(int i) const {
105 return FourVector(hepeup.PUP[i][0], hepeup.PUP[i][1],
106 hepeup.PUP[i][2], hepeup.PUP[i][3]);
107 }
108
109 /** @brief Clear this object. */
110 void clear();
111
112 /** @brief The actual HEPEUP object. */
113 LHEF::HEPEUP hepeup;
114
115 /** @brief The parsed XML-tags. */
116 std::vector<LHEF::XMLTag*> tags;
117
118
119 };
120
121 } // namespace HepMC3
122
123 #endif
124
125
126
127