Expand description
Opt-in recorder of ion paths: the collision points of chosen histories.
TrajectoryRecorder is a BcaTally like any other, so the engine pays
nothing for it unless a run uses it: no field on Particle, no flag and
no branch in the transport loop. Recorded forwards every hook to an
ordinary tally as well, so the usual results come out of the same run and
are identical with recording on or off (the recorder draws no random
numbers and never touches the engine state).
§Convention
A history is a list of tracks: the primary (generation 0) and every
displaced atom (a recoil, generation = parent + 1). A track is an ordered
list of points, positions in metres (x the depth) and energies in eV:
- a recoil starts with its state at creation;
- every collision partner adds the particle’s incoming state at the
collision (the
BcaTally::partnerconvention). A crystal step with several simultaneous partners adds one point. The primary’s own track therefore starts at its first collision, not at the surface; - a track that stops or leaves the target ends with that state (for an escape, the state outside after refraction by the surface barrier), the same position the other tallies see. A recoil that is created below the recoil cutoff, or with cascades off, is stopped at creation and has that one point.
Each non-primary track names its parent track in the same history. The
engine reports no track-start event; the recorder rebuilds the link by
mirroring the engine’s last-in first-out queue of recoils: a recoil
reported and then stopped with the identical state was never queued, any
other is followed after its parent ends, the most recent first.
§Bounds
Memory is bounded by two caps. Only histories with index below
TrajectoryConfig::max_histories are recorded, so the lowest indices win
whatever the thread count; the others are counted in
TrajectoryRecorder::histories_skipped. A history keeps at most
TrajectoryConfig::max_points points over all its tracks; further points
(and the tracks of further recoils) are dropped and the history is flagged
History::truncated. Histories are merged in chunk order, so the output
is bit-identical at any thread count.
Structs§
- History
- The recorded tracks of one primary history.
tracks[0]is the primary; everyparentindex is smaller than the track’s own. - Recorded
- An ordinary tally and a
TrajectoryRecorderfed by the same events of one run.innersees exactly what it would see alone. - Track
- The path of one particle.
- Trajectory
Config - Caps on what a
TrajectoryRecorderkeeps. - Trajectory
Point - One point of a track.
- Trajectory
Recorder - A
BcaTallythat records ion and recoil paths. See the module documentation for the convention and the caps.
Enums§
- Track
End - How a track ended.