{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "5efbd85a-a55f-41a9-a34e-452151c0a9a7", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import servicex as sx\n", "import awkward as ak\n", "from func_adl_servicex import ServiceXSourceUpROOT\n", "import matplotlib.pyplot as plt\n", "\n", "plt.rcParams['figure.dpi'] = 200 # make figures bigger and more readable" ] }, { "cell_type": "code", "execution_count": 2, "id": "1caae859-3d03-44c1-ba5c-88da8b576dd6", "metadata": {}, "outputs": [ { "ename": "ServiceXException", "evalue": "(ServiceXException(...), 'Do not know or have enough information to create a Minio Login info ({\\'request_id\\': \\'c27b2f21-378b-4ceb-93d4-1980a0c9691e\\', \\'did\\': \\'File List Provided in Request\\', \\'columns\\': None, \\'selection\\': \"(call Select (call EventDataset \\'bogus.root\\' \\'events\\') (lambda (list event) (attr event \\'met_pt\\')))\", \\'tree-name\\': None, \\'image\\': \\'sslhep/servicex_func_adl_uproot_transformer:20220418-1418-stable\\', \\'workers\\': 20, \\'result-destination\\': \\'volume\\', \\'result-format\\': \\'root-file\\', \\'workflow-name\\': \\'selection_codegen\\', \\'generated-code-cm\\': \\'c27b2f21-378b-4ceb-93d4-1980a0c9691e-generated-source\\', \\'status\\': \\'Submitted\\', \\'failure-info\\': None, \\'app-version\\': \\'1.0.0rc3\\', \\'code-gen-image\\': \\'sslhep/servicex_code_gen_func_adl_uproot:20220418-1418-stable\\'})')", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mServiceXException\u001b[0m Traceback (most recent call last)", "Input \u001b[0;32mIn [2]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m sx_dataset \u001b[38;5;241m=\u001b[39m sx\u001b[38;5;241m.\u001b[39mServiceXDataset(dataset_name, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124muproot\u001b[39m\u001b[38;5;124m\"\u001b[39m,result_destination\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvolume\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 3\u001b[0m ds \u001b[38;5;241m=\u001b[39m ServiceXSourceUpROOT(sx_dataset, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mevents\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m----> 4\u001b[0m missing_ET \u001b[38;5;241m=\u001b[39m \u001b[43mds\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mSelect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mlambda\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mevent\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mevent\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmet_pt\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mAsAwkwardArray\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalue\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/make_it_sync/func_wrapper.py:63\u001b[0m, in \u001b[0;36mmake_sync..wrapped_call\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 61\u001b[0m \u001b[38;5;129m@wraps\u001b[39m(fn)\n\u001b[1;32m 62\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapped_call\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m---> 63\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_sync_version_of_function\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/make_it_sync/func_wrapper.py:26\u001b[0m, in \u001b[0;36m_sync_version_of_function\u001b[0;34m(fn, *args, **kwargs)\u001b[0m\n\u001b[1;32m 23\u001b[0m exector \u001b[38;5;241m=\u001b[39m ThreadPoolExecutor(max_workers\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m 24\u001b[0m future \u001b[38;5;241m=\u001b[39m exector\u001b[38;5;241m.\u001b[39msubmit(get_data_wrapper, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m---> 26\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.8/concurrent/futures/_base.py:444\u001b[0m, in \u001b[0;36mFuture.result\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 442\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m CancelledError()\n\u001b[1;32m 443\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m==\u001b[39m FINISHED:\n\u001b[0;32m--> 444\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__get_result\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 446\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTimeoutError\u001b[39;00m()\n", "File \u001b[0;32m/opt/conda/lib/python3.8/concurrent/futures/_base.py:389\u001b[0m, in \u001b[0;36mFuture.__get_result\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 387\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exception:\n\u001b[1;32m 388\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 389\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exception\n\u001b[1;32m 390\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 391\u001b[0m \u001b[38;5;66;03m# Break a reference cycle with the exception in self._exception\u001b[39;00m\n\u001b[1;32m 392\u001b[0m \u001b[38;5;28mself\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n", "File \u001b[0;32m/opt/conda/lib/python3.8/concurrent/futures/thread.py:57\u001b[0m, in \u001b[0;36m_WorkItem.run\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 54\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 56\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 57\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 59\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfuture\u001b[38;5;241m.\u001b[39mset_exception(exc)\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/make_it_sync/func_wrapper.py:21\u001b[0m, in \u001b[0;36m_sync_version_of_function..get_data_wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 19\u001b[0m asyncio\u001b[38;5;241m.\u001b[39mset_event_loop(loop)\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m loop\u001b[38;5;241m.\u001b[39mis_running()\n\u001b[0;32m---> 21\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mloop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_until_complete\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.8/asyncio/base_events.py:616\u001b[0m, in \u001b[0;36mBaseEventLoop.run_until_complete\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 613\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m future\u001b[38;5;241m.\u001b[39mdone():\n\u001b[1;32m 614\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mEvent loop stopped before Future completed.\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 616\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/func_adl/object_stream.py:395\u001b[0m, in \u001b[0;36mObjectStream.value_async\u001b[0;34m(self, executor, title)\u001b[0m\n\u001b[1;32m 392\u001b[0m \u001b[38;5;66;03m# Run it\u001b[39;00m\n\u001b[1;32m 393\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfunc_adl\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mast\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmeta_data\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m remove_empty_metadata\n\u001b[0;32m--> 395\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mawait\u001b[39;00m exe(remove_empty_metadata(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_q_ast), title)\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/func_adl_servicex/ServiceX.py:180\u001b[0m, in \u001b[0;36mServiceXDatasetSourceBase.execute_result_async\u001b[0;34m(self, a, title)\u001b[0m\n\u001b[1;32m 178\u001b[0m \u001b[38;5;66;03m# Run the query for real!\u001b[39;00m\n\u001b[1;32m 179\u001b[0m attr \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mgetattr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_ds, name)\n\u001b[0;32m--> 180\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m attr(q_str, title\u001b[38;5;241m=\u001b[39mtitle)\n\u001b[1;32m 182\u001b[0m \u001b[38;5;66;03m# If this is a single column awkward query, and the user did not specify a column name, then\u001b[39;00m\n\u001b[1;32m 183\u001b[0m \u001b[38;5;66;03m# we will return the first column.\u001b[39;00m\n\u001b[1;32m 184\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mawkward\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m name \u001b[38;5;129;01mand\u001b[39;00m (\u001b[38;5;129;01mnot\u001b[39;00m has_col_names(a)) \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mkey=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcol1\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mstr\u001b[39m(result\u001b[38;5;241m.\u001b[39mlayout):\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex_utils.py:51\u001b[0m, in \u001b[0;36m_wrap_in_memory_sx_cache..cached_version_of_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 49\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 50\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mh\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m - processing request\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 51\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m fn(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 52\u001b[0m sx\u001b[38;5;241m.\u001b[39m_cache\u001b[38;5;241m.\u001b[39mset_inmem(h, result)\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:400\u001b[0m, in \u001b[0;36mServiceXDataset.get_data_awkward_async\u001b[0;34m(self, selection_query, title)\u001b[0m\n\u001b[1;32m 394\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(ServiceXABC\u001b[38;5;241m.\u001b[39mget_data_awkward_async, updated\u001b[38;5;241m=\u001b[39m())\n\u001b[1;32m 395\u001b[0m \u001b[38;5;129m@_wrap_in_memory_sx_cache\u001b[39m\n\u001b[1;32m 396\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget_data_awkward_async\u001b[39m(\n\u001b[1;32m 397\u001b[0m \u001b[38;5;28mself\u001b[39m, selection_query: \u001b[38;5;28mstr\u001b[39m, title: Optional[\u001b[38;5;28mstr\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 398\u001b[0m ):\n\u001b[1;32m 399\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_converter\u001b[38;5;241m.\u001b[39mcombine_awkward(\n\u001b[0;32m--> 400\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_data_return(\n\u001b[1;32m 401\u001b[0m selection_query, \u001b[38;5;28;01mlambda\u001b[39;00m f: \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_converter\u001b[38;5;241m.\u001b[39mconvert_to_awkward(f), title\n\u001b[1;32m 402\u001b[0m )\n\u001b[1;32m 403\u001b[0m )\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/backoff/_async.py:133\u001b[0m, in \u001b[0;36mretry_exception..retry\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 130\u001b[0m details \u001b[38;5;241m=\u001b[39m (target, args, kwargs, tries, elapsed)\n\u001b[1;32m 132\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 133\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m target(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 134\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m exception \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 135\u001b[0m giveup_result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m giveup(e)\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/backoff/_async.py:133\u001b[0m, in \u001b[0;36mretry_exception..retry\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 130\u001b[0m details \u001b[38;5;241m=\u001b[39m (target, args, kwargs, tries, elapsed)\n\u001b[1;32m 132\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 133\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m target(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 134\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m exception \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 135\u001b[0m giveup_result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m giveup(e)\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:621\u001b[0m, in \u001b[0;36mServiceXDataset._data_return\u001b[0;34m(self, selection_query, converter, title, data_format)\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[38;5;129m@on_exception\u001b[39m(backoff\u001b[38;5;241m.\u001b[39mconstant, ServiceXUnknownRequestID, interval\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.1\u001b[39m, max_tries\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n\u001b[1;32m 588\u001b[0m \u001b[38;5;129m@on_exception\u001b[39m(\n\u001b[1;32m 589\u001b[0m backoff\u001b[38;5;241m.\u001b[39mconstant,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 599\u001b[0m data_format: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mroot-file\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 600\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m List[Any]:\n\u001b[1;32m 601\u001b[0m \u001b[38;5;124;03m\"\"\"Given a query, return the data, in a unique order, that hold\u001b[39;00m\n\u001b[1;32m 602\u001b[0m \u001b[38;5;124;03m the data for the query.\u001b[39;00m\n\u001b[1;32m 603\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 619\u001b[0m \u001b[38;5;124;03m on the converter call.\u001b[39;00m\n\u001b[1;32m 620\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 621\u001b[0m all_data \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 622\u001b[0m f\u001b[38;5;241m.\u001b[39mfile: f\u001b[38;5;241m.\u001b[39mdata\n\u001b[1;32m 623\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stream_return(\n\u001b[1;32m 624\u001b[0m selection_query, title, converter, data_format\n\u001b[1;32m 625\u001b[0m )\n\u001b[1;32m 626\u001b[0m }\n\u001b[1;32m 628\u001b[0m \u001b[38;5;66;03m# Finally, we need them in the proper order so we append them\u001b[39;00m\n\u001b[1;32m 629\u001b[0m \u001b[38;5;66;03m# all together\u001b[39;00m\n\u001b[1;32m 630\u001b[0m ordered_data \u001b[38;5;241m=\u001b[39m [all_data[k] \u001b[38;5;28;01mfor\u001b[39;00m k \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28msorted\u001b[39m(all_data\u001b[38;5;241m.\u001b[39mkeys())]\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:621\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[38;5;129m@on_exception\u001b[39m(backoff\u001b[38;5;241m.\u001b[39mconstant, ServiceXUnknownRequestID, interval\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.1\u001b[39m, max_tries\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n\u001b[1;32m 588\u001b[0m \u001b[38;5;129m@on_exception\u001b[39m(\n\u001b[1;32m 589\u001b[0m backoff\u001b[38;5;241m.\u001b[39mconstant,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 599\u001b[0m data_format: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mroot-file\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 600\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m List[Any]:\n\u001b[1;32m 601\u001b[0m \u001b[38;5;124;03m\"\"\"Given a query, return the data, in a unique order, that hold\u001b[39;00m\n\u001b[1;32m 602\u001b[0m \u001b[38;5;124;03m the data for the query.\u001b[39;00m\n\u001b[1;32m 603\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 619\u001b[0m \u001b[38;5;124;03m on the converter call.\u001b[39;00m\n\u001b[1;32m 620\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 621\u001b[0m all_data \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 622\u001b[0m f\u001b[38;5;241m.\u001b[39mfile: f\u001b[38;5;241m.\u001b[39mdata\n\u001b[1;32m 623\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stream_return(\n\u001b[1;32m 624\u001b[0m selection_query, title, converter, data_format\n\u001b[1;32m 625\u001b[0m )\n\u001b[1;32m 626\u001b[0m }\n\u001b[1;32m 628\u001b[0m \u001b[38;5;66;03m# Finally, we need them in the proper order so we append them\u001b[39;00m\n\u001b[1;32m 629\u001b[0m \u001b[38;5;66;03m# all together\u001b[39;00m\n\u001b[1;32m 630\u001b[0m ordered_data \u001b[38;5;241m=\u001b[39m [all_data[k] \u001b[38;5;28;01mfor\u001b[39;00m k \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28msorted\u001b[39m(all_data\u001b[38;5;241m.\u001b[39mkeys())]\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:664\u001b[0m, in \u001b[0;36mServiceXDataset._stream_return\u001b[0;34m(self, selection_query, title, converter, data_format)\u001b[0m\n\u001b[1;32m 641\u001b[0m \u001b[38;5;124;03m\"\"\"Given a query, return the data, in the order it arrives back\u001b[39;00m\n\u001b[1;32m 642\u001b[0m \u001b[38;5;124;03mconverted as appropriate.\u001b[39;00m\n\u001b[1;32m 643\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 657\u001b[0m \u001b[38;5;124;03m on the converter call.\u001b[39;00m\n\u001b[1;32m 658\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 659\u001b[0m as_data \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 660\u001b[0m StreamInfoData(f\u001b[38;5;241m.\u001b[39mfile, \u001b[38;5;28;01mawait\u001b[39;00m asyncio\u001b[38;5;241m.\u001b[39mensure_future(converter(f\u001b[38;5;241m.\u001b[39mpath)))\n\u001b[1;32m 661\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stream_local_files(selection_query, title, data_format)\n\u001b[1;32m 662\u001b[0m ) \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[0;32m--> 664\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m as_data:\n\u001b[1;32m 665\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m r\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:659\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 634\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_stream_return\u001b[39m(\n\u001b[1;32m 635\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 636\u001b[0m selection_query: \u001b[38;5;28mstr\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 639\u001b[0m data_format: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mroot-file\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 640\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m AsyncIterator[StreamInfoData]:\n\u001b[1;32m 641\u001b[0m \u001b[38;5;124;03m\"\"\"Given a query, return the data, in the order it arrives back\u001b[39;00m\n\u001b[1;32m 642\u001b[0m \u001b[38;5;124;03m converted as appropriate.\u001b[39;00m\n\u001b[1;32m 643\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 657\u001b[0m \u001b[38;5;124;03m on the converter call.\u001b[39;00m\n\u001b[1;32m 658\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 659\u001b[0m as_data \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 660\u001b[0m StreamInfoData(f\u001b[38;5;241m.\u001b[39mfile, \u001b[38;5;28;01mawait\u001b[39;00m asyncio\u001b[38;5;241m.\u001b[39mensure_future(converter(f\u001b[38;5;241m.\u001b[39mpath)))\n\u001b[1;32m 661\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stream_local_files(selection_query, title, data_format)\n\u001b[1;32m 662\u001b[0m ) \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[1;32m 664\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m as_data:\n\u001b[1;32m 665\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m r\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:699\u001b[0m, in \u001b[0;36mServiceXDataset._stream_local_files\u001b[0;34m(self, selection_query, title, data_format)\u001b[0m\n\u001b[1;32m 691\u001b[0m \u001b[38;5;66;03m# Get all the files\u001b[39;00m\n\u001b[1;32m 692\u001b[0m as_files \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 693\u001b[0m f\n\u001b[1;32m 694\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_files(\n\u001b[1;32m 695\u001b[0m selection_query, data_format, notifier, title\n\u001b[1;32m 696\u001b[0m )\n\u001b[1;32m 697\u001b[0m ) \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[0;32m--> 699\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m name, a_path \u001b[38;5;129;01min\u001b[39;00m as_files:\n\u001b[1;32m 700\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m StreamInfoPath(name, Path(\u001b[38;5;28;01mawait\u001b[39;00m a_path))\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:692\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 689\u001b[0m notifier \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_create_notifier(title, \u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m 691\u001b[0m \u001b[38;5;66;03m# Get all the files\u001b[39;00m\n\u001b[0;32m--> 692\u001b[0m as_files \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 693\u001b[0m f\n\u001b[1;32m 694\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_files(\n\u001b[1;32m 695\u001b[0m selection_query, data_format, notifier, title\n\u001b[1;32m 696\u001b[0m )\n\u001b[1;32m 697\u001b[0m ) \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[1;32m 699\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m name, a_path \u001b[38;5;129;01min\u001b[39;00m as_files:\n\u001b[1;32m 700\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m StreamInfoPath(name, Path(\u001b[38;5;28;01mawait\u001b[39;00m a_path))\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/servicex.py:746\u001b[0m, in \u001b[0;36mServiceXDataset._get_files\u001b[0;34m(self, selection_query, data_type, notifier, title)\u001b[0m\n\u001b[1;32m 743\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_update_query_status(client, request_id)\n\u001b[1;32m 745\u001b[0m \u001b[38;5;66;03m# Get the minio adaptor we are going to use for downloading.\u001b[39;00m\n\u001b[0;32m--> 746\u001b[0m minio_adaptor \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_minio_adaptor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_best\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 747\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_cache\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlookup_query_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest_id\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 748\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 750\u001b[0m \u001b[38;5;66;03m# Look up the cache, and then fetch an iterator going thorugh the results\u001b[39;00m\n\u001b[1;32m 751\u001b[0m \u001b[38;5;66;03m# from either servicex or the cache, depending.\u001b[39;00m\n\u001b[1;32m 752\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n", "File \u001b[0;32m/opt/conda/lib/python3.8/site-packages/servicex/minio_adaptor.py:192\u001b[0m, in \u001b[0;36mMinioAdaptorFactory.from_best\u001b[0;34m(self, transaction_info)\u001b[0m\n\u001b[1;32m 183\u001b[0m logging\u001b[38;5;241m.\u001b[39mgetLogger(\u001b[38;5;18m__name__\u001b[39m)\u001b[38;5;241m.\u001b[39mdebug(\n\u001b[1;32m 184\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUsing the request-specific minio_adaptor\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 185\u001b[0m )\n\u001b[1;32m 186\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m MinioAdaptor(\n\u001b[1;32m 187\u001b[0m transaction_info[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mminio-endpoint\u001b[39m\u001b[38;5;124m\"\u001b[39m],\n\u001b[1;32m 188\u001b[0m \u001b[38;5;28mbool\u001b[39m(transaction_info[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mminio-secured\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 189\u001b[0m transaction_info[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mminio-access-key\u001b[39m\u001b[38;5;124m\"\u001b[39m],\n\u001b[1;32m 190\u001b[0m transaction_info[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mminio-secret-key\u001b[39m\u001b[38;5;124m\"\u001b[39m],\n\u001b[1;32m 191\u001b[0m )\n\u001b[0;32m--> 192\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ServiceXException(\n\u001b[1;32m 193\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mDo not know or have enough information to create a Minio \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 194\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLogin info (\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mtransaction_info\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 195\u001b[0m )\n", "\u001b[0;31mServiceXException\u001b[0m: (ServiceXException(...), 'Do not know or have enough information to create a Minio Login info ({\\'request_id\\': \\'c27b2f21-378b-4ceb-93d4-1980a0c9691e\\', \\'did\\': \\'File List Provided in Request\\', \\'columns\\': None, \\'selection\\': \"(call Select (call EventDataset \\'bogus.root\\' \\'events\\') (lambda (list event) (attr event \\'met_pt\\')))\", \\'tree-name\\': None, \\'image\\': \\'sslhep/servicex_func_adl_uproot_transformer:20220418-1418-stable\\', \\'workers\\': 20, \\'result-destination\\': \\'volume\\', \\'result-format\\': \\'root-file\\', \\'workflow-name\\': \\'selection_codegen\\', \\'generated-code-cm\\': \\'c27b2f21-378b-4ceb-93d4-1980a0c9691e-generated-source\\', \\'status\\': \\'Submitted\\', \\'failure-info\\': None, \\'app-version\\': \\'1.0.0rc3\\', \\'code-gen-image\\': \\'sslhep/servicex_code_gen_func_adl_uproot:20220418-1418-stable\\'})')" ] } ], "source": [ "dataset_name = [\"https://xrootd-local.unl.edu:1094//store/user/AGC/zmumu/RunIIFall15MiniAODv2/ZToMuMu_NNPDF30_13TeV-powheg_M_50_120/MINIAODSIM/PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/20000/022FAAEA-1BB9-E511-A6DF-44A842CFD5D8.root\"]\n", "sx_dataset = sx.ServiceXDataset(dataset_name, \"uproot\",result_destination=\"volume\")\n", "ds = ServiceXSourceUpROOT(sx_dataset, \"events\")\n", "missing_ET = ds.Select(lambda event: event.met_pt).AsAwkwardArray().value()" ] }, { "cell_type": "code", "execution_count": null, "id": "043b4fda-1806-4ca9-9881-dc8a9f09f1f0", "metadata": {}, "outputs": [], "source": [ "missing_ET" ] }, { "cell_type": "code", "execution_count": null, "id": "70b0d95d-794d-4098-8f9a-5d52aa84d166", "metadata": {}, "outputs": [], "source": [ "plt.hist([missing_ET], bins=100, range=(0, 100))\n", "plt.xlabel(r'$E_\\mathrm{T}^\\mathrm{miss}$ [GeV]')\n", "plt.ylabel('Events')\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.13" } }, "nbformat": 4, "nbformat_minor": 5 }