From dc8f8aed7a54c04e467d293585dc5d3f0c29217a Mon Sep 17 00:00:00 2001
From: Chao Peng <cpeng@anl.gov>
Date: Wed, 7 Apr 2021 17:54:14 -0500
Subject: [PATCH] separate barrel and endcap ECals

---
 compact/cb_ECal.xml                  | 73 ++++++++++++++++++++++++++++
 compact/{ecal.xml => ce_ci_ECal.xml} | 47 ------------------
 reference_detector.xml               |  3 +-
 3 files changed, 75 insertions(+), 48 deletions(-)
 create mode 100644 compact/cb_ECal.xml
 rename compact/{ecal.xml => ce_ci_ECal.xml} (72%)

diff --git a/compact/cb_ECal.xml b/compact/cb_ECal.xml
new file mode 100644
index 0000000..a904ef9
--- /dev/null
+++ b/compact/cb_ECal.xml
@@ -0,0 +1,73 @@
+<lccdd>
+
+  <limits>
+  </limits>
+
+  <regions>
+  </regions>
+
+  <!-- Common Generic visualization attributes -->
+  <comment>Common Generic visualization attributes</comment>
+  <display>
+  </display>
+
+
+  <detectors>
+
+    <comment>
+      ---------------------
+      Barrel EM Calorimeter
+      ---------------------
+      A layered EM calorimeter with tungsten and silicon (or scintillator) strips
+    </comment>
+    <detector 
+      id="ECalBarrel_ID"
+      name="EcalBarrel"
+      type="refdet_EcalBarrel"
+      readout="EcalBarrelHits"
+      calorimeterType="EM_BARREL"
+      offset="EcalBarrel_offset"
+      >
+      <dimensions 
+        numsides="CaloSides" 
+        rmin="EcalBarrel_rmin" 
+        z="EcalBarrelLength"/>
+      <staves vis="EcalBarrelVis"/>
+      <layer repeat="EcalBarrelLayer1_NRepeat">
+        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
+        <slice material="Copper" thickness="EcalCopperThickness"/>
+        <slice material="Kapton" thickness="EcalKaptonThickness"/>
+        <slice material="Air" thickness="EcalAir1Thickness"/>
+      </layer>
+      <layer repeat="EcalBarrelLayer2_NRepeat">
+        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
+        <slice material="Air" thickness="EcalAir2Thickness"/>
+        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
+        <slice material="Copper" thickness="EcalCopperThickness"/>
+        <slice material="Kapton" thickness="EcalKaptonThickness"/>
+        <slice material="Air" thickness="EcalAir1Thickness"/>
+      </layer>
+      <layer repeat="EcalBarrelLayer3_NRepeat">
+        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
+        <slice material="Air" thickness="EcalAir2Thickness"/>
+        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
+        <slice material="Copper" thickness="EcalCopperThickness"/>
+        <slice material="Kapton" thickness="EcalKaptonThickness"/>
+        <slice material="Air" thickness="EcalAir1Thickness"/>
+      </layer>
+    </detector>
+
+  </detectors>
+
+  <!--  Definition of the readout segmentation/definition  -->
+  <readouts>
+    <readout name="EcalBarrelHits">
+      <segmentation type="CartesianGridXY" grid_size_x="3.5 * mm" grid_size_y="3.5 * mm"/>
+      <id>system:8,barrel:3,module:4,layer:6,slice:5,x:32:-16,y:-16</id>
+    </readout>
+  </readouts>
+
+  <plugins>
+  </plugins>
+
+</lccdd>
diff --git a/compact/ecal.xml b/compact/ce_ci_ECal.xml
similarity index 72%
rename from compact/ecal.xml
rename to compact/ce_ci_ECal.xml
index 30cb801..aed6692 100644
--- a/compact/ecal.xml
+++ b/compact/ce_ci_ECal.xml
@@ -27,49 +27,6 @@
 
   <detectors>
 
-    <comment>
-      ---------------------
-      Barrel EM Calorimeter
-      ---------------------
-      A layered EM calorimeter with tungsten and silicon (or scintillator) strips
-    </comment>
-    <detector 
-      id="ECalBarrel_ID"
-      name="EcalBarrel"
-      type="refdet_EcalBarrel"
-      readout="EcalBarrelHits"
-      calorimeterType="EM_BARREL"
-      offset="EcalBarrel_offset"
-      >
-      <dimensions 
-        numsides="CaloSides" 
-        rmin="EcalBarrel_rmin" 
-        z="EcalBarrelLength"/>
-      <staves vis="EcalBarrelVis"/>
-      <layer repeat="EcalBarrelLayer1_NRepeat">
-        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
-        <slice material="Copper" thickness="EcalCopperThickness"/>
-        <slice material="Kapton" thickness="EcalKaptonThickness"/>
-        <slice material="Air" thickness="EcalAir1Thickness"/>
-      </layer>
-      <layer repeat="EcalBarrelLayer2_NRepeat">
-        <slice material="TungstenDens24" thickness="EcalThinTungstenThickness"/>
-        <slice material="Air" thickness="EcalAir2Thickness"/>
-        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
-        <slice material="Copper" thickness="EcalCopperThickness"/>
-        <slice material="Kapton" thickness="EcalKaptonThickness"/>
-        <slice material="Air" thickness="EcalAir1Thickness"/>
-      </layer>
-      <layer repeat="EcalBarrelLayer3_NRepeat">
-        <slice material="TungstenDens24" thickness="EcalThickTungstenThickness"/>
-        <slice material="Air" thickness="EcalAir2Thickness"/>
-        <slice material="Silicon" thickness="EcalSiliconThickness" sensitive="yes" limits="cal_limits"/>
-        <slice material="Copper" thickness="EcalCopperThickness"/>
-        <slice material="Kapton" thickness="EcalKaptonThickness"/>
-        <slice material="Air" thickness="EcalAir1Thickness"/>
-      </layer>
-    </detector>
-
     <comment>
       ------------------------------------------
       Forward (Positive Z) Endcap EM Calorimeter
@@ -167,10 +124,6 @@
       <id>system:8,sector:4,module:20,x:48:-8,y:-8</id>
     </readout>
     -->
-    <readout name="EcalBarrelHits">
-      <segmentation type="CartesianGridXY" grid_size_x="3.5 * mm" grid_size_y="3.5 * mm"/>
-      <id>system:8,barrel:3,module:4,layer:6,slice:5,x:32:-16,y:-16</id>
-    </readout>
     <readout name="EcalEndcapHits">
       <segmentation type="CartesianGridXY" grid_size_x="3.5 * mm" grid_size_y="3.5 * mm"/>
       <id>system:8,barrel:3,module:4,layer:6,slice:5,x:32:-16,y:-16</id>
diff --git a/reference_detector.xml b/reference_detector.xml
index 6d46ffa..268e6a7 100644
--- a/reference_detector.xml
+++ b/reference_detector.xml
@@ -116,7 +116,8 @@
   -->
   <include ref="ip6/beampipe.xml"/>
   <include ref="compact/solenoid.xml"/>
-  <include ref="compact/ecal.xml"/>
+  <include ref="compact/ce_ci_ECal.xml"/>
+  <include ref="compact/cb_ECal.xml"/>
   <include ref="compact/cb_CTD_Si.xml"/>
   <include ref="compact/ce_mrich.xml"/>
   <include ref="compact/ce_GEM.xml"/>
-- 
GitLab