delphi-edm4hep
DELPHI SDST/FDST -> EDM4hep converter
Loading...
Searching...
No Matches
Truth.h
Go to the documentation of this file.
1// Truth domain — split into two writers.
2//
3// TruthGenWriter : unpacks PSCLUJ (via PSHLUJ/PSFLUJ gating) and the
4// simulated tracks, emits <tag>_STSH_MCParticles
5// (generator event + particles made by DELSIM), sets
6// ctx_.gen_truth.
7// TruthRecoLinkWriter : reads ctx_.gen_truth + ctx_.tracking, walks
8// PSCTBL (IPAST then ISTLU) exact tables, emits
9// <tag>_TBL_RecoToMC (RecoMCParticleLink).
10//
11// The two-writer split is needed because the link emission depends on
12// Tracking having already run (so ctx_.tracking is populated).
13
14#pragma once
15
17#include "delphi_edm4hep/Truth/TruthData.h" // GenParticleResult
18
19#include <cstdint>
20
21namespace delphi_edm4hep::truth {
22
23/// What `generatorStatus` means on `STSH_MCParticles`.
24///
25/// Generator lines carry JETSET's status code KS, which DELSIM stores as
26/// K(I,1) = 10000 KS + KH (STSH bank) and SKELANA divides back out; the
27/// meanings follow the JETSET/PYTHIA 6 event-record convention. Particles the
28/// detector simulation created have status 0.
29///
30/// @collection{STSH_MCParticles}
31enum GeneratorStatus : std::int32_t {
32 kStatusSimulated = 0, ///< created by DELSIM, with
33 ///< `isCreatedInSimulation` set: decay products
34 ///< of the particles JETSET left undecayed
35 ///< (K0S, Lambda, Sigma, Xi, Omega, and pi, K, mu
36 ///< decaying in flight), and secondaries of
37 ///< interactions in the detector (photon
38 ///< conversions, bremsstrahlung, hadronic
39 ///< interactions). The parent is the particle
40 ///< entering its origin vertex; PDG is
41 ///< translated from DELPHI's particle code, with
42 ///< nuclei as nuclear codes
43 kStatusUndecayed = 1, ///< JETSET: undecayed particle. DELSIM may still
44 ///< have decayed it or ended it in an
45 ///< interaction; its endpoint is then that
46 ///< vertex and its daughters have status 0
47 kStatusDecayed = 11, ///< JETSET: decayed particle, or a fragmented
48 ///< parton that is the last of its colour
49 ///< singlet
50 kStatusFragmentedParton = 12, ///< JETSET: fragmented parton followed by more
51 ///< partons of the same colour singlet; also a
52 ///< B meson that decayed after mixing
53 kStatusRearrangedParton = 13, ///< JETSET: parton removed when special colour
54 ///< flow rearranged its parton system
55 kStatusBranchedParton = 14 ///< JETSET: parton that branched into further
56 ///< partons, with special colour flow
57};
58
60public:
62 void emit() override;
63};
64
66public:
68 void emit() override;
69};
70
71} // namespace delphi_edm4hep::truth
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)