-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import time | ||
|
||
import awkward as ak | ||
import hist | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from coffea.nanoevents import NanoEventsFactory, NanoAODSchema | ||
from coffea import processor | ||
|
||
import dask | ||
import dask_awkward as dak | ||
import hist.dask as hda | ||
|
||
from distributed import Client | ||
client=Client() | ||
|
||
# The opendata files are non-standard NanoAOD, so some optional data columns are missing | ||
NanoAODSchema.warn_missing_crossrefs = False | ||
|
||
# The warning emitted below indicates steps_per_file is for initial data exploration | ||
# and test. When running at scale there are better ways to specify processing chunks | ||
# of files. | ||
events = NanoEventsFactory.from_root( | ||
"root://eospublic.cern.ch//eos/root-eos/Run2012B_SingleMu.root:Events", | ||
steps_per_file=500, | ||
metadata={"dataset": "SingleMu"} | ||
).events() | ||
|
||
|
||
@pytest.mark.coffeacalver | ||
def test_adl1(): | ||
q1_hist = ( | ||
hda.Hist.new.Reg(100, 0, 200, name="met", label="$E_{T}^{miss}$ [GeV]") | ||
.Double() | ||
.fill(events.MET.pt) | ||
) | ||
q1_hist.compute().plot1d(flow="none") | ||
dak.necessary_columns(q1_hist) |