From b4bdacc7b261ad7ea0401addbfe55db34fbcf670 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Wed, 2 Oct 2019 18:56:23 +0200
Subject: [PATCH] Add reflection examples

---
 DDCore/src/plugins/ShapePlugins.cpp                          | 5 ++---
 .../compact/Check_Shape_Eightpoint_Reflect_Volume.xml        | 2 +-
 examples/ClientTests/ref/Ref_Eightpoint_Reflect_Volume.txt   | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/DDCore/src/plugins/ShapePlugins.cpp b/DDCore/src/plugins/ShapePlugins.cpp
index 151f76b08..4cfe5ff01 100644
--- a/DDCore/src/plugins/ShapePlugins.cpp
+++ b/DDCore/src/plugins/ShapePlugins.cpp
@@ -520,10 +520,9 @@ static Ref_t create_shape(Detector& description, xml_h e, Ref_t /* sens */)  {
     if ( pos.ptr() && rot.ptr() )  {
       Rotation3D  rot3D(RotationZYX(rot.z(0),rot.y(0),rot.x(0)));
       Position    pos3D(pos.x(0),pos.y(0),pos.z(0));
-      Rotation3D  rrot3D(rot3D);
       if ( reflect )
-        rrot3D = Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * rot3D;
-      Transform3D tr(rrot3D, pos3D);
+        rot3D = Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * rot3D;
+      Transform3D tr(rot3D, pos3D);
       pv = assembly.placeVolume(volume,tr);
     }
     else if ( pos.ptr() )  {
diff --git a/examples/ClientTests/compact/Check_Shape_Eightpoint_Reflect_Volume.xml b/examples/ClientTests/compact/Check_Shape_Eightpoint_Reflect_Volume.xml
index 0d881b6ea..bce121bee 100644
--- a/examples/ClientTests/compact/Check_Shape_Eightpoint_Reflect_Volume.xml
+++ b/examples/ClientTests/compact/Check_Shape_Eightpoint_Reflect_Volume.xml
@@ -4,7 +4,7 @@
   </includes>
 
   <detectors>
-    <detector id="1" name="Shape_Trapezoid" type="DD4hep_TestShape_Creator">
+    <detector id="1" name="Shape_Eightpoint" type="DD4hep_TestShape_Creator">
       <check vis="Shape1_vis">
         <shape type="EightPointSolid" dz="30*cm">
            <vertex x="-30*cm" y="-25*cm"/>
diff --git a/examples/ClientTests/ref/Ref_Eightpoint_Reflect_Volume.txt b/examples/ClientTests/ref/Ref_Eightpoint_Reflect_Volume.txt
index 00bfd6d71..c831dccf7 100644
--- a/examples/ClientTests/ref/Ref_Eightpoint_Reflect_Volume.txt
+++ b/examples/ClientTests/ref/Ref_Eightpoint_Reflect_Volume.txt
@@ -10,7 +10,7 @@ TGeoArb8         6   Local  ( -23.00,   27.00,   30.00) Global ( -23.00,   27.00
 TGeoArb8         7   Local  (  13.00,  -27.00,   30.00) Global (  13.00,  -27.00,  130.00)
 TGeoArb8         Bounding box:  dx=  27.50 dy=  27.00 dz=  30.00 Origin: x=  -2.50 y=   0.00 z=   0.00
 ShapeCheck[1] TGeoScaledShape  8 Mesh-points:
-TGeoScaledShape  TGeoScaledShape N(mesh)=8  N(vert)=8  N(seg)=12  N(pols)=6
+TGeoScaledShape  Shape_Eightpoint_vol_1_shape_refl N(mesh)=8  N(vert)=8  N(seg)=12  N(pols)=6
 TGeoScaledShape  0   Local  ( -30.00,  -25.00,   30.00) Global ( -30.00,  -25.00,  -70.00)
 TGeoScaledShape  1   Local  ( -25.00,   25.00,   30.00) Global ( -25.00,   25.00,  -70.00)
 TGeoScaledShape  2   Local  (   5.00,   25.00,   30.00) Global (   5.00,   25.00,  -70.00)
-- 
GitLab