Skip to main content

atlas-mc-scanner

PyPI - Version PyPI - Python Version


Table of Contents

Usage

Prerequisites:

  1. Install the package manager uv on your machine.
  2. Get a servicex.yaml file in your home directory.
    • As of this writing the UChicago instructions are slightly out of date. After clicking the sign-in link at the top of the UChicago servicex page, look for the ATLAS button. Click that and use your usual CERN sign-on.

The package manager uv enables a fast download and isolated install of simple utilities - and it means you don't have to pay attention to dependencies or anything else.

Running:

Here is the help you get back:

PS C:\Users\gordo> uvx atlas-mc-scanner --help
Installed 82 packages in 1.25s

 Usage: atlas-mc-scanner [OPTIONS] COMMAND [ARGS]...

╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.                                                                                                                                                                                        │
│ --show-completion             Show completion for the current shell, to copy it or customize the installation.                                                                                                                                                 │
│ --help                        Show this message and exit.                                                                                                                                                                                                      │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ particles         Dump particles in the dataset.                                                                                                                                                                                                               │
│ decays            print out decay frequency for a particular particle                                                                                                                                                                                          │
│ find-containers   List containers that likely contain TruthParticles.                                                                                                                                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Here is an example of a list of particle decays in the default container TruthBSMWithDecayParticles:

PS C:\Users\gordo> uvx atlas-mc-scanner particles mc23_13p6TeV:mc23_13p6TeV.561231.MGPy8EG_A14N23LO_HAHM_ggHZdZd_mumu_600_0p005.deriv.DAOD_LLP1.e8577_e8528_a934_s4370_r16083_r15970_p6619_tid42970882_00

╒══════════╤══════════════╤═════════╤═══════════════════╤═══════════════════╤═══════════════════╕
│   PDG ID │ Name         │   Count │   Avg Count/Event │   Max Count/Event │   Min Count/Event │
╞══════════╪══════════════╪═════════╪═══════════════════╪═══════════════════╪═══════════════════╡
│       13 │ mu-          │   45622 │            4.5622 │                 6 │                 2 │
├──────────┼──────────────┼─────────┼───────────────────┼───────────────────┼───────────────────┤
│       32 │ Unknown (32) │   20000 │            2      │                 2 │                 2 │
├──────────┼──────────────┼─────────┼───────────────────┼───────────────────┼───────────────────┤
│       22 │ gamma        │    2825 │            0.2825 │                 7 │                 0 │
├──────────┼──────────────┼─────────┼───────────────────┼───────────────────┼───────────────────┤
│       11 │ e-           │      25 │            0.0025 │                 4 │                 0 │
╘══════════╧══════════════╧═════════╧═══════════════════╧═══════════════════╧═══════════════════╛

And looking at the decay products:

$ atlas-mc-scanner decays mc23_13p6TeV:mc23_13p6TeV.561231.MGPy8EG_A14N23LO_HAHM_ggHZdZd_mumu_600_0p005.deriv.DAOD_LLP1.e8577_e8528_a934_s4370_r16083_r15970_p6619_tid42970882_00 13

╒═══════════════════════════╤═══════════════╤═════════════╤════════════╕
│ Decay Products (PDGIDs)   │ Decay Names   │   Frequency │ Fraction   │
╞═══════════════════════════╪═══════════════╪═════════════╪════════════╡
│ [13, 22]                  │ mu- + gamma   │        1438 │ 40.66%     │
├───────────────────────────┼───────────────┼─────────────┼────────────┤
│ [13]                      │ mu-           │        1373 │ 38.82%     │
├───────────────────────────┼───────────────┼─────────────┼────────────┤
│ No Decay Products         │               │         726 │ 20.53%     │
╘═══════════════════════════╧═══════════════╧═════════════╧════════════╛

The ATLAS decay model is complex:

  • If the Decay Products column contains No Decay Products, that means a decay vertex was found in the TruthParticle, but it had decay products.
  • If the Decay Products column contains Stable, that means no decay vertex was found.

Notes on uv:

  • uvx won't update atlas-mc-scanner unless explicitly told. If you think there is a new version released, please do uvx atlas-mc-scanner @latest --help to make sure you have the most recently released.
  • If you want atlas-mc-scanner to be available directly from your command line, then you can do uv tool install atlas-mc-scanner. After that, you should be able to just type atlas-mc-scanner directly without uvx. To upgrade it to the latest version do uv tool upgrade atlas-mc-scanner.

Commands

  • Use the particles sub-command to list a container of truth particles
  • Use the decays sub-command to list the decays of a particular particle
  • Use the find-containers sub-command to list all containers in the file that contains TruthParticles. Note this uses heuristics, so it might not be 100% correct.

All datasets are assumed to be rucio, though you can specify a https://xxx for a file if you like. Obviously, they must be a file in the xAOD format! This code uses the EventLoop C++ framework, run on ServiceX to extract the information.

Errors

Some common errors you might see.

Missing servicex.yaml file

The error message when you run is fairly straight forward. The servicex.yaml file (or .servicex) must exist in your home directory or in the current working directory.

Your dataset does not exist

This is a known bug. There are two hints. First, the Transform status update will be red rather than green. Second, you'll have a stack dump that ends with the message IndexError: list index out of range.

Bad container name

You will get the same stack-dump as with the data set not existing (the list index out of range), and scroll up and look at the top of the crash and look for Transform "atlas-mc-scanner" completed with failures: 1/1. Below that will be a huge URL which points to the monitoring (it is the seocond URL in the dump). From there look for an ERROR and click on the second column to expand that error entry. There, under logBody you can see the complete output from the EventLoop job. Near the bottom you'll finally find the familiar errors:

xAOD::TEvent::connectB... WARNING No metadata available for branch: forkitover
xAOD::TEvent::connectB... WARNING Branch "forkitover" not available on input
xAOD::TEvent::retrieve    WARNING Couldn't (const) retrieve "DataVector<xAOD::TruthParticle_v1>/forkitover"
AnalysisAlg              ERROR   /home/atlas/rel/source/analysis/Root/query.cxx:73 (virtual StatusCode query::execute()): Failed to call "evtStore()->retrieve(result, "forkitover")"

Installation

pip install atlas-mc-scanner

License

atlas-mc-scanner is distributed under the terms of the MIT license.

Metadata

Release files for atlas-mc-scanner 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atlas-mc-scanner 1.0.1
File Size Uploaded
atlas_mc_scanner-1.0.1.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atlas-mc-scanner 1.0.1
File Interpreter ABI Platform
atlas_mc_scanner-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / atlas_mc_scanner-1.0.1.tar.gz

Download URL atlas_mc_scanner-1.0.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
42e19a8b5d45e20ce8cbc5719e9141e2ec3bce9f785bfab89501286714476225
BLAKE2b-256 checksum
How to use checksums
60a73c4a83c82716f34d72c17a9f9f92ee580cfcb975fcb003f74b4f9ea44ae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 6, 2025.

Transparency log

Release files / atlas_mc_scanner-1.0.1-py3-none-any.whl

Download URL atlas_mc_scanner-1.0.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
956f8bb306a05f34e604e46ce199ec6d71ffacb104c9e66fe9624acfdb44e32d
BLAKE2b-256 checksum
How to use checksums
40ca310ee5a41e60a869d0ff93106c6ddc83baf8b2c0c00225a5698d5734125c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 6, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page