#!/usr/bin/env python # coding: utf-8 # # Coffea-Casa Benchmark Example 1 # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') import numpy as np import coffea.processor as processor import awkward as ak import hist from coffea.nanoevents import schemas from coffea.nanoevents.schemas import BaseSchema, NanoAODSchema # In[2]: class Q1Processor(processor.ProcessorABC): def process(self, events): return ( hist.Hist.new.Reg(100, 0, 200, name="met", label="$E_{T}^{miss}$ [GeV]") .Double() .fill(events.met_pt) ) def postprocess(self, accumulator): return accumulator # In[3]: from dask.distributed import Client client = Client("tcp://127.0.0.1:41775") client # In[4]: run = processor.Runner( executor=processor.DaskExecutor(client=client), use_skyhook=True, format="parquet", schema=BaseSchema, ) out = run( {'SingleMu' : "/mnt/cephfs/AGC/modified_agc.parquet"}, "events", processor_instance=Q1Processor() ) # In[ ]: out.plot1d()