Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • Corryvreckan Corryvreckan
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 39
    • Issues 39
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CorryvreckanCorryvreckan
  • CorryvreckanCorryvreckan
  • Merge requests
  • !114

Improve Clustering - allow arithmetic or charge-weighted mean for cluster centre

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jens Kroeger requested to merge jekroege/corryvreckan:improve_clustering4d into master May 28, 2019
  • Overview 49
  • Commits 26
  • Pipelines 19
  • Changes 6

Implemented improvements:

Now, there's the parameter charge_weighting to choose between charge weighted and arithmetic mean cluster centre calculation.

I also changed the Detector member functions getLocalPosition() and so on because: it would be much better to define a pixel as [col-0.5,col+0.5) rather than [col,col+1) as it is mostly (but not completely consistently) done now. This was fixed in a separate merge request (!116 (merged)), also updated all histograms etc. which are affected by this change.

Another issue we should discuss: We have a couple of pixel hits with charge=0. When these build single-pixel clusters, the charge-weighted mean will fail because

column += (pixel->column() * pixel->charge());
row += (pixel->row() * pixel->charge());

and later

column /= (charge > std::numeric_limits<double>::epsilon() ? charge : 1);
row /= (charge > std::numeric_limits<double>::epsilon() ? charge : 1);

don't make sense as we do something like column = 0/1. However, if I add a condition charge!=0 here, the charge-weighted mean is disturbed for multi-pixel clusters containing 1 pixel with zero charge.

Note: Previously, pixels with zero charge were completely kicked out.

How should we handle that?

Update: [See discussion below] The above problem, i.e. how to handle pixels with zero charge, is solved now by the following: If a cluster contains a pixel with zero charge we fall back to arithmetic mean instead of charge-weighted centre-of-gravity - assuming that charge=0 doesn't mean tiny charge but rather unknown charge, such that the arithmetic mean is the better estimate for the cluster position.

To Do before merging:

  • remove debug histograms
  • solve single-pixel with charge=0 question (see description above)
  • Implement the same in ClusteringSpatial()
Edited Sep 03, 2019 by Jens Kroeger
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: improve_clustering4d