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.md - •
references/datamodel-xaod-missing-et.md - •
references/datamodel-xaod-tools-btagging.md - •
references/datamodel-xaod-event-weights.md - •
references/datamodel-xaod-tlorentzvector.md
- •