Particle Template
particle_template is the C++ base for every user-defined particle type.
It stores a particle_t data struct (4-momentum + flags) and exposes
kinematic properties via the cproperty<T,G> getter/setter mechanism so that
subclasses can override individual components without changing the interface.
The class also manages topology helpers (register_parent, register_child,
DeltaR), ROOT-branch leaf registration (add_leaf, apply_type_prefix),
and in-place four-momentum addition (operator +=, iadd).
Class: particle_template
Header: <templates/particle_template.h>
Inheritance: tools
Constructors
Signature |
Description |
|---|---|
|
Default constructor; initialises |
|
Initialises from a serialised |
|
Copy constructor; |
|
Constructs from Cartesian four-momentum (all in MeV). |
|
Constructs massless particle from 3-momentum ( |
Kinematic Properties (cproperty)
All kinematic properties are readable and writable. The framework converts
between cylindrical (pt, η, φ, E) and Cartesian (px, py, pz, E)
representations on demand via to_polar() / to_cartesian().
Property |
Type |
Description |
|---|---|---|
|
|
Energy in MeV. |
|
|
Transverse momentum |
|
|
Pseudorapidity |
|
|
Azimuthal angle |
|
|
x-component of 3-momentum in MeV. |
|
|
y-component of 3-momentum in MeV. |
|
|
z-component of 3-momentum ( |
|
|
Invariant mass |
|
|
3-momentum magnitude |
|
|
Relativistic β = ||p||/E. Read-only. |
Meta-Data Properties
Property |
Type |
Description |
|---|---|---|
|
|
PDG particle identifier. Default |
|
|
LaTeX symbol, e.g. |
|
|
Electric charge in units of elementary charge. |
|
|
18-character hex string uniquely identifying this particle in an event. Read-only — computed from kinematic content. |
|
|
String type prefix set by |
|
|
Position index within the parent event particle collection. Default |
Truth / Flag Properties (read-only)
All flags are derived from particle_t.pdgid:
Property |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Topology Properties
Property |
Type |
Description |
|---|---|---|
|
|
Map of parent particles by their hash. |
|
|
Map of child particles by their hash. |
|
|
Internal backing store for |
|
|
Internal backing store for |
Public Methods
Signature |
Description |
|---|---|
|
Returns |
|
Hash-equality comparison. |
|
Returns a new particle of type g whose 4-momentum is the sum of
|
|
Adds p’s 4-momentum to |
|
In-place 4-momentum addition (Cartesian). |
|
Adds p to |
|
Adds p to |
|
Registers ROOT branch mapping: |
|
Prepends |
|
Serialises the particle to a nested map suitable for HDF5 storage. |
|
Override in subclasses to populate the particle from ROOT branch data held in el (called by the event builder). |
|
Override in subclasses to return a heap-allocated copy of the particle. The caller is responsible for ownership. |
|
Returns |
Public Data
Field |
Type |
Description |
|---|---|---|
|
|
Raw kinematic and flag storage struct. |
|
|
Maps property key → resolved ROOT branch name (populated by |
|
|
Set to |
|
|
Set to |