a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
LhefEvent.hpp
Go to the documentation of this file.
1/*
2 * LhefEvent.hpp
3 *
4 * Created on: Jan 26, 2012
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2012 Ben O'Leary
7 *
8 * This file is part of LesHouchesParserClasses, released under the
9 * GNU General Public License. Please see the accompanying
10 * README.LHPC_CPP.txt file for a full list of files, brief documentation
11 * on how to use these classes, and further details on the license.
12 */
13
14#ifndef LHEFEVENT_HPP_
15#define LHEFEVENT_HPP_
16
17#include <iostream>
18#include "ParticleLine.hpp"
20
21namespace LHPC
22{
23 namespace LHEF
24 {
25 // this class is for holding several ParticleLine instances together with
26 // some ints and doubles to describe a complete LHEF-format event.
28 {
29 public:
30 LhefEvent( bool const isVerbose );
31 LhefEvent( LhefEvent const& copySource );
32 ~LhefEvent();
33
34 int
36 int
37 NUP() const{ return getNumberOfParticles(); }
38 int
39 getEventId() const;
40 int
41 IDPRUP() const{ return getEventId(); }
42 double
43 getEventWeight() const;
44 double
45 XWGTUP() const{ return getEventWeight(); }
46 double
47 getEventScale() const;
48 double
49 SCALUP() const{ return getEventScale(); }
50 double
51 getAlphaQed() const;
52 double
53 AQEDUP() const{ return getAlphaQed(); }
54 double
55 getAlphaQcd() const;
56 double
57 AQCDUP() const{ return getAlphaQcd(); }
58 ParticleLine const&
59 getLine( int const whichLine ) const;
60 ParticleLine const&
61 operator[]( int const whichLine ) const{ return getLine( whichLine ); }
62 int
64 std::string const&
65 getAsString() const;
66 std::string const
67 getAsStringWithTags() const;
68 std::string const&
70
71 // stuff for setting up the LhefEvent:
72 bool
73 recordEvent( std::string const& eventAsString );
74 /* this interprets a string as the data it is meant to correspond to, &
75 * ensures that the ParticleLine instances correctly point to each other.
76 * if any of the lines had the wrong number of data entries, or if the
77 * header number of particles didn't correspond to the number of
78 * particle lines, setAsInvalid() is called & then false is returned.
79 * true is returned if all the entries were filled as expected.
80 */
81
82
83 protected:
84 static std::string const trimmingChars;
85 static bool const trueForVerbosity;
86
87 // in the order in which they appear in LHE format:
88 // 1st line of the event:
90 // NUP, the number of particles listed in the event.
92 // IDPRUP, which is not actually defined in hep-ph/0609017...
94 // XWGTUP, the weight of the event.
95 double eventScale;
96 // SCALUP, the energy scale of the event, in GeV.
97 double alphaQed;
98 // AQEDUP, the value of the electromagnetic alpha at eventScale.
99 double alphaQcd;
100 // AQCDUP, the value of the color force alpha at eventScale.
101
102 // then numberOfParticles lines, each of which are stored in a
103 // ParticleLine:
105
107 // this isn't specified as part of the LHEF format, but it's probably
108 // useful.
109
110 // stuff for setting up the LhefEvent:
114 std::string headerLine;
118 bool const isVerbose;
119 std::string eventAsString;
121
122 void
123 setAsInvalid();
124 // this sets every entry in the header line to
125 // BOL::UsefulStuff::notANumber & clears particleLines.
126 void
128 // this sets up the mother & daughter pointers for each ParticleLine in
129 // particleLines.
130 };
131
132
133
134
135
136 inline int
138 {
139 return numberOfParticles;
140 }
141
142 inline int
144 {
145 return eventId;
146 }
147
148 inline double
150 {
151 return eventId;
152 }
153
154 inline double
156 {
157 return eventScale;
158 }
159
160 inline double
162 {
163 return alphaQed;
164 }
165
166 inline double
168 {
169 return alphaQcd;
170 }
171
172 inline ParticleLine const&
173 LhefEvent::getLine( int const whichLine ) const
174 {
175 return particleLines[ whichLine - 1 ];
176 }
177
178 inline int
180 {
181 return eventNumberInFile;
182 }
183
184 inline std::string const&
186 {
187 return eventAsString;
188 }
189
190 inline std::string const
192 {
193 std::string returnString( "<event>\n" );
194 returnString.append( eventAsString );
195 returnString.append( "\n</event>" );
196 return returnString;
197 }
198
199 inline std::string const&
201 {
202 return optionalInformation;
203 }
204
205 inline void
207 // this sets every entry in the header line to
208 // BOL::UsefulStuff::notANumber & clears particleLines.
209 {
210 particleLines.clearEntries();
217
218 std::cout
219 << std::endl
220 << "LHPC::warning! the following string could not be parsed as a valid"
221 << " LHEF event:";
222 std::cout << std::endl << eventAsString;
223 std::cout << std::endl;
224 }
225
226 }
227
228}
229
230#endif /* LHEFEVENT_HPP_ */
static double const notANumber
Definition: UsefulStuff.hpp:28
int getEventId() const
Definition: LhefEvent.hpp:143
double getEventScale() const
Definition: LhefEvent.hpp:155
std::string eventAsString
Definition: LhefEvent.hpp:119
double AQCDUP() const
Definition: LhefEvent.hpp:57
std::string const & getOptionalInformation() const
Definition: LhefEvent.hpp:200
double getAlphaQcd() const
Definition: LhefEvent.hpp:167
ParticleLine * secondaryMotherLinePointer
Definition: LhefEvent.hpp:117
BOL::VectorlikeArray< ParticleLine > particleLines
Definition: LhefEvent.hpp:104
std::string const getAsStringWithTags() const
Definition: LhefEvent.hpp:191
void setUpPointersBetweenParticleLines()
Definition: LhefEvent.cpp:247
ParticleLine const & getLine(int const whichLine) const
Definition: LhefEvent.hpp:173
double getEventWeight() const
Definition: LhefEvent.hpp:149
BOL::VectorlikeArray< std::string > eventAsLines
Definition: LhefEvent.hpp:111
int getNumberOfParticles() const
Definition: LhefEvent.hpp:137
bool recordEvent(std::string const &eventAsString)
Definition: LhefEvent.cpp:81
std::string headerLine
Definition: LhefEvent.hpp:114
std::string optionalInformation
Definition: LhefEvent.hpp:120
LhefEvent(bool const isVerbose)
Definition: LhefEvent.cpp:23
int IDPRUP() const
Definition: LhefEvent.hpp:41
static bool const trueForVerbosity
Definition: LhefEvent.hpp:85
double XWGTUP() const
Definition: LhefEvent.hpp:45
double getAlphaQed() const
Definition: LhefEvent.hpp:161
int getEventNumberInFile() const
Definition: LhefEvent.hpp:179
static std::string const trimmingChars
Definition: LhefEvent.hpp:84
ParticleLine * primaryMotherLinePointer
Definition: LhefEvent.hpp:116
ParticleLine const & operator[](int const whichLine) const
Definition: LhefEvent.hpp:61
std::string const & getAsString() const
Definition: LhefEvent.hpp:185
double SCALUP() const
Definition: LhefEvent.hpp:49
BOL::VectorlikeArray< std::string > lineAsNumbersAsStrings
Definition: LhefEvent.hpp:112
double AQEDUP() const
Definition: LhefEvent.hpp:53