Rivet  3.1.4
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 
9 namespace 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 
55  bool processEvent();
56 
58  bool finalize();
59 
61 
62 
63  private:
64 
66  Log& getLog() const;
67 
69  AnalysisHandler& _ah;
70 
73 
76  double _fileweight = 1.0;
77 
79  double _xs = NAN;
80 
82 
83 
85  bool _listAnalyses = false;
86 
87 
90 
92  std::shared_ptr<GenEvent> _evt;
93 
95  std::shared_ptr<std::istream> _istr;
96 
98  std::shared_ptr<HepMC_IO_type> _hepmcReader;
99 
101 
102  };
103 
104 
105 }
106 
107 #endif
Definition: MC_Cent_pPb.hh:10
Interface to handle a run of events read from a HepMC stream or file.
Definition: Run.hh:17
Run & setListAnalyses(bool dolist)
Declare whether to list available analyses.
Run(AnalysisHandler &ah)
Standard constructor.
Run & setCrossSection(double xs)
Get the cross-section for this run.
Logging system for controlled & formatted writing to stdout.
Definition: Logging.hh:10
bool finalize()
Close up HepMC I/O.
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()
Destructor.