From 64ecaf7af11d907c91d1f1a710e43fe49d0b8da1 Mon Sep 17 00:00:00 2001
From: "lintao@ihep.ac.cn" <lintao@ihep.ac.cn>
Date: Tue, 25 Jun 2024 07:15:27 +0000
Subject: [PATCH] Test the geometry convert from DD4hep to TGeo

---
 .gitlab-ci.yml                                |  2 ++
 Detector/DetCRD/CMakeLists.txt                | 30 ++++++++++++-------
 .../TDR_o1_v02/TDR_Dimensions_v01_02.xml      |  3 ++
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9064c2ac..26bfdba7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -58,5 +58,7 @@ build:lcg:el7:
   artifacts:
     paths:
       - InstallArea
+      - TDR_o1_v01.tgeo.root
+      - TDR_o1_v02.tgeo.root
     reports:
       junit: build.${CEPCSW_LCG_VERSION}.${CEPCSW_LCG_PLATFORM}/cepcsw-ctest-result.xml
diff --git a/Detector/DetCRD/CMakeLists.txt b/Detector/DetCRD/CMakeLists.txt
index e271c24d..62ac7735 100644
--- a/Detector/DetCRD/CMakeLists.txt
+++ b/Detector/DetCRD/CMakeLists.txt
@@ -35,14 +35,24 @@ install(TARGETS DetCRD
 # Add tests
 ################################################################################
 
-add_test(
-  NAME Test_TDR_o1_v01_Sim
-  COMMAND gaudirun.py Detector/DetCRD/scripts/TDR_o1_v01/sim.py
-  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-)
+foreach(detoption TDR_o1_v01 TDR_o1_v02)
+  add_test(
+    NAME Test_${detoption}_Sim
+    COMMAND gaudirun.py Detector/DetCRD/scripts/${detoption}/sim.py
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    )
 
-add_test(
-  NAME Test_TDR_o1_v01_Rec
-  COMMAND gaudirun.py Detector/DetCRD/scripts/TDR_o1_v01/tracking.py
-  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-)
+  add_test(
+    NAME Test_${detoption}_Rec
+    COMMAND gaudirun.py Detector/DetCRD/scripts/${detoption}/tracking.py
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    )
+
+  add_test(
+    NAME Test_${detoption}_DD4hep2TGeo
+    COMMAND geoConverter -compact2tgeo 
+                         -input Detector/DetCRD/compact/${detoption}/${detoption}.xml 
+                         -output ${detoption}.tgeo.root
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    )
+endforeach()
diff --git a/Detector/DetCRD/compact/TDR_o1_v02/TDR_Dimensions_v01_02.xml b/Detector/DetCRD/compact/TDR_o1_v02/TDR_Dimensions_v01_02.xml
index 73ec69de..05fd2df0 100644
--- a/Detector/DetCRD/compact/TDR_o1_v02/TDR_Dimensions_v01_02.xml
+++ b/Detector/DetCRD/compact/TDR_o1_v02/TDR_Dimensions_v01_02.xml
@@ -185,6 +185,9 @@
     <limitset name="cal_limits">
       <limit name="step_length_max" particles="*" value="5.0" unit="mm" />
     </limitset>
+    <limitset name="tpc_limits">
+      <limit name="step_length_max" particles="*" value="10.0" unit="mm" />
+    </limitset>
     <limitset name="dc_limits">
       <limit name="step_length_max" particles="*" value="10.0" unit="mm" />
     </limitset>
-- 
GitLab