diff --git a/compact/definitions.xml b/compact/definitions.xml index 0494bfbb3a59c0ad1eefce5c1486e8cae8b75cfe..c3fdf11792f04e55867dc73deaca7209340bd484 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -423,6 +423,7 @@ </comment> <comment> BeamLines: IP6 </comment> <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_rotateX_angle" value="0.0 * rad"/> <constant name="ffi_ZDC_rotateY_angle" value="-0.0125 * rad"/> @@ -430,6 +431,7 @@ <comment> BeamLines: IP8 </comment> <!--<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_rotateX_angle" value="0.0 * rad"/> <constant name="ffi_ZDC_rotateY_angle" value="-0.025 * rad"/> diff --git a/compact/ffi_ZDC.xml b/compact/ffi_ZDC.xml index 2594f5f0b961693fdf003a8e0c79ee4fbc07b117..d0992dfa21d970c6dc9f20054c0485b4521eba16 100644 --- a/compact/ffi_ZDC.xml +++ b/compact/ffi_ZDC.xml @@ -16,7 +16,7 @@ <detectors> <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"/> <dimensions x="ffi_ZDC_width" z="ffi_ZDC_thickness"/> </detector> @@ -25,7 +25,7 @@ <readouts> <readout name="ffi_ZDC_Hits"> <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> </readouts> diff --git a/src/ffi_ZDC.cpp b/src/ffi_ZDC.cpp index 27b3f42c0b49fa732e0bbae430bbe74f2a665557..82ce4481a769f88cc761b0f6efbc1d1fa997b5cb 100644 --- a/src/ffi_ZDC.cpp +++ b/src/ffi_ZDC.cpp @@ -17,18 +17,10 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) double Thickness = dim.z(); 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(); - 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"); - std::cout << "positions: " << x_pos << " , " << z_pos << std::endl; - // Create Global Volume 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); @@ -37,7 +29,7 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) DetElement det(detName, detID); 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); det.setPlacement(detPV); return det;