Clustering & Pixels

Hi corry fans
In the process of getting more ATLAS Strip stuff working, I noticed that clustering takes quite a while in runs with loads of noise.
To some extent I can trace that down to the objects being held by corryvreckan::Cluster being TRef, rather than actual corryvreckan::Pixel* - I am guessing that is to do with being able to read partially processed data from a root file, but still wondering - once a cluster has called upon the actual Pixel* object (by doing GetObject()), couldn’t it hold on to those Pixel* rather than repeatedly doing GetObject whenever the pixels are required? GetObject includes quite a few checks that should really only be run once. Clustering does repeated checks on all pixels within a cluster, comparing them to others, thus it repeatedly does GetObject()… with clusters of multiple “pixels” (10-20), this gets slow very quickly.
Another way out that which I am contemplating is not creating a corryvreckan::Cluster within ClusteringSpatial, before I have all the hits collated, i.e. gather hits first, then generate a new cluster and add, refactor isNeighbor to check a Pixel* with respect to std::vector<Pixel*>.

On another note, wondering whether to post an issue: SetSplit is only over set to true - if the order in which hits are processed ever observes a split hit before it finds the joining hit then the cluster is never “unsplit” (i.e. a cluster with hit locations 1, 3, 2 could be created as a split cluster, but when looking at it in an orderly fashion it isn’t)

Hi @jdopke

your assesment is quite correct, accessing TRef is an overhead we would like to avoid - but I’m a but puzzled to still see this. We have introduced a wrapper (PointerWrapper) here already (taken from Allpix Squared’s corresponidng MR), so this should only even create TRefs when storing to file, and have raw pointers during processing.

Which version of Corry are you on?

/Simon

Hi Simon
I thought we had rebased everything lately, but lately was some two or three months ago - I’ll get rebased to master and re-run to see the improvement. Thanks, and apologies for not spotting that in master - had checked PixelDetector, but not dipped as far down as Cluster.hpp :frowning:
On a side note - this is on a branch that holds the radial developments from Jin, which now seem to be working ok-ish, so I would be tempted to have a discussion about that some time soon?
Best,
Jens

Hi @jdopke

sounds good, let’s have a discussion! There will also be a PhD student here at DESY for a few months who implemented the full radial strip geometry in Allpix Squared, so maybe he would like to join and can add to what’s there already? (See here for the MR).

Cheers,
Simon

1 Like