12 #include "HepMC3/Print.h"
13 #include "HepMC3/WriterAscii.h"
15 #ifdef SMASH_USE_HEPMC_ROOTIO
16 #include "HepMC3/WriterRootTree.h"
251 const bool full_event, std::string HepMC3_output_type)
253 filename_(path / (name +
"." + HepMC3_output_type)) {
256 #ifdef SMASH_USE_HEPMC_ROOTIO
257 if (HepMC3_output_type ==
"asciiv3") {
262 #ifdef SMASH_USE_HEPMC_ROOTIO
264 output_file_ = std::make_unique<HepMC3::WriterRootTree>(
278 const int32_t event_number,
281 logg[
LOutput].debug() <<
"Writing event " << event_number <<
" with "
282 <<
event_.particles().size() <<
" particles and "
283 <<
event_.vertices().size() <<
" vertices to output "
Base class for output handlers that need the HepMC3 structure.
void at_eventend(const Particles &particles, const int32_t event_number, const EventInfo &event) override
Add the final particles information of an event to the central vertex.
HepMC3::GenEvent event_
The event.
void at_eventend(const Particles &particles, const int32_t event_number, const EventInfo &event) override
Add the final particles information of an event to the central vertex.
const std::filesystem::path filename_
Filename of output.
HepMcOutput(const std::filesystem::path &path, std::string name, const bool full_event, std::string HepMC3_output_type)
Create HepMC particle output.
~HepMcOutput()
Destructor renames file.
std::filesystem::path filename_unfinished_
Filename of output as long as simulation is still running.
type_of_HepMC3_output output_type_
HepMC3 output type.
std::unique_ptr< HepMC3::Writer > output_file_
Pointers to the base class of HepMC3 output files.
The Particles class abstracts the storage and manipulation of particles.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
static constexpr int LOutput
Structure to contain custom data for output.