rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
Run.hh
1// -*- C++ -*-
2#ifndef RIVET_Run_HH
3#define RIVET_Run_HH
4
5#include "Rivet/Tools/RivetSTL.hh"
6#include "Rivet/Tools/RivetHepMC.hh"
7#include "Rivet/Tools/Logging.hh"
8
9namespace Rivet {
10
11
12 // Forward declaration
13 class AnalysisHandler;
14
15
17 class Run {
18 public:
19
22
25
26
29
31 Run& setCrossSection(double xs);
32
34 Run& setListAnalyses(bool dolist);
35
37
38
41
43 bool init(const std::string& evtfile, double weight=1.0);
44
46 bool openFile(const std::string& evtfile, double weight=1.0);
47
49 bool readEvent();
50
52 //bool skipEvent();
53
56 size_t numEvents() const { return _evtcount; }
57
60
62 bool finalize();
63
65
66
67 private:
68
70 Log& getLog() const;
71
73 AnalysisHandler& _ah;
74
77
80 double _fileweight = 1.0;
81
83 double _xs = NAN;
84
86 size_t _evtcount = 0;
87
89 int _evtnumber = -1;
90
92
93
95 bool _listAnalyses = false;
96
97
100
102 std::shared_ptr<GenEvent> _evt;
103
105 std::shared_ptr<std::istream> _istr;
106
108 std::shared_ptr<HepMC_IO_type> _hepmcReader;
109
111
112 };
113
114
115}
116
117#endif
The key class for coordination of Analysis objects and the event loop.
Definition AnalysisHandler.hh:29
Logging system for controlled & formatted writing to stdout.
Definition Logging.hh:10
Interface to handle a run of events read from a HepMC stream or file.
Definition Run.hh:17
bool init(const std::string &evtfile, double weight=1.0)
Set up HepMC file readers (using the appropriate file weight for the first file)
bool readEvent()
Read the next HepMC event.
Run & setCrossSection(double xs)
Get the cross-section for this run.
Run & setListAnalyses(bool dolist)
Declare whether to list available analyses.
bool openFile(const std::string &evtfile, double weight=1.0)
Open a HepMC GenEvent file (using the appropriate file weight for the first file)
bool processEvent()
Handle next event.
size_t numEvents() const
Read the next HepMC event only to skip it.
Definition Run.hh:56
bool finalize()
Close up HepMC I/O.
Run(AnalysisHandler &ah)
Standard constructor.
~Run()
Destructor.
Definition MC_CENT_PPB_Projections.hh:10