hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.1.4
High energy resummation for hadron colliders
Loading...
Searching...
No Matches
include
HEJ
LesHouchesReader.hh
Go to the documentation of this file.
1
8
#pragma once
9
10
#include <string>
11
12
#include "LHEF/LHEF.h"
13
14
#include "
HEJ/EventReader.hh
"
15
#include "
HEJ/stream.hh
"
16
17
namespace
HEJ
{
18
20
class
LesHouchesReader
:
public
EventReader
{
21
public
:
23
explicit
LesHouchesReader
(std::string
const
& filename):
24
stream_{filename},
25
reader_{stream_}
26
{
27
// always use the newest LHE version
28
reader_.heprup.version = LHEF::HEPRUP().version;
29
}
30
32
bool
read_event
()
override
{
33
return
reader_.readEvent();
34
}
35
37
std::string
const
&
header
()
const override
{
38
return
reader_.headerBlock;
39
}
40
42
LHEF::HEPRUP
const
&
heprup
()
const override
{
43
return
reader_.heprup;
44
}
45
47
LHEF::HEPEUP
const
&
hepeup
()
const override
{
48
return
reader_.hepeup;
49
}
50
51
private
:
52
istream
stream_;
53
LHEF::Reader reader_;
54
55
protected
:
57
LHEF::Reader &
reader
(){
58
return
reader_;
59
}
60
};
61
69
class
SherpaLHEReader
:
public
LesHouchesReader
{
70
public
:
72
explicit
SherpaLHEReader
(std::string
const
& filename);
73
74
bool
read_event
()
override
;
75
76
optional<size_t>
number_events
()
const override
{
77
return
num_events_;
78
}
79
80
private
:
81
double
num_trials_;
82
size_t
num_events_;
83
};
84
85
}
// 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:20
HEJ::LesHouchesReader::hepeup
LHEF::HEPEUP const & hepeup() const override
Access last read event.
Definition:
LesHouchesReader.hh:47
HEJ::LesHouchesReader::read_event
bool read_event() override
Read an event.
Definition:
LesHouchesReader.hh:32
HEJ::LesHouchesReader::reader
LHEF::Reader & reader()
Underlying reader.
Definition:
LesHouchesReader.hh:57
HEJ::LesHouchesReader::heprup
LHEF::HEPRUP const & heprup() const override
Access run information.
Definition:
LesHouchesReader.hh:42
HEJ::LesHouchesReader::LesHouchesReader
LesHouchesReader(std::string const &filename)
Contruct object reading from the given file.
Definition:
LesHouchesReader.hh:23
HEJ::LesHouchesReader::header
std::string const & header() const override
Access header text.
Definition:
LesHouchesReader.hh:37
HEJ::SherpaLHEReader
Les Houches Event file reader for LHE files created by Sherpa.
Definition:
LesHouchesReader.hh:69
HEJ::SherpaLHEReader::number_events
optional< size_t > number_events() const override
Guess number of events from header.
Definition:
LesHouchesReader.hh:76
HEJ::SherpaLHEReader::read_event
bool read_event() override
Read an event.
HEJ::SherpaLHEReader::SherpaLHEReader
SherpaLHEReader(std::string const &filename)
Inialise Reader for a Sherpa LHE file.
HEJ::istream
Small wrapper around boost's filtering_istream.
Definition:
stream.hh:19
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::optional
boost::optional< T > optional
Definition:
optional.hh:23
stream.hh
Declares input streams.
HEJ::EventReader
Abstract base class for reading events from files.
Definition:
EventReader.hh:26
Generated by
1.9.5