Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

End-to-End Scikit-HEP Analysis Pipeline

In the previous chapters you met uproot, awkward, vector, and hist one at a time. This chapter chains them into a single, realistic analysis: we will look for evidence of the Higgs boson in the H→ZZ∗→4ℓH \rightarrow ZZ^* \rightarrow 4\ell channel, using ATLAS Open Data from the 2015 and 2016 proton-proton runs.

The data is read in chunks, so the notebook runs in a small, fixed amount of memory however many files you process.

Reading the data

We use the 4lep skim of the ATLAS Run 2 open data: 16 files, 660 MB in total, holding 1.5 million events that contain at least four leptons. The files are plain ROOT ntuples, so uproot can read them directly.

Only eight branches are needed, and we read them a chunk at a time rather than all at once, so memory use stays flat no matter how much data is enabled below.

The analysis logic

Picking any four leptons and adding up their four-momenta does not work. Three things have to be right, and each one is a cut that matters enormously:

Lepton quality. The skim is deliberately loose, applying no quality requirements at all. Without lep_isTightID and lep_isTightIso, roughly 424,000 “candidates” survive and about 18,000 land in the Higgs mass window — some 500 times the real signal, almost all of it misidentified jets. With the cuts applied, 911 events remain.

The second Z is off-shell. Since mH=125 GeVm_H = 125\ \text{GeV} is below 2mZ=182 GeV2m_Z = 182\ \text{GeV}, the Higgs cannot decay into two on-shell Z bosons. One is real and the other is virtual (Z∗Z^*), typically well below 91 GeV. This is why the two mass windows below are deliberately asymmetric: demanding that both pairs sit near the Z mass would throw away essentially all of the signal.

The two Z candidates must not share a lepton. ak.combinations over a list of lepton pairs will happily return two pairs built from overlapping leptons, and adding those four-momenta double-counts a lepton. On this dataset about 90% of the naive combinations are of that kind. The fix is ak.argcombinations, which gives the indices of the paired leptons rather than the leptons themselves, so we can require all four indices to be distinct.

Processing the data and plotting

Now we loop over the files, read each one in chunks with TTree.iterate, and fill a hist histogram as we go. Only one chunk is ever in memory, so this would work just as well on a dataset far too large to load at once.

events read: 1,515,848
total candidates: 697
  Z -> 4l          26
  Higgs window     31
  ZZ continuum    319
<Figure size 900x500 with 1 Axes>

What the plot shows

Three features are worth picking out, and only one of them is the Higgs:

  • A peak at 91 GeV. This is Z→4ℓZ \rightarrow 4\ell, a single Z boson decaying to four leptons through a virtual photon. It is a known, precisely measured process, which makes it a useful check: if the machinery can reconstruct this peak in the right place, it is probably assembling four-vectors correctly.

  • The ZZ continuum above 180 GeV. Once there is enough energy to produce two real Z bosons, the rate climbs steeply. This dominates the plot by sheer numbers.

  • An excess near 125 GeV, with about 31 candidates in the 115–130 GeV window over a background of roughly 15.

The peak looks sharper than it really is, though. The histogram uses 29 bins between 80 and 250 GeV, so each one is about 5.9 GeV wide, and the signal happens to fall almost entirely inside a single bin. Re-binned to 2.5 GeV the same events spread over two bins of roughly eight entries each, which is far less striking. Only the binning has changed, not the physics — worth remembering whenever a bump is judged by eye.

Comparing that excess against the sidebands gives a local significance of about 3.5σ3.5\sigma. That is genuine evidence, and it is the right order of magnitude for this much data — but it is not a discovery. We have made no estimate of the systematic uncertainties, used a crude background model rather than simulation, and ignored the look-elsewhere effect. The real ATLAS measurement reached this level of sensitivity with the same data, and needed a great deal more care to turn it into a claim.

Fitting the peak

A bump that we can see is one thing; a number with an uncertainty is another. We can estimate the mass by fitting the region around the peak with a simple model: a Gaussian for the signal sitting on a flat background.

The fit is an extended unbinned maximum-likelihood fit, which uses the individual candidate masses rather than histogram bins — worth doing when there are only a handful of signal events, as there are here. iminuit provides both the likelihood (cost.ExtendedUnbinnedNLL) and the minimiser, so all we supply is a function returning the expected yield and the density.

fit converged: True
  m_H        = 123.4 +/- 1.4 GeV
  resolution = 3.3 +/- 0.9 GeV
  signal     = 16 +/- 6 events  (2.6 sigma)
  background = 62 +/- 9 events
<Figure size 900x500 with 1 Axes>

The fit returns a mass of about 123.4 GeV with an uncertainty of roughly 1.4 GeV, against the known value of 125.25 GeV — agreement to a little over one standard deviation, from fewer than twenty signal events. Repeating the fit over different ranges, anywhere from 95–165 GeV to 110–150 GeV, moves the result by less than 0.1 GeV, so it is not an artefact of where we drew the window.

The fitted width is also meaningful. At about 3.3 GeV it is far wider than the Higgs boson’s natural width of a few MeV, so what we are really measuring is the detector’s mass resolution for four leptons.

That uncertainty is statistical only. A real measurement would add systematic uncertainties — the lepton energy and momentum scales above all — and would model the background from simulation rather than assuming it is flat. With a signal of only 2.6σ2.6\sigma in this fit, the honest summary is that the data is consistent with the known Higgs boson mass, not that we have measured it.