aegir
Phlex-based simulation framework for the SHiP experiment.
Loading...
Searching...
No Matches
record_mode.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 CERN for the benefit of the SHiP Collaboration
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5// record_mode.hpp — how much of a generator's event record to emit
6//
7// Shared by the generator sources so the `record` option means the same thing
8// everywhere. Free of Phlex and data-model dependencies so the header-only
9// Pythia8 helpers (and the standalone benchmark that shares them) can use it.
10
11#pragma once
12
13#include <cstdint>
14#include <stdexcept>
15#include <string>
16#include <string_view>
17
18namespace aegir {
19
20enum class record_mode : std::uint8_t {
22 full,
23};
24
28[[nodiscard]] inline record_mode parse_record_mode(std::string_view value,
29 std::string_view source) {
30 if (value == "final_state") {
32 }
33 if (value == "full") {
34 return record_mode::full;
35 }
36 throw std::runtime_error(std::string{source} + ": unknown record mode '" +
37 std::string{value} +
38 "' (expected 'final_state' or 'full')");
39}
40
41} // namespace aegir
Definition hepmc_status.hpp:17
record_mode
Definition record_mode.hpp:20
@ final_state
Only particles the generator left undecayed.
@ full
The whole record, statuses and mother links intact.
record_mode parse_record_mode(std::string_view value, std::string_view source)
Parse the record configuration option.
Definition record_mode.hpp:28