Skip to content

coincidence

Kamil Brylew edited this page Oct 26, 2026 · 7 revisions

Coincidence Measurement

The Coincidence workspace performs live two-channel logic from current-IIO MCA list-mode streams. It requires two compatible list-mode channels and the shared software-start core. The workspace owns both DMA streams for the whole session.

For a completed radioactive-source experiment and downloadable replay sessions, follow the Na-22 511 keV LBC-detector showcase. It documents the physical arrangements, photopeak gates, archived timing fits, and energy matrix with links to the published Zenodo dataset.

Before starting

When several digitizers are connected, first select the intended board in the Coincidence workspace. Both channels must belong to that physical digitizer; cross-board coincidence is disabled because a shared application window does not establish a common hardware clock or trigger.

  1. Verify both physical channels and load compatible MCA settings.
  2. Configure CFD on both MCAs if fine timing will be used.
  3. Set and show the energy ROIs in the two MCA histograms if they should gate coincidence events.
  4. Validate the relative channel delay with a known common-input split before treating a timing peak as detector performance.
  5. Select the MCA DMA output mode. A recorded coincidence run applies that mode to both streams.

Starting coincidence sets external start on both MCAs, arms both IIO readers, and raises the shared software-start level only after both report ready. Stop, timeout, or failure gates start off and drains both channels.

Energy gates

Enable Use CH0 MCA ROI and/or Use CH1 MCA ROI to apply the visible MCA ROI. A hidden ROI or an unchecked option accepts the complete raw MCA-channel range. The accepted-energy plots show applied ROIs as shaded bands and inactive ROIs as muted references.

The current qualified producer maps its 16-bit selected-energy field into the 14-bit MCA channel as:

energy_channel = energyRaw >> 2

Do not shift again by the MCA histogram binning selector. This mapping has been cross-checked with paired captures but is not described by the driver’s opaque record ABI; repeat a labelled-source check after a producer/firmware change.

Logic modes

Rule Meaning
CH0 AND CH1 Emit every ROI-qualified pair inside the inclusive timing gate
NOT CH0 AND CH1 Accept a CH1 anchor only when no qualified CH0 event is inside its window
CH0 AND NOT CH1 Symmetric CH0 anti-coincidence
OR Union of eligible singles
XOR Eligible singles with no opposite-channel event inside the window

NOT does not invert an energy ROI. Both-NOT and NOT combined with OR/XOR are deliberately unavailable.

One event may participate in several AND pairs. The GUI therefore distinguishes pair count, unique participating events per channel, and anchors with multiple partners. Do not use the pair count as a synonym for unique physical pulses.

Timing convention

The signed raw difference is:

delay = CH1 event time - CH0 event time

The measured CH1-minus-CH0 common-input delay is then subtracted as the channel calibration. Bounds are inclusive and decimal nanosecond values are converted to exact internal integer coordinates.

Precision defaults to Coarse (8 ns). Fine mode requires valid CFD records on both MCAs and uses the qualified vdpp-zc-calc-q2.14-v1 profile:

eventTime_ns = 8 * timestampTicks
             + 2 * (uint8(zcOffset) + int16(fineRaw) / 16384)

fineRaw must lie in [-16384, 0]. PSD marker 0x08 takes priority over CFD marker 0x02; ineligible records are counted and excluded. Arithmetic remains integer in units of 1/8192 ns until bounded display differences are formed, so large uint64 timestamps keep adjacent ticks. The displayed delay histogram uses exact 62.5 ps bins.

zcOffset is unsigned and can wrap modulo 256. The client reports boundary crossings but never guesses an unwrap. A producer configuration that overflows this field is not qualified for fine timing.

With enough pairs and a significant local maximum, the GUI overlays a guarded constant-background Gaussian-core fit. It reports centre, FWHM, formal uncertainty, fitted signal count, and reduced chi-square. A poor-fit warning or a narrow fitted core is not by itself a complete detector CTR result.

Live example: Na-22 511 keV pair

This comparison was measured on the two-channel reference board at 192.168.10.128:30431. The prepared inputs carried the same Na-22 event signal with a nominal relative delay of about 25 ns. The application did not read or change the PSU.

Both runs used the same acquisition and selection settings:

  • negative pulse polarity, trigger level -512, and MCA binning 32;
  • CH0 AND CH1 logic with both MCA energy gates enabled;
  • CH0 ROI 2150–2450 and CH1 ROI 1500–1675, covering the two 511 keV photopeaks in this setup;
  • an inclusive timing gate from -40 ns to -16 ns;
  • zero CH1-minus-CH0 calibration, so the plots show the measured raw delay;
  • online-only analysis with delayed-random sidebands disabled.

Raw MCA-channel positions are specific to this detector gain and processing configuration. Locate the 511 keV photopeak again instead of copying these ROI numbers to another setup.

Coarse timestamps, CFD disabled

