HepMC3 event record library
|
Go to the documentation of this file.
20 WriterHEPEVT::WriterHEPEVT(
const std::string &filename): m_file(filename), m_stream(&m_file), m_events_count(0),m_vertices_positions_present(true)
22 HEPMC3_WARNING(
"WriterHEPEVT::WriterHEPEVT: HEPEVT format is outdated. Please use HepMC3 format instead." )
29 HEPMC3_WARNING(
"WriterHEPEVT::WriterHEPEVT: HEPEVT format is outdated. Please use HepMC3 format instead." )
37 char* cursor=&(buf[0]);
51 unsigned long length = cursor - &(buf[0]);
60 unsigned long length = cursor - &(buf[0]);
75 std::ofstream* ofs = dynamic_cast<std::ofstream*>(
m_stream);
76 if (ofs && !ofs->is_open())
return;
77 if (ofs) ofs->close();
82 return (
bool)
m_file.rdstate();
static bool fix_daughters()
Tries to fix list of daughters.
bool failed() override
Get stream error state flag.
void set_vertices_positions_present(bool iflong)
set flag if vertex positions are available
static double m(const int &index)
Get generated mass.
void write_event(const GenEvent &evt) override
Write event to file.
Stores event-related information.
static int status(const int &index)
Get status code.
static double x(const int &index)
Get X Production vertex.
Definition of class HEPEVT_Wrapper.
static double py(const int &index)
Get Y momentum.
Fortran common block HEPEVT.
static int number_entries()
Get number of entries.
static double z(const int &index)
Get Z Production vertex.
char * hepevtbuffer
Pointer to HEPEVT Fortran common block/C struct.
static double e(const int &index)
Get Energy.
static int last_parent(const int &index)
Get index of last mother.
Definition of class WriterHEPEVT.
static int first_child(const int &index)
Get index of 1st daughter.
static double y(const int &index)
Get Y Production vertex.
static double px(const int &index)
Get X momentum.
bool m_vertices_positions_present
true if vertex positions are available
int m_events_count
Events count. Needed to generate unique object name.
Definition of static class Print.
WriterHEPEVT(const std::string &filename)
Default constructor.
virtual void write_hepevt_particle(int index, bool iflong=true)
Write particle to file.
static int last_child(const int &index)
Get index of last daughter.
static double pz(const int &index)
Get Z momentum.
std::ofstream m_file
Output file.
bool get_vertices_positions_present() const
get flag if vertex positions are available
static int event_number()
Get event number.
static int id(const int &index)
Get PDG particle id.
static void set_hepevt_address(char *c)
Set Fortran block address.
#define HEPMC3_WARNING(MESSAGE)
Macro for printing HEPMC3_HEPMC3_WARNING messages.
static bool GenEvent_to_HEPEVT(const GenEvent *evt)
Convert GenEvent to HEPEVT.
static int first_parent(const int &index)
Get index of 1st mother.
std::ostream * m_stream
Output stream.
void close() override
Close file stream.
static double t(const int &index)
Get production time.
virtual void write_hepevt_event_header()
Write event header to file.