Commit 7ab4562b authored by Jens Kroeger's avatar Jens Kroeger
Browse files

Clustering4D/ClusteringSpatial: fixed error in logic, detected by @williamm

parent 57f5e28c
......@@ -182,7 +182,7 @@ void Clustering4D::calculateClusterCentre(Cluster* cluster) {
}
charge += pixel->charge();
if(chargeWeighting) {
if(chargeWeighting && !found_charge_zero) {
// charge-weighted cluster centre:
column += (pixel->column() * pixel->charge());
row += (pixel->row() * pixel->charge());
......
......@@ -192,7 +192,7 @@ void ClusteringSpatial::calculateClusterCentre(Cluster* cluster) {
}
charge += pixel->charge();
if(chargeWeighting) {
if(chargeWeighting && !found_charge_zero) {
// charge-weighted cluster centre:
column += (pixel->column() * pixel->charge());
row += (pixel->row() * pixel->charge());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment