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
7ec5b1c3
Commit
7ec5b1c3
authored
5 years ago
by
Stefan Reck
Browse files
Options
Downloads
Patches
Plain Diff
Added mc info extractor for real data, time gets corrected for
McHits automatically if McHits are in blob.
parent
9e20d808
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
orcasong_plag/core.py
+2
-1
2 additions, 1 deletion
orcasong_plag/core.py
orcasong_plag/mc_info_types.py
+16
-0
16 additions, 0 deletions
orcasong_plag/mc_info_types.py
orcasong_plag/modules.py
+4
-12
4 additions, 12 deletions
orcasong_plag/modules.py
with
22 additions
and
13 deletions
orcasong_plag/core.py
+
2
−
1
View file @
7ec5b1c3
...
...
@@ -28,8 +28,9 @@ class FileBinner:
n_memory_observer : int, optional
Print memory usage every n blobs.
do_time_preproc : bool
Do time preprocessing, i.e. add t0 to real data, subtract time
Do time preprocessing, i.e. add t0
only
to real data,
and
subtract time
of first triggered hit.
Will also be done for McHits if they are in the blob.
chunksize : int
Chunksize (along axis_0) used for saving the output to a .h5 file.
complib : str
...
...
This diff is collapsed.
Click to expand it.
orcasong_plag/mc_info_types.py
+
16
−
0
View file @
7ec5b1c3
...
...
@@ -20,12 +20,28 @@ def get_mc_info_extr(mc_info_extr):
if
mc_info_extr
==
"
mupage
"
:
mc_info_extr
=
get_mupage_mc
elif
mc_info_extr
==
"
event_and_run_id
"
:
mc_info_extr
=
get_event_and_run_id
else
:
raise
ValueError
(
"
Unknown mc_info_type
"
+
mc_info_extr
)
return
mc_info_extr
def
get_event_and_run_id
(
blob
):
"""
Get event id and run id from event info.
E.g. for the 2017 one line real data.
"""
event_id
=
blob
[
'
EventInfo
'
].
event_id
[
0
]
run_id
=
blob
[
"
EventInfo
"
].
run_id
track
=
{
'
event_id
'
:
event_id
,
'
run_id
'
:
run_id
,
}
return
track
def
get_mupage_mc
(
blob
):
"""
For mupage muon simulations.
...
...
This diff is collapsed.
Click to expand it.
orcasong_plag/modules.py
+
4
−
12
View file @
7ec5b1c3
...
...
@@ -43,20 +43,12 @@ class TimePreproc(kp.Module):
Time hits and mchits will be shifted by the time of the first
triggered hit.
Attributes
----------
correct_hits : bool
If true, will correct time of the hits.
correct_mchits : bool
If true, will correct the time of the McHits.
"""
def
configure
(
self
):
self
.
correct_hits
=
self
.
get
(
'
correct_hits
'
,
default
=
True
)
self
.
correct_mchits
=
self
.
get
(
'
correct_mchits
'
,
default
=
True
)
def
process
(
self
,
blob
):
blob
=
time_preproc
(
blob
,
self
.
correct_hits
,
self
.
correct_mchits
)
correct_mchits
=
"
McHits
"
in
blob
blob
=
time_preproc
(
blob
,
correct_hits
=
True
,
correct_mchits
=
correct_mchits
)
return
blob
...
...
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