From 8895fef37b180d0430a719fb1ad70f1424084e64 Mon Sep 17 00:00:00 2001
From: Li Zhihao <lizhihao@ihep.ac.cn>
Date: Mon, 25 Nov 2024 20:13:24 +0800
Subject: [PATCH] fix: rename CaloDetectorEndcap to EcalEndcaps so it can
 display in G4 geom

---
 .../compact/CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml       | 2 +-
 .../src/Calorimeter/LongCrystalBarEndcapCalorimeter_v01.cpp     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml
index a9ab8c90..170fcb7a 100755
--- a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml
+++ b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml
@@ -30,7 +30,7 @@
   </regions>
 
   <detectors>
-    <detector id="DetID_ECAL_ENDCAP" name="CaloDetectorEndcap" type="LongCrystalBarEndcapCalorimeter_v01" readout="EcalEndcapsCollection" vis="Invisible" sensitive="true" region="EcalendcapRegion">
+    <detector id="DetID_ECAL_ENDCAP" name="EcalEndcaps" type="LongCrystalBarEndcapCalorimeter_v01" readout="EcalEndcapsCollection" vis="Invisible" sensitive="true" region="EcalendcapRegion">
       <!-- Use cm as unit if you want to use Pandora for reconstruction -->
     </detector>
   </detectors>
diff --git a/Detector/DetCRD/src/Calorimeter/LongCrystalBarEndcapCalorimeter_v01.cpp b/Detector/DetCRD/src/Calorimeter/LongCrystalBarEndcapCalorimeter_v01.cpp
index 26bd4347..b127f648 100755
--- a/Detector/DetCRD/src/Calorimeter/LongCrystalBarEndcapCalorimeter_v01.cpp
+++ b/Detector/DetCRD/src/Calorimeter/LongCrystalBarEndcapCalorimeter_v01.cpp
@@ -90,7 +90,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
     // dd4hep::Volume envelopeVolZminus("envelopeVolZminus", boolean, vacuum); 
 
     
-    dd4hep::Volume envelopeVol("envelopeVol", unionean, vacuum); 
+    dd4hep::Volume envelopeVol(det_name, unionean, vacuum); 
     dd4hep::Transform3D transform(dd4hep::RotationZ(90*degree), dd4hep::Position(0.0, 0.0, -z_min-z_depth/2)); 
     dd4hep::PlacedVolume envelopePlv = motherVol.placeVolume(envelopeVol, transform);
 
-- 
GitLab