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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
reconstruction_benchmarks
Merge requests
!217
null pointer safety on PDG lookup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
null pointer safety on PDG lookup
python-root-tdatabasepdg-safety
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
null pointer safety on PDG lookup
Wouter Deconinck
requested to merge
python-root-tdatabasepdg-safety
into
master
Oct 6, 2021
Overview
0
Commits
1
Pipelines
0
Changes
1
Closes
#78 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
0d5951a9
1 commit,
Oct 6, 2021
1 file
+
12
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
benchmarks/imaging_ecal/scripts/draw_cluster.py
+
12
−
4
View file @ 0d5951a9
Edit in single-file editor
Open in Web IDE
Show full file
@@ -156,8 +156,12 @@ if __name__ == '__main__':
dfdecaymcp
=
dftemp
.
copy
()
for
iptl
in
[
0
,
len
(
dfdecaymcp
)
-
1
]:
infoptl
=
pdgbase
.
GetParticle
(
int
(
dfdecaymcp
[
'
pid
'
].
iloc
[
iptl
]))
print
(
"
{} Decaying particle = {}, pdgcode = {}, charge = {}, mass = {}
"
\
.
format
(
iptl
,
infoptl
.
GetName
(),
infoptl
.
PdgCode
(),
infoptl
.
Charge
(),
infoptl
.
Mass
()))
if
infoptl
:
print
(
"
{} Decaying particle = {}, pdgcode = {}, charge = {}, mass = {}
"
\
.
format
(
iptl
,
infoptl
.
GetName
(),
infoptl
.
PdgCode
(),
infoptl
.
Charge
(),
infoptl
.
Mass
()))
else
:
print
(
"
{} Decaying particle unknown pdgcode {}
"
\
.
format
(
iptl
,
int
(
dfdecaymcp
[
'
pid
'
].
iloc
[
iptl
])))
# Calculate geometric variables of decaying particles
dfdecaymcp
[
'
r
'
]
=
np
.
sqrt
(
dfdecaymcp
[
'
vex
'
].
values
**
2
+
dfdecaymcp
[
'
vey
'
].
values
**
2
+
dfdecaymcp
[
'
vez
'
].
values
**
2
)
dfdecaymcp
[
'
phi
'
]
=
np
.
arctan2
(
dfdecaymcp
[
'
vey
'
].
values
,
dfdecaymcp
[
'
vex
'
].
values
)
*
1000.
@@ -168,8 +172,12 @@ if __name__ == '__main__':
dfmcp
=
get_mcp_simple
(
args
.
file
,
args
.
iev
,
'
mcparticles
'
).
iloc
[
0
]
#pdgbase = ROOT.TDatabasePDG()
inpart
=
pdgbase
.
GetParticle
(
int
(
dfmcp
[
'
pid
'
]))
print
(
"
Incoming particle = {}, pdgcode = {}, charge = {}, mass = {}
"
\
.
format
(
inpart
.
GetName
(),
inpart
.
PdgCode
(),
inpart
.
Charge
(),
inpart
.
Mass
()))
if
inpart
:
print
(
"
Incoming particle = {}, pdgcode = {}, charge = {}, mass = {}
"
\
.
format
(
inpart
.
GetName
(),
inpart
.
PdgCode
(),
inpart
.
Charge
(),
inpart
.
Mass
()))
else
:
print
(
"
Incoming particle unknown pdgcode {}
"
\
.
format
(
int
(
dfmcp
[
'
pid
'
])))
# neutral particle, no need to consider magnetic field
if
np
.
isclose
(
inpart
.
Charge
(),
0.
,
rtol
=
1e-5
):
vec
=
dfmcp
[[
'
px
'
,
'
py
'
,
'
pz
'
]].
values
Loading