Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_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
reconstruction_benchmarks
Merge requests
!128
add benchmark for pion0
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add benchmark for pion0
add_pi0_benchmark
into
master
Overview
0
Commits
8
Pipelines
0
Changes
9
Merged
Chao Peng
requested to merge
add_pi0_benchmark
into
master
3 years ago
Overview
0
Commits
8
Pipelines
0
Changes
9
Expand
0
0
Merge request reports
Compare
master
version 7
d111afee
3 years ago
version 6
26f750fc
3 years ago
version 5
62751498
3 years ago
version 4
a1b3797c
3 years ago
version 3
29e7d3e6
3 years ago
version 2
f0d40986
3 years ago
version 1
91e5b0a9
3 years ago
master (base)
and
latest version
latest version
fcdb861a
8 commits,
3 years ago
version 7
d111afee
7 commits,
3 years ago
version 6
26f750fc
6 commits,
3 years ago
version 5
62751498
5 commits,
3 years ago
version 4
a1b3797c
4 commits,
3 years ago
version 3
29e7d3e6
3 commits,
3 years ago
version 2
f0d40986
2 commits,
3 years ago
version 1
91e5b0a9
1 commit,
3 years ago
9 files
+
700
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
benchmarks/clustering/scripts/cluster_plots.py
+
11
−
2
Options
@@ -27,15 +27,23 @@ def flatten_collection(rdf, collection, cols=None):
cols
=
[
str
(
c
)
for
c
in
rdf
.
GetColumnNames
()
if
str
(
c
).
startswith
(
'
{}.
'
.
format
(
collection
))]
else
:
cols
=
[
'
{}.{}
'
.
format
(
collection
,
c
)
for
c
in
cols
]
if
not
cols
:
print
(
'
cannot find any branch under collection {}
'
.
format
(
collection
))
return
pd
.
DataFrame
()
data
=
rdf
.
AsNumpy
(
cols
)
# flatten the data, add an event id to identify clusters from different events
evns
=
[]
for
i
,
vec
in
enumerate
(
data
[
cols
[
0
]]):
evns
+=
[
i
]
*
vec
.
size
()
for
n
,
vals
in
data
.
items
():
data
[
n
]
=
np
.
asarray
([
v
for
vec
in
vals
for
v
in
vec
])
# make sure ints are not converted to floats
typename
=
vals
[
0
].
__class__
.
__name__
.
lower
()
dtype
=
np
.
int64
if
'
int
'
in
typename
or
'
long
'
in
typename
else
np
.
float64
# type safe creation
data
[
n
]
=
np
.
asarray
([
v
for
vec
in
vals
for
v
in
vec
],
dtype
=
dtype
)
# build data frame
dfp
=
pd
.
DataFrame
(
columns
=
cols
,
data
=
np
.
vstack
(
list
(
data
.
values
())).
T
)
dfp
=
pd
.
DataFrame
(
{
c
:
pd
.
Series
(
v
)
for
c
,
v
in
data
.
items
()}
)
dfp
.
loc
[:,
'
event
'
]
=
evns
return
dfp
@@ -152,6 +160,7 @@ if __name__ == '__main__':
# calculate eta
if
'
eta
'
not
in
df
.
columns
:
df
.
loc
[:,
'
eta
'
]
=
-
np
.
log
(
np
.
tan
(
df
[
'
polar.theta
'
].
values
/
2.
))
# print(df[['eta', 'polar.theta', 'position.x', 'position.y', 'position.z']])
fig
,
axs
=
plt
.
subplots
(
2
,
2
,
figsize
=
(
12
,
8
),
dpi
=
160
)
ncl
=
df
.
groupby
(
'
event
'
)[
'
clusterID
'
].
nunique
().
values
axs
[
0
][
0
].
hist
(
ncl
,
weights
=
np
.
repeat
(
1.
/
float
(
ncl
.
shape
[
0
]),
ncl
.
shape
[
0
]),
Loading