LDMX-Software / ldmx-sw

The Light Dark Matter eXperiment simulation and reconstruction framework.
https://ldmx-software.github.io
GNU General Public License v3.0
22 stars 21 forks source link

Side Hcal position reconstruction #1181

Closed EinarElen closed 1 year ago

EinarElen commented 1 year ago

Describe the bug As Bertrand reported from his work on the v14 PN samples, the side Hcal position reconstruction isn't working right. The side hcal position reconstruction is taken directly from the Hcal geometry so the correct location to look for issues will be in building the side hcal center position map.

I've walked through all of the code leading up to this part, including the GDML and python configuration and I believe those are correct. I have also checked that the conversion from copy number to HcalID is correct on the simulation level.

Here are two sketches I made that I think is helpful to have as reference. Obviously, nothing here is to scale. A layer here corresponds to one absorber plate, two airgaps and one scintillator layer. Overview of a single section image

Overview of the v14 side hcal from the front. Note the orientation of the X-axis. image

Based on this sketch, I've outlined a small set of sanity checks that I'm going to check. Checked are tested and pass, checked and strikethrough are tested and fail at least once.

Top/Bottom

General features

- [x] Bars oriented along the X axis all have the same Y center within a given layer, but different between different layers (same offset as above) 
- [x] Bars oriented along the X axis all have different Z center within a layer but have the same Z center as bars with the same strip number in the other layers
- [x] ~~All bars along the X axis all have (positive) X centers for the (bottom) section~~
Fails on e.g. 

Hcal(2,8,10) -> (-765, -642, 765)

- [x] ~~All bars along the X axis all have negative X centers for the top section~~
Fails on e.g. 

Hcal(1,8,8) -> (665, 642, 665)

I think the above two issues might just be that we assume the X-axis is oriented to the right when looking from the front. But you can check either via a Geant4 geometry visualization or by looking at some hits in the HcalSD that the X-axis is oriented to the left. This is because we set the Z-direction along the beam.

This... might affect other geometries as well and possibly also the back hcal  :|

##  Left/Right (Same offsets etc, just being very explicit here) 
EinarElen commented 1 year ago

Ok, I've worked out all the issues now and tested them thoroughly. What really threw me off is that the entire Hcal geometry is offset in Y by 19.05 mm. I'm not sure why this is, but it can be corrected for relatively straight-forwardly. I'll make a PR with the patches for v14.