Version: SMASH-3.1
hepmcoutput.h
Go to the documentation of this file.
1 
2 /*
3  *
4  * Copyright (c) 2020-2022
5  * SMASH Team
6  *
7  * GNU General Public License (GPLv3 or later)
8  *
9  */
10 
11 #ifndef SRC_INCLUDE_SMASH_HEPMCOUTPUT_H_
12 #define SRC_INCLUDE_SMASH_HEPMCOUTPUT_H_
13 
14 #include <filesystem>
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
19 #include "HepMC3/Writer.h"
20 
21 #include "hepmcinterface.h"
22 
23 namespace smash {
24 
37 class HepMcOutput : public HepMcInterface {
38  public:
48  HepMcOutput(const std::filesystem::path &path, std::string name,
49  const bool full_event, std::string HepMC3_output_type);
50 
52  ~HepMcOutput();
61  void at_eventend(const Particles &particles, const int32_t event_number,
62  const EventInfo &event) override;
63 
64  private:
66  const std::filesystem::path filename_;
68  std::filesystem::path filename_unfinished_;
70  std::unique_ptr<HepMC3::Writer> output_file_;
75 };
76 
77 } // namespace smash
78 
79 #endif // SRC_INCLUDE_SMASH_HEPMCOUTPUT_H_
Base class for output handlers that need the HepMC3 structure.
SMASH output to HepMC file.
Definition: hepmcoutput.h:37
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.
Definition: hepmcoutput.cc:277
enum smash::HepMcOutput::enum_output type_of_HepMC3_output
enum to identify the HepMC3 output type
const std::filesystem::path filename_
Filename of output.
Definition: hepmcoutput.h:66
HepMcOutput(const std::filesystem::path &path, std::string name, const bool full_event, std::string HepMC3_output_type)
Create HepMC particle output.
Definition: hepmcoutput.cc:250
enum_output
enum to identify the HepMC3 output type
Definition: hepmcoutput.h:72
~HepMcOutput()
Destructor renames file.
Definition: hepmcoutput.cc:270
std::filesystem::path filename_unfinished_
Filename of output as long as simulation is still running.
Definition: hepmcoutput.h:68
type_of_HepMC3_output output_type_
HepMC3 output type.
Definition: hepmcoutput.h:74
std::unique_ptr< HepMC3::Writer > output_file_
Pointers to the base class of HepMC3 output files.
Definition: hepmcoutput.h:70
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
Definition: action.h:24
Structure to contain custom data for output.