3 #include <HepMC/GenEvent.h>
27 : _id(phevent.get_id()),
28 _event_record(phevent.get_event_record()),
34 : _id(phevent->get_id()),
35 _event_record(phevent->get_event_record()),
41 if (_event)
delete _event;
45 if (stale()) refresh();
46 return (
const HepMC::GenEvent*)_event;
50 if (stale()) refresh();
56 _event_record.Clear();
62 std::stringstream streamer;
63 event.write(streamer);
64 _event_record = streamer.str();
71 _event_record.Clear();
77 std::stringstream streamer;
78 event->write(streamer);
79 _event_record = streamer.str();
85 if (stale()) refresh();
86 return _event->particles_size();
90 if (stale()) refresh();
91 return _event->vertices_size();
96 _event_record.Clear();
105 if (stale()) refresh();
107 out <<
" id = " << _id << endl;
111 void PHGenEventv1::refresh()
const {
118 _event =
new HepMC::GenEvent();
120 std::stringstream streamer;
121 streamer << _event_record;
122 _event->read(streamer);
ClassImp(PHGenEventv1) using namespace std
void set_event(HepMC::GenEvent &event)
void print(std::ostream &out=std::cout) const
const HepMC::GenEvent * get_event() const
size_t particles_size() const
size_t vertices_size() const
void identify(std::ostream &out=std::cout) const