Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3BUU
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
simulation
KM3BUU
Commits
e67c7297
Commit
e67c7297
authored
3 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix_empty_files' into 'master'
Fix empty file handling See merge request
!18
parents
7a5a76ab
1050f5f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!18
Fix empty file handling
Pipeline
#23372
passed with warnings
3 years ago
Stage: test
Stage: coverage
Stage: doc
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3buu/output.py
+10
-0
10 additions, 0 deletions
km3buu/output.py
with
10 additions
and
0 deletions
km3buu/output.py
+
10
−
0
View file @
e67c7297
...
...
@@ -206,6 +206,12 @@ W2LIST_LOOKUP = {
W2LIST_LENGTH
=
len
(
W2LIST_LOOKUP
)
GIBUU_FIELDNAMES
=
[
'
weight
'
,
'
barcode
'
,
'
Px
'
,
'
Py
'
,
'
Pz
'
,
'
E
'
,
'
evType
'
,
'
lepIn_E
'
,
'
lepIn_Px
'
,
'
lepIn_Py
'
,
'
lepIn_Pz
'
,
'
lepOut_E
'
,
'
lepOut_Px
'
,
'
lepOut_Py
'
,
'
lepOut_Pz
'
,
'
nuc_E
'
,
'
nuc_Px
'
,
'
nuc_Py
'
,
'
nuc_Pz
'
]
def
read_nu_abs_xsection
(
filepath
):
"""
...
...
@@ -467,6 +473,8 @@ class GiBUUOutput:
"""
import
pandas
as
pd
df
=
ak
.
to_pandas
(
self
.
arrays
)
if
len
(
df
)
==
0
:
return
df
sec_df
=
df
[
df
.
index
.
get_level_values
(
1
)
==
0
].
copy
()
sec_df
.
loc
[:,
"
E
"
]
=
sec_df
.
lepOut_E
sec_df
.
loc
[:,
"
Px
"
]
=
sec_df
.
lepOut_Px
...
...
@@ -494,6 +502,8 @@ class GiBUUOutput:
else
:
tmp
=
fobj
[
"
RootTuple
"
].
arrays
()
retval
=
np
.
concatenate
((
retval
,
tmp
))
if
len
(
retval
)
==
0
:
retval
=
ak
.
Array
(
np
.
recarray
((
0
,),
dtype
=
list
(
zip
(
GIBUU_FIELDNAMES
,
len
(
GIBUU_FIELDNAMES
)
*
[
float
]))))
# Calculate additional information
retval
[
"
xsec
"
]
=
self
.
_event_xsec
(
retval
)
retval
[
"
Bx
"
]
=
GiBUUOutput
.
bjorken_x
(
retval
)
...
...
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