---
title: "Detector Response and Unfolding Interactive Lab | Sandbox Physics"
description: "Can two nearby peaks survive a blurred measurement? A response matrix connects the original spectrum to the detector record."
canonical_url: "https://sandboxphysics.com/labs/detector-unfolding/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/detector-unfolding/"
---

Collider physics · recovering a mass spectrum

# Detector Response and Unfolding

**Can two nearby peaks survive a blurred measurement?** A response matrix connects the original spectrum to the detector record. Unfolding estimates the original distribution, but finite resolution and a mismatched response can amplify noise or bias the result.

Follow saved simulated events from true mass to reconstructed mass. Change the detector resolution, then unfold the recorded spectrum and compare it with the known simulated truth.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Model assumptions

Synthetic mass records with a Gaussian detector response. Open the model notes for calibration, prior and uncertainty assumptions.

### The mass spectrum

Simulated truth Recorded counts Unfolded estimate

Bars show square-root count errors on the recorded bins; unfolded uncertainties are not shown.

### Where each true bin is recorded

$R_{ji}=P(j\mid i)$

Brighter cells mean a larger probability. Each column sums to its acceptance; lost events stay outside the matrix.

[From a collision to jets and inference: eight connected chapters](https://sandboxphysics.com/stories/collider-qcd/)

Start with four-momentum, work through clustering, response matrices and likelihoods, then check extrapolation against a public jet spectrum.

Physics tutorial

## Recovering a spectrum after the detector blurs it

**Background** A particle pair has one true invariant mass, but a detector records a nearby value and sometimes misses the event. A narrow peak spreads across several measured bins.

**Why it matters** Two nearby peaks can merge into one broad hill. A response matrix tells us how likely each migration is, so we can ask which true spectra could have produced the recorded counts.

Start with the essentials

- **Focus question**: What can a blurred mass spectrum tell us about two nearby structures?
- **One-sentence intuition**: Unfolding reallocates recorded counts using a calibrated response; its apparent sharpness depends on the information in the data and on regularization.

### Core mathematical model

#### From true bins to recorded bins

$$
\nu_j=\sum_i R_{ji}t_i,\qquad \epsilon_i=\sum_j R_{ji}
$$

The column index labels true mass and the row labels reconstructed mass. A column can sum to less than one because detection and the displayed mass window lose events.

#### One iterative update

$$
\begin{aligned}\nu_j^{(k)}&=\sum_\ell R_{j\ell}t_\ell^{(k)}\\t_i^{(k+1)}&=\frac{t_i^{(k)}}{\epsilon_i}\sum_j R_{ji}\frac{n_j}{\nu_j^{(k)}}\end{aligned}
$$

Start with a positive flat cause-bin spectrum. Each update allocates observed counts among their possible causes and corrects for efficiency. Stopping early smooths the answer; more iterations can amplify noise.

#### Compare the estimate with simulated truth

$$
e=\frac{\sqrt{\sum_i(\hat t_i-t_i)^2}}{\sqrt{\sum_i t_i^2}}
$$

This relative error uses the true histogram saved by the simulator. A real measurement cannot compute it from recorded counts alone.

### Common difficulties

#### A good refolded spectrum can conceal a wrong answer

**Typical misconception** If the unfolded result reproduces the measured spectrum after folding, it must be the true distribution.

**Better mental model** Several sharply different true spectra can blur into similar recorded counts. A response offset missing from calibration can also move the inferred peaks. Independent truth shapes and repeated simulated acquisitions test that sensitivity.

#### Iteration count changes the estimator

**Typical misconception** Enough iterations will always reveal every narrow peak.

**Better mental model** Finite resolution discards information. Iterations trade smoothing bias for noise, and the saved sample has finite statistics. A confidence interval must account for this bias and for uncertainty in the response.

### Run the experiment

1. 01

   #### Follow one event through the measurement

   Watch the cyan-to-coral paths, then drag the gold resolution handle.

   **What to observe:** Paths spread sideways as resolution worsens. Lost events fade; they do not enter the recorded mass histogram.

2. 02

   #### Merge the peaks

   Choose Peaks merge and compare recorded counts with simulated truth.

   **What to observe:** Two narrow truth structures produce one broad measured hill. The response matrix spreads across several reconstructed bins.

3. 03

   #### Change the regularization

   Increase Unfolding iterations while keeping the acquisition fixed.

   **What to observe:** The gold estimate can develop sharper structure. The recorded coral points do not change because the same saved events are being analysed.

4. 04

   #### Miss a calibration shift

   Choose Calibration misses a shift and compare truth error with refolded Poisson deviance.

   **What to observe:** The fitted recorded spectrum can look plausible while the recovered masses move away from the known simulated truth.

Physical conclusion

A response model connects a measurement to possible true spectra. Independent samples, alternative shapes and uncertainty studies determine how much detail the unfolding can support.

## Related experiments and articles

Collider physics · Reading path

### Collider physics from events to inference

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Recover a spectrum after detector smearing**](https://sandboxphysics.com/stories/collider-qcd/detector-response-and-unfolding/)

Quantum & fields · Starter path

## Start from a single measurement

Predict an outcome, then count what the measurements actually give. The path starts with one qubit and moves on to wave packets, bound states and two-photon interference.

[Start here → **Quantum State & Born Measurement** Predict a probability, turn the analyzer, then compare your prediction with the measured frequency over many shots. Observe · 15 min](https://sandboxphysics.com/labs/qubit-state/)

1. [1 Quantum State & Born Measurement](https://sandboxphysics.com/labs/qubit-state/)
2. [2 Stern–Gerlach Sequence](https://sandboxphysics.com/labs/stern-gerlach-sequence/)
3. [3 Wave Packet & Uncertainty](https://sandboxphysics.com/labs/wave-packet-uncertainty/)
4. [4 Quantum Harmonic Oscillator](https://sandboxphysics.com/labs/quantum-harmonic-oscillator/)
5. [5 Which Path & Quantum Eraser](https://sandboxphysics.com/labs/quantum-eraser/)
6. [6 Hong–Ou–Mandel Two-Photon Interference](https://sandboxphysics.com/labs/hong-ou-mandel/)

[View the full path →](https://sandboxphysics.com/topics/quantum/#starter-path)