For the coarse run, hardware CFD was explicitly disabled on both MCA channels and Coarse (8 ns) was selected. The broad maximum falls in the bin centred at -20 ns; an 8 ns histogram cannot resolve the prepared delay more precisely. CFD valid: 0 in the footer independently confirms that no fine-CFD values entered this result.

Live Na-22 511 keV coincidence measurement using coarse 8 ns timestamps with CFD disabled.

The screenshot is a live view and therefore says provisional. After it was captured, both streams were stopped and drained. CH0 completed 348 frames (356,352 records) and CH1 completed 339 frames (347,136 records); both final summaries reported verified continuity, zero DMA faults, and zero list deadtime.

CFD fine timing

For the fine run, CFD was enabled on both channels with factor 0.4, delay 2 ns, and a time-walk window of 8–64 ns. CFD fine (62.5 ps bins) was then selected without changing the trigger, energy ROIs, timing gate, or channel calibration. The live Gaussian-core fit placed the peak near -27.14 ns with an FWHM of about 0.15 ns. This resolves the relative delay hidden inside the coarse 8 ns bins; the difference from the nominal 25 ns also includes the uncalibrated channel and producer timing offsets.

Live Na-22 511 keV coincidence measurement using 62.5 ps CFD timing bins.

This screenshot is also provisional. The subsequent drain completed with 151 CH0 frames (154,624 records) and 146 CH1 frames (149,504 records). Both channels finished with verified continuity, zero DMA faults, and zero list deadtime. Treat the displayed Gaussian FWHM as the fitted core for this short validation run, not as a complete detector timing-resolution result.

Energy matrix and random subtraction

Ordinary AND analysis fills a 512 × 512 matrix. Rows are CH1, columns are CH0, and each matrix bin spans 32 raw MCA channels. Raw channels remain on the bottom and left axes; valid MCA energy calibrations provide keV labels on the top and right axes.

Movable vertical and horizontal display gates project selected CH1 and CH0 populations. They do not alter acquisition or prompt-pair counting.

Matrix modes are:

  • prompt pairs;
  • the combined delayed-random sidebands;
  • prompt minus scaled random.

The two delayed sidebands each have the prompt-window width and are separated by a configurable gap. Their combined matrix is multiplied by 0.5 before subtraction. Corrected logarithmic display uses a sign-preserving sign(count) * log10(1 + abs(count)) transform. Matrix analysis is unavailable for veto, OR, and XOR because those rules do not produce two-member pairs.

The live prompt matrix below uses the same .128 Na-22 configuration as the coarse 511 keV example above: trigger -512, binning 32, CH0 ROI 2150–2450, CH1 ROI 1500–1675, timing gate -40…-16 ns, and CFD disabled. The matrix and both projections are zoomed to the active energy region; this changes only the display, not the acquired matrix or its raw-channel axes. Prompt data and a logarithmic scale make the correlated band visible. Delayed-random sidebands were disabled for this short demonstration, so no background subtraction is implied.

Live Na-22 511 keV prompt energy matrix and its CH0 and CH1 projections.

The brightest 32-channel matrix cell was centred near CH0 2256 and CH1 1584, inside the two independently selected 511 keV ROIs. The diagonal extent reflects the correlation between the pulse-height estimates in the two prepared input signals; it is not an energy-calibration line. The image was captured while the result was still marked Live provisional. The final drain completed with 197 CH0 frames (201,728 records) and 192 CH1 frames (196,608 records). Both channel summaries reported verified continuity, zero DMA faults, and zero list deadtime.

Recording and finalization

A recorded run creates channel-specific files (..._ch0, ..._ch1) plus a common _session.yaml manifest. Binary output keeps per-channel YAML and JSON sidecars; HDF5 and ROOT embed configuration metadata. Online-only creates no capture files.

The session manifest records the timing equation, channel-delay sign, inclusive gate, pairing policy, schema profile, and available transport identity. Live results remain provisional until both fixed-frame streams stop and drain.

The current producer can pad the final 1,024-record frame with zero records but does not publish an exact valid-record count. Ambiguous zero-time padding is reported rather than silently treated as a real coincidence or an infallible end marker.

Prompt, random, and corrected matrices can be exported to HDF5 or ROOT without overwriting an existing file. Exports include raw-channel edges, timing and display gates, calibration metadata, and session diagnostics.

Validation checklist

  • Both readers reported ready before shared start.
  • No driver DMA fault, completed-frame mismatch, or list deadtime was reported.
  • The two streams overlap in time and the final drain completed.
  • The channel-delay sign was verified with a known split input.
  • Fine mode shows no unacceptable zcOffset boundary behaviour.
  • Energy mapping was checked after any producer/firmware change.
  • Pair counts are interpreted separately from unique-event counts.

See Capture Files and Integrity for file metadata and Troubleshooting for list-mode transport failures.

Clone this wiki locally