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
1c484b75
Commit
1c484b75
authored
9 months ago
by
Dmitry Kalinkin
Browse files
Options
Downloads
Patches
Plain Diff
ecal_backwards.org: use pyHepMC3 SWIG bindings that support ROOT formats
parent
a3cc33d7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/backgrounds/ecal_backwards.org
+37
-37
37 additions, 37 deletions
benchmarks/backgrounds/ecal_backwards.org
with
37 additions
and
37 deletions
benchmarks/backgrounds/ecal_backwards.org
+
37
−
37
View file @
1c484b75
...
...
@@ -15,7 +15,7 @@ import dask_awkward as dak
import dask_histogram as dh
import numpy as np
import uproot
import pyhepmc
from pyHepMC3 import HepMC3
#+end_src
#+begin_src jupyter-python :results silent
...
...
@@ -66,47 +66,47 @@ output_dir.mkdir(parents=True, exist_ok=True)
#+begin_src jupyter-python :results silent
builder = ak.ArrayBuilder()
n = 0
with pyhepmc.open(PROTON_BEAM_GAS_GEN) as f:
it = iter(f
)
for event in f
:
builder.begin_list()
for vertex in event.vertices:
assert event.length_unit.name == "MM"
with builder.record("Vector4D"):
builder.field("x")
builder.real(vertex.position
.x
)
builder.field("y")
builder.real(vertex.position
.y
)
builder.field("z")
builder.real(vertex.position
.z
)
builder.field("t")
builder.real(vertex.position
.t
)
builder.end_list()
n += 1
if n > 10000: break
f = HepMC3.ReaderPlugin(PROTON_BEAM_GAS_GEN, "libHepMC3rootIO.so", "newReaderRootTreefile")
event = HepMC3.GenEvent(
)
while f.read_event(event)
:
builder.begin_list()
assert event.length_unit().name == "MM"
for vertex in event.vertices():
with builder.record("Vector4D"):
builder.field("x")
builder.real(vertex.position
().x()
)
builder.field("y")
builder.real(vertex.position
().y()
)
builder.field("z")
builder.real(vertex.position
().z()
)
builder.field("t")
builder.real(vertex.position
().t()
)
builder.end_list()
n += 1
if n > 10000: break
vertices_proton_beam_gas = builder.snapshot()
builder = ak.ArrayBuilder()
n = 0
with pyhepmc.ope
n(ELECTRON_BEAM_GAS_GEN
) as f:
it = iter(f
)
for event in f
:
builder.begin_list()
for vertex in event.vertices:
assert event.length_unit.name == "MM"
with builder.record("Vector
3
D"):
builder.field("x")
builder.real(vertex.position
.x
)
builder.field("y")
builder.real(vertex.position
.y
)
builder.field("z")
builder.real(vertex.position
.z
)
builder.field("t")
builder.real(vertex.position
.t
)
builder.end_list()
n += 1
if n > 10000: break
f = HepMC3.ReaderPlugi
n(ELECTRON_BEAM_GAS_GEN
, "libHepMC3rootIO.so", "newReaderRootTreefile")
event = HepMC3.GenEvent(
)
while f.read_event(event)
:
builder.begin_list()
assert event.length_unit().name == "MM"
for vertex in event.vertices():
with builder.record("Vector
4
D"):
builder.field("x")
builder.real(vertex.position
().x()
)
builder.field("y")
builder.real(vertex.position
().y()
)
builder.field("z")
builder.real(vertex.position
().z()
)
builder.field("t")
builder.real(vertex.position
().t()
)
builder.end_list()
n += 1
if n > 10000: break
vertices_electron_beam_gas = builder.snapshot()
#+end_src
...
...
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