From ceadbd94c1f7c20d7e5e3f1253033c6a38cd849d Mon Sep 17 00:00:00 2001 From: mariakzurek <33816222+mariakzurek@users.noreply.github.com> Date: Tue, 24 Jan 2023 13:37:17 -0600 Subject: [PATCH] Add cladding to fibers (#172) ### Briefly, what does this PR introduce? This PR implements the cladding of the Sci Fibers in the SciFi/Pb barrel Calorimeter. Now the fibers are implemented in assemblies of fiber cores (sensitive) and cladding (insensitive) and placed inside the lead slice. This resulted in the fastest geometry implementation I could achieve (no significant change wrt the previous implementation). ### 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: - [x] Tests for the changes have been added - [x] Documentation has been added / updated - [x] 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: Maria --- .github/workflows/linux-eic-shell.yml | 2 +- compact/ecal/barrel_interlayers.xml | 15 +++++++------- src/BarrelCalorimeterInterlayers_geo.cpp | 26 ++++++++++++++++-------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 7375e241c..f108b7de3 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -103,7 +103,7 @@ jobs: if-no-files-found: error - run: | source install/setup.sh - sed -i '/\1|g; s|\(/fiber>\)|\1|g' sed -i '/ - + @@ -39,13 +39,14 @@ + For Pb/SiFi (GlueX): X0 ~ 1.45 cm For W/SiFi (sPHENIX): X0 ~ 0.7 cm (but different fiber orientation) - - + + @@ -142,11 +143,7 @@ - - - - + @@ -154,6 +151,7 @@ @@ -170,6 +168,7 @@ diff --git a/src/BarrelCalorimeterInterlayers_geo.cpp b/src/BarrelCalorimeterInterlayers_geo.cpp index e6049d864..812fda6d5 100644 --- a/src/BarrelCalorimeterInterlayers_geo.cpp +++ b/src/BarrelCalorimeterInterlayers_geo.cpp @@ -179,6 +179,7 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com { auto [s_trd_x1, s_thick, s_length, hphi] = dimensions; double f_radius = getAttrOrDefault(x_fiber, _U(radius), 0.1 * cm); + double f_cladding_thickness = getAttrOrDefault(x_fiber, _Unicode(cladding_thickness), 0.0 * cm); double f_spacing_x = getAttrOrDefault(x_fiber, _Unicode(spacing_x), 0.122 * cm); double f_spacing_z = getAttrOrDefault(x_fiber, _Unicode(spacing_z), 0.134 * cm); std::string f_id_grid = getAttrOrDefault(x_fiber, _Unicode(identifier_grid), "grid"); @@ -195,8 +196,11 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com auto grid_div = getNdivisions(s_trd_x1, s_thick, 2.0 * cm, 2.0 * cm); // Calculate polygonal grid coordinates (vertices) auto grid_vtx = gridPoints(grid_div.first, grid_div.second, s_trd_x1, s_thick, hphi); - Tube f_tube(0, f_radius, s_length); - Volume f_vol("fiber_vol", f_tube, desc.material(x_fiber.materialStr())); + double f_radius_core = f_radius-f_cladding_thickness; + Tube f_tube_clad(f_radius_core, f_radius, s_length); + Volume f_vol_clad("fiber_vol", f_tube_clad, desc.material(x_fiber.materialStr())); + Tube f_tube_core(0, f_radius_core, s_length); + Volume f_vol_core("fiber_core_vol", f_tube_core, desc.material(x_fiber.materialStr())); vector f_id_count(grid_div.first * grid_div.second, 0); auto f_pos = fiberPositions(f_radius, f_spacing_x, f_spacing_z, s_trd_x1, s_thick, hphi); @@ -208,7 +212,8 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com } double l_pos_y = line.front().y(); // use assembly as intermediate volume container to reduce number of daughter volumes - Assembly lfibers(Form("fiber_array_line_%lu", il)); + Assembly lfibers_clad(Form("fiber_clad_array_line_%lu", il)); + Assembly lfibers_core(Form("fiber_core_array_line_%lu", il)); for (auto& p : line) { int f_grid_id = -1; int f_id = -1; @@ -236,19 +241,22 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com } if (x_fiber.isSensitive()) { - f_vol.setSensitiveDetector(sens); + f_vol_core.setSensitiveDetector(sens); } - f_vol.setAttributes(desc, x_fiber.regionStr(), x_fiber.limitsStr(), x_fiber.visStr()); + f_vol_core.setAttributes(desc, x_fiber.regionStr(), x_fiber.limitsStr(), x_fiber.visStr()); // Fiber placement // Transform3D f_tr(RotationZYX(0,0,M_PI*0.5),Position(p.x(), 0, p.y())); // PlacedVolume fiber_phv = s_vol.placeVolume(f_vol, Position(p.x(), 0., p.y())); - PlacedVolume fiber_phv = lfibers.placeVolume(f_vol, Position(p.x(), 0., 0.)); - fiber_phv.addPhysVolID(f_id_grid, f_grid_id + 1).addPhysVolID(f_id_fiber, f_id + 1); + PlacedVolume core_phv = lfibers_core.placeVolume(f_vol_core, Position(p.x(), 0., 0.)); + core_phv.addPhysVolID(f_id_grid, f_grid_id + 1).addPhysVolID(f_id_fiber, f_id + 1); + lfibers_clad.placeVolume(f_vol_clad, Position(p.x(), 0., 0.)); } - lfibers.ptr()->Voxelize(""); + lfibers_core.ptr()->Voxelize(""); + lfibers_clad.ptr()->Voxelize(""); Transform3D l_tr(RotationZYX(0, 0, M_PI * 0.5), Position(0., 0, l_pos_y)); - s_vol.placeVolume(lfibers, l_tr); + s_vol.placeVolume(lfibers_core, l_tr); + s_vol.placeVolume(lfibers_clad, l_tr); } }