Rivet  1.8.3
Run.hh
1 // -*- C++ -*-
2 #ifndef RIVET_Run_HH
3 #define RIVET_Run_HH
4 
5 #include "Rivet/AnalysisHandler.fhh"
6 #include "Rivet/RivetBoost.hh"
7 
8 namespace HepMC {
9  class IO_GenEvent;
10 }
11 
12 
13 namespace Rivet {
14 
15 
17  class Run {
18  public:
19 
21 
22  Run(AnalysisHandler& ah);
24 
26  ~Run();
28 
29 
30  public:
31 
33 
34 
36  Run& setCrossSection(const double xs);
37 
39  double crossSection() const;
40 
42  Run& setListAnalyses(const bool dolist);
43 
45 
46 
48 
49 
51  bool init(const std::string& evtfile, double weight=1.0);
52 
54  bool openFile(const std::string& evtfile, double weight=1.0);
55 
57  bool readEvent();
58 
60  bool processEvent();
61 
63  bool finalize();
64 
66 
67 
68  private:
69 
71  AnalysisHandler& _ah;
72 
74 
75 
78  double _fileweight;
79 
81  double _xs;
82 
84 
85 
87  bool _listAnalyses;
88 
89 
91 
92 
94  shared_ptr<GenEvent> _evt;
95 
97  shared_ptr<std::istream> _istr;
98 
100  shared_ptr<HepMC::IO_GenEvent> _io;
101 
103 
104  };
105 
106 
107 }
108 
109 #endif
Interface to handle a run of events read from a HepMC stream or file.
Definition: Run.hh:17
Run & setListAnalyses(const bool dolist)
Declare whether to list available analyses.
Definition: Run.cc:30
double crossSection() const
Get the current cross-section from the analysis handler in pb.
Definition: Run.cc:25
Run(AnalysisHandler &ah)
The standard constructor.
Definition: Run.cc:11
bool finalize()
Close up HepMC I/O.
Definition: Run.cc:132
bool readEvent()
Read the next HepMC event.
Definition: Run.cc:37
bool init(const std::string &evtfile, double weight=1.0)
Set up HepMC file readers (using the appropriate file weight for the first file)
Definition: Run.cc:74
bool openFile(const std::string &evtfile, double weight=1.0)
Open a HepMC GenEvent file (using the appropriate file weight for the first file) ...
Definition: Run.cc:54
bool processEvent()
Handle next event.
Definition: Run.cc:106
Definition: AnalysisHandler.hh:29
Run & setCrossSection(const double xs)
Get the cross-section for this run.
Definition: Run.cc:19
~Run()
The destructor.
Definition: Run.cc:16