From f4514d1f5504635da93425c7f46d88781c8502b7 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 3 Jun 2024 22:40:18 -0400 Subject: [PATCH] EEEMCal: reparametrize inner collar in terms of proton ring x offest --- compact/ecal/backward_PbWO4.xml | 2 +- src/HomogeneousCalorimeter_geo.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compact/ecal/backward_PbWO4.xml b/compact/ecal/backward_PbWO4.xml index 636440545..ad371a013 100644 --- a/compact/ecal/backward_PbWO4.xml +++ b/compact/ecal/backward_PbWO4.xml @@ -103,9 +103,9 @@ electron_rmax="73 * mm" proton_rmin="35 * mm" proton_rmax="43 * mm" - straight_section_tilt="62.05 * deg" z_length="EcalEndcapN_inner_support_length" x_offset="-1 * mm" + proton_x_offset="64 * mm" material="Copper" vis="AnlOrange" /> diff --git a/src/HomogeneousCalorimeter_geo.cpp b/src/HomogeneousCalorimeter_geo.cpp index e24ceeae8..ea3f69f35 100644 --- a/src/HomogeneousCalorimeter_geo.cpp +++ b/src/HomogeneousCalorimeter_geo.cpp @@ -45,15 +45,15 @@ static Volume inner_support_collar(Detector& desc, xml_comp_t handle) { Material inner_ring_material = desc.material(handle.materialStr()); - double electron_rmin = handle.attr(_Unicode(electron_rmin)); - double electron_rmax = handle.attr(_Unicode(electron_rmax)); - double proton_rmin = handle.attr(_Unicode(proton_rmin)); - double proton_rmax = handle.attr(_Unicode(proton_rmax)); - double straight_section_tilt = handle.attr(_Unicode(straight_section_tilt)); - double z_length = handle.z_length(); - - double proton_x_offset = ((electron_rmax + electron_rmin) - (proton_rmax + proton_rmin)) / 2 / - cos(straight_section_tilt); + double electron_rmin = handle.attr(_Unicode(electron_rmin)); + double electron_rmax = handle.attr(_Unicode(electron_rmax)); + double proton_rmin = handle.attr(_Unicode(proton_rmin)); + double proton_rmax = handle.attr(_Unicode(proton_rmax)); + double proton_x_offset = handle.attr(_Unicode(proton_x_offset)); + double z_length = handle.z_length(); + + double straight_section_tilt = + acos(((electron_rmax + electron_rmin) - (proton_rmax + proton_rmin)) / 2 / proton_x_offset); double mean_radius = (electron_rmax + electron_rmin + proton_rmax + proton_rmin) / 4; Position straight_section_offset{ proton_x_offset / 2 + cos(straight_section_tilt) * mean_radius,