Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
e6686013
Commit
e6686013
authored
Oct 26, 2017
by
Daniel Hynds
Browse files
if pixel tot is 0 then give it weight 1 (binary weighting)
parent
1d1f7ba2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/algorithms/Timepix3Clustering.cpp
View file @
e6686013
...
...
@@ -176,17 +176,18 @@ void Timepix3Clustering::calculateClusterCentre(Cluster* cluster) {
// Loop over all pixels
for
(
int
pix
=
0
;
pix
<
pixels
->
size
();
pix
++
)
{
tot
+=
(
*
pixels
)[
pix
]
->
m_adc
;
row
+=
((
*
pixels
)[
pix
]
->
m_row
*
(
*
pixels
)[
pix
]
->
m_adc
);
column
+=
((
*
pixels
)[
pix
]
->
m_column
*
(
*
pixels
)[
pix
]
->
m_adc
);
double
pixelToT
=
(
*
pixels
)[
pix
]
->
m_adc
;
if
(
pixelToT
==
0
){
LOG
(
DEBUG
)
<<
"Pixel with ToT 0!"
;
pixelToT
=
1
;
}
tot
+=
pixelToT
;
row
+=
((
*
pixels
)[
pix
]
->
m_row
*
pixelToT
);
column
+=
((
*
pixels
)[
pix
]
->
m_column
*
pixelToT
);
if
((
*
pixels
)[
pix
]
->
m_timestamp
<
timestamp
)
timestamp
=
(
*
pixels
)[
pix
]
->
m_timestamp
;
}
// Row and column positions are tot-weighted
if
(
tot
==
0
){
LOG
(
WARNING
)
<<
"Cluster with ToT 0!"
;
tot
=
1.
;
}
row
/=
tot
;
column
/=
tot
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment