From a3fa1230558e44e7cfe6744d5412df278431c60f Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Mon, 12 Apr 2021 19:35:36 -0500
Subject: [PATCH] 	modified:   compact/ci_GEM.xml 	modified:  
 src/ci_GEM.cpp

---
 compact/ci_GEM.xml | 5 +++--
 src/ci_GEM.cpp     | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/compact/ci_GEM.xml b/compact/ci_GEM.xml
index 7e9514f..5c1ff67 100644
--- a/compact/ci_GEM.xml
+++ b/compact/ci_GEM.xml
@@ -43,8 +43,9 @@
       Central Ion GEM
     </comment>
     <detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis" readout="ci_GEM_Hits">
-	    <material name="Ar10CO2"/>  
-            <position x="0" y="0" z="0"/>
+      <material name="Ar10CO2"/>  
+      <comment> position of the front face of the detector </comment>
+      <position x="0" y="0" z="0"/>
       <dimensions rmin="ci_GEM_rin" rmax="ci_GEM_rout" z_length="ci_GEM_sizez" z_offset="ci_GEM_shiftz"	z="ci_GEM_posz" x="ci_GEM_posx" number="ci_GEM_nlayers" rmax1="ci_HCAL_lay_rin -1. * cm"/>
       <layer id="0" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 0) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 0) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 0) * cm" dz="1 * cm" />
       <layer id="1" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 1) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 1) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 1) * cm" dz="1 * cm" />
diff --git a/src/ci_GEM.cpp b/src/ci_GEM.cpp
index 39a8e77..dab132c 100644
--- a/src/ci_GEM.cpp
+++ b/src/ci_GEM.cpp
@@ -46,7 +46,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
 
   DetElement   det(detName, detID);
   Volume       motherVol = desc.pickMotherVolume(det);
-  Transform3D  tr(RotationZYX(0.0, 0.0, 0.0), Position(pos.x(), pos.x(), pos.z()));
+  Transform3D  tr(RotationZYX(0.0, 0.0, 0.0), Position(pos.x(), pos.x(), pos.z()+SizeZ/2.0));
   PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
   detPV.addPhysVolID("system", detID);
   det.setPlacement(detPV);
-- 
GitLab