hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.1.4
High energy resummation for hadron colliders
Loading...
Searching...
No Matches
include
HEJ
BufferedEventReader.hh
Go to the documentation of this file.
1
8
#pragma once
9
10
#include <cstddef>
11
#include <memory>
12
#include <stack>
13
#include <string>
14
#include <utility>
15
#include <vector>
16
17
#include "LHEF/LHEF.h"
18
19
#include "
HEJ/EventReader.hh
"
20
#include "
HEJ/optional.hh
"
21
22
namespace
HEJ
{
23
25
29
class
BufferedEventReader
:
public
EventReader
{
30
public
:
31
explicit
BufferedEventReader
(std::unique_ptr<EventReader> reader):
32
reader_{std::move(reader)}
33
{}
34
36
bool
read_event
()
override
;
37
39
std::string
const
&
header
()
const override
{
40
return
reader_->header();
41
}
42
44
LHEF::HEPRUP
const
&
heprup
()
const override
{
45
return
reader_->heprup();
46
}
47
49
LHEF::HEPEUP
const
&
hepeup
()
const override
{
50
return
cur_event_;
51
}
52
54
optional<std::size_t>
number_events
()
const override
{
55
return
reader_->number_events();
56
}
57
59
template
<
class
... T>
60
void
emplace
(T&&... args) {
61
buffer_.emplace(std::forward<T>(args)...);
62
}
63
64
private
:
65
std::stack<LHEF::HEPEUP, std::vector<LHEF::HEPEUP>> buffer_;
66
std::unique_ptr<EventReader> reader_;
67
LHEF::HEPEUP cur_event_;
68
};
69
}
// namespace HEJ
EventReader.hh
Header file for event reader interface.
HEJ::BufferedEventReader
Event reader with internal buffer.
Definition:
BufferedEventReader.hh:29
HEJ::BufferedEventReader::number_events
optional< std::size_t > number_events() const override
Guess number of events from header.
Definition:
BufferedEventReader.hh:54
HEJ::BufferedEventReader::BufferedEventReader
BufferedEventReader(std::unique_ptr< EventReader > reader)
Definition:
BufferedEventReader.hh:31
HEJ::BufferedEventReader::hepeup
LHEF::HEPEUP const & hepeup() const override
Access last read event.
Definition:
BufferedEventReader.hh:49
HEJ::BufferedEventReader::emplace
void emplace(T &&... args)
Push event back into reader.
Definition:
BufferedEventReader.hh:60
HEJ::BufferedEventReader::header
std::string const & header() const override
Access header text.
Definition:
BufferedEventReader.hh:39
HEJ::BufferedEventReader::heprup
LHEF::HEPRUP const & heprup() const override
Access run information.
Definition:
BufferedEventReader.hh:44
HEJ::BufferedEventReader::read_event
bool read_event() override
Read an event.
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::optional
boost::optional< T > optional
Definition:
optional.hh:23
optional.hh
Defines the optional type.
HEJ::EventReader
Abstract base class for reading events from files.
Definition:
EventReader.hh:26
Generated by
1.9.5