Skip to content

Conversation

@veprbl
Copy link
Member

@veprbl veprbl commented Jan 29, 2023

The issue with the current implementation is that is_neighbour() relies on geometrical dimensions of a calorimeter being used. This makes it cumbersome and error-prone to enable clustering for different detectors. The goal is to instead use readout cellID fields.

This PR suggests a following interface for doing that: A new parameter adjacencyMatrix is added to describe the adjacency of the sensitive elements. It can be used replace the existing settings like localDistXY. The value specified must be a string expression (to be evaluated by DD4hep evaluator) that returns a "boolean" value which is non-zero for adjacent cells. An example predicate for a calorimeter with a readout ID spec like system:8,row:8,column:8 could look like

cl = IslandCluster("cl",
  readoutClass="EcalBarrelSciGlassHits",
  adjacencyMatrix="(abs(row_1 - row_2) + abs(column_1 - column_2)) == 1",
  # ...
)

A calorimeter that has sectors might require a more sophisticated predicate like:

(
  abs(tower_1 - tower_2)
  + abs((sector_1 - sector2) * 5 + row_1 - row2)
) == 1

There are few minor issues with the current implementation:

  1. The 5 is a magical constant for number of rows per sector. It is possible to scan the geometry and define some sort of row_max constant to be used in place.
  2. Expressions are evaluated for every tower. This may be slow, but those values can be precomputed if needed.
  3. The DD4hep evaluator is designed to work with doubles, there might be some floating points caveats. Should not affect us unless we get into large numbers?

@veprbl veprbl marked this pull request as ready for review February 6, 2023 21:24
@veprbl
Copy link
Member Author

veprbl commented Feb 6, 2023

@veprbl veprbl closed this Feb 6, 2023
@veprbl veprbl deleted the pr/readout_clustering branch February 6, 2023 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant