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
Changes from 5 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
22 changes: 20 additions & 2 deletions src/DRICH_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move hard-coded numbers (0.4 and 0.41) to drich.xml.


// if debugging, draw full sphere
if (debugMirror) {
Expand All @@ -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
Expand All @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's time to come up with clearer names than using incrementing numbers, since we are now at "5".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any good ideas, but maybe something like

  • mirrorSolidInnerTile
  • mirrorSolidOuterTileA
  • mirrorSolidOuterTileB

Or you could put these in some STL container, such as std::set, so that you don't really have to give them names.


// 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Volume mirrorVol(detName + "_mirror_0" + secName, mirrorSolid2, mirrorMat);
Volume mirrorVol2(detName + "_mirror_1" + secName, mirrorSolid4, mirrorMat);
Volume mirrorVol3(detName + "_mirror_2" + secName, mirrorSolid5, mirrorMat);
Volume mirrorVol(detName + "_mirror_tile0" + secName, mirrorSolid2, mirrorMat);
Volume mirrorVol2(detName + "_mirror_tile1" + secName, mirrorSolid4, mirrorMat);
Volume mirrorVol3(detName + "_mirror_tile2" + secName, mirrorSolid5, mirrorMat);

or some suitable name, just so it's clear what 0, 1, and 2 mean.


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();

Expand Down