aegir
Phlex-based simulation framework for the SHiP experiment.
Loading...
Searching...
No Matches
hepmc_status.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// hepmc_status.hpp — HepMC generator status codes
6//
7// SHiP::MCParticle::status carries the HepMC status code (the conventions
8// agreed in February 2009), as produced by Pythia8's Particle::statusHepMC()
9// and used by EDM4hep for its generatorStatus. Geant4's own HepMC example
10// uses the same status == 1 predicate to decide what to track.
11//
12// Deliberately free of includes so the Pythia8 benchmark's stand-in particle
13// struct can use it without pulling in the data model.
14
15#pragma once
16
17namespace aegir::hepmc {
18
19inline constexpr int empty = 0;
20inline constexpr int final_state = 1;
21inline constexpr int decayed = 2;
22inline constexpr int documentation = 3;
23inline constexpr int beam = 4;
24// 11-200 are intermediate entries with a generator-dependent classification.
25inline constexpr int intermediate_min = 11;
26inline constexpr int intermediate_max = 200;
27
34[[nodiscard]] constexpr bool is_final_state(int status) noexcept {
35 return status == final_state;
36}
37
38static_assert(is_final_state(final_state));
39static_assert(!is_final_state(empty));
40static_assert(!is_final_state(decayed));
41static_assert(!is_final_state(documentation));
42static_assert(!is_final_state(beam));
43static_assert(!is_final_state(intermediate_min));
44
45} // namespace aegir::hepmc
Definition hepmc_status.hpp:17
constexpr int documentation
Documentation entry.
Definition hepmc_status.hpp:22
constexpr int empty
Empty entry — never tracked.
Definition hepmc_status.hpp:19
constexpr int decayed
Decayed SM hadron, tau or muon.
Definition hepmc_status.hpp:21
constexpr int final_state
Not decayed by the generator.
Definition hepmc_status.hpp:20
constexpr bool is_final_state(int status) noexcept
True for entries the generator left undecayed — the ones a detector simulation is responsible for.
Definition hepmc_status.hpp:34
constexpr int intermediate_min
Definition hepmc_status.hpp:25
constexpr int intermediate_max
Definition hepmc_status.hpp:26
constexpr int beam
Incoming beam particle.
Definition hepmc_status.hpp:23