MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
Reader.h
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef HEPMC3_READER_H
7#define HEPMC3_READER_H
17
18#include "HepMC3/GenRunInfo.h"
19
20namespace HepMC3 {
21
22// Forward declaration
23class GenEvent;
24
25class Reader {
26public:
28 Reader() {}
29
31 virtual ~Reader() {}
32
34 virtual bool skip(const int) { return !failed();}
35
37 virtual bool read_event(GenEvent& evt) = 0;
39 virtual bool failed()=0;
41 virtual void close()=0;
42
44 virtual std::shared_ptr<GenRunInfo> run_info() const { return m_run_info; }
45
47 Reader(const Reader&) = delete;
49 Reader& operator = (const Reader &) = delete;
51 virtual void set_options(const std::map<std::string, std::string>& options) { m_options = options; }
53 virtual std::map<std::string, std::string> get_options() const { return m_options; }
54//protected:
56 virtual void set_run_info(std::shared_ptr<GenRunInfo> run) { m_run_info = run; }
57
58protected:
60 std::map<std::string, std::string> m_options;
61private:
63 std::shared_ptr<GenRunInfo> m_run_info;
64};
65
66
67} // namespace HepMC3
68
69#endif
Stores event-related information.
Definition GenEvent.h:47
virtual std::shared_ptr< GenRunInfo > run_info() const
Get the global GenRunInfo object.
Definition Reader.h:44
std::map< std::string, std::string > m_options
Options.
Definition Reader.h:60
virtual bool skip(const int)
skip or fast forward reading of some events
Definition Reader.h:34
virtual void set_options(const std::map< std::string, std::string > &options)
Set options.
Definition Reader.h:51
Reader(const Reader &)=delete
deleted copy constructor
virtual void close()=0
Close file and/or stream.
virtual ~Reader()
Virtual destructor.
Definition Reader.h:31
virtual void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
Definition Reader.h:56
Reader & operator=(const Reader &)=delete
deleted copy assignment operator
virtual bool read_event(GenEvent &evt)=0
Fill next event from input into evt.
virtual std::map< std::string, std::string > get_options() const
Get options.
Definition Reader.h:53
virtual bool failed()=0
Get file and/or stream error state.
Reader()
Constructor.
Definition Reader.h:28