Skip to content

Commit

Permalink
Fix bug in neutron_plots.py (#26)
Browse files Browse the repository at this point in the history
* Update neutron_plots.py

import uproot as ur

* fixed another bug in the neutron_plots.py

* Update config.yml

Make sure the neutron::analyze stage actually runs.
  • Loading branch information
sebouh137 authored Aug 26, 2024
1 parent 3e6a6ef commit 388dff9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions benchmarks/neutron/analysis/neutron_plots.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import numpy as np, pandas as pd, matplotlib.pyplot as plt, matplotlib as mpl, awkward as ak, sys
import numpy as np, pandas as pd, matplotlib.pyplot as plt, matplotlib as mpl, awkward as ak, sys, uproot as ur
import mplhep as hep
hep.style.use("CMS")

Expand Down Expand Up @@ -57,7 +57,7 @@ def gauss(x, A,mu, sigma):
w=E

array['theta_recon']=np.sum(np.arccos(zp/r)*w, axis=-1)/np.sum(w, axis=-1)
array['eta_recon']=-np.log(np.tan(['theta_recon']/2))
array['eta_recon']=-np.log(np.tan(array['theta_recon']/2))


array['E_Hcal']=np.sum(array['HcalEndcapPInsertClusters.energy'], axis=-1)#*20/12.5
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/neutron/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ neutron:analyze:
extends: .phy_benchmark
needs: ["neutron:simulate"]
script:
- snakemake --cores 1 --touch results/epic_craterlake/neutron
- mkdir -p results/epic_craterlake
- python benchmarks/neutron/analysis/neutron_plots.py results/epic_craterlake/neutron

neutron:results:
stage: collect
Expand Down

0 comments on commit 388dff9

Please sign in to comment.