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

Mirror ribs #471

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions compact/pid/drich.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,20 @@
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"
mirThCut1="0.40"
mirThCut2="0.41"
mirPhiACut="0.05"
mirPhiBCut="0.06"
>
<mirrorRib
material="CarbonFiber"
sectorRibPhi="0.5*degree"
/>

</mirror>
<!-- /detectors/detector/sensors -->
<documentation level="10">
#### Sensors
Expand Down Expand Up @@ -327,7 +335,7 @@ photodetector unit (PDU) assembly diagram: matrix of SiPMs with services
radius="110.0*cm"
/>
<sphericalpatch
phiw="30*degree"
phiw="18*degree"
rmin="111.0*cm"
rmax="179.0*cm"
zmin="DRICH_snout_length + 4.0*cm"
Expand Down
80 changes: 69 additions & 11 deletions src/DRICH_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
auto mirrorMat = desc.material(mirrorElem.attr<std::string>(_Unicode(material)));
auto mirrorVis = desc.visAttributes(mirrorElem.attr<std::string>(_Unicode(vis)));
auto mirrorSurf = surfMgr.opticalSurface(mirrorElem.attr<std::string>(_Unicode(surface)));
auto mirrorThCut1 = mirrorElem.attr<double>(_Unicode(mirThCut1));
auto mirrorThCut2 = mirrorElem.attr<double>(_Unicode(mirThCut2));
auto mirrorPhiACut = mirrorElem.attr<double>(_Unicode(mirPhiACut));
auto mirrorPhiBCut = mirrorElem.attr<double>(_Unicode(mirPhiBCut));
auto mirrorBackplane = mirrorElem.attr<double>(_Unicode(backplane));
auto mirrorThickness = mirrorElem.attr<double>(_Unicode(thickness));
auto mirrorRibElem = mirrorElem.child(_Unicode(mirrorRib));
auto mirrorRibMat = desc.material(mirrorRibElem.attr<std::string>(_Unicode(material)));
auto mirrorSecRib = mirrorRibElem.attr<double>(_Unicode(sectorRibPhi));
auto mirrorRmin = mirrorElem.attr<double>(_Unicode(rmin));
auto mirrorRmax = mirrorElem.attr<double>(_Unicode(rmax));
auto mirrorPhiw = mirrorElem.attr<double>(_Unicode(phiw));
Expand Down Expand Up @@ -378,7 +385,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 = 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) {
Expand All @@ -391,6 +400,18 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
Sphere mirrorSolid1(mirrorRadius, mirrorRadius + mirrorThickness, mirrorTheta1, mirrorTheta2, -40 * degree,
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
Expand All @@ -399,19 +420,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);
IntersectionSolid mirrorSolid2(pieSlice, mirrorSolid1, mirrorPlacement);

// mirror volume, attributes, and placement
Volume mirrorVol(detName + "_mirror_" + secName, mirrorSolid2, mirrorMat);
mirrorVol.setVisAttributes(mirrorVis);
auto mirrorSectorPlacement = Transform3D(sectorRotation); // rotate about beam axis to sector
auto mirrorPV = gasvolVol.placeVolume(mirrorVol, 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+mirrorSecRib) / 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, 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);

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);
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)
Expand Down