Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
common
KM3io.jl
Commits
6e5ed406
Verified
Commit
6e5ed406
authored
2 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Use the crossing point of PMT axes for module center
Only if the module position is not specified.
parent
5f624ae5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/src/api.md
+2
-1
2 additions, 1 deletion
docs/src/api.md
src/hardware.jl
+7
-5
7 additions, 5 deletions
src/hardware.jl
with
9 additions
and
6 deletions
docs/src/api.md
+
2
−
1
View file @
6e5ed406
...
...
@@ -21,7 +21,7 @@ Evt
## Online Format
## Hardware
Components
## Hardware
```
@docs
PMT
...
...
@@ -31,6 +31,7 @@ Hydrophone
Tripod
piezoenabled
hydrophoneenabled
center
```
## Optical Data
...
...
This diff is collapsed.
Click to expand it.
src/hardware.jl
+
7
−
5
View file @
6e5ed406
...
...
@@ -65,14 +65,16 @@ Base.getindex(d::DetectorModule, i) = d.pmts[i+1]
Calculate the centre of a module by fitting the crossing point of the PMT axes.
"""
function
center
(
m
::
DetectorModule
)
center
(
m
::
DetectorModule
)
=
center
(
m
.
pmts
)
function
center
(
pmts
::
Vector
{
PMT
})
x
=
0.0
y
=
0.0
z
=
0.0
V
=
zeros
(
Float64
,
3
,
3
)
for
pmt
∈
m
for
pmt
∈
pmts
xx
=
1.0
-
pmt
.
dir
.
x
*
pmt
.
dir
.
x
yy
=
1.0
-
pmt
.
dir
.
y
*
pmt
.
dir
.
y
zz
=
1.0
-
pmt
.
dir
.
z
*
pmt
.
dir
.
z
...
...
@@ -357,10 +359,10 @@ function Detector(io::IO)
if
ismissing
(
pos
)
# Similar to the module t₀, the module position was introduced in DETX v4.
# If this is missing, it will be set to the
averaged PMT positions. If it's
# a base module, the position is set to (0, 0, 0).
# If this is missing, it will be set to the
crossing point of the PMT axes.
#
If it's
a base module, the position is set to (0, 0, 0).
if
length
(
pmts
)
>
0
pos
=
mean
([
pmt
.
pos
for
pmt
in
pmts
]
)
pos
=
center
(
pmts
)
else
pos
=
Position
(
0
,
0
,
0
)
end
...
...
This diff is collapsed.
Click to expand it.
Tamas Gal
@tgal
mentioned in commit
2228c50e
·
2 years ago
mentioned in commit
2228c50e
mentioned in commit 2228c50ec6bb6f1782f64239a6821e3a7e31497f
Toggle commit list
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