Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECal Layer Z-Position Bug #1490

Closed
SanjitMasanam opened this issue Oct 25, 2024 · 0 comments · Fixed by #1524
Closed

ECal Layer Z-Position Bug #1490

SanjitMasanam opened this issue Oct 25, 2024 · 0 comments · Fixed by #1524
Assignees

Comments

@SanjitMasanam
Copy link
Contributor

SanjitMasanam commented Oct 25, 2024

Describe the bug
Currently, the silicon layer positions in GDML and those saved to ECalSim/RecHits are not the same. This may also result in incorrect layer weights, but further testing needs to be done.

To Reproduce
Run the script below to see the mismatch

import numpy

# Constants
PCB_dz = 1.666
Glue_dz = 0.1
Si_dz = 0.3
GlueThick_dz = 0.2
CarbonBasePlate_dz = 0.79
MotherBoardAssembly_dz = 8.166
CarbonCoolingPlane_dz = 5.7
CarbonCoolingPlane_dy = 495.3
CarbonCoolingPlane_dx = 673.1
strongback_bar_dy = 25.4
strongback_bar_dx = 838.2 - 0.6815
PCB_Motherboard_Gap = 3.5
FrontTolerance = 0.5
BackTolerance = 0.5
preshower_extra_air = 0.5
bilayer_start = 240.5
sampling_section_offset = 2*preshower_extra_air
front_pre_tungsten_dz = 2.0
cooling_pre_tungsten_dz = 2.0

# Arrays
layerZPositions = [7.932, 14.532, 32.146, 40.746, 58.110, 67.710, 86.574, 96.774, 115.638, 125.838, 144.702, 154.902, 173.766, 183.966, 202.830, 213.030, 231.894, 242.094, 260.958, 271.158, 290.022, 300.222, 319.086, 329.286, 351.650, 365.250, 387.614, 401.214, 423.578, 437.178, 459.542, 473.142, 495.506, 509.106]
bilayer_absorber_cumulative = [0.0, 3.0, 8.0, 15.1, 22.2, 29.3, 36.4, 43.5, 50.6, 57.7, 64.8, 71.9, 85.9, 99.9, 113.9, 127.9, 141.9]
front_tungsten_dz = [1.0, 2.0, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 7.0, 7.0, 7.0, 7.0, 7.0]
cooling_tungsten_dz = [1.0, 1.5, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 1.8, 3.5, 3.5, 3.5, 3.5, 3.5]

# Calculated constants
Flower_dz = PCB_dz + Glue_dz + Si_dz + GlueThick_dz + CarbonBasePlate_dz
bilayer_noabsorber_thickness = FrontTolerance + PCB_dz + PCB_Motherboard_Gap + Flower_dz + CarbonCoolingPlane_dz + Flower_dz + PCB_Motherboard_Gap + PCB_dz + BackTolerance

# Position of silicon modules
first_sc_z_pos = bilayer_start + FrontTolerance + PCB_dz + PCB_Motherboard_Gap + PCB_dz + Glue_dz
second_sc_z_pos = bilayer_start + FrontTolerance + PCB_dz + PCB_Motherboard_Gap + Flower_dz + preshower_extra_air + CarbonCoolingPlane_dz + CarbonBasePlate_dz + GlueThick_dz
calc_layers = [first_sc_z_pos, second_sc_z_pos]
for i in range(len(bilayer_absorber_cumulative)-1):
    odd_layer = bilayer_start + sampling_section_offset + bilayer_noabsorber_thickness*(i+1) + bilayer_absorber_cumulative[i] + BackTolerance + front_tungsten_dz[i] + FrontTolerance + PCB_dz + PCB_Motherboard_Gap
    even_layer = bilayer_start + sampling_section_offset + bilayer_noabsorber_thickness*(i+1) + bilayer_absorber_cumulative[i] + BackTolerance + front_tungsten_dz[i] + FrontTolerance + PCB_dz + PCB_Motherboard_Gap + Flower_dz + cooling_tungsten_dz[i] + CarbonCoolingPlane_dz + cooling_tungsten_dz[i] + CarbonBasePlate_dz + GlueThick_dz
    calc_layers.append(odd_layer)
    calc_layers.append(even_layer)

# print results
print("True  Given  Diff")
for i in range(len(layerZPositions)):
    print(round(calc_layers[i] - 240, 3), round(layerZPositions[i], 3), round(numpy.abs(calc_layers[i] - layerZPositions[i] - 240), 3))

Desired behavior
We want the GDML and defined positions to match and an easier way to check if this issue arises again with new versions of the geometry. #1482 addresses the check.

@SanjitMasanam SanjitMasanam self-assigned this Oct 25, 2024
@SanjitMasanam SanjitMasanam removed their assignment Nov 29, 2024
@tvami tvami self-assigned this Jan 17, 2025
@SanjitMasanam SanjitMasanam self-assigned this Jan 18, 2025
@tvami tvami linked a pull request Jan 20, 2025 that will close this issue
2 tasks
@tvami tvami changed the title Layer Position Bug ECal Layer Z-Position Bug Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants