Skip to content

Conversation

@wdconinc
Copy link
Contributor

Briefly, what does this PR introduce?

The island clustering in the BEMC EcalBarrelScFiProtoClusters should happen in the XY plane, not the XZ plane. This should remove the unreasonable effectiveness of the island clustering for two gammas in the same sector. We only gain Z information when we add timing analysis, and we don't lose the Y information at that point but combine it all in topological clustering.

What kind of change does this PR introduce?

  • Bug fix (issue: EcalBarrelScFiProtoClusters unreasonably effective)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

Yes, makes EcalBarrelScFiProtoClusters worse.

@veprbl
Copy link
Member

veprbl commented Oct 2, 2025

Do I understand correctly, that Y is the radial direction? I'm not entirely sure what is the effect is being fixed or worked around here. Ultimately, we want XZ, but the artificial Z segmentation is not representative of the resolution?

@wdconinc
Copy link
Contributor Author

wdconinc commented Oct 2, 2025

Do I understand correctly, that Y is the radial direction? I'm not entirely sure what is the effect is being fixed or worked around here. Ultimately, we want XZ, but the artificial Z segmentation is not representative of the resolution?

Island clustering for the scfi should have as primary directions X and Y (i.e. the tangential and radial directions at the end of sector readout plane*). The Z information is only secondarily available (since it requires time info, and then resolving which pulses on both ends are matching the same original hit). We therefore don't want Z information in our island clustering (which is 2D only).

Right now we are ignoring radial direction entirely when doing the clustering, and instead we are using Z information which is leading to a too optimistic operation.

So, this will make scfi clustering intentionally worse since we are now applying clustering in a way that is unrealistically efficient for same-sector clusters.

@wdconinc wdconinc requested a review from mariakzurek October 2, 2025 15:01
@sly2j
Copy link
Contributor

sly2j commented Oct 2, 2025

I think there's a bit of a misunderstanding: In local coordinates, the fibers are in the y-direction and the grid cells are in the x-z plane (similar to the tracker disks). See for example here: https://github.com/eic/epic/blob/fc2eb7a5f35264d46c5c5c04e0404e3b816b8e82/src/BarrelCalorimeterScFi_geo.cpp#L279C50-L279C51

In other words, we shouldn't change this as this would break what the algorithm is supposed to be doing.

@wdconinc
Copy link
Contributor Author

wdconinc commented Oct 2, 2025

I think there's a bit of a misunderstanding: In local coordinates, the fibers are in the y-direction and the grid cells are in the x-z plane (similar to the tracker disks). See for example here: https://github.com/eic/epic/blob/fc2eb7a5f35264d46c5c5c04e0404e3b816b8e82/src/BarrelCalorimeterScFi_geo.cpp#L279C50-L279C51

In other words, we shouldn't change this as this would break what the algorithm is supposed to be doing.

You can print out the positions it operates on to see that the local position is not rotated, only shifted.

@wdconinc
Copy link
Contributor Author

wdconinc commented Oct 2, 2025

You can print out the positions it operates on to see that the local position is not rotated, only shifted.

And there's the fact that for events with two gammas in the same sector we somehow identify two clusters with scfi island clustering, which shouldn't be possible. This change reverts that back to reconstruction of a single cluster, as it should be if we don't use the z segmentation.

@wdconinc
Copy link
Contributor Author

wdconinc commented Oct 3, 2025

Here are the input x and y local coordinates for EcalBarrelScFiRecHits:
image
And here is the z local coordinate:
image
(sorry for splitting, they are on different rows in capybara) (these are rec_dis_18x275_minQ2=0_craterlake_18x275)

These are not local in the sector coordinate system anymore. As discussed with @sly2j on mm, there is possibly a change in the geometry that caused this, e.g. a change from placing an actual sector volume to placing fibers in an assembly. I can't find anything while blame surfing epic.

We (=I) should get back to adding the capybara output to the epic repository, so we capture these issues, if it is a geometry change.

The other possible cause could be in our global-to-local handling in CalorimeterHitReco which may have started to use a different reference volume. I don't see any relevant changes to that in a long time, so I don't know what could have changed.

@sly2j
Copy link
Contributor

sly2j commented Oct 3, 2025

Interesting, I wonder what changed and how long the algorithm has been wrong. From your figures I agree that XY is the correct plane to use here. I retract my previous objection. We should also fix the comments in the geometry implementation so we avoid future confusion.

@veprbl veprbl added this pull request to the merge queue Oct 8, 2025
@veprbl veprbl removed this pull request from the merge queue due to a manual request Oct 8, 2025
@veprbl
Copy link
Member

veprbl commented Oct 8, 2025

Not sure if this or #2107 is intended

@wdconinc
Copy link
Contributor Author

wdconinc commented Oct 8, 2025

Not sure if this or #2107 is intended

If we have to pick something now, then this is better than nothing. #2107 doesn't work yet and the patient needs diagnosis.

@veprbl veprbl added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit 192ae12 Oct 9, 2025
130 checks passed
@veprbl veprbl deleted the EcalBarrelScFiProtoCluster-localDistXY branch October 9, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants