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