Skip to content
Snippets Groups Projects
Commit c94c9731 authored by Chao Peng's avatar Chao Peng
Browse files

fix a bug of incorrect rotation of wedge for the mirror intersection in LGC

parent 98e32686
Branches
No related tags found
1 merge request!1Update
Pipeline #95202 passed with warnings
......@@ -76,7 +76,7 @@
wedge corner coordinates
</comment>
<constant name="LGC_inner_wedge_P2_x" value="18.23*cm"/>
<constant name="LGC_inner_wedge_P2_y" value="173.42*cm"/>
<constant name="LGC_inner_wedge_P2_y" value="173.43*cm"/>
<constant name="LGC_inner_wedge_P2_z" value="305.82*cm"/>
<constant name="LGC_inner_wedge_P4_x" value="7.57*cm"/>
......@@ -121,7 +121,7 @@
name="LightGasCherenkov"
type="SoLID_GasCherenkov"
readout="LightGasCherenkovHits"
numsides="24">
numsides="30">
<placement x="LGC_x" y="LGC_y" z0="LGC_z" />
<tank material="Kapton" vis="LGCTankVis">
......@@ -165,20 +165,22 @@
<piece id="1" material="PyrexGlassOptical" surface="MirrorOpticalSurface" vis="LGCMirrorVis">
<placement x="LGC_inner_shell_x" y="LGC_inner_shell_y" z="LGC_inner_shell_z - LGC_z"/>
<shell rmin="LGC_inner_shell_rmin" rmax="LGC_inner_shell_rmax"
theta0="0" dtheta="90*degree" phi0="0" dphi="360*degree"/>
theta0="0*degree" dtheta="90*degree" phi0="180*degree" dphi="180*degree"/>
<comment> dz, dy are swapped because of x rotation </comment>
<wedge dx1="LGC_inner_wedge_dx1" dx2="LGC_inner_wedge_dx2"
dy="LGC_inner_wedge_dy" dz="LGC_inner_wedge_dz"
dy="LGC_inner_wedge_dz" dz="LGC_inner_wedge_dy"
x="LGC_inner_wedge_x" y="LGC_inner_wedge_y" z="LGC_inner_wedge_z"
rotx="90*degree" roty="0" rotz="0"/>
rotx="-90*degree" roty="0" rotz="0"/>
</piece>
<piece id="2" material="PyrexGlassOptical" surface="MirrorOpticalSurface" vis="LGCMirrorVis">
<placement x="LGC_outer_shell_x" y="LGC_outer_shell_y" z="LGC_outer_shell_z - LGC_z"/>
<shell rmin="LGC_outer_shell_rmin" rmax="LGC_outer_shell_rmax"
theta0="0" dtheta="90*degree" phi0="0" dphi="360*degree"/>
theta0="0*degree" dtheta="60*degree" phi0="0*degree" dphi="360*degree"/>
<comment> dz, dy are swapped because of x rotation </comment>
<wedge dx1="LGC_outer_wedge_dx1" dx2="LGC_outer_wedge_dx2"
dy="LGC_outer_wedge_dy" dz="LGC_outer_wedge_dz"
dy="LGC_outer_wedge_dz" dz="LGC_outer_wedge_dy"
x="LGC_outer_wedge_x" y="LGC_outer_wedge_y" z="LGC_outer_wedge_z"
rotx="90*degree" roty="0" rotz="0"/>
rotx="-90*degree" roty="0" rotz="0"/>
</piece>
</mirrors>
......
......@@ -117,15 +117,15 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
xml_dim_t x_msph = x_mir.child(_Unicode(shell));
// front half, this is to help debugging visualization
Sphere mshell(x_msph.rmin(), x_msph.rmax(),
x_msph.attr<double>(_Unicode(theta0)), x_msph.attr<double>(_Unicode(dtheta)),
x_msph.attr<double>(_Unicode(phi0)), x_msph.attr<double>(_Unicode(dphi)));
x_msph.attr<double>(_Unicode(theta0)), x_msph.attr<double>(_Unicode(theta0)) + x_msph.attr<double>(_Unicode(dtheta)),
x_msph.attr<double>(_Unicode(phi0)), x_msph.attr<double>(_Unicode(phi0)) + x_msph.attr<double>(_Unicode(dphi)));
// build trapezoid
xml_dim_t x_mtrd = x_mir.child(_Unicode(wedge));
Trd1 mwedge(x_mtrd.attr<double>(_Unicode(dx1)), x_mtrd.attr<double>(_Unicode(dx2)), x_mtrd.dy(), x_mtrd.dz());
auto mwedge_trans = Transform3D(Position(x_mtrd.x(), x_mtrd.y(), x_mtrd.z()))\
* RotationZYX(x_mtrd.attr<double>(_Unicode(rotz)),
x_mtrd.attr<double>(_Unicode(roty)),
x_mtrd.attr<double>(_Unicode(rotz)));
x_mtrd.attr<double>(_Unicode(rotx)));
// mirror volume
// use union to debug if intersection does not exist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment