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
0aaff96d
Commit
0aaff96d
authored
4 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Add secondary lepton to output particles in pandas df
parent
c2c20d7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#14573
failed
4 years ago
Stage: test
Stage: coverage
Stage: doc
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
km3buu/output.py
+13
-0
13 additions, 0 deletions
km3buu/output.py
with
13 additions
and
0 deletions
km3buu/output.py
+
13
−
0
View file @
0aaff96d
...
...
@@ -182,6 +182,19 @@ class GiBUUOutput:
df
.
columns
=
[
col
[
0
]
for
col
in
df
.
columns
]
df
[
"
By
"
]
=
1
-
df
.
lepOut_E
/
df
.
lepIn_E
df
[
"
xsec_wgt
"
]
=
self
.
_event_weights
(
df
)
# Add secondary lepton to particle list
sec_df
=
df
[
df
.
index
.
get_level_values
(
1
)
==
0
]
sec_df
.
loc
[:,
"
E
"
]
=
sec_df
.
lepOut_E
sec_df
.
loc
[:,
"
Px
"
]
=
sec_df
.
lepOut_Px
sec_df
.
loc
[:,
"
Py
"
]
=
sec_df
.
lepOut_Py
sec_df
.
loc
[:,
"
Pz
"
]
=
sec_df
.
lepOut_Pz
sec_pdgid
=
(
PDGID_LOOKUP
[
self
.
jobcard
[
"
neutrino_induced
"
][
"
flavor_id
"
]]
-
1
)
*
np
.
sign
(
self
.
jobcard
[
"
neutrino_induced
"
][
"
process_id
"
])
sec_df
.
loc
[:,
"
barcode
"
]
=
sec_pdgid
sec_df
.
index
=
pd
.
MultiIndex
.
from_tuples
(
zip
(
*
np
.
unique
(
df
.
index
.
get_level_values
(
0
),
return_counts
=
True
)))
df
=
df
.
append
(
sec_df
)
return
df
...
...
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