From 5c0f897c01c22b90f99dfa64f3d8ab50fcf27936 Mon Sep 17 00:00:00 2001
From: "shexin@ihep.ac.cn" <shexin@ihep.ac.cn>
Date: Tue, 2 Jul 2024 06:12:39 +0000
Subject: [PATCH] Fix a bug in TPC_ModularEndcap_o1_v01.cpp when constructing
 Al frame position at the TPC endcap

---
 .../compact/TDR_o1_v01/TDR_o1_v01-onlyTracker.xml     | 11 +++++------
 .../DetCRD/src/Tracker/TPC_ModularEndcap_o1_v01.cpp   |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyTracker.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyTracker.xml
index 402afae0..a3cbc62d 100644
--- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyTracker.xml
+++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyTracker.xml
@@ -29,16 +29,15 @@
   <!--TODO: vertex cooling-->
   <!--include ref="../CRD_common_v02/Beampipe_v01_03.xml"/-->
   <!--preliminary vertex and tracker, to update/-->
-  <!--include ref="../CRD_common_v02/VXD_StaggeredLadder_v02_01.xml"/>
+  <include ref="../CRD_common_v02/VXD_StaggeredLadder_v02_01.xml"/>
   <include ref="../CRD_common_v02/FTD_SkewRing_v01_05.xml"/>
   <include ref="../CRD_common_v02/SIT_SimplePixel_v01_03.xml"/>
-  <include ref="../CRD_common_v01/TPC_Simple_v10_02.xml"/>
-  <include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/-->
-  <include ref="./TPC_ModularEndcap_TDR_o1_v01.xml"/>
+  <!--include ref="../CRD_common_v01/TPC_Simple_v10_02.xml"/-->
+  <include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/>
   
   <!--prepare for update, need check first-->
-  <!--include ref="../CRD_common_v02/TPC_ModularEndcap_o1_v01.xml"/-->
-  <include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/>
+  <include ref="../CRD_common_v02/TPC_ModularEndcap_o1_v01.xml"/>
+  <!--include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/-->
 
   <fields>
     <field name="InnerSolenoid" type="solenoid"
diff --git a/Detector/DetCRD/src/Tracker/TPC_ModularEndcap_o1_v01.cpp b/Detector/DetCRD/src/Tracker/TPC_ModularEndcap_o1_v01.cpp
index 2ec03997..616c7e1a 100644
--- a/Detector/DetCRD/src/Tracker/TPC_ModularEndcap_o1_v01.cpp
+++ b/Detector/DetCRD/src/Tracker/TPC_ModularEndcap_o1_v01.cpp
@@ -371,7 +371,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
                     double phi_end   = 2*M_PI;
                     Tube   ringSolid(rCursor, r_end, dz_Alframe/2., phi_start,  phi_end) ;
                     Volume ringLog( layerName+"Log", ringSolid, materialAlframe) ;
-                    pv = endcapLog.placeVolume( ringLog, Position(0., 0., -dz_Endpaltelength/2. + dz_Alframe) ) ;
+                    pv = endcapLog.placeVolume( ringLog, Position(0., 0., -dz_Endpaltelength/2. + dz_Alframe/2.) ) ;
                     tpc.setVisAttributes(theDetector,"GrayVis",ringLog);
                 }
                 if(layerType == "Module")
-- 
GitLab