Skip to content
Snippets Groups Projects
Commit 8b577329 authored by Jihee Kim's avatar Jihee Kim
Browse files

Added position and rotation of volume

parent 357a9982
No related branches found
No related tags found
1 merge request!11Resolve "Implement ffi_ZDC"
Pipeline #7732 failed
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
...@@ -423,6 +423,7 @@ ...@@ -423,6 +423,7 @@
</comment> </comment>
<comment> BeamLines: IP6 </comment> <comment> BeamLines: IP6 </comment>
<constant name="ffi_ZDC_x_pos" value="90.0 * cm"/> <constant name="ffi_ZDC_x_pos" value="90.0 * cm"/>
<constant name="ffi_ZDC_y_pos" value="0.0 * cm"/>
<constant name="ffi_ZDC_z_pos" value="3800.0 * cm"/> <constant name="ffi_ZDC_z_pos" value="3800.0 * cm"/>
<constant name="ffi_ZDC_rotateX_angle" value="0.0 * rad"/> <constant name="ffi_ZDC_rotateX_angle" value="0.0 * rad"/>
<constant name="ffi_ZDC_rotateY_angle" value="-0.0125 * rad"/> <constant name="ffi_ZDC_rotateY_angle" value="-0.0125 * rad"/>
...@@ -430,6 +431,7 @@ ...@@ -430,6 +431,7 @@
<comment> BeamLines: IP8 </comment> <comment> BeamLines: IP8 </comment>
<!--<constant name="ffi_ZDC_x_pos" value="127.0 * cm"/> <!--<constant name="ffi_ZDC_x_pos" value="127.0 * cm"/>
<constant name="ffi_ZDC_y_pos" value="0.0 * cm"/>
<constant name="ffi_ZDC_z_pos" value="3600.0 * cm"/> <constant name="ffi_ZDC_z_pos" value="3600.0 * cm"/>
<constant name="ffi_ZDC_rotateX_angle" value="0.0 * rad"/> <constant name="ffi_ZDC_rotateX_angle" value="0.0 * rad"/>
<constant name="ffi_ZDC_rotateY_angle" value="-0.025 * rad"/> <constant name="ffi_ZDC_rotateY_angle" value="-0.025 * rad"/>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<detectors> <detectors>
<detector id="ffi_ZDC_ID" name="ffi_ZDC" type="ffi_ZDC" readout="ffi_ZDC_Hits" vis="ffi_ZDCVis"> <detector id="ffi_ZDC_ID" name="ffi_ZDC" type="ffi_ZDC" readout="ffi_ZDC_Hits" vis="ffi_ZDCVis">
<position x="ffi_ZDC_x_pos" z="ffi_ZDC_z_pos"/> <position x="ffi_ZDC_x_pos" y="ffi_ZDC_y_pos" z="ffi_ZDC_z_pos"/>
<rotation x="ffi_ZDC_rotateX_angle" y="ffi_ZDC_rotateY_angle" z="ffi_ZDC_rotateZ_angle"/> <rotation x="ffi_ZDC_rotateX_angle" y="ffi_ZDC_rotateY_angle" z="ffi_ZDC_rotateZ_angle"/>
<dimensions x="ffi_ZDC_width" z="ffi_ZDC_thickness"/> <dimensions x="ffi_ZDC_width" z="ffi_ZDC_thickness"/>
</detector> </detector>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<readouts> <readouts>
<readout name="ffi_ZDC_Hits"> <readout name="ffi_ZDC_Hits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" /> <segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
<id>system:8,module:12,x:48:-8,y:-8</id> <id>system:8,module:12,x:32:-16,y:-16</id>
</readout> </readout>
</readouts> </readouts>
......
...@@ -17,18 +17,10 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) ...@@ -17,18 +17,10 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
double Thickness = dim.z(); double Thickness = dim.z();
xml_dim_t pos = x_det.position(); xml_dim_t pos = x_det.position();
double x_pos = dd4hep::getAttrOrDefault(pos, _Unicode(x),0.0);
double z_pos = dd4hep::getAttrOrDefault(pos, _Unicode(z),0.0);
xml_dim_t rot = x_det.rotation(); xml_dim_t rot = x_det.rotation();
double x_rot = dd4hep::getAttrOrDefault(rot, _Unicode(x),0.0);
double y_rot = dd4hep::getAttrOrDefault(rot, _Unicode(y),0.0);
double z_rot = dd4hep::getAttrOrDefault(rot, _Unicode(z),0.0);
Material Vacuum = desc.material("Vacuum"); Material Vacuum = desc.material("Vacuum");
std::cout << "positions: " << x_pos << " , " << z_pos << std::endl;
// Create Global Volume // Create Global Volume
Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5); Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5);
Volume detVol("ffi_ZDC_GVol_Logic", ffi_ZDC_GVol_Solid, Vacuum); Volume detVol("ffi_ZDC_GVol_Logic", ffi_ZDC_GVol_Solid, Vacuum);
...@@ -37,7 +29,7 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) ...@@ -37,7 +29,7 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
DetElement det(detName, detID); DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det); Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(z_rot, y_rot, x_rot), Position(x_pos, 0., z_pos)); Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z()));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr); PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
det.setPlacement(detPV); det.setPlacement(detPV);
return det; return det;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment