Run.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_Run_HH
00003 #define RIVET_Run_HH
00004 
00005 #include "Rivet/AnalysisHandler.fhh"
00006 #include "Rivet/RivetBoost.hh"
00007 
00008 namespace HepMC {
00009   class IO_GenEvent;
00010 }
00011 
00012 namespace Rivet {
00013 
00014 
00015   class Run {
00016 
00017   public:
00018 
00019     /// @name Standard constructors and destructors. */
00020     //@{
00021     /// The standard constructor.
00022     Run(AnalysisHandler& ah);
00023 
00024     /// The destructor
00025     ~Run();
00026     //@}
00027 
00028 
00029   public:
00030 
00031     /// @name Set run properties
00032     //@{
00033 
00034     /// Get the cross-section for this run.
00035     Run& setCrossSection(const double xs);
00036 
00037     /// Declare whether to list available analyses
00038     Run& setListAnalyses(const bool dolist);
00039 
00040     //@}
00041 
00042 
00043     /// @name File processing stages
00044     //@{
00045 
00046     /// Set up HepMC file readers
00047     bool init(const std::string& evtfile);
00048 
00049     /// Open a HepMC GenEvent file
00050     bool openFile(const std::string& evtfile);
00051 
00052     /// Read the next HepMC event
00053     bool readEvent();
00054 
00055     /// Handle next event
00056     bool processEvent();
00057 
00058     /// Close up HepMC I/O
00059     bool finalize();
00060 
00061     //@}
00062 
00063 
00064   private:
00065 
00066     /// AnalysisHandler object
00067     AnalysisHandler& _ah;
00068  
00069 
00070     /// @name Run variables obtained from events or command line
00071     //@{
00072 
00073     /// Cross-section from command line
00074     double _xs;
00075 
00076     //@}
00077 
00078 
00079     /// Flag to show list of analyses
00080     bool _listAnalyses;
00081 
00082 
00083     /// @name HepMC I/O members
00084     //@{
00085 
00086     /// Current event
00087     shared_ptr<GenEvent> _evt;
00088 
00089     /// Output stream for HepMC writer
00090     shared_ptr<std::istream> _istr;
00091 
00092     /// HepMC I/O writer
00093     shared_ptr<HepMC::IO_GenEvent> _io;
00094 
00095     //@}
00096 
00097   };
00098 
00099 
00100 }
00101 
00102 #endif