From d9dac627b1caf9f0c47b64a302f7bf5fc4b99e58 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Mon, 14 Nov 2022 16:03:58 +0100 Subject: [PATCH] OpticalSurface example: fix detector driver Use of top level assembly no longer working since commit 12e78b79d3d5644e81621103b7411387fd91821b ? --- examples/OpticalSurfaces/src/OpNovice_geo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/OpticalSurfaces/src/OpNovice_geo.cpp b/examples/OpticalSurfaces/src/OpNovice_geo.cpp index c4221a7a9..f49d78835 100644 --- a/examples/OpticalSurfaces/src/OpNovice_geo.cpp +++ b/examples/OpticalSurfaces/src/OpNovice_geo.cpp @@ -32,7 +32,8 @@ static Ref_t create_detector(Detector &description, xml_h e, SensitiveDetector / xml_det_t x_tank = x_det.child(_Unicode(tank)); xml_det_t x_bubble = x_det.child(_Unicode(bubble)); - Assembly hall_vol("Hall"); + Volume world = description.pickMotherVolume(sdet); + Box encl_box(_toDouble("world_x-2*cm"),_toDouble("world_y-2*cm"),_toDouble("world_z-2*cm")); Volume encl_vol("Enclosure",encl_box,description.air()); Box tank_box(x_tank.x(), x_tank.y(), x_tank.z()); @@ -48,10 +49,9 @@ static Ref_t create_detector(Detector &description, xml_h e, SensitiveDetector / bubblePlace.addPhysVolID("bubble",1); PlacedVolume tankPlace = encl_vol.placeVolume(tank_vol); tankPlace.addPhysVolID("tank",1); - PlacedVolume enclPlace = hall_vol.placeVolume(encl_vol); - PlacedVolume hallPlace = description.pickMotherVolume(sdet).placeVolume(hall_vol); - hallPlace.addPhysVolID("system",x_det.id()); - sdet.setPlacement(hallPlace); + PlacedVolume enclPlace = world.placeVolume(encl_vol); + enclPlace.addPhysVolID("system",x_det.id()); + sdet.setPlacement(enclPlace); #if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) // Now attach the surface