FuncADL

FuncADL expresses queries as a chain of functions applied to sequences of events or objects. Queries are written as typed Python objects and translated into C++ or Python depending on the source format. Two variants are available: one for uproot-readable flat data, and one for xAOD datasets.

Warning

FuncADL is a complex query format. A thorough reading of the FuncADL user guide is strongly recommended before use.

Uproot-FuncADL Query

The Uproot-FuncADL variant applies FuncADL’s functional syntax to uproot-readable data, suited for flat ROOT TTrees and NanoAOD formats. Queries chain method calls starting from FuncADL_Uproot(), selecting a tree and the desired columns:

query.FuncADL_Uproot()
.FromTree("CollectionTree")
.Select(lambda e: {"el_pt": e["AnalysisElectronsAuxDyn.pt"]})

See also

For full reference documentation on Uproot-FuncADL, see the FuncADL user guide.

FuncADL xAOD Query

The xAOD variant is designed for ATLAS PHYS and PHYSLITE datasets, where queries are translated into optimized C++ and executed in AnalysisBase. The following example fetches the \(p_T\), \(\eta\), and EM fraction of jets from a PHYSLITE file:

from func_adl_servicex_xaodr22 import FuncADLQueryPHYSLITE, cpp_float

query = FuncADLQueryPHYSLITE()
jets_per_event = query.Select(lambda e: e.Jets('AnalysisJets'))
jet_info_per_event = jets_per_event.Select(
    lambda jets: {
        'pt': jets.Select(lambda j: j.pt()),
        'eta': jets.Select(lambda j: j.eta()),
        'emf': jets.Select(lambda j: j.getAttribute[cpp_float]('EMFrac'))  # type: ignore
    }
)

See also

For full reference documentation on the xAOD variant, see the FuncADL user guide.

API Reference

FuncADLQuery_Uproot

class servicex.func_adl.func_adl_dataset.FuncADLQuery_Uproot(item_type: Type = typing.Any)[source]
generate_selection_string()[source]

override with the selection string to send to ServiceX

FuncADLQuery_ATLASr21

class servicex.func_adl.func_adl_dataset.FuncADLQuery_ATLASr21(item_type: Type = typing.Any)[source]

FuncADLQuery_ATLASr22

class servicex.func_adl.func_adl_dataset.FuncADLQuery_ATLASr22(item_type: Type = typing.Any)[source]

FuncADLQuery_ATLASxAOD

class servicex.func_adl.func_adl_dataset.FuncADLQuery_ATLASxAOD(item_type: Type = typing.Any)[source]

FuncADLQuery_CMS

class servicex.func_adl.func_adl_dataset.FuncADLQuery_CMS(item_type: Type = typing.Any)[source]