Rivet: /Users/chrisg/software/rivet/include/Rivet/Run.hh Source File

| Rivet 3.1.9

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
21 Run(AnalysisHandler& ah);
22
24 ~Run();
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
59 bool processEvent();
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
Rivet::AnalysisHandler
The key class for coordination of Analysis objects and the event loop.
Definition AnalysisHandler.hh:23
Rivet::Log
Logging system for controlled & formatted writing to stdout.
Definition Logging.hh:10
Rivet::Run
Interface to handle a run of events read from a HepMC stream or file.
Definition Run.hh:17
Rivet::Run::init
bool init(const std::string &evtfile, double weight=1.0)
Set up HepMC file readers (using the appropriate file weight for the first file)
Rivet::Run::readEvent
bool readEvent()
Read the next HepMC event.
Rivet::Run::setCrossSection
Run & setCrossSection(double xs)
Get the cross-section for this run.
Rivet::Run::setListAnalyses
Run & setListAnalyses(bool dolist)
Declare whether to list available analyses.
Rivet::Run::openFile
bool openFile(const std::string &evtfile, double weight=1.0)
Open a HepMC GenEvent file (using the appropriate file weight for the first file)
Rivet::Run::processEvent
bool processEvent()
Handle next event.
Rivet::Run::numEvents
size_t numEvents() const
Read the next HepMC event only to skip it.
Definition Run.hh:56
Rivet::Run::finalize
bool finalize()
Close up HepMC I/O.
Rivet::Run::Run
Run(AnalysisHandler &ah)
Standard constructor.
Rivet::Run::~Run
~Run()
Destructor.
Rivet
Definition MC_Cent_pPb.hh:10