| name | servicex |
| description | Write ServiceX queries in func_adl against ATLAS xAOD data (PHYSLITE/PHYS) and provide guidance for dataset selection, filtering, and deliver usage. Use when asked to build, edit, or debug ServiceX/func_adl queries, ATLAS xAOD skims, or rucio dataset fetches. |
ServiceX
Overview
Provide concise, correct func_adl query patterns for ServiceX on ATLAS xAOD, with best practices for selections, outputs, and deliver usage.
Workflow
- Identify the dataset type and base query.
- Use
FuncADLQueryPHYSLITEfor PHYSLITE or OpenData. - Use
FuncADLQueryPHYSfor PHYS or other derivations.
- Use
- Build a top-level
Selectthat gathers all required collections and singletons.- Apply object-level filters with nested
.Whereinside thisSelect. - Do not pick columns yet.
- Apply object-level filters with nested
- Apply event-level filtering with a top-level
.Whereafter the collectionsSelect. - Create a final top-level
Selectthat returns a single dictionary of output columns.- Convert units to standard LHC units (GeV, meters, etc.).
- Never return a nested dictionary.
- Use
deliveronce withNFiles=1by default and appropriate dataset source(s). - Make sure that the layout of the data that will be returned is remembered - downstream tasks that want to work with the data will need to understand it.
Core Rules
- Prefer two top-level
Selectcalls: collections first, output columns second. - Filter objects with nested
.Where; filter events with a top-level.Where. - Use a single final
Selectthat returns a dictionary of outputs. - Do not use
awkwardfunctions inside ServiceX queries. - Use
dataset.Ruciofor rucio DIDs anddataset.FileListfor URL lists. - Always set
NFiles=1indeliverby default. - If a transform fails and logs are required, respond with
HELP USER. - Ensure
func_adl_servicex_xaodr25is listed as a dependency in the active project and installed in the current virtual environment before running or generating code that uses it.
References
- Load
references/servicex-hints.mdfor overall ServiceX query patterns, best practices, and error handling, and template code. - Load only the relevant xAOD data model topic file(s) to keep context small. Naming convention:
references/datamodel-xaod-*.md. - xAOD topics:
references/datamodel-xaod-units.md(standard ATLAS units (energy, etc))references/datamodel-xaod-objects.md(jets, electrons, muons)references/datamodel-xaod-tau.mdreferences/datamodel-xaod-missing-et.mdreferences/datamodel-xaod-tools-btagging.mdreferences/datamodel-xaod-event-weights.mdreferences/datamodel-xaod-tlorentzvector.md