HepMC3 event record library
ReaderHEPEVT.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5 //
6 #ifndef HEPMC3_READERHEPEVT_H
7 #define HEPMC3_READERHEPEVT_H
8 /**
9  * @file ReaderHEPEVT.h
10  * @brief Definition of \b class ReaderHEPEVT
11  *
12  * @class HepMC3::ReaderHEPEVT
13  * @brief GenEvent I/O parsing and serialization for HEPEVT files
14  *
15  *
16  * @ingroup IO
17  *
18  */
19 #include "HepMC3/Reader.h"
20 #include "HepMC3/GenEvent.h"
21 #include "HepMC3/GenRunInfo.h"
23 
24 
25 namespace HepMC3
26 {
27 
28 class ReaderHEPEVT : public Reader
29 {
30 //
31 // Constructors
32 //
33 public:
34  /** @brief Default constructor */
35  ReaderHEPEVT(const std::string &filename);
36 
37 //
38 // Functions
39 //
40 public:
41  /** @brief Find and read event header line from file
42  *
43  */
44  virtual bool read_hepevt_event_header();
45  /** @brief read particle from file
46  *
47  * @param[in] i Particle id
48  * @param[in] iflong Event style
49  */
50  virtual bool read_hepevt_particle(int i, bool iflong=true);
51 
52 
53  /** @brief Read event from file
54  *
55  * @param[in] iflong Event style
56  * @param[out] evt Contains parsed even
57  */
58  bool read_event(GenEvent &evt, bool iflong);
59 
60  /** @brief Read event from file
61  *
62  * @param[out] evt Contains parsed even
63  */
64  bool read_event(GenEvent &evt);
65 
66 
67  /** @brief Close file stream */
68  void close();
69 
70  /** @brief Get stream error state */
71  bool failed();
72 
73 
74 public:
75  char* hepevtbuffer; //!< Pointer to HEPEVT Fortran common block/C struct
76  FILE* m_file; //!< File to read
77  bool m_failed; //!< File state
78  int m_events_count; //!< Event count
79 };
80 
81 } // namespace HepMC3
82 
83 #endif
void close()
Close file stream.
FILE * m_file
File to read.
Definition: ReaderHEPEVT.h:76
Definition of class GenRunInfo.
HepMC3 main namespace.
Definition: WriterDOT.h:19
Definition of interface Reader.
bool m_failed
File state.
Definition: ReaderHEPEVT.h:77
ReaderHEPEVT(const std::string &filename)
Default constructor.
Definition: ReaderHEPEVT.cc:18
GenEvent I/O parsing and serialization for HEPEVT files.
Definition: ReaderHEPEVT.h:28
Definition of struct GenEventData.
virtual bool read_hepevt_event_header()
Find and read event header line from file.
Definition: ReaderHEPEVT.cc:35
int m_events_count
Event count.
Definition: ReaderHEPEVT.h:78
Stores event-related information.
Definition: GenEvent.h:42
bool read_event(GenEvent &evt, bool iflong)
Read event from file.
char * hepevtbuffer
Pointer to HEPEVT Fortran common block/C struct.
Definition: ReaderHEPEVT.h:75
virtual bool read_hepevt_particle(int i, bool iflong=true)
read particle from file
Definition: ReaderHEPEVT.cc:63
Definition of class GenEvent.
Base class for all I/O readers.
Definition: Reader.h:25
bool failed()
Get stream error state.