diff --git a/compact/display.xml b/compact/display.xml index ae6af1bf18fd1819d37492fc0e8484eee122e111..22c79293d5a84752d30b4f1c85eb19c00cb9cfea 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -49,6 +49,7 @@ <vis name="BeamPipeVis" alpha="1" r= "0.75" g="0.75" b="0.75" showDaughters="true" visible="true"/> <vis name="cb_SolenoidVis" alpha="0.4" r= "0.1" g="0.0" b="0.1" showDaughters="true" visible="true"/> + <vis name="ffi_ZDCVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/> <comment> Deprecated colors. diff --git a/src/ffi_ZDC.cpp b/src/ffi_ZDC.cpp index 7e7889340c5525672beceee921061e388375e726..27b3f42c0b49fa732e0bbae430bbe74f2a665557 100644 --- a/src/ffi_ZDC.cpp +++ b/src/ffi_ZDC.cpp @@ -25,12 +25,19 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) 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); + + detVol.setVisAttributes(desc.visAttributes(x_det.visStr())); DetElement det(detName, detID); Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(0., 0., 0.), Position(0., 0., 0.)); + Transform3D tr(RotationZYX(z_rot, y_rot, x_rot), Position(x_pos, 0., z_pos)); PlacedVolume detPV = motherVol.placeVolume(detVol, tr); det.setPlacement(detPV); return det;