1 #ifndef HEPMC3_WRITERROOTTREEOPAL_H 2 #define HEPMC3_WRITERROOTTREEOPAL_H 3 /// 4 /// @file WriterRootTreeOPAL.h 5 /// @brief Definition of class \b WriterRootTreeOPAL 6 /// 7 /// @class HepMC3::WriterRootTreeOPAL 8 /// @brief GenEvent I/O output to files similar to these produced by OPAL software 9 /// 10 /// @ingroup Examples 11 /// 12 #include "HepMC3/WriterRootTree.h" 13 #include "HepMC3/GenEvent.h" 14 #include "HepMC3/GenParticle.h" 15 #include "HepMC3/Data/GenEventData.h" 16 namespace HepMC3 17 { 18 class WriterRootTreeOPAL : public WriterRootTree 19 { 20 public: 21 /** @brief Constructor */ 22 WriterRootTreeOPAL(const std::string &filename,std::shared_ptr<GenRunInfo> run = std::shared_ptr<GenRunInfo>()); 23 /** @brief Init ROOT branches */ 24 void init_branches(); 25 /** @brief Write event */ 26 void write_event(const GenEvent &evt); 27 /** @brief Set run number */ 28 void set_run_number(const int nr); 29 private: 30 float m_Ebeam; ///< Beam energy in GEV 31 int m_Irun; ///< Run number 32 int m_Ievnt; ///< Event number 33 }; 34 } 35 #endif 36