File: ReaderRoot.h

package info (click to toggle)
hepmc3 3.1.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,124 kB
  • sloc: fortran: 66,849; cpp: 13,604; ansic: 1,374; xml: 109; sh: 72; makefile: 33
file content (66 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// -*- C++ -*-
//
// This file is part of HepMC
// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
//
#ifndef HEPMC3_READERROOT_H
#define HEPMC3_READERROOT_H
/**
 *  @file  ReaderRoot.h
 *  @brief Definition of \b class ReaderRoot
 *
 *  @class HepMC3::ReaderRoot
 *  @brief GenEvent I/O parsing and serialization for root files
 *
 *  If HepMC was compiled with path to ROOT available, this class can be used
 *  for root file I/O in the same manner as with HepMC::ReaderAscii class.
 *
 *  @ingroup IO
 *
 */
#include "HepMC3/Reader.h"
#include "HepMC3/GenEvent.h"
#include "HepMC3/Data/GenEventData.h"
#include "HepMC3/Data/GenRunInfoData.h"

// ROOT header files
#include "TFile.h"
#include "TKey.h"

namespace HepMC3 {

class ReaderRoot : public Reader {
//
// Constructors
//
public:
    /** @brief Default constructor */
    ReaderRoot(const std::string &filename);

//
// Functions
//
public:

    /** @brief Read event from file
     *
     *  @param[out] evt Contains parsed event
     */
    bool read_event(GenEvent &evt);

    /** @brief Close file stream */
    void close();

    /** @brief Get stream error state */
    bool failed();
//
// Fields
//
private:
    TFile* m_file; //!< File handler
    TIter* m_next; //!< Iterator for event reading
};

} // namespace HepMC3

#endif