Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OrcaSong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Machine Learning
OrcaSong
Commits
d0681f28
Commit
d0681f28
authored
6 years ago
by
ViaFerrata
Browse files
Options
Downloads
Patches
Plain Diff
Small bugfix for run_id readout and check for particle type.
parent
5430773f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
orcasong/data_to_images.py
+6
-2
6 additions, 2 deletions
orcasong/data_to_images.py
orcasong/file_to_hits.py
+11
-2
11 additions, 2 deletions
orcasong/file_to_hits.py
with
17 additions
and
4 deletions
orcasong/data_to_images.py
+
6
−
2
View file @
d0681f28
...
...
@@ -294,9 +294,13 @@ def get_file_particle_type(event_pump):
file_particle_type
=
'
undefined
'
else
:
particle_type
=
event_pump
[
0
][
'
McTracks
'
].
type
if
np
.
abs
(
particle_type
)
==
13
:
# if mupage file: first mc_track is an empty neutrino track, second track is the first muon
if
particle_type
[
0
]
==
0
and
np
.
abs
(
particle_type
[
1
])
==
13
:
file_particle_type
=
'
muon
'
elif
np
.
abs
(
particle_type
)
in
[
12
,
14
,
16
]:
# the first mc_track is the primary neutrino if the input file is containing neutrino events
elif
np
.
abs
(
particle_type
[
0
])
in
[
12
,
14
,
16
]:
file_particle_type
=
'
neutrino
'
else
:
raise
ValueError
(
'
The type of the particles in the
"
McTracks
"
folder, <
'
,
str
(
particle_type
),
'
> is not known.
'
)
...
...
This diff is collapsed.
Click to expand it.
orcasong/file_to_hits.py
+
11
−
2
View file @
d0681f28
...
...
@@ -132,10 +132,19 @@ def get_tracks(event_blob, file_particle_type, event_hits, prod_ident):
"""
# parse EventInfo and Header information
event_id
=
event_blob
[
'
EventInfo
'
].
event_id
[
0
]
if
'
Header
'
in
event_blob
:
# if Header exists in file, take run_id from it. Else take it from RawHeader.
# the run_id info in the EventInfo group is broken for ORCA neutrino and mupage files
# The Header run_id is the most reliable one.
if
'
Header
'
in
event_blob
:
# if Header exists in file, take run_id from it.
run_id
=
event_blob
[
'
Header
'
].
start_run
.
run_id
.
astype
(
'
float32
'
)
else
:
run_id
=
event_blob
[
'
RawHeader
'
][
0
][
0
].
astype
(
'
float32
'
)
if
file_particle_type
==
'
muon
'
:
run_id
=
event_blob
[
'
RawHeader
'
][
1
][
0
].
astype
(
'
float32
'
)
elif
file_particle_type
==
'
undefined
'
:
# currently used with random_noise files
run_id
=
event_blob
[
'
EventInfo
'
].
run_id
else
:
run_id
=
event_blob
[
'
RawHeader
'
][
0
][
0
].
astype
(
'
float32
'
)
# collect all event_track information, dependent on file_particle_type
...
...
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