HepMC3 event record library
ReaderLHEF.h
Go to the documentation of this file.
1// -*- C++ -*-
2// -*- C++ -*-
3//
4// This file is part of HepMC
5// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
6//
7#ifndef HEPMC3_READERLHEF_H
8#define HEPMC3_READERLHEF_H
9/**
10 * @file ReaderLHEF.h
11 * @brief Definition of \b class ReaderLHEF
12 *
13 * @class HepMC3::ReaderLHEF
14 * @brief GenEvent I/O parsing and serialization for LHEF files
15 *
16 *
17 * @ingroup IO
18 *
19 */
20#include "HepMC3/Reader.h"
21#include "HepMC3/GenEvent.h"
22#include <string>
23#include <fstream>
24#include <istream>
26#include "HepMC3/GenEvent.h"
27#include "HepMC3/GenParticle.h"
28#include "HepMC3/GenVertex.h"
29#include <iomanip>
30
31
32namespace HepMC3
33{
34class ReaderLHEF : public Reader
35{
36public:
37 /// The ctor to read from stream
38 ReaderLHEF(std::istream &);
39private:
40 void init(); ///< Init helper
41public:
42 /** @brief Constructor */
43 ReaderLHEF(const std::string& filename);
44 /** @brief Reading event */
45 bool read_event(GenEvent& ev);
46 /** @brief Close */
47 void close();
48 /** @brief State */
49 bool failed();
50 /** @brief Destructor */
51 ~ReaderLHEF() ;
52private:
53 LHEF::Reader* m_reader; ///< The actual reader
54 shared_ptr<HEPRUPAttribute> m_hepr; ///< Holder of attributes
55 int m_neve; ///< Event counter
56 bool m_failed; ///< State of reader
57};
58}
59#endif
Definition of class GenEvent.
Definition of class GenParticle.
Definition of class GenVertex.
Definition of class HEPRUPAttribute and class HEPEUAttribute.
Definition of interface Reader.
Stores event-related information.
Definition: GenEvent.h:42
GenEvent I/O parsing and serialization for LHEF files.
Definition: ReaderLHEF.h:35
~ReaderLHEF()
Destructor.
Definition: ReaderLHEF.cc:70
void init()
Init helper.
Definition: ReaderLHEF.cc:26
LHEF::Reader * m_reader
The actual reader.
Definition: ReaderLHEF.h:53
void close()
Close.
Definition: ReaderLHEF.cc:126
bool read_event(GenEvent &ev)
Reading event.
Definition: ReaderLHEF.cc:72
shared_ptr< HEPRUPAttribute > m_hepr
Holder of attributes.
Definition: ReaderLHEF.h:54
bool m_failed
State of reader.
Definition: ReaderLHEF.h:56
bool failed()
State.
Definition: ReaderLHEF.cc:123
ReaderLHEF(std::istream &)
The ctor to read from stream.
Definition: ReaderLHEF.cc:20
int m_neve
Event counter.
Definition: ReaderLHEF.h:55
Base class for all I/O readers.
Definition: Reader.h:25
HepMC3 main namespace.
Definition: ReaderGZ.h:28