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
1
Expand
0
0
Merge request reports
Compare
version 6
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
version 7
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
Show latest version
1 file
+
14
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
benchmarks/imaging_ecal/scripts/get_layerids.py
+
14
−
10
Options
@@ -21,7 +21,13 @@ class AthenaDecoder:
def
get
(
self
,
idvals
,
field
):
start
,
width
=
self
.
fieldsmap
[
field
]
return
np
.
bitwise_and
(
np
.
right_shift
(
idvals
,
start
),
(
1
<<
width
)
-
1
)
if
width
>=
0
:
return
np
.
bitwise_and
(
np
.
right_shift
(
idvals
,
start
),
(
1
<<
width
)
-
1
)
# first bit is sign bit
else
:
width
=
abs
(
width
)
-
1
vals
=
np
.
bitwise_and
(
np
.
right_shift
(
idvals
,
start
),
(
1
<<
width
)
-
1
)
return
np
.
where
(
np
.
bitwise_and
(
np
.
right_shift
(
idvals
,
start
+
width
),
1
),
vals
-
(
1
<<
width
),
vals
)
@staticmethod
def
getReadouts
(
path
):
@@ -53,11 +59,11 @@ class AthenaDecoder:
for
field_bits
in
id_str
.
split
(
'
,
'
):
elements
=
field_bits
.
split
(
'
:
'
)
field_name
=
elements
[
0
]
bit_width
=
abs
(
int
(
elements
[
-
1
])
)
bit_width
=
int
(
elements
[
-
1
])
if
len
(
elements
)
==
3
:
curr_bit
=
int
(
elements
[
1
])
res
[
field_name
]
=
(
curr_bit
,
bit_width
)
curr_bit
+=
bit_width
curr_bit
+=
abs
(
bit_width
)
return
res
@@ -113,17 +119,15 @@ if __name__ == '__main__':
# kernel = DDG4.Kernel()
# description = kernel.detectorDescription()
# kernel.loadGeometry("file:{}".format(args.compact))
# decoder = description.readout(args.readout).idSpec().decoder()
# lindex = decoder.index('layer')
# get_layer_id = np.vectorize(lambda cid: decoder.get(cid, lindex))
# dd4hep_decoder = description.readout(args.readout).idSpec().decoder()
# lindex = dd4hep_decoder.index('x')
# get_layer_id = np.vectorize(lambda cid: dd4hep_decoder.get(cid, lindex))
# df.loc[:, 'layerID'] = get_layer_id(df['cellID'].astype(int).values)
# print(df[['cellID', 'layerID', 'position.x', 'position.y', 'position.z', 'energy']])
# always terminate dd4hep kernel
# kernel.terminate()
# faster way to get layerids
df
.
loc
[:,
'
layerID
'
]
=
decoder
.
get
(
df
[
'
cellID
'
].
values
,
'
layer
'
)
print
(
df
[[
'
cellID
'
,
'
layerID
'
,
'
position.x
'
,
'
position.y
'
,
'
position.z
'
,
'
energy
'
]])
df
.
loc
[:,
'
xID
'
]
=
decoder
.
get
(
df
[
'
cellID
'
].
values
,
'
x
'
)
print
(
df
[[
'
cellID
'
,
'
layerID
'
,
'
xID
'
,
'
position.x
'
,
'
position.y
'
,
'
position.z
'
,
'
energy
'
]])
Loading