Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
03850ad4
Unverified
Commit
03850ad4
authored
1 year ago
by
Dmitry Kalinkin
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
ecal_gaps: add profile to the plots (
#19
)
parent
16fd651e
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#91123
passed with warnings
11 months ago
Stage: status-pending
Stage: config
Stage: initialize
Stage: data_init
Stage: simulate
Stage: calibrate
Stage: benchmarks
Stage: collect
Stage: deploy
Stage: trigger
Stage: status-report
Pipeline: physics_benchmarks
#91130
Pipeline: reconstruction_benchmarks
#91129
Changes
1
Pipelines
260
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/ecal_gaps/ecal_gaps.org
+50
-21
50 additions, 21 deletions
benchmarks/ecal_gaps/ecal_gaps.org
with
50 additions
and
21 deletions
benchmarks/ecal_gaps/ecal_gaps.org
+
50
−
21
View file @
03850ad4
...
...
@@ -65,6 +65,9 @@ def filter_name(name):
import functools
axis_eta = bh.axis.Regular(200, -4, 4)
axis_eta_coarse = bh.axis.Regular(100, -4, 4)
@functools.cache
def get_events(particle="e-", energy="20GeV", num_files=1):
events = uproot.dask(
...
...
@@ -81,8 +84,6 @@ def get_events(particle="e-", energy="20GeV", num_files=1):
eta = -np.log(np.tan(theta / 2))
p = np.hypot(pt, events["MCParticles.momentum.z"][:,0])
axis_eta = bh.axis.Regular(200, -4, 4)
hist_norm = dh.factory(
eta,
axes=(
...
...
@@ -103,27 +104,38 @@ def get_events(particle="e-", energy="20GeV", num_files=1):
events["eta_thrown"] = eta
events["weights"] = weights
return events
, axis_eta
return events
#+end_src
#+begin_src jupyter-python
particle = "e-"
for energy in ["500MeV", "5GeV", "20GeV"]:
events
, axis_eta
= get_events(particle=particle, energy=energy)
events = get_events(particle=particle, energy=energy)
for calo_name in ["EcalEndcapN", "EcalBarrelScFi", "EcalBarrelImaging", "EcalEndcapP"]:
cond = ak.sum(events[f"{calo_name}RecHits.energy"], axis=1) > 10e-3 # GeV
hist = dh.factory(
events["eta_thrown"][cond],
(ak.sum(events[f"{calo_name}RecHits.energy"], axis=1) / events["p_thrown"])[cond],
axes=(
axis_eta,
bh.axis.Regular(100, 0.1, 1.1),
hist, profile = client.gather(client.compute([
dh.factory(
events["eta_thrown"][cond],
(ak.sum(events[f"{calo_name}RecHits.energy"], axis=1) / events["p_thrown"])[cond],
axes=(
axis_eta,
bh.axis.Regular(100, 0.1, 1.1),
),
weights=events["weights"][cond],
),
dh.factory(
events["eta_thrown"][cond],
sample=(ak.sum(events[f"{calo_name}RecHits.energy"], axis=1) / events["p_thrown"])[cond],
storage=bh.storage.WeightedMean(),
axes=(
axis_eta_coarse,
),
weights=events["weights"][cond],
),
weights=events["weights"][cond],
).compute()
]))
cmap = plt.get_cmap(name="rainbow", lut=None).copy()
cmap.set_under("none")
...
...
@@ -138,6 +150,9 @@ for energy in ["500MeV", "5GeV", "20GeV"]:
),
)
plt.colorbar()
std = np.sqrt(profile.variances())
cond = profile.values() > std
plt.errorbar(profile.axes[0].centers[cond], profile.values()[cond], yerr=std[cond], marker=".", markersize=2, color="black", ls="none", lw=0.6, capsize=1.)
plt.xlabel(r"$\eta_{thrown}$", loc="right")
plt.ylabel(r"$\sum E_{\mathrm{dep.}} / p_{\mathrm{thrown}}$", loc="top")
plt.title(f"{energy} {particle} in {calo_name}")
...
...
@@ -151,7 +166,7 @@ for energy in ["500MeV", "5GeV", "20GeV"]:
particle = "e-"
for energy in ["500MeV", "5GeV", "20GeV"]:
events
, axis_eta
= get_events(particle=particle, energy=energy)
events = get_events(particle=particle, energy=energy)
calos = ["EcalEndcapN", "EcalBarrelScFi", "EcalEndcapP"]
total_energy = sum([
...
...
@@ -159,15 +174,26 @@ for energy in ["500MeV", "5GeV", "20GeV"]:
for calo_name in calos
])
hist = dh.factory(
events["eta_thrown"],
total_energy / events["p_thrown"],
axes=(
axis_eta,
bh.axis.Regular(100, 0.0, 1.1),
hist, profile = client.gather(client.compute([
dh.factory(
events["eta_thrown"],
total_energy / events["p_thrown"],
axes=(
axis_eta,
bh.axis.Regular(100, 0.1, 1.1),
),
weights=events["weights"],
),
weights=events["weights"],
).compute()
dh.factory(
events["eta_thrown"],
sample=total_energy / events["p_thrown"],
storage=bh.storage.WeightedMean(),
axes=(
axis_eta_coarse,
),
weights=events["weights"],
),
]))
cmap = plt.get_cmap(name="rainbow", lut=None).copy()
cmap.set_under("none")
...
...
@@ -182,6 +208,9 @@ for energy in ["500MeV", "5GeV", "20GeV"]:
),
)
plt.colorbar()
std = np.sqrt(profile.variances())
cond = profile.values() > std
plt.errorbar(profile.axes[0].centers[cond], profile.values()[cond], yerr=std[cond], marker=".", markersize=2, color="black", ls="none", lw=0.6, capsize=1.)
plt.xlabel(r"$\eta_{thrown}$", loc="right")
plt.ylabel(r"$\sum E_{\mathrm{dep.}} / p_{\mathrm{thrown}}$", loc="top")
plt.title(f"{energy} {particle}\n" + "+".join(calos))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment