From 291bfcaee12b3fc0af076fd5f70c5b734fc73181 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wouter.deconinck@umanitoba.ca>
Date: Mon, 6 Sep 2021 19:55:38 +0000
Subject: [PATCH] Frame behind MRICH, 2 mm Carbon Fiber all across

(cherry picked from commit 55e89e0f4a80203d5451e64ad1d4e1ab6ccc2a23)
---
 compact/mrich.xml | 1 +
 src/MRich_geo.cpp | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/compact/mrich.xml b/compact/mrich.xml
index cfccfcc5..91fce35e 100644
--- a/compact/mrich.xml
+++ b/compact/mrich.xml
@@ -151,6 +151,7 @@
         <!--position x="782.7750000006"  y="316.0250000001"/-->
         <!--position x="782.7750000006"  y="453.3750000002"/-->
       </positions>
+      <layer thickness="MRICHCarbonFrame_thickness" material="CarbonFiber"/>
     </detector>
   </detectors>
 
diff --git a/src/MRich_geo.cpp b/src/MRich_geo.cpp
index 9eb0ff27..e00c2ece 100644
--- a/src/MRich_geo.cpp
+++ b/src/MRich_geo.cpp
@@ -355,6 +355,14 @@ static Ref_t createDetector(Detector& description, xml::Handle_t e, SensitiveDet
     }
   }
 
+  // place frame
+  xml_comp_t x_layer = x_det.child(_Unicode(layer));
+  double   layer_thickness = x_layer.thickness();
+  Material layer_mat = description.material(x_layer.materialStr());
+  Tube   frameShape(rmin, rmax, layer_thickness / 2., 0., 2 * M_PI);
+  Volume frameVol("MRICH_Frame", frameShape, layer_mat);
+  pv = envVol.placeVolume(frameVol, Position(0, 0, (length - layer_thickness) / 2.0));
+
   // place envelope
   Volume motherVol = description.pickMotherVolume(sdet);
   if (reflect) {
-- 
GitLab