From 33f186f3a2545945b907794b9ac1921410bcc36d Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 7 Feb 2024 12:43:45 -0600 Subject: [PATCH] feat: add front support to BarrelImaging Calorimeter (#608) ### Briefly, what does this PR introduce? Adds the 0.5 cm aluminum front support ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] 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? No. --------- Co-authored-by: akshaya <99753263+AkshayaVijay@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- compact/definitions.xml | 2 +- compact/ecal/barrel_interlayers.xml | 13 ++++++++----- src/BarrelCalorimeterImaging_geo.cpp | 27 +++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/compact/definitions.xml b/compact/definitions.xml index e8d63b29a..9cca86c2f 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -544,7 +544,7 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc - + diff --git a/compact/ecal/barrel_interlayers.xml b/compact/ecal/barrel_interlayers.xml index 7cac6d796..037f24248 100644 --- a/compact/ecal/barrel_interlayers.xml +++ b/compact/ecal/barrel_interlayers.xml @@ -30,7 +30,8 @@ - + + @@ -68,7 +69,7 @@ - + @@ -145,9 +146,11 @@ + + + space_before="EcalBarrel_FrontSupportThickness"> + space_before="EcalBarrel_FrontSupportThickness + EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2."> - + diff --git a/src/BarrelCalorimeterImaging_geo.cpp b/src/BarrelCalorimeterImaging_geo.cpp index 3b3aed02b..190c14eb5 100644 --- a/src/BarrelCalorimeterImaging_geo.cpp +++ b/src/BarrelCalorimeterImaging_geo.cpp @@ -28,6 +28,10 @@ using namespace dd4hep; typedef ROOT::Math::XYPoint Point; +// geometry helpers +static void buildSupport(Detector& desc, Volume& mother, xml_comp_t x_support, + const std::tuple& dimensions); + // barrel ecal layers contained in an assembly static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) { @@ -176,8 +180,10 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) } } } - - // Loop over the sets of layer elements in the detector. + if (x_detector.hasChild(_Unicode(support))) { + buildSupport(desc, sector_volume, x_detector.child(_Unicode(support)), {inner_r, layer_pos_z, x_dimensions.z(), half_dphi}); + } + //Loop over the sets of layer elements in the detector. int layer_num = 1; for (xml_coll_t i_layer(x_detector, _U(layer)); i_layer; ++i_layer) { xml_comp_t x_layer = i_layer; @@ -399,4 +405,21 @@ static Ref_t create_detector(Detector& desc, xml_h e, SensitiveDetector sens) return sdet; } +// simple aluminum sheet cover +// dimensions: (inner r, position in z, length, phi) +static void buildSupport(Detector& desc, Volume& sector_volume, xml_comp_t x_support, + const std::tuple& dimensions) +{ + auto [inner_r, pos_z, sector_length, hphi] = dimensions; + double support_thickness = getAttrOrDefault(x_support, _Unicode(thickness), 0.5 * cm); + auto material = desc.material(x_support.materialStr()); + double trd_y = sector_length / 2.; + double trd_x1_support = std::tan(hphi) * pos_z; + double trd_x2_support = std::tan(hphi) * (pos_z + support_thickness); + + Trapezoid s_shape(trd_x1_support, trd_x2_support, trd_y, trd_y, support_thickness / 2.); + Volume s_vol("support_layer", s_shape, material); + s_vol.setVisAttributes(desc.visAttributes(x_support.visStr())); + sector_volume.placeVolume(s_vol, Position(0.0, 0.0, pos_z + support_thickness / 2.)); +} DECLARE_DETELEMENT(epic_EcalBarrelImaging, create_detector)