HepMC3 event record library
|
Go to the documentation of this file.
23 m_file = TFile::Open(filename.c_str(),
"RECREATE");
25 ERROR(
"WriterRoot: problem opening file: " << filename )
33 if ( !
m_file->IsOpen() )
return;
40 WARNING(
"WriterAscii::write_event: GenEvents contain "
41 "different GenRunInfo objects from - only the "
42 "first such object will be serialized." )
51 int nbytes =
m_file->WriteObject(&data, buf);
54 ERROR(
"WriterRoot: error writing event")
65 int nbytes =
m_file->WriteObject(&data,
"GenRunInfoData");
68 ERROR(
"WriterRoot: error writing GenRunInfo")
78 if ( !
m_file->IsOpen() )
return true;
#define ERROR(MESSAGE)
Macro for printing error messages.
shared_ptr< GenRunInfo > run_info() const
Get the global GenRunInfo object.
Stores event-related information.
int m_events_count
Events count. Needed to generate unique object name.
bool failed()
Get stream error state flag.
Stores serializable event information.
void set_run_info(shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
void write_event(const GenEvent &evt)
Write event to file.
void write_data(GenEventData &data) const
Fill GenEventData object.
Definition of class WriterRoot.
void write_run_info()
Write the GenRunInfo object to file.
void close()
Close file stream.
shared_ptr< GenRunInfo > run_info() const
Get a pointer to the the GenRunInfo object.
Stores serializable run information.
TFile * m_file
File handler.
WriterRoot(const std::string &filename, shared_ptr< GenRunInfo > run=shared_ptr< GenRunInfo >())
Default constructor.
#define WARNING(MESSAGE)
Macro for printing warning messages.