From 031c8bfc60b1c621d9165a5f86e8750e0c735d3c Mon Sep 17 00:00:00 2001 From: Chandradoy Chatterjee Date: Wed, 5 Jul 2023 17:55:23 +0200 Subject: [PATCH 1/8] Added C2F6 mirror-ribs --- src/DRICH_geo.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index 88820a11e..566b73fe4 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -362,7 +362,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // spherical mirror patch cuts and rotation double mirrorThetaRot = std::asin(mirrorCenterX / mirrorRadius); double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX - mirrorRmin) / mirrorRadius); - double mirrorTheta2 = mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta2 = 0.4*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta3 = 0.41*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta4 = 1.0*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); // if debugging, draw full sphere if (debugMirror) { @@ -375,6 +377,8 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, -40 * degree, 40 * degree); + Sphere mirrorSolid3(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + 40 * degree); // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; auto mirrorPlacement(Translation3D(mirrorPos.x(), mirrorPos.y(), mirrorPos.z()) // re-center to specified position @@ -384,17 +388,31 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // cut overlaps with other sectors using "pie slice" wedges, to the extent specified // by `mirrorPhiw` Tube pieSlice(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSlice1(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, (0.05*mirrorPhiw) / 2.0); + Tube pieSlice2(0.01 * cm, vesselRmax2, tankLength / 2.0, (0.06*mirrorPhiw) / 2.0, mirrorPhiw / 2.0); IntersectionSolid mirrorSolid2(pieSlice, mirrorSolid1, mirrorPlacement); + IntersectionSolid mirrorSolid4(pieSlice1, mirrorSolid3, mirrorPlacement); + IntersectionSolid mirrorSolid5(pieSlice2, mirrorSolid3, mirrorPlacement); // mirror volume, attributes, and placement - Volume mirrorVol(detName + "_mirror_" + secName, mirrorSolid2, mirrorMat); + Volume mirrorVol(detName + "_mirror_0" + secName, mirrorSolid2, mirrorMat); + Volume mirrorVol2(detName + "_mirror_1" + secName, mirrorSolid4, mirrorMat); + Volume mirrorVol3(detName + "_mirror_2" + secName, mirrorSolid5, mirrorMat); + mirrorVol.setVisAttributes(mirrorVis); + mirrorVol2.setVisAttributes(mirrorVis); + mirrorVol3.setVisAttributes(mirrorVis); + auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector auto mirrorPV = gasvolVol.placeVolume(mirrorVol, mirrorSectorPlacement); + auto mirrorPV2 = gasvolVol.placeVolume(mirrorVol2, mirrorSectorPlacement); + auto mirrorPV3 = gasvolVol.placeVolume(mirrorVol3, mirrorSectorPlacement); // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); mirrorDE.setPlacement(mirrorPV); + mirrorDE.setPlacement(mirrorPV2); + mirrorDE.setPlacement(mirrorPV3); SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorVol); mirrorSkin.isValid(); From b61297e936c6398e99977f9ead1f450652b910b5 Mon Sep 17 00:00:00 2001 From: Chandradoy Chatterjee Date: Wed, 5 Jul 2023 17:56:32 +0200 Subject: [PATCH 2/8] C2F6 abs 30*m --- compact/optical_materials.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact/optical_materials.xml b/compact/optical_materials.xml index feb0888ec..7ec65a80c 100644 --- a/compact/optical_materials.xml +++ b/compact/optical_materials.xml @@ -577,8 +577,8 @@ 6.19921*eV 1.000840 "/> @@ -327,7 +331,7 @@ photodetector unit (PDU) assembly diagram: matrix of SiPMs with services radius="110.0*cm" /> (_Unicode(material))); auto mirrorVis = desc.visAttributes(mirrorElem.attr(_Unicode(vis))); auto mirrorSurf = surfMgr.opticalSurface(mirrorElem.attr(_Unicode(surface))); + auto mirrorThCut1 = mirrorElem.attr(_Unicode(mirThCut1)); + auto mirrorThCut2 = mirrorElem.attr(_Unicode(mirThCut2)); + auto mirrorPhiACut = mirrorElem.attr(_Unicode(mirPhiACut)); + auto mirrorPhiBCut = mirrorElem.attr(_Unicode(mirPhiBCut)); auto mirrorBackplane = mirrorElem.attr(_Unicode(backplane)); auto mirrorThickness = mirrorElem.attr(_Unicode(thickness)); auto mirrorRmin = mirrorElem.attr(_Unicode(rmin)); @@ -374,13 +378,13 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // translate mirror center to be w.r.t vessel front plane mirrorCenterZ -= vesselZmin; - + // spherical mirror patch cuts and rotation double mirrorThetaRot = std::asin(mirrorCenterX / mirrorRadius); double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX - mirrorRmin) / mirrorRadius); - double mirrorTheta2 = 0.4*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); - double mirrorTheta3 = 0.41*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); - double mirrorTheta4 = 1.0*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta2 = mirrorThCut1*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta3 = mirrorThCut2*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta4 = mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); // if debugging, draw full sphere if (debugMirror) { @@ -393,8 +397,18 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, -40 * degree, 40 * degree); - Sphere mirrorSolid3(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + Sphere mirrorSolid2(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + 40 * degree); + + Sphere mirrorRibSolid0(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta4, -40 * degree, 40 * degree); + + Sphere mirrorRibSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta2, mirrorTheta3, -40 * degree, + 40 * degree); + + Sphere mirrorRibSolid2(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + 40 * degree); + // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; auto mirrorPlacement(Translation3D(mirrorPos) * // re-center to specified position @@ -403,33 +417,56 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // cut overlaps with other sectors using "pie slice" wedges, to the extent specified // by `mirrorPhiw` - Tube pieSlice(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); - Tube pieSlice1(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, (0.05*mirrorPhiw) / 2.0); - Tube pieSlice2(0.01 * cm, vesselRmax2, tankLength / 2.0, (0.06*mirrorPhiw) / 2.0, mirrorPhiw / 2.0); - IntersectionSolid mirrorSolid2(pieSlice, mirrorSolid1, mirrorPlacement); - IntersectionSolid mirrorSolid4(pieSlice1, mirrorSolid3, mirrorPlacement); - IntersectionSolid mirrorSolid5(pieSlice2, mirrorSolid3, mirrorPlacement); - - // mirror volume, attributes, and placement - Volume mirrorVol(detName + "_mirror_0" + secName, mirrorSolid2, mirrorMat); - Volume mirrorVol2(detName + "_mirror_1" + secName, mirrorSolid4, mirrorMat); - Volume mirrorVol3(detName + "_mirror_2" + secName, mirrorSolid5, mirrorMat); - - mirrorVol.setVisAttributes(mirrorVis); - mirrorVol2.setVisAttributes(mirrorVis); - mirrorVol3.setVisAttributes(mirrorVis); - - auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector - auto mirrorPV = gasvolVol.placeVolume(mirrorVol, mirrorSectorPlacement); - auto mirrorPV2 = gasvolVol.placeVolume(mirrorVol2, mirrorSectorPlacement); - auto mirrorPV3 = gasvolVol.placeVolume(mirrorVol3, mirrorSectorPlacement); - + Tube pieSliceInner(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSliceOuterA(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, (mirrorPhiACut*mirrorPhiw) / 2.0); + Tube pieSliceOuterB(0.01 * cm, vesselRmax2, tankLength / 2.0, (mirrorPhiBCut*mirrorPhiw) / 2.0, mirrorPhiw / 2.0); + //ribs + Tube pieSliceInnerRib(0.01*cm,vesselRmax2,tankLength/2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSliceOuterRib(0.01*cm,vesselRmax2,tankLength/2.0, (mirrorPhiACut*mirrorPhiw) / 2.0 , (mirrorPhiBCut*mirrorPhiw) / 2.0); + Tube pieSliceSectorRib(0.01*cm,vesselRmax2,tankLength/2.0, mirrorPhiw / 2.0 , (mirrorPhiw+0.017) / 2.0); + //mirror solids + IntersectionSolid mirrorInnerSolid(pieSliceInner, mirrorSolid1, mirrorPlacement); + IntersectionSolid mirrorOuterSolidA(pieSliceOuterA, mirrorSolid2, mirrorPlacement); + IntersectionSolid mirrorOuterSolidB(pieSliceOuterB, mirrorSolid2, mirrorPlacement); + //rib solids + IntersectionSolid mirrorRibInnerSolid(pieSliceInnerRib,mirrorRibSolid1,mirrorPlacement); + IntersectionSolid mirrorRibOuterSolid(pieSliceOuterRib,mirrorRibSolid2,mirrorPlacement); + IntersectionSolid mirrorRibSectorSolid(pieSliceSectorRib,mirrorRibSolid0,mirrorPlacement); + + // mirror and rib volume, attributes, and placement + Volume mirrorInnerVol(detName + "_mirror_tile0" + secName, mirrorInnerSolid, mirrorMat); + Volume mirrorOuterVolA(detName + "_mirror_tile1" + secName, mirrorOuterSolidA, mirrorMat); + Volume mirrorOuterVolB(detName + "_mirror_tile2" + secName, mirrorOuterSolidB, mirrorMat); + + Volume mirrorRibInnerVol(detName + "_mirror_rib0" + secName, mirrorRibInnerSolid, vesselMat); + Volume mirrorRibOuterVol(detName + "_mirror_rib1" + secName, mirrorRibOuterSolid, vesselMat); + Volume mirrorRibSectorVol(detName + "_mirror_rib3" + secName, mirrorRibSectorSolid, vesselMat); + + mirrorInnerVol.setVisAttributes(mirrorVis); + mirrorOuterVolA.setVisAttributes(mirrorVis); + mirrorOuterVolB.setVisAttributes(mirrorVis); + + mirrorRibInnerVol.setVisAttributes(resinVis); + mirrorRibOuterVol.setVisAttributes(resinVis); + mirrorRibSectorVol.setVisAttributes(resinVis); + + auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector + auto mirrorInnerPV = gasvolVol.placeVolume(mirrorInnerVol, mirrorSectorPlacement); + auto mirrorOuterPVA = gasvolVol.placeVolume(mirrorOuterVolA, mirrorSectorPlacement); + auto mirrorOuterPVB = gasvolVol.placeVolume(mirrorOuterVolB, mirrorSectorPlacement); + auto mirrorRibInnerPV = gasvolVol.placeVolume(mirrorRibInnerVol,mirrorSectorPlacement); + auto mirrorRibOuterPV = gasvolVol.placeVolume(mirrorRibOuterVol,mirrorSectorPlacement); + auto mirrorRibSectorPV = gasvolVol.placeVolume(mirrorRibSectorVol,mirrorSectorPlacement); + // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); - mirrorDE.setPlacement(mirrorPV); - mirrorDE.setPlacement(mirrorPV2); - mirrorDE.setPlacement(mirrorPV3); - SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorVol); + mirrorDE.setPlacement(mirrorInnerPV); + mirrorDE.setPlacement(mirrorOuterPVA); + mirrorDE.setPlacement(mirrorOuterPVB); + mirrorDE.setPlacement(mirrorRibInnerPV); + mirrorDE.setPlacement(mirrorRibOuterPV); + mirrorDE.setPlacement(mirrorRibSectorPV); + SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorInnerVol); mirrorSkin.isValid(); // reconstruction constants (w.r.t. IP) From 7820d3251d9c3e5b3f0084415b0ce97f9ed4d6c1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:42:54 +0000 Subject: [PATCH 4/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/DRICH_geo.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index 3a5b34975..d6181e294 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -378,7 +378,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // translate mirror center to be w.r.t vessel front plane mirrorCenterZ -= vesselZmin; - + // spherical mirror patch cuts and rotation double mirrorThetaRot = std::asin(mirrorCenterX / mirrorRadius); double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX - mirrorRmin) / mirrorRadius); @@ -402,13 +402,13 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Sphere mirrorRibSolid0(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta4, -40 * degree, 40 * degree); - + Sphere mirrorRibSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta2, mirrorTheta3, -40 * degree, - 40 * degree); - + 40 * degree); + Sphere mirrorRibSolid2(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, - 40 * degree); - + 40 * degree); + // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; auto mirrorPlacement(Translation3D(mirrorPos) * // re-center to specified position @@ -432,7 +432,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec IntersectionSolid mirrorRibInnerSolid(pieSliceInnerRib,mirrorRibSolid1,mirrorPlacement); IntersectionSolid mirrorRibOuterSolid(pieSliceOuterRib,mirrorRibSolid2,mirrorPlacement); IntersectionSolid mirrorRibSectorSolid(pieSliceSectorRib,mirrorRibSolid0,mirrorPlacement); - + // mirror and rib volume, attributes, and placement Volume mirrorInnerVol(detName + "_mirror_tile0" + secName, mirrorInnerSolid, mirrorMat); Volume mirrorOuterVolA(detName + "_mirror_tile1" + secName, mirrorOuterSolidA, mirrorMat); @@ -441,7 +441,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Volume mirrorRibInnerVol(detName + "_mirror_rib0" + secName, mirrorRibInnerSolid, vesselMat); Volume mirrorRibOuterVol(detName + "_mirror_rib1" + secName, mirrorRibOuterSolid, vesselMat); Volume mirrorRibSectorVol(detName + "_mirror_rib3" + secName, mirrorRibSectorSolid, vesselMat); - + mirrorInnerVol.setVisAttributes(mirrorVis); mirrorOuterVolA.setVisAttributes(mirrorVis); mirrorOuterVolB.setVisAttributes(mirrorVis); @@ -457,7 +457,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec auto mirrorRibInnerPV = gasvolVol.placeVolume(mirrorRibInnerVol,mirrorSectorPlacement); auto mirrorRibOuterPV = gasvolVol.placeVolume(mirrorRibOuterVol,mirrorSectorPlacement); auto mirrorRibSectorPV = gasvolVol.placeVolume(mirrorRibSectorVol,mirrorSectorPlacement); - + // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); mirrorDE.setPlacement(mirrorInnerPV); From 3e3bee88243e4bc8509e4ed299378be148740961 Mon Sep 17 00:00:00 2001 From: Chandradoy Chatterjee Date: Wed, 5 Jul 2023 17:55:23 +0200 Subject: [PATCH 5/8] Added C2F6 mirror-ribs --- src/DRICH_geo.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index 45c9066a0..fa3b04f91 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -378,7 +378,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // spherical mirror patch cuts and rotation double mirrorThetaRot = std::asin(mirrorCenterX / mirrorRadius); double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX - mirrorRmin) / mirrorRadius); - double mirrorTheta2 = mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta2 = 0.4*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta3 = 0.41*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta4 = 1.0*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); // if debugging, draw full sphere if (debugMirror) { @@ -391,6 +393,8 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, -40 * degree, 40 * degree); + Sphere mirrorSolid3(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + 40 * degree); // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; auto mirrorPlacement(Translation3D(mirrorPos) * // re-center to specified position @@ -400,17 +404,31 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // cut overlaps with other sectors using "pie slice" wedges, to the extent specified // by `mirrorPhiw` Tube pieSlice(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSlice1(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, (0.05*mirrorPhiw) / 2.0); + Tube pieSlice2(0.01 * cm, vesselRmax2, tankLength / 2.0, (0.06*mirrorPhiw) / 2.0, mirrorPhiw / 2.0); IntersectionSolid mirrorSolid2(pieSlice, mirrorSolid1, mirrorPlacement); + IntersectionSolid mirrorSolid4(pieSlice1, mirrorSolid3, mirrorPlacement); + IntersectionSolid mirrorSolid5(pieSlice2, mirrorSolid3, mirrorPlacement); // mirror volume, attributes, and placement - Volume mirrorVol(detName + "_mirror_" + secName, mirrorSolid2, mirrorMat); + Volume mirrorVol(detName + "_mirror_0" + secName, mirrorSolid2, mirrorMat); + Volume mirrorVol2(detName + "_mirror_1" + secName, mirrorSolid4, mirrorMat); + Volume mirrorVol3(detName + "_mirror_2" + secName, mirrorSolid5, mirrorMat); + mirrorVol.setVisAttributes(mirrorVis); + mirrorVol2.setVisAttributes(mirrorVis); + mirrorVol3.setVisAttributes(mirrorVis); + auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector auto mirrorPV = gasvolVol.placeVolume(mirrorVol, mirrorSectorPlacement); + auto mirrorPV2 = gasvolVol.placeVolume(mirrorVol2, mirrorSectorPlacement); + auto mirrorPV3 = gasvolVol.placeVolume(mirrorVol3, mirrorSectorPlacement); // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); mirrorDE.setPlacement(mirrorPV); + mirrorDE.setPlacement(mirrorPV2); + mirrorDE.setPlacement(mirrorPV3); SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorVol); mirrorSkin.isValid(); From 112037794a06fd38093dc6ec5c069d346ced6594 Mon Sep 17 00:00:00 2001 From: chchatte92 Date: Wed, 13 Dec 2023 16:42:32 +0100 Subject: [PATCH 6/8] Mirror ribs nomeclature changed and ribs added --- compact/pid/drich.xml | 6 ++- src/DRICH_geo.cpp | 97 ++++++++++++++++++++++++++++++------------- 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/compact/pid/drich.xml b/compact/pid/drich.xml index 8637f6a3c..07e86120c 100644 --- a/compact/pid/drich.xml +++ b/compact/pid/drich.xml @@ -173,6 +173,10 @@ thickness="0.2*cm" focus_tune_x="-7.00*cm" focus_tune_z="6.15*cm" + mirThCut1="0.40" + mirThCut2="0.41" + mirPhiACut="0.05" + mirPhiBCut="0.06" /> @@ -327,7 +331,7 @@ photodetector unit (PDU) assembly diagram: matrix of SiPMs with services radius="110.0*cm" /> (_Unicode(material))); auto mirrorVis = desc.visAttributes(mirrorElem.attr(_Unicode(vis))); auto mirrorSurf = surfMgr.opticalSurface(mirrorElem.attr(_Unicode(surface))); + auto mirrorThCut1 = mirrorElem.attr(_Unicode(mirThCut1)); + auto mirrorThCut2 = mirrorElem.attr(_Unicode(mirThCut2)); + auto mirrorPhiACut = mirrorElem.attr(_Unicode(mirPhiACut)); + auto mirrorPhiBCut = mirrorElem.attr(_Unicode(mirPhiBCut)); auto mirrorBackplane = mirrorElem.attr(_Unicode(backplane)); auto mirrorThickness = mirrorElem.attr(_Unicode(thickness)); auto mirrorRmin = mirrorElem.attr(_Unicode(rmin)); @@ -374,13 +378,13 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // translate mirror center to be w.r.t vessel front plane mirrorCenterZ -= vesselZmin; - + // spherical mirror patch cuts and rotation double mirrorThetaRot = std::asin(mirrorCenterX / mirrorRadius); double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX - mirrorRmin) / mirrorRadius); - double mirrorTheta2 = 0.4*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); - double mirrorTheta3 = 0.41*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); - double mirrorTheta4 = 1.0*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta2 = mirrorThCut1*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta3 = mirrorThCut2*mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); + double mirrorTheta4 = mirrorThetaRot + std::asin((mirrorRmax - mirrorCenterX) / mirrorRadius); // if debugging, draw full sphere if (debugMirror) { @@ -393,8 +397,18 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, -40 * degree, 40 * degree); - Sphere mirrorSolid3(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + Sphere mirrorSolid2(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + 40 * degree); + + Sphere mirrorRibSolid0(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta4, -40 * degree, 40 * degree); + + Sphere mirrorRibSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta2, mirrorTheta3, -40 * degree, + 40 * degree); + + Sphere mirrorRibSolid2(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta3, mirrorTheta4, -40 * degree, + 40 * degree); + // mirror placement transformation (note: transformations are in reverse order) auto mirrorPos = Position(mirrorCenterX, 0., mirrorCenterZ) + originFront; auto mirrorPlacement(Translation3D(mirrorPos) * // re-center to specified position @@ -403,33 +417,56 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // cut overlaps with other sectors using "pie slice" wedges, to the extent specified // by `mirrorPhiw` - Tube pieSlice(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); - Tube pieSlice1(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, (0.05*mirrorPhiw) / 2.0); - Tube pieSlice2(0.01 * cm, vesselRmax2, tankLength / 2.0, (0.06*mirrorPhiw) / 2.0, mirrorPhiw / 2.0); - IntersectionSolid mirrorSolid2(pieSlice, mirrorSolid1, mirrorPlacement); - IntersectionSolid mirrorSolid4(pieSlice1, mirrorSolid3, mirrorPlacement); - IntersectionSolid mirrorSolid5(pieSlice2, mirrorSolid3, mirrorPlacement); - - // mirror volume, attributes, and placement - Volume mirrorVol(detName + "_mirror_0" + secName, mirrorSolid2, mirrorMat); - Volume mirrorVol2(detName + "_mirror_1" + secName, mirrorSolid4, mirrorMat); - Volume mirrorVol3(detName + "_mirror_2" + secName, mirrorSolid5, mirrorMat); - - mirrorVol.setVisAttributes(mirrorVis); - mirrorVol2.setVisAttributes(mirrorVis); - mirrorVol3.setVisAttributes(mirrorVis); - - auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector - auto mirrorPV = gasvolVol.placeVolume(mirrorVol, mirrorSectorPlacement); - auto mirrorPV2 = gasvolVol.placeVolume(mirrorVol2, mirrorSectorPlacement); - auto mirrorPV3 = gasvolVol.placeVolume(mirrorVol3, mirrorSectorPlacement); - + Tube pieSliceInner(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSliceOuterA(0.01 * cm, vesselRmax2, tankLength / 2.0, -mirrorPhiw / 2.0, (mirrorPhiACut*mirrorPhiw) / 2.0); + Tube pieSliceOuterB(0.01 * cm, vesselRmax2, tankLength / 2.0, (mirrorPhiBCut*mirrorPhiw) / 2.0, mirrorPhiw / 2.0); + //ribs + Tube pieSliceInnerRib(0.01*cm,vesselRmax2,tankLength/2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); + Tube pieSliceOuterRib(0.01*cm,vesselRmax2,tankLength/2.0, (mirrorPhiACut*mirrorPhiw) / 2.0 , (mirrorPhiBCut*mirrorPhiw) / 2.0); + Tube pieSliceSectorRib(0.01*cm,vesselRmax2,tankLength/2.0, mirrorPhiw / 2.0 , (mirrorPhiw+0.017) / 2.0); + //mirror solids + IntersectionSolid mirrorInnerSolid(pieSliceInner, mirrorSolid1, mirrorPlacement); + IntersectionSolid mirrorOuterSolidA(pieSliceOuterA, mirrorSolid2, mirrorPlacement); + IntersectionSolid mirrorOuterSolidB(pieSliceOuterB, mirrorSolid2, mirrorPlacement); + //rib solids + IntersectionSolid mirrorRibInnerSolid(pieSliceInnerRib,mirrorRibSolid1,mirrorPlacement); + IntersectionSolid mirrorRibOuterSolid(pieSliceOuterRib,mirrorRibSolid2,mirrorPlacement); + IntersectionSolid mirrorRibSectorSolid(pieSliceSectorRib,mirrorRibSolid0,mirrorPlacement); + + // mirror and rib volume, attributes, and placement + Volume mirrorInnerVol(detName + "_mirror_tile0" + secName, mirrorInnerSolid, mirrorMat); + Volume mirrorOuterVolA(detName + "_mirror_tile1" + secName, mirrorOuterSolidA, mirrorMat); + Volume mirrorOuterVolB(detName + "_mirror_tile2" + secName, mirrorOuterSolidB, mirrorMat); + + Volume mirrorRibInnerVol(detName + "_mirror_rib0" + secName, mirrorRibInnerSolid, vesselMat); + Volume mirrorRibOuterVol(detName + "_mirror_rib1" + secName, mirrorRibOuterSolid, vesselMat); + Volume mirrorRibSectorVol(detName + "_mirror_rib3" + secName, mirrorRibSectorSolid, vesselMat); + + mirrorInnerVol.setVisAttributes(mirrorVis); + mirrorOuterVolA.setVisAttributes(mirrorVis); + mirrorOuterVolB.setVisAttributes(mirrorVis); + + mirrorRibInnerVol.setVisAttributes(resinVis); + mirrorRibOuterVol.setVisAttributes(resinVis); + mirrorRibSectorVol.setVisAttributes(resinVis); + + auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector + auto mirrorInnerPV = gasvolVol.placeVolume(mirrorInnerVol, mirrorSectorPlacement); + auto mirrorOuterPVA = gasvolVol.placeVolume(mirrorOuterVolA, mirrorSectorPlacement); + auto mirrorOuterPVB = gasvolVol.placeVolume(mirrorOuterVolB, mirrorSectorPlacement); + auto mirrorRibInnerPV = gasvolVol.placeVolume(mirrorRibInnerVol,mirrorSectorPlacement); + auto mirrorRibOuterPV = gasvolVol.placeVolume(mirrorRibOuterVol,mirrorSectorPlacement); + auto mirrorRibSectorPV = gasvolVol.placeVolume(mirrorRibSectorVol,mirrorSectorPlacement); + // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); - mirrorDE.setPlacement(mirrorPV); - mirrorDE.setPlacement(mirrorPV2); - mirrorDE.setPlacement(mirrorPV3); - SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorVol); + mirrorDE.setPlacement(mirrorInnerPV); + mirrorDE.setPlacement(mirrorOuterPVA); + mirrorDE.setPlacement(mirrorOuterPVB); + mirrorDE.setPlacement(mirrorRibInnerPV); + mirrorDE.setPlacement(mirrorRibOuterPV); + mirrorDE.setPlacement(mirrorRibSectorPV); + SkinSurface mirrorSkin(desc, mirrorDE, "mirror_optical_surface_" + secName, mirrorSurf, mirrorInnerVol); mirrorSkin.isValid(); // reconstruction constants (w.r.t. IP) From 0f28a8074ead3e8b76b2b2021882ff6b248232de Mon Sep 17 00:00:00 2001 From: chchatte92 Date: Wed, 13 Dec 2023 17:12:29 +0100 Subject: [PATCH 7/8] Rib Material CarbonFiber; removed hardcoded variables --- compact/pid/drich.xml | 8 ++++++-- src/DRICH_geo.cpp | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/compact/pid/drich.xml b/compact/pid/drich.xml index 07e86120c..1b288f2f8 100644 --- a/compact/pid/drich.xml +++ b/compact/pid/drich.xml @@ -169,7 +169,7 @@ backplane="DRICH_window_thickness + 1.0*cm" rmin="DRICH_rmin1 + DRICH_wall_thickness - 1.0*cm" rmax="DRICH_rmax2 - DRICH_wall_thickness - 3.0*cm" - phiw="59.5*degree" + phiw="59.75*degree" thickness="0.2*cm" focus_tune_x="-7.00*cm" focus_tune_z="6.15*cm" @@ -177,8 +177,12 @@ mirThCut2="0.41" mirPhiACut="0.05" mirPhiBCut="0.06" + > + - + #### Sensors diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index 53666c631..e8b3d98f8 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -84,6 +84,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec auto mirrorPhiBCut = mirrorElem.attr(_Unicode(mirPhiBCut)); auto mirrorBackplane = mirrorElem.attr(_Unicode(backplane)); auto mirrorThickness = mirrorElem.attr(_Unicode(thickness)); + auto mirrorRibElem = mirrorElem.child(_Unicode(mirrorRib)); + auto mirrorRibMat = desc.material(mirrorRibElem.attr(_Unicode(material))); + auto mirrorSecRib = mirrorRibElem.attr(_Unicode(sectorRibPhi)); auto mirrorRmin = mirrorElem.attr(_Unicode(rmin)); auto mirrorRmax = mirrorElem.attr(_Unicode(rmax)); auto mirrorPhiw = mirrorElem.attr(_Unicode(phiw)); @@ -423,7 +426,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec //ribs Tube pieSliceInnerRib(0.01*cm,vesselRmax2,tankLength/2.0, -mirrorPhiw / 2.0, mirrorPhiw / 2.0); Tube pieSliceOuterRib(0.01*cm,vesselRmax2,tankLength/2.0, (mirrorPhiACut*mirrorPhiw) / 2.0 , (mirrorPhiBCut*mirrorPhiw) / 2.0); - Tube pieSliceSectorRib(0.01*cm,vesselRmax2,tankLength/2.0, mirrorPhiw / 2.0 , (mirrorPhiw+0.017) / 2.0); + Tube pieSliceSectorRib(0.01*cm,vesselRmax2,tankLength/2.0, mirrorPhiw / 2.0 , (mirrorPhiw+mirrorSecRib) / 2.0); //mirror solids IntersectionSolid mirrorInnerSolid(pieSliceInner, mirrorSolid1, mirrorPlacement); IntersectionSolid mirrorOuterSolidA(pieSliceOuterA, mirrorSolid2, mirrorPlacement); @@ -438,9 +441,9 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Volume mirrorOuterVolA(detName + "_mirror_tile1" + secName, mirrorOuterSolidA, mirrorMat); Volume mirrorOuterVolB(detName + "_mirror_tile2" + secName, mirrorOuterSolidB, mirrorMat); - Volume mirrorRibInnerVol(detName + "_mirror_rib0" + secName, mirrorRibInnerSolid, vesselMat); - Volume mirrorRibOuterVol(detName + "_mirror_rib1" + secName, mirrorRibOuterSolid, vesselMat); - Volume mirrorRibSectorVol(detName + "_mirror_rib3" + secName, mirrorRibSectorSolid, vesselMat); + Volume mirrorRibInnerVol(detName + "_mirror_rib0" + secName, mirrorRibInnerSolid, mirrorRibMat); + Volume mirrorRibOuterVol(detName + "_mirror_rib1" + secName, mirrorRibOuterSolid, mirrorRibMat); + Volume mirrorRibSectorVol(detName + "_mirror_rib3" + secName, mirrorRibSectorSolid, mirrorRibMat); mirrorInnerVol.setVisAttributes(mirrorVis); mirrorOuterVolA.setVisAttributes(mirrorVis); From 3ebfaea0de84cefb236f1b26e65b7de8e22ea185 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:58:40 +0000 Subject: [PATCH 8/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/DRICH_geo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DRICH_geo.cpp b/src/DRICH_geo.cpp index 6eb939510..ceb06a47e 100644 --- a/src/DRICH_geo.cpp +++ b/src/DRICH_geo.cpp @@ -381,7 +381,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec // translate mirror center to be w.r.t vessel front plane mirrorCenterZ -= vesselZmin; - + // spherical mirror patch cuts and rotation double mirrorThetaRot = std::asin(mirrorCenterX / mirrorRadius); double mirrorTheta1 = mirrorThetaRot - std::asin((mirrorCenterX - mirrorRmin) / mirrorRadius); @@ -435,7 +435,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec IntersectionSolid mirrorRibInnerSolid(pieSliceInnerRib,mirrorRibSolid1,mirrorPlacement); IntersectionSolid mirrorRibOuterSolid(pieSliceOuterRib,mirrorRibSolid2,mirrorPlacement); IntersectionSolid mirrorRibSectorSolid(pieSliceSectorRib,mirrorRibSolid0,mirrorPlacement); - + // mirror and rib volume, attributes, and placement Volume mirrorInnerVol(detName + "_mirror_tile0" + secName, mirrorInnerSolid, mirrorMat); Volume mirrorOuterVolA(detName + "_mirror_tile1" + secName, mirrorOuterSolidA, mirrorMat); @@ -444,11 +444,11 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec Volume mirrorRibInnerVol(detName + "_mirror_rib0" + secName, mirrorRibInnerSolid, mirrorRibMat); Volume mirrorRibOuterVol(detName + "_mirror_rib1" + secName, mirrorRibOuterSolid, mirrorRibMat); Volume mirrorRibSectorVol(detName + "_mirror_rib3" + secName, mirrorRibSectorSolid, mirrorRibMat); - + mirrorInnerVol.setVisAttributes(mirrorVis); mirrorOuterVolA.setVisAttributes(mirrorVis); mirrorOuterVolB.setVisAttributes(mirrorVis); - + mirrorRibInnerVol.setVisAttributes(resinVis); mirrorRibOuterVol.setVisAttributes(resinVis); mirrorRibSectorVol.setVisAttributes(resinVis); @@ -460,7 +460,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec auto mirrorRibInnerPV = gasvolVol.placeVolume(mirrorRibInnerVol,mirrorSectorPlacement); auto mirrorRibOuterPV = gasvolVol.placeVolume(mirrorRibOuterVol,mirrorSectorPlacement); auto mirrorRibSectorPV = gasvolVol.placeVolume(mirrorRibSectorVol,mirrorSectorPlacement); - + // properties DetElement mirrorDE(det, "mirror_de_" + secName, isec); mirrorDE.setPlacement(mirrorInnerPV);