rivet is hosted by Hepforge, IPPP Durham
Rivet  3.1.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 
8 namespace Rivet {
9 
10 
11  // Forward declaration
12  class AnalysisHandler;
13 
14 
16  class Run {
17  public:
18 
20 
21  Run(AnalysisHandler& ah);
23 
25  ~Run();
27 
28 
29  public:
30 
32 
33 
35  Run& setCrossSection(const double xs);
36 
38  Run& setListAnalyses(const bool dolist);
39 
41 
42 
44 
45 
47  bool init(const std::string& evtfile, double weight=1.0);
48 
50  bool openFile(const std::string& evtfile, double weight=1.0);
51 
53  bool readEvent();
54 
56  //bool skipEvent();
57 
59  bool processEvent();
60 
62  bool finalize();
63 
65 
66 
67  private:
68 
70  AnalysisHandler& _ah;
71 
73 
74 
77  double _fileweight;
78 
80  double _xs;
81 
83 
84 
86  bool _listAnalyses;
87 
88 
90 
91 
93  std::shared_ptr<GenEvent> _evt;
94 
96  std::shared_ptr<std::istream> _istr;
97 
99  std::shared_ptr<HepMC_IO_type> _hepmcReader;
100 
102 
103  };
104 
105 
106 }
107 
108 #endif
Definition: MC_Cent_pPb.hh:10
Interface to handle a run of events read from a HepMC stream or file.
Definition: Run.hh:16
Run(AnalysisHandler &ah)
The standard constructor.
bool finalize()
Close up HepMC I/O.
Run & setCrossSection(const double xs)
Get the cross-section for this run.
bool readEvent()
Read the next HepMC event.
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 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()
Read the next HepMC event only to skip it.
The key class for coordination of Analysis objects and the event loop.
Definition: AnalysisHandler.hh:23
Run & setListAnalyses(const bool dolist)
Declare whether to list available analyses.
~Run()
The destructor.