Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSD Detector Project
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
Container Registry
Model registry
Operate
Environments
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
CSD-team
CSD Detector Project
Commits
2c8dee22
Commit
2c8dee22
authored
6 years ago
by
unknown
Browse files
Options
Downloads
Patches
Plain Diff
Change return List to numpy array
parent
aeb6d6da
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Detector.py
+7
-5
7 additions, 5 deletions
Detector.py
Documentation_Detector.md
+3
-3
3 additions, 3 deletions
Documentation_Detector.md
Documentation_Detector.rtf
+51
-52
51 additions, 52 deletions
Documentation_Detector.rtf
with
61 additions
and
60 deletions
Detector.py
+
7
−
5
View file @
2c8dee22
...
...
@@ -25,7 +25,7 @@ class Layer:
phiLow
=
np
.
arctan
(
int
(
x
/
0.0025
-
1
)
*
0.0025
/
self
.
Position
)
#^arctan ^round x to next upper/lower 25 mikrometer ^adjacent
else
:
return
None
# if the Layer is not hit, return "None"
return
((
None
,
None
),
(
None
,
None
))
# if the Layer is not hit, return "None"
if
0
<=
y
<
50
:
thetaHigh
=
np
.
arctan
(
int
(
y
/
0.0025
+
1
)
*
0.0025
/
self
.
Position
)
...
...
@@ -36,7 +36,7 @@ class Layer:
thetaLow
=
np
.
arctan
(
int
(
y
/
0.0025
-
1
)
*
0.0025
/
self
.
Position
)
else
:
return
None
return
((
None
,
None
),
(
None
,
None
))
return
((
phiHigh
,
phiLow
),
(
thetaHigh
,
thetaLow
))
...
...
@@ -56,9 +56,11 @@ class Detector:
"""
Calculate for a given angles (phi, theta) the hitted grid.
Returns the angles from source to grid edge or
"
None
"
if the Layer is not hitted
"""
result
=
[]
for
Layer
in
[
self
.
Layer1
,
self
.
Layer2
,
self
.
Layer3
,
self
.
Layer4
,
self
.
Layer5
]:
result
.
append
(
Layer
.
detect
((
phi
,
theta
)))
if
Layer
==
self
.
Layer1
:
#First Time creat numpy array
result
=
np
.
array
([
Layer
.
detect
((
phi
,
theta
))])
else
:
#For rest, just add
result
=
np
.
append
(
result
,
[
Layer
.
detect
((
phi
,
theta
))],
axis
=
0
)
return
result
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Documentation_Detector.md
+
3
−
3
View file @
2c8dee22
...
...
@@ -33,7 +33,7 @@ phi, theta: represents the angles of the particle starting from the source<br>
phi is for the x-axis [-pi,pi]
<br>
theta is for the y-axis [-pi,pi]
<br><br>
*Return:*
<br>
Returns a
List of 5 Tupl
es, each Tuple has 2 Tuples with a higher and a lower angle bound.
<br>
Returns a
numpy array with 5 entri
es, each Tuple has 2 Tuples with a higher and a lower angle bound.
<br>
This means:
<br>
e.g. returnvalue
[
a
][
b
]
[c]
<br>
a – [0,4] select Layer
<br>
...
...
@@ -41,7 +41,7 @@ b
c – 0 is the upper bound, 1 the lower bound
<br><br>
If a Layer is not hit, the Tuple is “None”
<br>
e.g. returnvalue [a] is “None”
<br>
e.g. returnvalue [a] is “
((
None
, None)( None, None))
”
<br>
...
...
@@ -80,6 +80,6 @@ This means:<br>
e.g. returnvalue
[
a
][
b
]
<br>
a – 0 is phi, 1 is theta
<br>
b – 0 is the upper bound, 1 the lower bound
<br><br>
If this Layer is not hit, the Tuple is “None”
<br>
If this Layer is not hit, the Tuple is “
((
None
, None)( None, None))
”
<br>
This diff is collapsed.
Click to expand it.
Documentation_Detector.rtf
+
51
−
52
View file @
2c8dee22
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