17 m_file(filename.c_str(),
"RECREATE"),
22 ERROR(
"WriterRoot: problem opening file: " << filename )
30 if ( !
m_file.IsOpen() )
return;
37 WARNING(
"WriterAscii::write_event: GenEvents contain " 38 "different GenRunInfo objects from - only the " 39 "first such object will be serialized." )
48 int nbytes =
m_file.WriteObject(&data, buf);
51 ERROR(
"WriterRoot: error writing event")
62 int nbytes =
m_file.WriteObject(&data,
"GenRunInfoData");
65 ERROR(
"WriterRoot: error writing GenRunInfo")
75 if ( !
m_file.IsOpen() )
return true;
TFile m_file
File handler.
void set_run_info(shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
Stores serializable run information.
void write_run_info()
Write the GenRunInfo object to file.
WriterRoot(const std::string &filename, shared_ptr< GenRunInfo > run=shared_ptr< GenRunInfo >())
Default constructor.
shared_ptr< GenRunInfo > run_info() const
Get the global GenRunInfo object.
shared_ptr< GenRunInfo > run_info() const
Get a pointer to the the GenRunInfo object.
Stores event-related information.
bool failed()
Get stream error state flag.
Definition of class WriterRoot.
void write_event(const GenEvent &evt)
Write event to file.
void close()
Close file stream.
int m_events_count
Events count. Needed to generate unique object name.
Definition of template class SmartPointer.
Stores serializable event information.
void write_data(GenEventData &data) const
Fill GenEventData object.