20 WriterHEPEVT::WriterHEPEVT(
const std::string &filename): m_events_count(0),m_vertices_positions_present(true), m_file(filename), m_stream(&m_file)
35 char* cursor=&(buf[0]);
36 cursor +=sprintf(cursor,
"% 8i% 8i",HEPEVT_Wrapper::status(index), HEPEVT_Wrapper::id(index));
39 cursor +=sprintf(cursor,
"% 8i% 8i",HEPEVT_Wrapper::first_parent(index),HEPEVT_Wrapper::last_parent(index));
40 cursor +=sprintf(cursor,
"% 8i% 8i",HEPEVT_Wrapper::first_child(index),HEPEVT_Wrapper::last_child(index));
41 cursor +=sprintf(cursor,
"% 19.8E% 19.8E% 19.8E% 19.8E% 19.8E\n",HEPEVT_Wrapper::px(index),HEPEVT_Wrapper::py(index),HEPEVT_Wrapper::pz(index),HEPEVT_Wrapper::e(index),HEPEVT_Wrapper::m(index));
42 cursor +=sprintf(cursor,
"%-48s% 19.8E% 19.8E% 19.8E% 19.8E\n",
" ",HEPEVT_Wrapper::x(index),HEPEVT_Wrapper::y(index),HEPEVT_Wrapper::z(index),HEPEVT_Wrapper::t(index));
46 cursor +=sprintf(cursor,
"% 8i% 8i",HEPEVT_Wrapper::first_child(index),HEPEVT_Wrapper::last_child(index));
47 cursor +=sprintf(cursor,
"% 19.8E% 19.8E% 19.8E% 19.8E\n",HEPEVT_Wrapper::px(index),HEPEVT_Wrapper::py(index),HEPEVT_Wrapper::pz(index),HEPEVT_Wrapper::m(index));
49 unsigned long length = cursor - &(buf[0]);
57 cursor +=sprintf(cursor,
"E% 8i %8i\n",HEPEVT_Wrapper::event_number(),HEPEVT_Wrapper::number_entries());
58 unsigned long length = cursor - &(buf[0]);
73 std::ofstream* ofs =
dynamic_cast<std::ofstream*
>(
m_stream);
74 if (ofs && !ofs->is_open())
return;
75 if (ofs) ofs->close();
80 return (
bool)
m_file.rdstate();