Slow-extraction spill monitor
SlowExtractionMonitor reads events from one named Slow extraction (SlowExtraction)
command and accumulates spill histograms by tracking turn, physical arrival
time, or both. It never selects particles from the ring or changes particle
state. Source event rows, rather than a repeated scan of negative tags, are
the counting input. Repeated execution for the same source batch does not
count its events twice.
The Source value must exactly match a SlowExtraction sequence name
in the same beam. The monitor must execute after that source at the same
S (m). Default priorities 850 and 860 provide this order; if explicit
Order is used at that position, set distinct values on every node there.
The monitor must consume every source invocation from its first batch, including
turns outside its statistical window. Missing a batch raises an error; the monitor
does not recover skipped events from the source file.
Windows and bin definitions
Turn and physical-time windows are independently optional and intersect when both are configured. Each is left-closed and right-open. Monitor windows filter the source’s already captured events; they do not change the source’s extraction conditions. A monitor cannot recover particles that its source never captured.
With Bin by="turn", bins of Turn bin width turns are anchored at
Start turn. With Bin by="time", bins of Time bin width (s) seconds
are anchored at Time origin (s). "both" writes the two histograms
separately. Time bins always use the source’s captured particle times:
No fixed revolution-frequency conversion is used. Particles from one turn can occupy different time bins, and later tracking turns can add events to earlier time bins. Therefore time histograms remain provisional during a run; writing a snapshot does not close their bins.
Nominal bin_start and bin_end stay fixed between snapshots.
Time edges are evaluated in float64 as origin + k * width. Assignment uses
exact left-closed, right-open comparisons against these same stored edges,
without snapping nearby times to a boundary. A width too small to resolve
distinct edges at the observed times raises an error.
observed_start, observed_end and observed_width separately describe
the portion covered by the observations so far. Turn coverage is the range
of executed turns inside the monitor’s turn window. Time coverage is the
envelope of the source reference times and accepted particle event times,
clipped to the monitor’s time window. This envelope does not prove that all
particle arrivals in it are complete.
Zero-count bins are included within the observed range, not extrapolated
over the entire requested run. is_partial marks bins whose observed
range is smaller than their nominal range. An event exactly on the newest
time boundary can produce a zero-width partial bin until later observations
extend its coverage. Exclude partial bins when comparing full-bin spill
uniformity, and retain the chosen bin width with any reported ripple metric.
Interface parameters
Python parameter |
JSON key |
Type / default |
Meaning |
|---|---|---|---|
|
|
|
Read-only spill monitor type. |
|
|
finite nonnegative float, required |
Same tracking plane as the source. |
|
|
strict int or null; null |
Same-position order; default priority 860. |
|
|
nonempty str, required |
Exact sequence name of a |
|
|
|
|
|
|
strict positive int; 1 |
Nominal turn-bin width; origin is |
|
|
finite positive float; 0.001 |
Nominal physical-time bin width. |
|
|
finite float; 0 |
Anchor of the time-bin grid; negative bin indices are allowed. |
|
|
strict nonnegative int; 0 |
Inclusive statistical starting turn. |
|
|
strict int or null; null |
Exclusive ending turn, greater than the start when supplied. |
|
|
finite float or null; null |
Inclusive event arrival-time bound. |
|
|
finite float or null; null |
Exclusive arrival-time bound, greater than the start if both exist. |
|
|
strict positive int; 100 |
Output cadence; finalization writes pending updates. |
|
|
|
|
Example
This snippet assumes an existing extract action at the same plane.
from PASS.para.schema import SlowExtractionMonitorItem
seq.add("spill", SlowExtractionMonitorItem(
s=12.5, source="extract", bin_by="both",
start_turn=100, end_turn=10000,
start_time=0.10, end_time=1.20,
turn_bin_width=10, time_bin_width=1e-3, time_origin=0.0,
write_interval_turns=100,
))
Counts include only source events satisfying both the turn and time bounds.
SlowExtractionMonitor is also accepted as the type in the high-level
API’s monitor list. Use SlowExtractionItem separately for the action.
Output tables
Tables are written under slow_extraction/ in the run output directory;
flat-output mode omits the slow_extraction subdirectory. Source and monitor
names, a digest, run identity and beam identifier form the filename stem.
Suffixes _turn.h5 and _time.h5 identify the selected histogram types.
Completed turn bins are appended once at each write interval; the active
partial turn bin is appended only at finalization. The in-memory
get_histogram("turn") result also includes the current partial bin.
Time output publishes a complete cumulative snapshot at its file path,
allowing later events to revise earlier bins. The source’s particle-event
table remains separate.
Column |
Meaning |
|---|---|
|
Fixed nominal edges, in turns or seconds; left-closed, right-open. |
|
Observed coverage in the same units; width is nonnegative. |
|
Boolean indicator of incomplete nominal-bin coverage. |
|
Number of macro-particle events in the bin. |
|
Sum of |
|
Sum of signed |
|
Cumulative macro-particle and real-particle counts in increasing bin order. |
|
Time table only: |
|
Time table only: |
Rates are NaN when observed_width is zero. They use the observed width,
not an assumed full-bin exposure. A partial-bin rate should not be compared
directly with a full-bin ripple statistic. Headers record source event-file
identity, time definition, windows and observed reference/event envelopes.
The CPU and GPU paths consume the same owned host event batches. The monitor does not reread event files on every turn. Writes normally occur every 100 turns and at run completion or finalization; an interrupted run uses the normal command-finalization mechanism. Hard process failure can lose updates still held in memory. A failed turn-table append can leave an incomplete table; execution stops without retrying that append. Time snapshots replace only previously completed snapshots. Histogram state and source event history are not restored by a resume ledger in this implementation.
Read tables with PASS.utils.table_io.read_table as described in
Table output formats. Use the separate source event table for six-dimensional
distributions, particle-level arrival times or different offline binning.