Loading [MathJax]/extensions/tex2jax.js
hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.3.0
High energy resummation for hadron colliders
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
c
d
f
g
h
i
j
l
m
n
o
p
r
s
t
Variables
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
s
t
u
w
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Typedefs
Related Functions
Files
File List
File Members
All
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
include
HEJ
LesHouchesReader.hh
Go to the documentation of this file.
1
8
#pragma once
9
10
#include <string>
11
#include <numeric>
12
13
#include "LHEF/LHEF.h"
14
15
#include "
HEJ/EventReader.hh
"
16
#include "
HEJ/stream.hh
"
17
18
namespace
HEJ
{
19
21
class
LesHouchesReader
:
public
EventReader
{
22
public
:
24
explicit
LesHouchesReader
(std::string
const
& filename);
25
27
bool
read_event
()
override
;
28
30
std::string
const
&
header
()
const override
{
31
return
reader_.headerBlock;
32
}
33
35
LHEF::HEPRUP
const
&
heprup
()
const override
{
36
return
reader_.heprup;
37
}
38
40
LHEF::HEPEUP
const
&
hepeup
()
const override
{
41
return
reader_.hepeup;
42
}
43
44
std::optional<size_t>
number_events
()
const override
{
45
std::size_t start =
header
().rfind(
"Number of Events"
);
46
start =
header
().find_first_of(
"123456789"
, start);
47
if
(start == std::string::npos) {
48
return
{};
49
}
50
const
std::size_t end =
header
().find_first_not_of(
"0123456789"
, start);
51
return
std::stoi(
header
().substr(start, end - start));
52
}
53
54
double
scalefactor
()
const override
;
55
56
private
:
57
enum class
Generator{
58
HEJ
,
59
HEJFOG,
60
Sherpa,
61
MG,
62
unknown
63
};
64
65
bool
calculate_XSECUP() {
66
return
calculate_XSECUP_;
67
}
68
Generator get_generator(
69
LHEF::HEPRUP
const
&
heprup
, std::string
const
&
header
70
);
71
72
istream stream_;
73
LHEF::Reader reader_;
74
std::vector<size_t> num_trials_;
75
Generator generator_;
76
bool
calculate_XSECUP_;
77
};
78
79
}
// namespace HEJ
EventReader.hh
Header file for event reader interface.
HEJ::LesHouchesReader
Class for reading events from a file in the Les Houches Event File format.
Definition:
LesHouchesReader.hh:21
HEJ::LesHouchesReader::hepeup
LHEF::HEPEUP const & hepeup() const override
Access last read event.
Definition:
LesHouchesReader.hh:40
HEJ::LesHouchesReader::read_event
bool read_event() override
Read an event.
HEJ::LesHouchesReader::scalefactor
double scalefactor() const override
HEJ::LesHouchesReader::heprup
LHEF::HEPRUP const & heprup() const override
Access run information.
Definition:
LesHouchesReader.hh:35
HEJ::LesHouchesReader::LesHouchesReader
LesHouchesReader(std::string const &filename)
Contruct object reading from the given file.
HEJ::LesHouchesReader::number_events
std::optional< size_t > number_events() const override
Guess number of events from header.
Definition:
LesHouchesReader.hh:44
HEJ::LesHouchesReader::header
std::string const & header() const override
Access header text.
Definition:
LesHouchesReader.hh:30
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
stream.hh
Declares input streams.
HEJ::EventReader
Abstract base class for reading events from files.
Definition:
EventReader.hh:25
Generated by
1.9.1