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
Merge requests
!47
Resolve "Muon Propagation"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Muon Propagation"
8-muon-propagation
into
master
Overview
0
Commits
35
Pipelines
10
Changes
1
Merged
Johannes Schumann
requested to merge
8-muon-propagation
into
master
1 year ago
Overview
0
Commits
35
Pipelines
10
Changes
1
Expand
Closes
#8 (closed)
0
0
Merge request reports
Viewing commit
77f5d366
Prev
Next
Show latest version
1 file
+
25
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
77f5d366
Add in CAN check to CAN only geometry
· 77f5d366
Johannes Schumann
authored
2 years ago
km3buu/geometry.py
+
25
−
0
Options
@@ -244,6 +244,31 @@ class CanVolume(DetectorVolume):
else
:
return
pos
def
in_can
(
self
,
pos
):
"""
Check if position is inside the CAN
Parameters
----------
pos: np.array
The positions which should be checked
Return
------
boolean / np.array
"""
if
type
(
pos
)
is
tuple
or
pos
.
ndim
==
1
:
pos
=
np
.
reshape
(
pos
,
(
-
1
,
3
))
zmask
=
(
pos
[:,
2
]
>=
self
.
_zmin
)
&
(
pos
[:,
2
]
<=
self
.
_zmax
)
r2
=
(
pos
[:,
0
]
-
self
.
_coord_origin
[
0
])
**
2
+
\
(
pos
[:,
1
]
-
self
.
_coord_origin
[
1
])
**
2
rmask
=
r2
<
(
self
.
_radius
**
2
)
mask
=
zmask
&
rmask
if
len
(
mask
)
==
1
:
return
mask
[
0
]
else
:
return
mask
def
random_dir
(
self
,
n
=
1
):
phi
=
np
.
random
.
uniform
(
0
,
2
*
np
.
pi
,
n
)
cos_theta
=
np
.
random
.
uniform
(
self
.
_cosZmin
,
self
.
_cosZmax
,
n
)
Loading