File indexing completed on 2025-08-05 08:15:59
0001 #ifndef PHHEPMC_FUN4ALLHEPMCOUTPUTMANAGER_H
0002 #define PHHEPMC_FUN4ALLHEPMCOUTPUTMANAGER_H
0003
0004 #include <fun4all/Fun4AllOutputManager.h>
0005
0006 #include <fstream>
0007 #include <string>
0008
0009 namespace HepMC
0010 {
0011 class IO_GenEvent;
0012 }
0013
0014 class PHCompositeNode;
0015
0016 class Fun4AllHepMCOutputManager : public Fun4AllOutputManager
0017 {
0018 public:
0019 Fun4AllHepMCOutputManager(const std::string &myname = "HEPMCOUT",
0020 const std::string &filename = "hepmcout.txt");
0021
0022 ~Fun4AllHepMCOutputManager() override;
0023
0024 int outfileopen(const std::string & ) override { return 0; }
0025
0026 void Print(const std::string &what = "ALL") const override;
0027
0028 int Write(PHCompositeNode *startNode) override;
0029
0030 int AddComment(const std::string &text);
0031
0032
0033
0034
0035
0036 int get_embedding_id() const { return _embedding_id; }
0037
0038
0039
0040
0041
0042 void set_embedding_id(int id) { _embedding_id = id; }
0043
0044 protected:
0045 std::string outfilename;
0046 HepMC::IO_GenEvent *ascii_out;
0047 std::string comment;
0048 int comment_written;
0049
0050
0051 std::ofstream *filestream;
0052 std::ostream *zipstream;
0053
0054
0055
0056
0057 int _embedding_id;
0058 };
0059
0060 #endif