File indexing completed on 2025-01-18 10:01:14
0001
0002
0003
0004
0005
0006 #ifndef HEPMC3_WRITERHEPEVT_H
0007 #define HEPMC3_WRITERHEPEVT_H
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <fstream>
0020 #include "HepMC3/Writer.h"
0021 #include "HepMC3/GenEvent.h"
0022 #include "HepMC3/Data/GenEventData.h"
0023 #include "HepMC3/HEPEVT_Wrapper_Template.h"
0024 namespace HepMC3
0025 {
0026
0027 class WriterHEPEVT : public Writer
0028 {
0029
0030
0031
0032 public:
0033
0034
0035
0036 WriterHEPEVT(const std::string &filename,
0037 std::shared_ptr<GenRunInfo> run = nullptr);
0038
0039
0040 WriterHEPEVT(std::ostream& stream,
0041 std::shared_ptr<GenRunInfo> run = nullptr);
0042
0043 WriterHEPEVT(std::shared_ptr<std::ostream> s_stream,
0044 std::shared_ptr<GenRunInfo> run = nullptr);
0045
0046
0047
0048 public:
0049
0050
0051
0052
0053
0054
0055
0056 virtual void write_hepevt_particle( int index, bool iflong = true );
0057
0058
0059
0060 virtual void write_hepevt_event_header();
0061
0062
0063
0064
0065
0066 void write_event(const GenEvent &evt) override;
0067
0068
0069 void close() override;
0070
0071
0072 bool failed() override;
0073
0074
0075
0076 void set_vertices_positions_present(bool iflong);
0077
0078
0079
0080
0081 bool get_vertices_positions_present() const;
0082
0083 protected:
0084 std::ofstream m_file;
0085 std::shared_ptr<std::ostream> m_shared_stream;
0086 std::ostream* m_stream;
0087 char* hepevtbuffer = nullptr;
0088 int m_events_count = 0;
0089 HEPEVT_Wrapper_Template<100000> m_hepevt_interface;
0090 };
0091
0092 }
0093 #endif