HepMC3 event record library
WriterRootTreeOPAL.h
Go to the documentation of this file.
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"
16 namespace HepMC3
17 {
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
Definition of class GenParticle.
GenEvent I/O output to files similar to these produced by OPAL software.
Definition of class WriterRootTree.
void write_event(const GenEvent &evt)
Write event.
Definition of struct GenEventData.
void set_run_number(const int nr)
Set run number.
float m_Ebeam
Beam energy in GEV.
Stores event-related information.
Definition: GenEvent.h:41
WriterRootTreeOPAL(const std::string &filename, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >())
Constructor.
GenEvent I/O serialization for root files based on root TTree.
void init_branches()
Init ROOT branches.
Definition of class GenEvent.