12 #include <HepMC/IO_GenEvent.h>
17 #include <boost/iostreams/filter/bzip2.hpp>
18 #include <boost/iostreams/filter/gzip.hpp>
19 #include <boost/iostreams/filtering_streambuf.hpp>
29 namespace HepMC {
class GenEvent; }
33 static boost::iostreams::filtering_streambuf<boost::iostreams::output>
zoutbuffer;
38 , outfilename(filename)
44 TString tstr(filename);
45 TPRegexp bzip_ext(
".bz2$");
46 TPRegexp gzip_ext(
".gz$");
48 if (tstr.Contains(bzip_ext))
51 filestream =
new ofstream(filename.c_str(), std::ios::out | std::ios::binary);
52 zoutbuffer.push(boost::iostreams::bzip2_compressor(9));
57 else if (tstr.Contains(gzip_ext))
60 filestream =
new ofstream(filename.c_str(), std::ios::out | std::ios::binary);
61 zoutbuffer.push(boost::iostreams::gzip_compressor(9));
69 ascii_out =
new HepMC::IO_GenEvent(filename, std::ios::out);
74 cout <<
"error opening " <<
outfilename <<
" exiting " << endl;
109 cout <<
"comment : " <<
comment << endl;
128 PHHepMCGenEventMap *geneventmap = findNode::getClass<PHHepMCGenEventMap>(topNode,
"PHHepMCGenEventMap");
132 cout <<
"Fun4AllHepMCOutputManager::Write - Fatal Error - missing source node PHHepMCGenEventMap" << endl;
140 cout <<
"Fun4AllHepMCOutputManager::Write - Warning - missing sub-event with embedding ID" <<
_embedding_id <<
" on node PHHepMCGenEventMap" << endl;
145 HepMC::GenEvent *evt = genevt->
getEvent();
148 cout <<
PHWHERE <<
"0 HepMC Pointer" << endl;