diff --git a/Detector/DetCRD/CMakeLists.txt b/Detector/DetCRD/CMakeLists.txt
index 62ac77358c1a99766a4be025bb0717082693b99b..a2a26a56b925bb76a5b5f5917d9c69abadc29c08 100644
--- a/Detector/DetCRD/CMakeLists.txt
+++ b/Detector/DetCRD/CMakeLists.txt
@@ -11,8 +11,8 @@ gaudi_add_module(DetCRD
src/Calorimeter/Lumical_v01_geo.cpp
src/Other/Lumical_v01_geo_beampipe.cpp
src/Other/CRDBeamPipe_v01_geo.cpp
- src/Muon/Muon_Barrel_v01.cpp
- src/Muon/Muon_Endcap_v01.cpp
+ src/Muon/Muon_Barrel_v01_01.cpp
+ src/Muon/Muon_Endcap_v01_01.cpp
src/Tracker/SiTrackerSkewRing_v01_geo.cpp
src/Tracker/SiTrackerStaggeredLadder_v01_geo.cpp
src/Tracker/TPC_Simple_o1_v01.cpp
diff --git a/Detector/DetCRD/compact/CRD_common_v01/Muon_Barrel_v01.xml b/Detector/DetCRD/compact/CRD_common_v01/Muon_Barrel_v01.xml
deleted file mode 100644
index d392b47abecfd0df1e66f3e995a11b3cd972b2f8..0000000000000000000000000000000000000000
--- a/Detector/DetCRD/compact/CRD_common_v01/Muon_Barrel_v01.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lccdd>
-
- <info name="Muon_Barrel"
- title="Test with A Single Muon Barrel"
- author="Zibing Bai"
- url="http://cepcgit.ihep.ac.cn"
- status="development"
- version="v01">
- <comment>Test with A Single Muon Barrel</comment>
- </info>
- <define>
- <constant name="env_num" value="2"/>
- <constant name="Fe_num" value="12"/>
- <constant name="superlayer_num" value="6"/>
- <constant name="strip_num_0" value="40"/>
- <constant name="strip_num_1" value="48"/>
- <constant name="strip_num_2" value="62"/>
- <constant name="strip_num_3" value="74"/>
- <constant name="strip_num_4" value="84"/>
- <constant name="strip_num_5" value="96"/>
- <constant name="strip_num" value="100"/>
-
- <constant name="Fe_y" value="strip_z+2*surf+Fe_gap"/>
- <constant name="Fe_z" value="Fe_x1"/>
- <constant name="Fe_posx" value="-1*Fe_x1"/>
-
- <constant name="env_y" value="Fe_y"/>
- <constant name="env_posy" value="0.5*env_y"/>
-
- <constant name="layer_init" value="-21.5*cm"/>
- <constant name="layer_gap" value="12.5*cm"/>
- <constant name="superlayer_air" value="0.1*cm"/>
- <constant name="superlayer_Al" value="0.5*superlayer_air"/>
-
- <constant name="superlayer_y" value="2*strip_y+2*superlayer_air"/>
- <constant name="superlayer_z" value="strip_z+2*surf+2*superlayer_air"/>
-
- <constant name="Al_posx" value="0"/>
- <constant name="Al_posy" value="0"/>
- <constant name="Al_posz" value="0"/>
-
- </define>
-
- <detectors>
- <detector id="0" name="Muon_Barrel_v01" type="Muon_Barrel_v01" readout="MuonBarrelCollection" vis="VisibleBlank_Muon" material="Air">
- <material name="Air"/>
- <position x="0" y="0" z="0"/>
- <dimensions dx="0.5*world_x" dy="0.5*world_y" dz="0.5*world_z"/>
- <module id="Fe_num" name="env" type="env" vis="InvisibleWithChildren_Muon" material="Air">
- <position x="0" y="env_posy" z="0"/>
- <dimensions dy="0.5*env_y"/>
- <module id="0" name="Fe" type="Fe" vis="VisibleMental_Muon" material="Iron">
- <material name="Iron"/>
- <position x="Fe_posx" y="0"/>
- <dimensions x1="0.5*Fe_x1" y1="0.5*Fe_y" y2="0.5*Fe_y" dz="0.5*Fe_z"/>
- <module id="superlayer_num" name="Superlayer" type="Superlayer" vis="VisibleBlank_Muon" material="Air">
- <module id="0" name="Layer_Al" type="Layer_Al" vis="VisibleMental_Muon" material="Aluminum">
- <material name="Aluminum"/>
- <position x="0" y="0" z="0"/>
- <module id="0" name="Stripe" type="Stripe" vis="VisibleBlank_Muon" material="Air">
- <material name="Air"/>
- <dimensions dx="0.5*strip_x" dy="0.5*strip_y" dz="0.5*strip_z+SiPM_z"/>
- <module id="0" type="surface" name="surface" vis="VisibleGreen_Muon" material="BC420">
- <position x="0" y="0" z="0"/>
- <dimensions dx="0.5*surface_x" dy="0.5*surface_y" dz="0.5*surface_z"/>
- <section name="cut1" vis="VisibleBlank_Muon" material="Air">
- <position x="cut1_posx" y="cut1_posy" z="cut1_posz"/>
- <dimensions dx="0.5*cut1_x" dy="0.5*cut1_y" dz="0.5*cut1_z"/>
- </section>
- </module>
- <module id="1" type="BC420" name="BC420" vis="VisibleGreen_Muon" material="BC420">
- <position x="0" y="0" z="0"/>
- <dimensions dx="0.5*BC420_x" dy="0.5*BC420_y" dz="0.5*BC420_z"/>
- <section name="cut3" vis="VisibleBlank_Muon" material="Air">
- <position x="cut3_posx" y="cut3_posy" z="cut3_posz"/>
- <dimensions rmin="0" rmax="cut3_rmax" dz="0.5*cut3_z"/>
- <section name="cut2" vis="VisibleBlank_Muon" material="Air">
- <position x="cut2_posx" y="cut2_posy" z="cut2_posz"/>
- <dimensions dx="0.5*cut2_x" dy="0.5*cut2_y" dz="0.5*cut2_z"/>
- </section>
- </section>
- </module>
- <section id="0" type="cladding" name="cladding" vis="VisibleBlue_Muon" material="Pethylene1">
- <position x="0" y="0" z="0"/>
- <dimensions rmin="cladding_rmin" rmax="cladding_rmax" dz="0.5*cladding_z"/>
- </section>
- <section id="1" type="core" name="core" vis="VisibleRed_Muon" material="Pethylene2">
- <position x="0" y="0" z="0"/>
- <dimensions rmin="0" rmax="core_rmax" dz="0.5*core_z"/>
- </section>
- <module id="2" type="SiPM" name="SiPM" vis="VisibleBlue_Muon" material="Air">
- <position x="SiPM_posx" y="SiPM_posy" z="SiPM_posz"/>
- <dimensions dx="0.5*SiPM_x" dy="0.5*SiPM_y" dz="0.5*SiPM_z"/>
- </module>
- </module>
- </module>
- </module>
- </module>
- </module>
- </detector>
- </detectors>
-
- <readouts>
- <readout name="MuonBarrelCollection">
- <id>Env:2,Fe:2,Superlayer:2,Layer:2,Stripe:10:3,SiPM:2</id>
- </readout>
- </readouts>
-
-</lccdd>
diff --git a/Detector/DetCRD/compact/CRD_common_v01/Muon_Barrel_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Muon_Barrel_v01_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3c262fa2cdbdc96a6def2633cbf0f8e2ffc2ecd1
--- /dev/null
+++ b/Detector/DetCRD/compact/CRD_common_v01/Muon_Barrel_v01_01.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lccdd>
+
+ <info name="Muon_Barrel"
+ title="Test with A Single Muon Barrel"
+ author="Zibing Bai"
+ url="http://cepcgit.ihep.ac.cn"
+ status="development"
+ version="v01">
+ <comment>Test with A Single Muon Barrel</comment>
+ </info>
+
+ <define>
+ <!--Muon Barrel-->
+ <constant name="Muon_barrel_superlayer_num" value="6"/>
+ <constant name="Muon_barrel_strip_num_0" value="40"/>
+ <constant name="Muon_barrel_strip_num_1" value="48"/>
+ <constant name="Muon_barrel_strip_num_2" value="62"/>
+ <constant name="Muon_barrel_strip_num_3" value="74"/>
+ <constant name="Muon_barrel_strip_num_4" value="84"/>
+ <constant name="Muon_barrel_strip_num_5" value="96"/>
+ <constant name="Muon_barrel_strip_num" value="100"/>
+
+ <constant name="Muon_barrel_iron_x1" value="Muon_standard_scale"/>
+ <constant name="Muon_barrel_iron_y" value="Muon_strip_z+2*Muon_strip_surf+Muon_Iron_gap_z"/>
+ <constant name="Muon_barrel_iron_z" value="Muon_standard_scale"/>
+ <constant name="Muon_barrel_iron_posx" value="-1*Muon_standard_scale"/>
+
+ <constant name="Muon_barrel_barrel_y" value="Muon_barrel_iron_y"/>
+ <constant name="Muon_barrel_barrel_posy" value="0.5*Muon_barrel_barrel_y"/>
+
+ <constant name="Muon_barrel_superlayer_init" value="-21.5*cm"/>
+ <constant name="Muon_barrel_superlayer_gap" value="12.5*cm"/>
+ <constant name="Muon_barrel_superlayer_air_gap" value="0.1*cm"/>
+ <constant name="Muon_barrel_superlayer_aluminum_gap" value="0.5*Muon_barrel_superlayer_air_gap"/>
+
+ <constant name="Muon_barrel_superlayer_y" value="2*Muon_strip_y+2*Muon_barrel_superlayer_air_gap"/>
+ <constant name="Muon_barrel_superlayer_z" value="Muon_strip_z+2*Muon_strip_surf+2*Muon_barrel_superlayer_air_gap"/>
+ <!--Checkout-->
+ <constant name="Muon_barrel_inner_radius" value="483*cm"/>
+ <constant name="Muon_barrel_barrel_num" value="2"/>
+ <constant name="Muon_barrel_iron_part_num" value="12"/>
+
+ </define>
+
+ <detectors>
+ <detector id="201" name="Muon_Barrel_v01_01" type="Muon_Barrel_v01_01" readout="MuonBarrelCollection" vis="WhiteVis">
+ <position x="0" y="0" z="0"/>
+ <barrel id="Muon_barrel_iron_part_num" name="Muon_barrel_barrel" type="Muon_barrel_barrel" vis="SeeThrough">
+ <position x="0" y="Muon_barrel_barrel_posy" z="0"/>
+ <iron id="0" name="Muon_barrel_iron_part" type="Muon_barrel_iron_part" vis="GrayVis" material="Iron">
+ <material name="Iron"/>
+ <position x="Muon_barrel_iron_posx" y="0"/>
+ <dimensions x1="0.5*Muon_barrel_iron_x1" y1="0.5*Muon_barrel_iron_y" y2="0.5*Muon_barrel_iron_y" dz="0.5*Muon_barrel_iron_z"/>
+ <superlayer id="Muon_barrel_superlayer_num" name="Muon_barrel_superlayer" type="Muon_barrel_superlayer" vis="GreenVis" material="Air">
+ <aluminum id="0" name="Muon_barrel_superlayer_aluminum" type="Muon_barrel_superlayer_aluminum" vis="GrayVis" material="Aluminum">
+ <material name="Aluminum"/>
+ <position x="0" y="0" z="0"/>
+ <stripe id="0" name="Muon_stripe" type="Muon_stripe" vis="GreenVis" material="Air">
+ <material name="Air"/>
+ <dimensions dx="0.5*Muon_strip_x" dy="0.5*Muon_strip_y" dz="0.5*Muon_strip_z+Muon_strip_SiPM_z"/>
+ <component id="0" type="Muon_strip_surface" name="Muon_strip_surface" vis="GreenVis" material="BC420">
+ <position x="0" y="0" z="0"/>
+ <dimensions dx="0.5*Muon_strip_surface_x" dy="0.5*Muon_strip_surface_y" dz="0.5*Muon_strip_surface_z"/>
+ <cut name="Muon_strip_cut1" vis="GreenVis" material="Air">
+ <position x="Muon_strip_cut1_posx" y="Muon_strip_cut1_posy" z="Muon_strip_cut1_posz"/>
+ <dimensions dx="0.5*Muon_strip_cut1_x" dy="0.5*Muon_strip_cut1_y" dz="0.5*Muon_strip_cut1_z"/>
+ </cut>
+ </component>
+ <component id="1" type="Muon_strip_scintillator" name="Muon_strip_scintillator" vis="GreenVis" material="BC420">
+ <position x="0" y="0" z="0"/>
+ <dimensions dx="0.5*Muon_strip_scintillator_x" dy="0.5*Muon_strip_scintillator_y" dz="0.5*Muon_strip_scintillator_z"/>
+ <cut name="Muon_strip_cut3" vis="GreenVis" material="Air">
+ <position x="Muon_strip_cut3_posx" y="Muon_strip_cut3_posy" z="Muon_strip_cut3_posz"/>
+ <dimensions rmin="0" rmax="Muon_strip_cut3_rmax" dz="0.5*Muon_strip_cut3_z"/>
+ <comb name="Muon_strip_cut2" vis="GreenVis" material="Air">
+ <position x="Muon_strip_cut2_posx" y="Muon_strip_cut2_posy" z="Muon_strip_cut2_posz"/>
+ <dimensions dx="0.5*Muon_strip_cut2_x" dy="0.5*Muon_strip_cut2_y" dz="0.5*Muon_strip_cut2_z"/>
+ </comb>
+ </cut>
+ </component>
+ <fiber id="0" type="Muon_fiber_cladding" name="Muon_fiber_cladding" vis="GreenVis" material="Pethylene1">
+ <position x="0" y="0" z="0"/>
+ <dimensions rmin="Muon_fiber_cladding_rmin" rmax="Muon_fiber_cladding_rmax" dz="0.5*Muon_fiber_cladding_z"/>
+ </fiber>
+ <fiber id="1" type="Muon_fiber_core" name="Muon_fiber_core" vis="GreenVis" material="Pethylene2">
+ <position x="0" y="0" z="0"/>
+ <dimensions rmin="0" rmax="Muon_fiber_core_rmax" dz="0.5*Muon_fiber_core_z"/>
+ </fiber>
+ <component id="2" type="Muon_strip_SiPM" name="Muon_strip_SiPM" vis="GreenVis" material="Air">
+ <position x="Muon_strip_SiPM_posx" y="Muon_strip_SiPM_posy" z="Muon_strip_SiPM_posz"/>
+ <dimensions dx="0.5*Muon_strip_SiPM_x" dy="0.5*Muon_strip_SiPM_y" dz="0.5*Muon_strip_SiPM_z"/>
+ </component>
+ </stripe>
+ </aluminum>
+ </superlayer>
+ </iron>
+ </barrel>
+ </detector>
+ </detectors>
+
+ <readouts>
+ <readout name="MuonBarrelCollection">
+ <id>system:5,Env:5,Fe:5,Superlayer:4,Layer:2,Stripe:9,SiPM:2</id>
+ </readout>
+ </readouts>
+
+</lccdd>
diff --git a/Detector/DetCRD/compact/CRD_common_v01/Muon_Endcap_v01.xml b/Detector/DetCRD/compact/CRD_common_v01/Muon_Endcap_v01.xml
deleted file mode 100644
index 71e396de8205b487de320e6ef80cdd9bb73a2eef..0000000000000000000000000000000000000000
--- a/Detector/DetCRD/compact/CRD_common_v01/Muon_Endcap_v01.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lccdd>
-
- <info name="Muon_Endcap"
- title="Test with Two Single Muon Endcaps"
- author="Zibing Bai"
- url="http://cepcgit.ihep.ac.cn"
- status="development"
- version="v01">
- <comment>Test with Two Single Muon Endcaps</comment>
- </info>
- <define>
- <constant name="env_num_endcap" value="4"/>
- <constant name="layer_num" value="2"/>
- <constant name="strip_num_endcap" value="146"/>
- <constant name="strip_num_cut" value="13"/>
- <constant name="env_rmin" value="52*cm"/>
- <constant name="env_z" value="3*cm"/>
- <constant name="multiple" value="1.05"/>
-
- <constant name="envelope_halfZ" value="strip_z+2*surf+Fe_gap+env_z"/>
- <constant name="env_posy_endcap" value="strip_z+2*surf+Fe_gap+0.5*env_z"/>
- </define>
-
- <detectors>
- <detector id="2" name="Muon_Endcap_v01" type="Muon_Endcap_v01" readout="MuonEndcapCollection" vis="VisibleMental_Muon" material="Iron">
- <material name="Iron"/>
- <position x="0" y="env_posy_endcap" z="0"/>
- <dimensions rmin="env_rmin" dz="0.5*env_z"/>
- <module id="0" name="Stripe" type="Stripe" vis="VisibleBlank_Muon" material="Air">
- <material name="Air"/>
- <dimensions dx="0.5*strip_x" dy="0.5*strip_y" dz="0.5*strip_z+SiPM_z"/>
- <module id="0" type="surface" name="surface" vis="VisibleGreen_Muon" material="BC420">
- <position x="0" y="0" z="0"/>
- <dimensions dx="0.5*surface_x" dy="0.5*surface_y" dz="0.5*surface_z"/>
- <section name="cut1" vis="VisibleBlank_Muon" material="Air">
- <position x="cut1_posx" y="cut1_posy" z="cut1_posz"/>
- <dimensions dx="0.5*cut1_x" dy="0.5*cut1_y" dz="0.5*cut1_z"/>
- </section>
- </module>
- <module id="1" type="BC420" name="BC420" vis="VisibleGreen_Muon" material="BC420">
- <position x="0" y="0" z="0"/>
- <dimensions dx="0.5*BC420_x" dy="0.5*BC420_y" dz="0.5*BC420_z"/>
- <section name="cut3" vis="VisibleBlank_Muon" material="Air">
- <position x="cut3_posx" y="cut3_posy" z="cut3_posz"/>
- <dimensions rmin="0" rmax="cut3_rmax" dz="0.5*cut3_z"/>
- <section name="cut2" vis="VisibleBlank_Muon" material="Air">
- <position x="cut2_posx" y="cut2_posy" z="cut2_posz"/>
- <dimensions dx="0.5*cut2_x" dy="0.5*cut2_y" dz="0.5*cut2_z"/>
- </section>
- </section>
- </module>
- <section id="0" type="cladding" name="cladding" vis="VisibleBlue_Muon" material="Pethylene1">
- <position x="0" y="0" z="0"/>
- <dimensions rmin="cladding_rmin" rmax="cladding_rmax" dz="0.5*cladding_z"/>
- </section>
- <section id="1" type="core" name="core" vis="VisibleRed_Muon" material="Pethylene2">
- <position x="0" y="0" z="0"/>
- <dimensions rmin="0" rmax="core_rmax" dz="0.5*core_z"/>
- </section>
- <module id="2" type="SiPM" name="SiPM" vis="VisibleBlue_Muon" material="Air">
- <position x="SiPM_posx" y="SiPM_posy" z="SiPM_posz"/>
- <dimensions dx="0.5*SiPM_x" dy="0.5*SiPM_y" dz="0.5*SiPM_z"/>
- </module>
- </module>
- </detector>
- </detectors>
-
- <readouts>
- <readout name="MuonEndcapCollection">
- <id>Endcap:2,Env:2,Layer:2,Stripe:8:3,SiPM:2</id>
- </readout>
- </readouts>
-
-</lccdd>
diff --git a/Detector/DetCRD/compact/CRD_common_v01/Muon_Endcap_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Muon_Endcap_v01_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..2328674ad08f4bcb22847f1ca6a349e9de0cff7f
--- /dev/null
+++ b/Detector/DetCRD/compact/CRD_common_v01/Muon_Endcap_v01_01.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lccdd>
+
+ <info name="Muon_Endcap"
+ title="Test with Two Single Muon Endcaps"
+ author="Zibing Bai"
+ url="http://cepcgit.ihep.ac.cn"
+ status="development"
+ version="v01">
+ <comment>Test with Two Single Muon Endcaps</comment>
+ </info>
+
+ <define>
+ <!--Muon Endcap-->
+ <constant name="Muon_endcap_part_num" value="4"/>
+ <constant name="Muon_endcap_superlayer_num" value="6"/>
+ <constant name="Muon_endcap_iron_gap_num" value="Muon_endcap_superlayer_num+1"/>
+ <constant name="Muon_endcap_layer_num" value="2"/>
+ <constant name="Muon_endcap_strip_num" value="146"/>
+ <constant name="Muon_endcap_strip_num_cut" value="13"/>
+ <constant name="Muon_endcap_endcap_rmin" value="52*cm"/>
+ <constant name="Muon_endcap_magnification" value="1.02"/>
+
+ <constant name="Muon_endcap_iron_gap" value="12.5*cm"/>
+ <constant name="Muon_endcap_endcap_z" value="Muon_endcap_iron_gap_num*Muon_endcap_iron_gap+2*Muon_endcap_superlayer_num*Muon_strip_y"/>
+ <constant name="Muon_endcap_endcap_posy" value="Muon_strip_z+2*Muon_strip_surf+Muon_Iron_gap_z+0.5*Muon_endcap_endcap_z"/>
+ </define>
+
+ <detectors>
+ <detector id="202" name="Muon_Endcap_v01_01" type="Muon_Endcap_v01_01" readout="MuonEndcapCollection" vis="GrayVis" material="Iron">
+ <material name="Iron"/>
+ <position x="0" y="Muon_endcap_endcap_posy" z="0"/>
+ <dimensions rmin="Muon_endcap_endcap_rmin" dz="0.5*Muon_endcap_endcap_z"/>
+ <stripe id="0" name="Muon_stripe" type="Muon_stripe" vis="GreenVis" material="Air">
+ <material name="Air"/>
+ <dimensions dx="0.5*Muon_strip_x" dy="0.5*Muon_strip_y" dz="0.5*Muon_strip_z+Muon_strip_SiPM_z"/>
+ <component id="0" type="Muon_strip_surface" name="Muon_strip_surface" vis="GreenVis" material="BC420">
+ <position x="0" y="0" z="0"/>
+ <dimensions dx="0.5*Muon_strip_surface_x" dy="0.5*Muon_strip_surface_y" dz="0.5*Muon_strip_surface_z"/>
+ <cut name="Muon_strip_cut1" vis="GreenVis" material="Air">
+ <position x="Muon_strip_cut1_posx" y="Muon_strip_cut1_posy" z="Muon_strip_cut1_posz"/>
+ <dimensions dx="0.5*Muon_strip_cut1_x" dy="0.5*Muon_strip_cut1_y" dz="0.5*Muon_strip_cut1_z"/>
+ </cut>
+ </component>
+ <component id="1" type="Muon_strip_scintillator" name="Muon_strip_scintillator" vis="GreenVis" material="BC420">
+ <position x="0" y="0" z="0"/>
+ <dimensions dx="0.5*Muon_strip_scintillator_x" dy="0.5*Muon_strip_scintillator_y" dz="0.5*Muon_strip_scintillator_z"/>
+ <cut name="Muon_strip_cut3" vis="GreenVis" material="Air">
+ <position x="Muon_strip_cut3_posx" y="Muon_strip_cut3_posy" z="Muon_strip_cut3_posz"/>
+ <dimensions rmin="0" rmax="Muon_strip_cut3_rmax" dz="0.5*Muon_strip_cut3_z"/>
+ <comb name="Muon_strip_cut2" vis="GreenVis" material="Air">
+ <position x="Muon_strip_cut2_posx" y="Muon_strip_cut2_posy" z="Muon_strip_cut2_posz"/>
+ <dimensions dx="0.5*Muon_strip_cut2_x" dy="0.5*Muon_strip_cut2_y" dz="0.5*Muon_strip_cut2_z"/>
+ </comb>
+ </cut>
+ </component>
+ <fiber id="0" type="Muon_fiber_cladding" name="Muon_fiber_cladding" vis="GreenVis" material="Pethylene1">
+ <position x="0" y="0" z="0"/>
+ <dimensions rmin="Muon_fiber_cladding_rmin" rmax="Muon_fiber_cladding_rmax" dz="0.5*Muon_fiber_cladding_z"/>
+ </fiber>
+ <fiber id="1" type="Muon_fiber_core" name="Muon_fiber_core" vis="GreenVis" material="Pethylene2">
+ <position x="0" y="0" z="0"/>
+ <dimensions rmin="0" rmax="Muon_fiber_core_rmax" dz="0.5*Muon_fiber_core_z"/>
+ </fiber>
+ <component id="2" type="Muon_strip_SiPM" name="Muon_strip_SiPM" vis="GreenVis" material="Air">
+ <position x="Muon_strip_SiPM_posx" y="Muon_strip_SiPM_posy" z="Muon_strip_SiPM_posz"/>
+ <dimensions dx="0.5*Muon_strip_SiPM_x" dy="0.5*Muon_strip_SiPM_y" dz="0.5*Muon_strip_SiPM_z"/>
+ </component>
+ </stripe>
+ </detector>
+ </detectors>
+
+
+ <readouts>
+ <readout name="MuonEndcapCollection">
+ <id>system:5,Env:5,Endcap:2,Superlayer:15:4,Layer:2,Stripe:9,SiPM:2</id>
+ <!--id>Endcap:2,Superlayer:2,Env:2,Layer:2,Stripe:10:3,SiPM:2</id-->
+ </readout>
+ </readouts>
+
+</lccdd>
diff --git a/Detector/DetCRD/compact/CRD_common_v02/materials.xml b/Detector/DetCRD/compact/CRD_common_v02/materials.xml
index d59e16913ed1379dd354177529ce493d338ad93c..26a99dd0c1732d88c90b3d55452218a4af6203fb 100644
--- a/Detector/DetCRD/compact/CRD_common_v02/materials.xml
+++ b/Detector/DetCRD/compact/CRD_common_v02/materials.xml
@@ -1,3 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lccdd>
+ <properties>
+ <matrix name="RINDEX__Air" coldim="2" values="
+ 1.0*eV 1.00029
+ 5.1*eV 1.00029
+ "/>
+ <matrix name="RINDEX__BC420" coldim="2" values="
+ 2.38*eV 1.58
+ 2.88*eV 1.58
+ 3.45*eV 1.58
+ "/>
+ <matrix name="ABSLENGTH__BC420" coldim="2" values="
+ 2.38*eV 10*cm
+ 2.88*eV 10*cm
+ 3.45*eV 10*cm
+ "/>
+ <matrix name="WLSCOMPONENT__BC420" coldim="2" values="
+ 2.38*eV 0.
+ 2.88*eV 1.
+ 3.45*eV 0.
+ "/>
+ <matrix name="SCINTILLATIONCOMPONENT__BC420" coldim="2" values="
+ 2.38*eV 1.0
+ 2.88*eV 1.0
+ 3.45*eV 1.0
+ "/>
+ <matrix name="RINDEX__Pethylene1" coldim="2" values="
+ 2.0*eV 1.49
+ 2.87*eV 1.49
+ 2.90*eV 1.49
+ 3.47*eV 1.49
+ "/>
+ <matrix name="ABSLENGTH__Pethylene1" coldim="2" values="
+ 2.0*eV 3.0*m
+ 2.87*eV 3.0*m
+ 2.90*eV 3.0*m
+ 3.47*eV 3.0*m
+ "/>
+ <matrix name="RINDEX__Pethylene2" coldim="2" values="
+ 2.0*eV 1.60
+ 2.87*eV 1.60
+ 2.90*eV 1.60
+ 3.47*eV 1.60
+ "/>
+ <matrix name="WLSABSLENGTH__Pethylene2" coldim="2" values="
+ 2.0*eV 3.0*m
+ 2.87*eV 3.0*m
+ 2.90*eV 0.1*mm
+ 3.47*eV 0.1*mm
+ "/>
+ <matrix name="WLSCOMPONENT__Pethylene2" coldim="2" values="
+ 2.0*eV 1.0
+ 2.87*eV 1.0
+ 2.90*eV 0.
+ 3.47*eV 0.
+ "/>
+ </properties>
+
<materials>
<isotope N="1" Z="1" name="H1">
<atom unit="g/mole" value="1.00782503081372"/>
@@ -714,4 +773,49 @@
<fraction n="0.56" ref="Si" />
<fraction n="1.428" ref="O" />
</material>
+
+ <material name="BC420">
+ <D type="density" value="1.032" unit="g/cm3"/>
+ <composite n="10" ref="C"/>
+ <composite n="11" ref="H"/>
+ <property name="RINDEX" ref="RINDEX__BC420"/>
+ <property name="ABSLENGTH" ref="ABSLENGTH__BC420"/>
+ <property name="WLSCOMPONENT" ref="WLSCOMPONENT__BC420"/>
+ <property name="SCINTILLATIONCOMPONENT1" ref="SCINTILLATIONCOMPONENT__BC420"/>
+ <property name="SCINTILLATIONCOMPONENT2" ref="SCINTILLATIONCOMPONENT__BC420"/>
+ <constant name="SCINTILLATIONYIELD" value="10240./MeV"/>
+ <constant name="RESOLUTIONSCALE" value="2.5"/>
+ <constant name="SCINTILLATIONTIMECONSTANT1" value="0.9*ns"/>
+ <constant name="SCINTILLATIONTIMECONSTANT2" value="2.1*ns"/>
+ <constant name="SCINTILLATIONYIELD1" value="1.0"/>
+ <constant name="SCINTILLATIONYIELD2" value="0."/>
+ <constant name="BirksConstant" value="0.126*mm/MeV"/>
+ </material>
+
+ <material name="Pethylene1">
+ <D type="density" value="1200" unit="kg/m3"/>
+ <composite n="2" ref="C"/>
+ <composite n="4" ref="H"/>
+ <property name="RINDEX" ref="RINDEX__Pethylene1"/>
+ <property name="ABSLENGTH" ref="ABSLENGTH__Pethylene1"/>
+ </material>
+
+ <material name="Pethylene2">
+ <D type="density" value="1190" unit="kg/m3"/>
+ <composite n="5" ref="C"/>
+ <composite n="8" ref="H"/>
+ <composite n="2" ref="O"/>
+ <property name="RINDEX" ref="RINDEX__Pethylene2"/>
+ <property name="WLSABSLENGTH" ref="WLSABSLENGTH__Pethylene2"/>
+ <property name="WLSCOMPONENT" ref="WLSCOMPONENT__Pethylene2"/>
+ <constant name="WLSTIMECONSTANT" value="0.5*ns"/>
+ </material>
+
</materials>
+
+ <surfaces>
+ <opticalsurface name="Muon_surf_stripe" model="glisur" finish="polished" type="dielectric_metal"/>
+ <opticalsurface name="Muon_surf_fiber" model="glisur" finish="polished" type="dielectric_metal"/>
+ </surfaces>
+
+</lccdd>
diff --git a/Detector/DetCRD/compact/Standalone/Muon_Dimensions_v01_01.xml b/Detector/DetCRD/compact/Standalone/Muon_Dimensions_v01_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..44d335eb0451887c9afc7c101dd8fff5c435a9ae
--- /dev/null
+++ b/Detector/DetCRD/compact/Standalone/Muon_Dimensions_v01_01.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lccdd>
+ <info name="MuonDimensions"
+ title="Dimensions of Muon Detector"
+ author="baizb"
+ url="no"
+ status="development"
+ version="1.0">
+ <comment>
+ undeterminded parameters
+ </comment>
+ </info>
+
+ <define>
+ <!--strip & fiber dimensions-->
+ <constant name="Muon_strip_x" value="4*cm"/>
+ <constant name="Muon_strip_y" value="1*cm"/>
+ <constant name="Muon_strip_z" value="4*m"/>
+ <constant name="Muon_strip_surf" value="1*mm"/>
+
+ <constant name="Muon_strip_surface_x" value="Muon_strip_x"/>
+ <constant name="Muon_strip_surface_y" value="Muon_strip_y"/>
+ <constant name="Muon_strip_surface_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_strip_scintillator_x" value="Muon_strip_x-2*Muon_strip_surf"/>
+ <constant name="Muon_strip_scintillator_y" value="Muon_strip_y-2*Muon_strip_surf"/>
+ <constant name="Muon_strip_scintillator_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_strip_SiPM_x" value="6*mm"/>
+ <constant name="Muon_strip_SiPM_y" value="6*mm"/>
+ <constant name="Muon_strip_SiPM_z" value="Muon_strip_surf"/>
+ <constant name="Muon_strip_SiPM_posx" value="0"/>
+ <constant name="Muon_strip_SiPM_posy" value="0"/>
+ <constant name="Muon_strip_SiPM_posz" value="0.5*Muon_strip_z+0.5*Muon_strip_SiPM_z"/>
+
+ <constant name="Muon_fiber_core_rmax" value="0.95*mm"/>
+ <constant name="Muon_fiber_core_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_fiber_cladding_rmin" value="Muon_fiber_core_rmax"/>
+ <constant name="Muon_fiber_cladding_rmax" value="1*mm"/>
+ <constant name="Muon_fiber_cladding_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_strip_cut_gap" value="0.1*mm"/>
+ <constant name="Muon_strip_cut3_rmax" value="Muon_fiber_cladding_rmax+Muon_strip_cut_gap"/>
+ <constant name="Muon_strip_cut3_z" value="Muon_strip_z"/>
+ <constant name="Muon_strip_cut3_posx" value="0"/>
+ <constant name="Muon_strip_cut3_posy" value="Muon_strip_cut3_rmax-Muon_fiber_cladding_rmax"/>
+ <constant name="Muon_strip_cut3_posz" value="0"/>
+
+ <constant name="Muon_strip_cut1_x" value="2*Muon_strip_cut3_rmax"/>
+ <constant name="Muon_strip_cut1_y" value="Muon_strip_surf"/>
+ <constant name="Muon_strip_cut1_z" value="Muon_strip_z"/>
+ <constant name="Muon_strip_cut1_posx" value="0"/>
+ <constant name="Muon_strip_cut1_posy" value="0.5*Muon_strip_y-0.5*Muon_strip_cut1_y"/>
+ <constant name="Muon_strip_cut1_posz" value="0"/>
+
+ <constant name="Muon_strip_cut2_x" value="Muon_strip_cut1_x"/>
+ <constant name="Muon_strip_cut2_y" value="0.5*Muon_strip_scintillator_y-Muon_strip_cut3_rmax+Muon_fiber_cladding_rmax"/>
+ <constant name="Muon_strip_cut2_z" value="Muon_strip_z"/>
+ <constant name="Muon_strip_cut2_posx" value="0"/>
+ <constant name="Muon_strip_cut2_posy" value="0.5*Muon_strip_scintillator_y-0.5*Muon_strip_cut2_y"/>
+ <constant name="Muon_strip_cut2_posz" value="0"/>
+
+ <!--standard scale-->
+ <constant name="Muon_standard_scale" value="105*cm"/>
+ <constant name="Muon_Iron_gap_z" value="2.5*cm"/>
+
+ <!--Muon Barrel>
+ <constant name="Muon_barrel_barrel_num" value="2"/>
+ <constant name="Muon_barrel_iron_part_num" value="12"/>
+ <constant name="Muon_barrel_superlayer_num" value="6"/>
+ <constant name="Muon_barrel_strip_num_0" value="40"/>
+ <constant name="Muon_barrel_strip_num_1" value="48"/>
+ <constant name="Muon_barrel_strip_num_2" value="62"/>
+ <constant name="Muon_barrel_strip_num_3" value="74"/>
+ <constant name="Muon_barrel_strip_num_4" value="84"/>
+ <constant name="Muon_barrel_strip_num_5" value="96"/>
+ <constant name="Muon_barrel_strip_num" value="100"/>
+
+ <constant name="Muon_barrel_iron_x1" value="Muon_standard_scale"/>
+ <constant name="Muon_barrel_iron_y" value="Muon_strip_z+2*Muon_strip_surf+Muon_Iron_gap_z"/>
+ <constant name="Muon_barrel_iron_z" value="Muon_standard_scale"/>
+ <constant name="Muon_barrel_iron_posx" value="-1*Muon_standard_scale"/>
+
+ <constant name="Muon_barrel_barrel_y" value="Muon_barrel_iron_y"/>
+ <constant name="Muon_barrel_barrel_posy" value="0.5*Muon_barrel_barrel_y"/>
+
+ <constant name="Muon_barrel_superlayer_init" value="-21.5*cm"/>
+ <constant name="Muon_barrel_superlayer_gap" value="12.5*cm"/>
+ <constant name="Muon_barrel_superlayer_air_gap" value="0.1*cm"/>
+ <constant name="Muon_barrel_superlayer_aluminum_gap" value="0.5*Muon_barrel_superlayer_air_gap"/>
+
+ <constant name="Muon_barrel_superlayer_y" value="2*Muon_strip_y+2*Muon_barrel_superlayer_air_gap"/>
+ <constant name="Muon_barrel_superlayer_z" value="Muon_strip_z+2*Muon_strip_surf+2*Muon_barrel_superlayer_air_gap"/>
+
+ <Muon Endcap>
+ <constant name="Muon_endcap_part_num" value="4"/>
+ <constant name="Muon_endcap_superlayer_num" value="6"/>
+ <constant name="Muon_endcap_iron_gap_num" value="Muon_endcap_superlayer_num+1"/>
+ <constant name="Muon_endcap_layer_num" value="2"/>
+ <constant name="Muon_endcap_strip_num" value="146"/>
+ <constant name="Muon_endcap_strip_num_cut" value="13"/>
+ <constant name="Muon_endcap_endcap_rmin" value="52*cm"/>
+ <constant name="Muon_endcap_magnification" value="1.02"/>
+
+ <constant name="Muon_endcap_iron_gap" value="12.5*cm"/>
+ <constant name="Muon_endcap_endcap_z" value="Muon_endcap_iron_gap_num*Muon_endcap_iron_gap+2*Muon_endcap_superlayer_num*Muon_strip_y"/>
+ <constant name="Muon_endcap_endcap_posy" value="Muon_strip_z+2*Muon_strip_surf+Muon_Iron_gap_z+0.5*Muon_endcap_endcap_z"/-->
+ </define>
+
+ <display>
+ <vis name="Invisible" showDaughters="false" visible="false"/>
+ <vis name="SeeThrough" showDaughters="true" visible="false"/>
+ <vis name="RedVis" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
+ <vis name="BlueVis" alpha="1.0" r="0.0" g="0.0" b="1.0" showDaughters="false" visible="true"/>
+ <vis name="GreenVis" alpha="1.0" r="0.0" g="1.0" b="0.0" drawingStyle="solid" lineStyle="solid" showDaughters="true" visible="true"/>
+ <vis name="GrayVis" alpha="1.0" r="0.5" g="0.5" b="0.5" showDaughters="true" visible="true"/>
+ <vis name="WhiteVis" alpha="0.0" r="0.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
+ </display>
+
+</lccdd>
diff --git a/Detector/DetCRD/compact/Standalone/Standalone-Muon.xml b/Detector/DetCRD/compact/Standalone/Standalone-Muon.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f3ccdcba6b1161eba13c3cddf57e3e0a1dfed476
--- /dev/null
+++ b/Detector/DetCRD/compact/Standalone/Standalone-Muon.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">
+ <info name="TDR_o1_v01"
+ title="CepC reference detctor with coil inside Hcal, pixel SIT/SET"
+ author="C.D.Fu, "
+ url="http://cepc.ihep.ac.cn"
+ status="developing"
+ version="v01">
+ <comment>CepC reference detector simulation models used for detector study </comment>
+ </info>
+
+ <includes>
+ <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/elements.xml"/>
+ <gdmlFile ref="../materials.xml"/>
+ </includes>
+
+ <define>
+ <!--world size-->
+ <constant name="Muon_world_size" value="25*m"/>
+ <constant name="world_x" value="Muon_world_size"/>
+ <constant name="world_y" value="Muon_world_size"/>
+ <constant name="world_z" value="Muon_world_size"/>
+ </define>
+
+ <include ref="./Muon_Dimensions_v01_01.xml"/>
+
+ <!--include ref="../CRD_common_v01/Beampipe_v01_01.xml"/-->
+ <!--include ref="../CRD_common_v01/VXD_v01_01.xml"/-->
+ <!--include ref="../CRD_common_v01/FTD_SkewRing_v01_01.xml"/-->
+ <!--include ref="../CRD_common_v01/SIT_SimplePixel_v01_01.xml"/-->
+ <!--include ref="../CRD_common_v01/DC_Simple_v01_05.xml"/-->
+ <!--include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/-->
+ <!--include ref="../CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml"/-->
+ <!--include ref="../CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml"/-->
+ <include ref="../CRD_common_v01/Muon_Endcap_v01_01.xml"/>
+ <include ref="../CRD_common_v01/Muon_Barrel_v01_01.xml"/>
+
+ <!--fields>
+ <field name="InnerSolenoid" type="solenoid"
+ inner_field="Field_nominal_value"
+ outer_field="0"
+ zmax="SolenoidCoil_half_length"
+ inner_radius="SolenoidCoil_center_radius"
+ outer_radius="Solenoid_outer_radius">
+ </field>
+ <field name="OuterSolenoid" type="solenoid"
+ inner_field="0"
+ outer_field="Field_outer_nominal_value"
+ zmax="SolenoidCoil_half_length"
+ inner_radius="Solenoid_outer_radius"
+ outer_radius="Yoke_barrel_inner_radius">
+ </field>
+ </fields-->
+
+</lccdd>
diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml
index 9ffa7d744176c6d53d4c1bdf286b175f934de2b3..a237e37cf7be977be1d4848fb9f6f19ebb06d007 100644
--- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml
+++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_Dimensions_v01_01.xml
@@ -191,6 +191,102 @@
<constant name="tracker_region_zmax" value="Ecal_endcap_zmin"/>
<constant name="tracker_region_rmax" value="Ecal_barrel_inner_radius"/>
+ <!--Muon Detector-->
+ <!--strip & fiber dimensions-->
+ <constant name="Muon_strip_x" value="4*cm"/>
+ <constant name="Muon_strip_y" value="1*cm"/>
+ <constant name="Muon_strip_z" value="4*m"/>
+ <constant name="Muon_strip_surf" value="1*mm"/>
+
+ <constant name="Muon_strip_surface_x" value="Muon_strip_x"/>
+ <constant name="Muon_strip_surface_y" value="Muon_strip_y"/>
+ <constant name="Muon_strip_surface_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_strip_scintillator_x" value="Muon_strip_x-2*Muon_strip_surf"/>
+ <constant name="Muon_strip_scintillator_y" value="Muon_strip_y-2*Muon_strip_surf"/>
+ <constant name="Muon_strip_scintillator_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_strip_SiPM_x" value="6*mm"/>
+ <constant name="Muon_strip_SiPM_y" value="6*mm"/>
+ <constant name="Muon_strip_SiPM_z" value="Muon_strip_surf"/>
+ <constant name="Muon_strip_SiPM_posx" value="0"/>
+ <constant name="Muon_strip_SiPM_posy" value="0"/>
+ <constant name="Muon_strip_SiPM_posz" value="0.5*Muon_strip_z+0.5*Muon_strip_SiPM_z"/>
+
+ <constant name="Muon_fiber_core_rmax" value="0.95*mm"/>
+ <constant name="Muon_fiber_core_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_fiber_cladding_rmin" value="Muon_fiber_core_rmax"/>
+ <constant name="Muon_fiber_cladding_rmax" value="1*mm"/>
+ <constant name="Muon_fiber_cladding_z" value="Muon_strip_z"/>
+
+ <constant name="Muon_strip_cut_gap" value="0.1*mm"/>
+ <constant name="Muon_strip_cut3_rmax" value="Muon_fiber_cladding_rmax+Muon_strip_cut_gap"/>
+ <constant name="Muon_strip_cut3_z" value="Muon_strip_z"/>
+ <constant name="Muon_strip_cut3_posx" value="0"/>
+ <constant name="Muon_strip_cut3_posy" value="Muon_strip_cut3_rmax-Muon_fiber_cladding_rmax"/>
+ <constant name="Muon_strip_cut3_posz" value="0"/>
+
+ <constant name="Muon_strip_cut1_x" value="2*Muon_strip_cut3_rmax"/>
+ <constant name="Muon_strip_cut1_y" value="Muon_strip_surf"/>
+ <constant name="Muon_strip_cut1_z" value="Muon_strip_z"/>
+ <constant name="Muon_strip_cut1_posx" value="0"/>
+ <constant name="Muon_strip_cut1_posy" value="0.5*Muon_strip_y-0.5*Muon_strip_cut1_y"/>
+ <constant name="Muon_strip_cut1_posz" value="0"/>
+
+ <constant name="Muon_strip_cut2_x" value="Muon_strip_cut1_x"/>
+ <constant name="Muon_strip_cut2_y" value="0.5*Muon_strip_scintillator_y-Muon_strip_cut3_rmax+Muon_fiber_cladding_rmax"/>
+ <constant name="Muon_strip_cut2_z" value="Muon_strip_z"/>
+ <constant name="Muon_strip_cut2_posx" value="0"/>
+ <constant name="Muon_strip_cut2_posy" value="0.5*Muon_strip_scintillator_y-0.5*Muon_strip_cut2_y"/>
+ <constant name="Muon_strip_cut2_posz" value="0"/>
+
+ <!--standard scale-->
+ <constant name="Muon_standard_scale" value="105*cm"/>
+ <constant name="Muon_Iron_gap_z" value="50*cm"/>
+
+ <!--Muon Barrel>
+ <constant name="Muon_barrel_barrel_num" value="2"/>
+ <constant name="Muon_barrel_iron_part_num" value="12"/>
+ <constant name="Muon_barrel_superlayer_num" value="6"/>
+ <constant name="Muon_barrel_strip_num_0" value="40"/>
+ <constant name="Muon_barrel_strip_num_1" value="48"/>
+ <constant name="Muon_barrel_strip_num_2" value="62"/>
+ <constant name="Muon_barrel_strip_num_3" value="74"/>
+ <constant name="Muon_barrel_strip_num_4" value="84"/>
+ <constant name="Muon_barrel_strip_num_5" value="96"/>
+ <constant name="Muon_barrel_strip_num" value="100"/>
+
+ <constant name="Muon_barrel_iron_x1" value="Muon_standard_scale"/>
+ <constant name="Muon_barrel_iron_y" value="Muon_strip_z+2*Muon_strip_surf+Muon_Iron_gap_z"/>
+ <constant name="Muon_barrel_iron_z" value="Muon_standard_scale"/>
+ <constant name="Muon_barrel_iron_posx" value="-1*Muon_standard_scale"/>
+
+ <constant name="Muon_barrel_barrel_y" value="Muon_barrel_iron_y"/>
+ <constant name="Muon_barrel_barrel_posy" value="0.5*Muon_barrel_barrel_y"/>
+
+ <constant name="Muon_barrel_superlayer_init" value="-21.5*cm"/>
+ <constant name="Muon_barrel_superlayer_gap" value="12.5*cm"/>
+ <constant name="Muon_barrel_superlayer_air_gap" value="0.1*cm"/>
+ <constant name="Muon_barrel_superlayer_aluminum_gap" value="0.5*Muon_barrel_superlayer_air_gap"/>
+
+ <constant name="Muon_barrel_superlayer_y" value="2*Muon_strip_y+2*Muon_barrel_superlayer_air_gap"/>
+ <constant name="Muon_barrel_superlayer_z" value="Muon_strip_z+2*Muon_strip_surf+2*Muon_barrel_superlayer_air_gap"/>
+
+ <Muon Endcap>
+ <constant name="Muon_endcap_part_num" value="4"/>
+ <constant name="Muon_endcap_superlayer_num" value="6"/>
+ <constant name="Muon_endcap_iron_gap_num" value="Muon_endcap_superlayer_num+1"/>
+ <constant name="Muon_endcap_layer_num" value="2"/>
+ <constant name="Muon_endcap_strip_num" value="146"/>
+ <constant name="Muon_endcap_strip_num_cut" value="13"/>
+ <constant name="Muon_endcap_endcap_rmin" value="52*cm"/>
+ <constant name="Muon_endcap_magnification" value="1.02"/>
+
+ <constant name="Muon_endcap_iron_gap" value="12.5*cm"/>
+ <constant name="Muon_endcap_endcap_z" value="Muon_endcap_iron_gap_num*Muon_endcap_iron_gap+2*Muon_endcap_superlayer_num*Muon_strip_y"/>
+ <constant name="Muon_endcap_endcap_posy" value="Muon_strip_z+2*Muon_strip_surf+Muon_Iron_gap_z+0.5*Muon_endcap_endcap_z"/-->
+
</define>
<limits>
diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyMuon.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyMuon.xml
index 45f6c350052ffd0a19e9d784563701ba0a6cdead..ffc849124d9264b633ec80b164f56064947d9dfd 100644
--- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyMuon.xml
+++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01-onlyMuon.xml
@@ -13,80 +13,17 @@
<includes>
<gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/elements.xml"/>
- <gdmlFile ref="../materials_muon.xml"/>
+ <gdmlFile ref="../materials.xml"/>
</includes>
-
<define>
- <constant name="world_size" value="25*m"/>
- <constant name="world_x" value="world_size"/>
- <constant name="world_y" value="world_size"/>
- <constant name="world_z" value="world_size"/>
-
- <constant name="strip_x" value="4*cm"/>
- <constant name="strip_y" value="1*cm"/>
- <constant name="strip_z" value="4*m"/>
- <constant name="surf" value="1*mm"/>
-
- <constant name="Fe_gap" value="2.5*cm"/>
- <constant name="Fe_x1" value="105*cm"/>
-
- <constant name="surface_x" value="strip_x"/>
- <constant name="surface_y" value="strip_y"/>
- <constant name="surface_z" value="strip_z"/>
-
- <constant name="BC420_x" value="strip_x-2*surf"/>
- <constant name="BC420_y" value="strip_y-2*surf"/>
- <constant name="BC420_z" value="strip_z"/>
-
- <constant name="SiPM_x" value="6*mm"/>
- <constant name="SiPM_y" value="6*mm"/>
- <constant name="SiPM_z" value="surf"/>
- <constant name="SiPM_posx" value="0"/>
- <constant name="SiPM_posy" value="0"/>
- <constant name="SiPM_posz" value="0.5*strip_z+0.5*SiPM_z"/>
-
- <constant name="core_rmax" value="0.95*mm"/>
- <constant name="core_z" value="strip_z"/>
-
- <constant name="cladding_rmin" value="core_rmax"/>
- <constant name="cladding_rmax" value="1*mm"/>
- <constant name="cladding_z" value="strip_z"/>
-
- <constant name="deviation" value="0.1*mm"/>
- <constant name="cut3_rmax" value="cladding_rmax+deviation"/>
- <constant name="cut3_z" value="strip_z"/>
- <constant name="cut3_posx" value="0"/>
- <constant name="cut3_posy" value="cut3_rmax-cladding_rmax"/>
- <constant name="cut3_posz" value="0"/>
-
- <constant name="cut1_x" value="2*cut3_rmax"/>
- <constant name="cut1_y" value="surf"/>
- <constant name="cut1_z" value="strip_z"/>
- <constant name="cut1_posx" value="0"/>
- <constant name="cut1_posy" value="0.5*strip_y-0.5*cut1_y"/>
- <constant name="cut1_posz" value="0"/>
-
- <constant name="cut2_x" value="cut1_x"/>
- <constant name="cut2_y" value="0.5*BC420_y-cut3_rmax+cladding_rmax"/>
- <constant name="cut2_z" value="strip_z"/>
- <constant name="cut2_posx" value="0"/>
- <constant name="cut2_posy" value="0.5*BC420_y-0.5*cut2_y"/>
- <constant name="cut2_posz" value="0"/>
-
- <include ref="${DD4hepINSTALL}/DDDetectors/compact/detector_types.xml"/>
+ <!--world size-->
+ <constant name="Muon_world_size" value="25*m"/>
+ <constant name="world_x" value="Muon_world_size"/>
+ <constant name="world_y" value="Muon_world_size"/>
+ <constant name="world_z" value="Muon_world_size"/>
</define>
- <display>
- <vis name="Invisible_Muon" showDaughters="false" visible="false"/>
- <vis name="InvisibleWithChildren_Muon" showDaughters="true" visible="false"/>
- <vis name="VisibleRed_Muon" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
- <vis name="VisibleBlue_Muon" alpha="0.5" r="0.0" g="0.0" b="1.0" showDaughters="false" visible="true"/>
- <vis name="VisibleGreen_Muon" alpha="0.3" r="0.0" g="1.0" b="0.0" drawingStyle="solid" lineStyle="solid" showDaughters="true" visible="true"/>
- <vis name="VisibleMental_Muon" alpha="0.1" r="0.5" g="0.5" b="0.5" showDaughters="true" visible="true"/>
- <vis name="VisibleBlank_Muon" alpha="0.0" r="0.0" g="0.0" b="0.0" showDaughters="true" visible="true"/>
- </display>
-
<include ref="./TDR_Dimensions_v01_01.xml"/>
<!--include ref="../CRD_common_v01/Beampipe_v01_01.xml"/-->
@@ -97,8 +34,8 @@
<!--include ref="../CRD_common_v01/SET_SimplePixel_v01_01.xml"/-->
<!--include ref="../CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml"/-->
<!--include ref="../CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml"/-->
- <include ref="../CRD_common_v01/Muon_Endcap_v01.xml"/>
- <include ref="../CRD_common_v01/Muon_Barrel_v01.xml"/>
+ <include ref="../CRD_common_v01/Muon_Endcap_v01_01.xml"/>
+ <include ref="../CRD_common_v01/Muon_Barrel_v01_01.xml"/>
<fields>
<field name="InnerSolenoid" type="solenoid"
diff --git a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml
index 50e6fd84342ce19827ede5fe5de1f1fb6484cee7..26bc43aaaa03b2777d4e255f87814d6a06ad8d57 100644
--- a/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml
+++ b/Detector/DetCRD/compact/TDR_o1_v01/TDR_o1_v01.xml
@@ -47,13 +47,13 @@
<include ref="../CRD_common_v01/Lumical_o1_v01.xml"/>
<!--preliminary Magnet, to update/-->
<include ref="../CRD_common_v02/Coil_Simple_v01_02.xml"/>
- <!--preliminary Muon, to update/-->
+ <!--preliminary Muon, to update/>
<include ref="../CRD_common_v02/Yoke_Polyhedra_Barrel_v01_01.xml"/>
- <include ref="../CRD_common_v02/Yoke_Polyhedra_Endcaps_v01_01.xml"/>
+ <include ref="../CRD_common_v02/Yoke_Polyhedra_Endcaps_v01_01.xml"/-->
- <!--muon detector/-->
- <!--include ref="../CRD_common_v01/Muon_Barrel_v01.xml"/-->
- <!--include ref="../CRD_common_v01/Muon_Endcap_v01.xml"/-->
+ <!--muon detector-->
+ <include ref="../CRD_common_v01/Muon_Barrel_v01_01.xml"/>
+ <include ref="../CRD_common_v01/Muon_Endcap_v01_01.xml"/>
<fields>
<field name="InnerSolenoid" type="solenoid"
diff --git a/Detector/DetCRD/compact/materials.xml b/Detector/DetCRD/compact/materials.xml
index a86e3c48cccd159c8fa873bf65f60c66bc6378de..da28e0f5fa45e52ab35f93e9c25523c12808101a 100644
--- a/Detector/DetCRD/compact/materials.xml
+++ b/Detector/DetCRD/compact/materials.xml
@@ -1,152 +1,247 @@
<?xml version="1.0" encoding="UTF-8"?>
-<materials>
-
- <!--
- Air by weight from
-
- http://www.engineeringtoolbox.com/air-composition-24_212.html
- -->
- <material name="Air">
- <D type="density" unit="g/cm3" value="0.0012"/>
- <fraction n="0.754" ref="N"/>
- <fraction n="0.234" ref="O"/>
- <fraction n="0.012" ref="Ar"/>
- </material>
+<lccdd>
+ <properties>
+ <matrix name="RINDEX__Air" coldim="2" values="
+ 1.0*eV 1.00029
+ 5.1*eV 1.00029
+ "/>
+ <matrix name="RINDEX__BC420" coldim="2" values="
+ 2.38*eV 1.58
+ 2.88*eV 1.58
+ 3.45*eV 1.58
+ "/>
+ <matrix name="ABSLENGTH__BC420" coldim="2" values="
+ 2.38*eV 10*cm
+ 2.88*eV 10*cm
+ 3.45*eV 10*cm
+ "/>
+ <matrix name="WLSCOMPONENT__BC420" coldim="2" values="
+ 2.38*eV 0.
+ 2.88*eV 1.
+ 3.45*eV 0.
+ "/>
+ <matrix name="SCINTILLATIONCOMPONENT__BC420" coldim="2" values="
+ 2.38*eV 1.0
+ 2.88*eV 1.0
+ 3.45*eV 1.0
+ "/>
+ <matrix name="RINDEX__Pethylene1" coldim="2" values="
+ 2.0*eV 1.49
+ 2.87*eV 1.49
+ 2.90*eV 1.49
+ 3.47*eV 1.49
+ "/>
+ <matrix name="ABSLENGTH__Pethylene1" coldim="2" values="
+ 2.0*eV 3.0*m
+ 2.87*eV 3.0*m
+ 2.90*eV 3.0*m
+ 3.47*eV 3.0*m
+ "/>
+ <matrix name="RINDEX__Pethylene2" coldim="2" values="
+ 2.0*eV 1.60
+ 2.87*eV 1.60
+ 2.90*eV 1.60
+ 3.47*eV 1.60
+ "/>
+ <matrix name="WLSABSLENGTH__Pethylene2" coldim="2" values="
+ 2.0*eV 3.0*m
+ 2.87*eV 3.0*m
+ 2.90*eV 0.1*mm
+ 3.47*eV 0.1*mm
+ "/>
+ <matrix name="WLSCOMPONENT__Pethylene2" coldim="2" values="
+ 2.0*eV 1.0
+ 2.87*eV 1.0
+ 2.90*eV 0.
+ 3.47*eV 0.
+ "/>
+ </properties>
+
+ <materials>
+
+ <material name="Air">
+ <D type="density" unit="g/cm3" value="0.0012"/>
+ <fraction n="0.754" ref="N"/>
+ <fraction n="0.234" ref="O"/>
+ <fraction n="0.012" ref="Ar"/>
+ <property name="RINDEX" ref="RINDEX__Air"/>
+ </material>
- <!-- We model vakuum just as very thin air -->
- <material name="Vacuum">
- <D type="density" unit="g/cm3" value="0.0000000001" />
- <fraction n="0.754" ref="N"/>
- <fraction n="0.234" ref="O"/>
- <fraction n="0.012" ref="Ar"/>
- </material>
-
- <material name="Epoxy">
- <D type="density" value="1.3" unit="g/cm3"/>
- <composite n="44" ref="H"/>
- <composite n="15" ref="C"/>
- <composite n="7" ref="O"/>
- </material>
-
- <material name="Quartz">
- <D type="density" value="2.2" unit="g/cm3"/>
- <composite n="1" ref="Si"/>
- <composite n="2" ref="O"/>
- </material>
-
- <material name="G10">
- <D type="density" value="1.7" unit="g/cm3"/>
- <fraction n="0.08" ref="Cl"/>
- <fraction n="0.773" ref="Quartz"/>
- <fraction n="0.147" ref="Epoxy"/>
- </material>
-
- <material name="Polystyrene">
- <D value="1.032" unit="g/cm3"/>
- <composite n="19" ref="C"/>
- <composite n="21" ref="H"/>
- </material>
-
- <material name="Steel235">
- <D value="7.85" unit="g/cm3"/>
- <fraction n="0.998" ref="Fe"/>
- <fraction n=".002" ref="C"/>
- </material>
-
- <material name="SiliconOxide">
- <D type="density" value="2.65" unit="g/cm3"/>
- <composite n="1" ref="Si"/>
- <composite n="2" ref="O"/>
- </material>
-
- <material name="BoronOxide">
- <D type="density" value="2.46" unit="g/cm3"/>
- <composite n="2" ref="B"/>
- <composite n="3" ref="O"/>
- </material>
-
- <material name="SodiumOxide">
- <D type="density" value="2.65" unit="g/cm3"/>
- <composite n="2" ref="Na"/>
- <composite n="1" ref="O"/>
- </material>
-
- <material name="AluminumOxide">
- <D type="density" value="3.89" unit="g/cm3"/>
- <composite n="2" ref="Al"/>
- <composite n="3" ref="O"/>
- </material>
-
- <material name="PyrexGlass">
- <D type="density" value="2.23" unit="g/cm3"/>
- <fraction n="0.806" ref="SiliconOxide"/>
- <fraction n="0.130" ref="BoronOxide"/>
- <fraction n="0.040" ref="SodiumOxide"/>
- <fraction n="0.023" ref="AluminumOxide"/>
- </material>
-
- <material name="CarbonFiber">
- <D type="density" value="1.5" unit="g/cm3"/>
- <fraction n="0.65" ref="C"/>
- <fraction n="0.35" ref="Epoxy"/>
- </material>
+ <!-- We model vakuum just as very thin air -->
+ <material name="Vacuum">
+ <D type="density" unit="g/cm3" value="0.0000000001" />
+ <fraction n="0.754" ref="N"/>
+ <fraction n="0.234" ref="O"/>
+ <fraction n="0.012" ref="Ar"/>
+ </material>
+
+ <material name="Epoxy">
+ <D type="density" value="1.3" unit="g/cm3"/>
+ <composite n="44" ref="H"/>
+ <composite n="15" ref="C"/>
+ <composite n="7" ref="O"/>
+ </material>
+
+ <material name="Quartz">
+ <D type="density" value="2.2" unit="g/cm3"/>
+ <composite n="1" ref="Si"/>
+ <composite n="2" ref="O"/>
+ </material>
+
+ <material name="G10">
+ <D type="density" value="1.7" unit="g/cm3"/>
+ <fraction n="0.08" ref="Cl"/>
+ <fraction n="0.773" ref="Quartz"/>
+ <fraction n="0.147" ref="Epoxy"/>
+ </material>
+
+ <material name="Polystyrene">
+ <D value="1.032" unit="g/cm3"/>
+ <composite n="19" ref="C"/>
+ <composite n="21" ref="H"/>
+ </material>
+
+ <material name="Steel235">
+ <D value="7.85" unit="g/cm3"/>
+ <fraction n="0.998" ref="Fe"/>
+ <fraction n=".002" ref="C"/>
+ </material>
+
+ <material name="SiliconOxide">
+ <D type="density" value="2.65" unit="g/cm3"/>
+ <composite n="1" ref="Si"/>
+ <composite n="2" ref="O"/>
+ </material>
+
+ <material name="BoronOxide">
+ <D type="density" value="2.46" unit="g/cm3"/>
+ <composite n="2" ref="B"/>
+ <composite n="3" ref="O"/>
+ </material>
+
+ <material name="SodiumOxide">
+ <D type="density" value="2.65" unit="g/cm3"/>
+ <composite n="2" ref="Na"/>
+ <composite n="1" ref="O"/>
+ </material>
+
+ <material name="AluminumOxide">
+ <D type="density" value="3.89" unit="g/cm3"/>
+ <composite n="2" ref="Al"/>
+ <composite n="3" ref="O"/>
+ </material>
+
+ <material name="PyrexGlass">
+ <D type="density" value="2.23" unit="g/cm3"/>
+ <fraction n="0.806" ref="SiliconOxide"/>
+ <fraction n="0.130" ref="BoronOxide"/>
+ <fraction n="0.040" ref="SodiumOxide"/>
+ <fraction n="0.023" ref="AluminumOxide"/>
+ </material>
+
+ <material name="CarbonFiber">
+ <D type="density" value="1.5" unit="g/cm3"/>
+ <fraction n="0.65" ref="C"/>
+ <fraction n="0.35" ref="Epoxy"/>
+ </material>
- <material name="CarbonFiber_50D">
- <D type="density" value="0.75" unit="g/cm3"/>
- <fraction n="0.65" ref="C"/>
- <fraction n="0.35" ref="Epoxy"/>
- </material>
-
- <material name="Rohacell31">
- <D type="density" value="0.032" unit="g/cm3"/>
- <composite n="9" ref="C"/>
- <composite n="13" ref="H"/>
- <composite n="2" ref="O"/>
- <composite n="1" ref="N"/>
- </material>
+ <material name="CarbonFiber_50D">
+ <D type="density" value="0.75" unit="g/cm3"/>
+ <fraction n="0.65" ref="C"/>
+ <fraction n="0.35" ref="Epoxy"/>
+ </material>
+
+ <material name="Rohacell31">
+ <D type="density" value="0.032" unit="g/cm3"/>
+ <composite n="9" ref="C"/>
+ <composite n="13" ref="H"/>
+ <composite n="2" ref="O"/>
+ <composite n="1" ref="N"/>
+ </material>
- <material name="Rohacell31_50D">
- <D type="density" value="0.016" unit="g/cm3"/>
- <composite n="9" ref="C"/>
- <composite n="13" ref="H"/>
- <composite n="2" ref="O"/>
- <composite n="1" ref="N"/>
- </material>
-
- <material name="RPCGasDefault" state="gas">
- <D type="density" value="0.0037" unit="g/cm3"/>
- <composite n="209" ref="C"/>
- <composite n="239" ref="H"/>
- <composite n="381" ref="F"/>
- </material>
-
- <material name="PolystyreneFoam">
- <D type="density" value="0.0056" unit="g/cm3"/>
- <fraction n="1.0" ref="Polystyrene"/>
- </material>
-
- <material name="Kapton">
- <D value="1.43" unit="g/cm3" />
- <composite n="22" ref="C"/>
- <composite n="10" ref="H" />
- <composite n="2" ref="N" />
- <composite n="5" ref="O" />
- </material>
-
- <material name="PEEK">
- <D value="1.37" unit="g/cm3" />
- <composite n="19" ref="C"/>
- <composite n="12" ref="H" />
- <composite n="3" ref="O" />
- </material>
-
- <material name="G4_BGO" state="solid">
- <MEE unit="eV" value="534.1"/>
- <D value="7.13" unit="g/cm3" />
- <fraction n="0.154126" ref="O"/>
- <fraction n="0.174820" ref="Ge" />
- <fraction n="0.671054" ref="Bi" />
- </material>
-
-
-</materials>
+ <material name="Rohacell31_50D">
+ <D type="density" value="0.016" unit="g/cm3"/>
+ <composite n="9" ref="C"/>
+ <composite n="13" ref="H"/>
+ <composite n="2" ref="O"/>
+ <composite n="1" ref="N"/>
+ </material>
+
+ <material name="RPCGasDefault" state="gas">
+ <D type="density" value="0.0037" unit="g/cm3"/>
+ <composite n="209" ref="C"/>
+ <composite n="239" ref="H"/>
+ <composite n="381" ref="F"/>
+ </material>
+
+ <material name="PolystyreneFoam">
+ <D type="density" value="0.0056" unit="g/cm3"/>
+ <fraction n="1.0" ref="Polystyrene"/>
+ </material>
+
+ <material name="Kapton">
+ <D value="1.43" unit="g/cm3" />
+ <composite n="22" ref="C"/>
+ <composite n="10" ref="H" />
+ <composite n="2" ref="N" />
+ <composite n="5" ref="O" />
+ </material>
+
+ <material name="PEEK">
+ <D value="1.37" unit="g/cm3" />
+ <composite n="19" ref="C"/>
+ <composite n="12" ref="H" />
+ <composite n="3" ref="O" />
+ </material>
+
+ <material name="G4_BGO" state="solid">
+ <MEE unit="eV" value="534.1"/>
+ <D value="7.13" unit="g/cm3" />
+ <fraction n="0.154126" ref="O"/>
+ <fraction n="0.174820" ref="Ge" />
+ <fraction n="0.671054" ref="Bi" />
+ </material>
+
+ <material name="BC420">
+ <D type="density" value="1.032" unit="g/cm3"/>
+ <composite n="10" ref="C"/>
+ <composite n="11" ref="H"/>
+ <property name="RINDEX" ref="RINDEX__BC420"/>
+ <property name="ABSLENGTH" ref="ABSLENGTH__BC420"/>
+ <property name="WLSCOMPONENT" ref="WLSCOMPONENT__BC420"/>
+ <property name="SCINTILLATIONCOMPONENT1" ref="SCINTILLATIONCOMPONENT__BC420"/>
+ <property name="SCINTILLATIONCOMPONENT2" ref="SCINTILLATIONCOMPONENT__BC420"/>
+ <constant name="SCINTILLATIONYIELD" value="10240./MeV"/>
+ <constant name="RESOLUTIONSCALE" value="2.5"/>
+ <constant name="SCINTILLATIONTIMECONSTANT1" value="0.9*ns"/>
+ <constant name="SCINTILLATIONTIMECONSTANT2" value="2.1*ns"/>
+ <constant name="SCINTILLATIONYIELD1" value="1.0"/>
+ <constant name="SCINTILLATIONYIELD2" value="0."/>
+ <constant name="BirksConstant" value="0.126*mm/MeV"/>
+ </material>
+
+ <material name="Pethylene1">
+ <D type="density" value="1200" unit="kg/m3"/>
+ <composite n="2" ref="C"/>
+ <composite n="4" ref="H"/>
+ <property name="RINDEX" ref="RINDEX__Pethylene1"/>
+ <property name="ABSLENGTH" ref="ABSLENGTH__Pethylene1"/>
+ </material>
+
+ <material name="Pethylene2">
+ <D type="density" value="1190" unit="kg/m3"/>
+ <composite n="5" ref="C"/>
+ <composite n="8" ref="H"/>
+ <composite n="2" ref="O"/>
+ <property name="RINDEX" ref="RINDEX__Pethylene2"/>
+ <property name="WLSABSLENGTH" ref="WLSABSLENGTH__Pethylene2"/>
+ <property name="WLSCOMPONENT" ref="WLSCOMPONENT__Pethylene2"/>
+ <constant name="WLSTIMECONSTANT" value="0.5*ns"/>
+ </material>
+ </materials>
+
+ <surfaces>
+ <opticalsurface name="Muon_surf_stripe" model="glisur" finish="polished" type="dielectric_metal"/>
+ <opticalsurface name="Muon_surf_fiber" model="glisur" finish="polished" type="dielectric_metal"/>
+ </surfaces>
+</lccdd>
diff --git a/Detector/DetCRD/compact/materials_muon.xml b/Detector/DetCRD/compact/materials_muon.xml
deleted file mode 100644
index 34c657294e08b9b3328a58eafdbc3819c7b948a2..0000000000000000000000000000000000000000
--- a/Detector/DetCRD/compact/materials_muon.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lccdd>
- <properties>
-
- <matrix name="RINDEX__Air" coldim="2" values="
- 1.0*eV 1.00029
- 5.1*eV 1.00029
- "/>
- <matrix name="RINDEX__BC420" coldim="2" values="
- 2.38*eV 1.58
- 2.88*eV 1.58
- 3.45*eV 1.58
- "/>
- <matrix name="ABSLENGTH__BC420" coldim="2" values="
- 2.38*eV 10*cm
- 2.88*eV 10*cm
- 3.45*eV 10*cm
- "/>
- <matrix name="WLSCOMPONENT__BC420" coldim="2" values="
- 2.38*eV 0.
- 2.88*eV 1.
- 3.45*eV 0.
- "/>
- <matrix name="SCINTILLATIONCOMPONENT__BC420" coldim="2" values="
- 2.38*eV 1.0
- 2.88*eV 1.0
- 3.45*eV 1.0
- "/>
- <matrix name="RINDEX__Pethylene1" coldim="2" values="
- 2.0*eV 1.49
- 2.87*eV 1.49
- 2.90*eV 1.49
- 3.47*eV 1.49
- "/>
- <matrix name="ABSLENGTH__Pethylene1" coldim="2" values="
- 2.0*eV 3.0*m
- 2.87*eV 3.0*m
- 2.90*eV 3.0*m
- 3.47*eV 3.0*m
- "/>
- <matrix name="RINDEX__Pethylene2" coldim="2" values="
- 2.0*eV 1.60
- 2.87*eV 1.60
- 2.90*eV 1.60
- 3.47*eV 1.60
- "/>
- <matrix name="WLSABSLENGTH__Pethylene2" coldim="2" values="
- 2.0*eV 3.0*m
- 2.87*eV 3.0*m
- 2.90*eV 0.1*mm
- 3.47*eV 0.1*mm
- "/>
- <matrix name="WLSCOMPONENT__Pethylene2" coldim="2" values="
- 2.0*eV 1.0
- 2.87*eV 1.0
- 2.90*eV 0.
- 3.47*eV 0.
- "/>
- </properties>
-
- <materials>
-
- <material name="Air">
- <D type="density" unit="g/cm3" value="0.0012"/>
- <fraction n="0.754" ref="N"/>
- <fraction n="0.234" ref="O"/>
- <fraction n="0.012" ref="Ar"/>
- <property name="RINDEX" ref="RINDEX__Air"/>
- </material>
-
- <material name="Vacuum">
- <D type="density" unit="g/cm3" value="0.0000000001" />
- <fraction n="0.754" ref="N"/>
- <fraction n="0.234" ref="O"/>
- <fraction n="0.012" ref="Ar"/>
- </material>
-
- <material name="Steel235">
- <D value="7.85" unit="g/cm3"/>
- <fraction n="0.998" ref="Fe"/>
- <fraction n=".002" ref="C"/>
- </material>
-
- <material name="BC420">
- <D type="density" value="1.032" unit="g/cm3"/>
- <composite n="10" ref="C"/>
- <composite n="11" ref="H"/>
- <property name="RINDEX" ref="RINDEX__BC420"/>
- <property name="ABSLENGTH" ref="ABSLENGTH__BC420"/>
- <property name="WLSCOMPONENT" ref="WLSCOMPONENT__BC420"/>
- <property name="SCINTILLATIONCOMPONENT1" ref="SCINTILLATIONCOMPONENT__BC420"/>
- <property name="SCINTILLATIONCOMPONENT2" ref="SCINTILLATIONCOMPONENT__BC420"/>
- <constant name="SCINTILLATIONYIELD" value="10240./MeV"/>
- <constant name="RESOLUTIONSCALE" value="2.5"/>
- <constant name="SCINTILLATIONTIMECONSTANT1" value="0.9*ns"/>
- <constant name="SCINTILLATIONTIMECONSTANT2" value="2.1*ns"/>
- <constant name="SCINTILLATIONYIELD1" value="1.0"/>
- <constant name="SCINTILLATIONYIELD2" value="0."/>
- <constant name="BirksConstant" value="0.126*mm/MeV"/>
- </material>
-
- <material name="Pethylene1">
- <D type="density" value="1200" unit="kg/m3"/>
- <composite n="2" ref="C"/>
- <composite n="4" ref="H"/>
- <property name="RINDEX" ref="RINDEX__Pethylene1"/>
- <property name="ABSLENGTH" ref="ABSLENGTH__Pethylene1"/>
- </material>
-
- <material name="Pethylene2">
- <D type="density" value="1190" unit="kg/m3"/>
- <composite n="5" ref="C"/>
- <composite n="8" ref="H"/>
- <composite n="2" ref="O"/>
- <property name="RINDEX" ref="RINDEX__Pethylene2"/>
- <property name="WLSABSLENGTH" ref="WLSABSLENGTH__Pethylene2"/>
- <property name="WLSCOMPONENT" ref="WLSCOMPONENT__Pethylene2"/>
- <constant name="WLSTIMECONSTANT" value="0.5*ns"/>
- </material>
-
- </materials>
-
- <surfaces>
- <opticalsurface name="Surf__stripe" model="glisur" finish="polished" type="dielectric_metal"/>
- <opticalsurface name="Surf__fiber" model="glisur" finish="polished" type="dielectric_metal"/>
- </surfaces>
-</lccdd>
diff --git a/Detector/DetCRD/src/Muon/Muon_Barrel_v01.cpp b/Detector/DetCRD/src/Muon/Muon_Barrel_v01_01.cpp
similarity index 82%
rename from Detector/DetCRD/src/Muon/Muon_Barrel_v01.cpp
rename to Detector/DetCRD/src/Muon/Muon_Barrel_v01_01.cpp
index 69f985ab340cb6a0f0fa034bfdd09d23e78a1d08..28b86daa4a9fb8a66ef3b7619f601bf3dcdc3be4 100644
--- a/Detector/DetCRD/src/Muon/Muon_Barrel_v01.cpp
+++ b/Detector/DetCRD/src/Muon/Muon_Barrel_v01_01.cpp
@@ -29,13 +29,10 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
MYDEBUGVAL(det_name);
MYDEBUGVAL(det_type);
xml_dim_t pos (x_det.child(_U(position)));
- xml_dim_t dim (x_det.child(_U(dimensions)));
-
- dd4hep::Material det_mat(theDetector.material(x_det.materialStr()));
dd4hep::DetElement sdet(det_name, x_det.id());
- dd4hep::Volume envelope(det_name,dd4hep::Box(dim.dx(),dim.dy(),dim.dz()),det_mat);
+ dd4hep::Assembly envelope(det_name);
dd4hep::xml::setDetectorTypeFlag( e, sdet ) ;
@@ -45,31 +42,28 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
// dd4hep::Readout readout = sens.readout();
// dd4hep::Segmentation seg = readout.segmentation();
- xml_coll_t dcEnv(x_det,_U(module));
+ xml_coll_t dcEnv(x_det,Unicode("barrel"));
xml_comp_t x_env = dcEnv;
- for(int i0 = 0; i0 < theDetector.constant<int>("env_num"); i0++)
+ for(int i0 = 0; i0 < theDetector.constant<int>("Muon_barrel_barrel_num"); i0++)
{
for(int i1 = 0; i1 < x_env.id(); i1++ )
{
std::string env_name = x_env.nameStr() + dd4hep::_toString(i1,"_%d");
- dd4hep::Material env_mat(theDetector.material(x_env.materialStr()));
xml_dim_t env_pos(x_env.child(_U(position)));
- xml_dim_t env_dim(x_env.child(_U(dimensions)));
- xml_coll_t dcFe(x_env,_U(module));
+ xml_coll_t dcFe(x_env,Unicode("iron"));
xml_comp_t x_Fe = dcFe;
std::string Fe_name = x_Fe.nameStr() + dd4hep::_toString(i1,"_%d");
dd4hep::Material Fe_mat(theDetector.material(x_Fe.materialStr()));
xml_dim_t Fe_pos(x_Fe.child(_U(position)));
xml_dim_t Fe_dim(x_Fe.child(_U(dimensions)));
- double Fe_halfX2 = theDetector.constant<double>("Fe_x1") * ( 0.5 + std::sqrt(3));
- double Fe_posZ = -1 * theDetector.constant<double>("Fe_x1") * ( 2.5 + 1.5 * std::sqrt(3) );
- double env_halfX = 2 * theDetector.constant<double>("Fe_x1") * ( 1 + std::sqrt(3) );
- double env_halfZ = 2 * theDetector.constant<double>("Fe_x1") * ( 3 + 1.5 * std::sqrt(3) );
- dd4hep::Box env_solid(env_halfX,env_dim.dy(),env_halfZ);
- dd4hep::Volume env_vol(env_name, env_solid, env_mat);
- env_vol.setVisAttributes(theDetector.visAttributes(x_env.visStr()));
+ double Fe_halfX2 = theDetector.constant<double>("Muon_barrel_iron_x1") * ( 0.5 + std::sqrt(3));
+ //double Fe_posZ = -1 * theDetector.constant<double>("Muon_barrel_iron_x1") * ( 2.5 + 1.5 * std::sqrt(3) );
+ double Fe_posZ = -1 * ( theDetector.constant<double>("Muon_barrel_inner_radius") + 0.5 * theDetector.constant<double>("Muon_barrel_iron_z") );
+ double env_halfX = 2 * theDetector.constant<double>("Muon_barrel_iron_x1") * ( 1 + std::sqrt(3) );
+ double env_halfZ = 2 * theDetector.constant<double>("Muon_barrel_iron_x1") * ( 3 + 1.5 * std::sqrt(3) );
+ dd4hep::Assembly env_vol(env_name);
double env_rot = i1 * 360 * dd4hep::degree / x_env.id();
dd4hep::Transform3D env_transform(dd4hep::Rotation3D(dd4hep::RotationY(env_rot)),dd4hep::Position(env_pos.x(), ( 2 * i0 - 1 ) * env_pos.y(),env_pos.z()));
@@ -78,19 +72,19 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
Fe_vol.setVisAttributes(theDetector.visAttributes(x_Fe.visStr()));
dd4hep::Transform3D Fe_transform(dd4hep::Rotation3D(),dd4hep::Position(Fe_pos.x(),Fe_pos.y(),Fe_posZ));
- xml_coll_t dcSuperlayer(x_Fe,_U(module));
+ xml_coll_t dcSuperlayer(x_Fe,Unicode("superlayer"));
xml_comp_t x_superlayer = dcSuperlayer;
for(int i2 = 0; i2 < x_superlayer.id(); i2++)
{
std::string superlayer_name = x_superlayer.nameStr() + dd4hep::_toString(i2,"_%d");
- std::string num_name = "strip_num" + dd4hep::_toString(i2,"_%d");
+ std::string num_name = "Muon_barrel_strip_num" + dd4hep::_toString(i2,"_%d");
int strip_num = theDetector.constant<int>(num_name);
- double superlayer_halfX = 0.5 * strip_num * theDetector.constant<double>("strip_x") + theDetector.constant<double>("superlayer_air");
- double superlayer_halfY = 0.5 * theDetector.constant<double>("superlayer_y");
- double superlayer_halfZ = 0.5 * theDetector.constant<double>("superlayer_z");
+ double superlayer_halfX = 0.5 * strip_num * theDetector.constant<double>("Muon_strip_x") + theDetector.constant<double>("Muon_barrel_superlayer_air_gap");
+ double superlayer_halfY = 0.5 * theDetector.constant<double>("Muon_barrel_superlayer_y");
+ double superlayer_halfZ = 0.5 * theDetector.constant<double>("Muon_barrel_superlayer_z");
- double superlayer_posZ = i2 * theDetector.constant<double>("layer_gap") + theDetector.constant<double>("layer_init");
+ double superlayer_posZ = i2 * theDetector.constant<double>("Muon_barrel_superlayer_gap") + theDetector.constant<double>("Muon_barrel_superlayer_init");
dd4hep::Material superlayer_mat(theDetector.material(x_superlayer.materialStr()));
dd4hep::Box superlayer_solid(superlayer_halfX, superlayer_halfY, superlayer_halfZ);
@@ -98,15 +92,15 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
superlayer_vol.setVisAttributes(theDetector.visAttributes(x_superlayer.visStr()));
dd4hep::Transform3D superlayer_transform(dd4hep::Rotation3D(dd4hep::RotationX(90*dd4hep::degree)),dd4hep::Position(0, 0, superlayer_posZ));
- xml_coll_t dcAl(x_superlayer,_U(module));
+ xml_coll_t dcAl(x_superlayer,Unicode("aluminum"));
xml_comp_t x_Al = dcAl;
std::string Al_name = x_Al.nameStr();
dd4hep::Material Al_mat(theDetector.material(x_Al.materialStr()));
xml_dim_t Al_pos(x_Al.child(_U(position)));
- double Al_halfX = superlayer_halfX - theDetector.constant<double>("superlayer_Al");
- double Al_halfY = superlayer_halfY - theDetector.constant<double>("superlayer_Al");
- double Al_halfZ = superlayer_halfZ - theDetector.constant<double>("superlayer_Al");
+ double Al_halfX = superlayer_halfX - theDetector.constant<double>("Muon_barrel_superlayer_aluminum_gap");
+ double Al_halfY = superlayer_halfY - theDetector.constant<double>("Muon_barrel_superlayer_aluminum_gap");
+ double Al_halfZ = superlayer_halfZ - theDetector.constant<double>("Muon_barrel_superlayer_aluminum_gap");
dd4hep::Box Al_solid(Al_halfX, Al_halfY, Al_halfZ);
dd4hep::Volume Al_vol(Al_name, Al_solid, Al_mat);
Al_vol.setVisAttributes(theDetector.visAttributes(x_Al.visStr()));
@@ -120,7 +114,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
}
if ( i3 == 1 )
{
- num = theDetector.constant<int>("strip_num");
+ num = theDetector.constant<int>("Muon_barrel_strip_num");
}
for ( int i4 = 0; i4 < num; i4++ )
{
@@ -128,23 +122,23 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::Rotation3D strip_rot;
if ( i3 == 0 )
{
- strip_halfZ = 0.5 * theDetector.constant<double>("strip_z") + theDetector.constant<double>("surf");
- strip_posX = theDetector.constant<double>("strip_x") * ( i4 + 0.5 * (1 - strip_num));
- strip_posY = 0.5 * theDetector.constant<double>("strip_y");
+ strip_halfZ = 0.5 * theDetector.constant<double>("Muon_strip_z") + theDetector.constant<double>("Muon_strip_surf");
+ strip_posX = theDetector.constant<double>("Muon_strip_x") * ( i4 + 0.5 * (1 - strip_num));
+ strip_posY = 0.5 * theDetector.constant<double>("Muon_strip_y");
strip_posZ = 0;
}
if ( i3 == 1 )
{
strip_rot = dd4hep::Rotation3D(dd4hep::RotationY( 90 * dd4hep::degree ));
- strip_halfZ = 0.5 * strip_num * theDetector.constant<double>("strip_x") + theDetector.constant<double>("surf");
+ strip_halfZ = 0.5 * strip_num * theDetector.constant<double>("Muon_strip_x") + theDetector.constant<double>("Muon_strip_surf");
strip_posX = 0;
- strip_posY = -0.5 * theDetector.constant<double>("strip_y");
- strip_posZ = theDetector.constant<double>("strip_x") * ( i4 + 0.5 ) - 0.5 * theDetector.constant<double>("strip_z");
+ strip_posY = -0.5 * theDetector.constant<double>("Muon_strip_y");
+ strip_posZ = theDetector.constant<double>("Muon_strip_x") * ( i4 + 0.5 ) - 0.5 * theDetector.constant<double>("Muon_strip_z");
}
double surface_halfZ, BC420_halfZ, fiber_halfZ, cut_halfZ;
- double SiPM_posZ = strip_halfZ + theDetector.constant<double>("surf");
- surface_halfZ = BC420_halfZ = fiber_halfZ = cut_halfZ = strip_halfZ - theDetector.constant<double>("surf");
- xml_coll_t dcStrip(x_Al,_U(module));
+ double SiPM_posZ = strip_halfZ - 0.5 * theDetector.constant<double>("Muon_strip_surf");
+ surface_halfZ = BC420_halfZ = fiber_halfZ = cut_halfZ = strip_halfZ - theDetector.constant<double>("Muon_strip_surf");
+ xml_coll_t dcStrip(x_Al,Unicode("stripe"));
xml_comp_t x_strip = dcStrip;
std::string strip_name = x_strip.nameStr() + dd4hep::_toString(i0,"_%d") + dd4hep::_toString(i1,"_%d") + dd4hep::_toString(i2,"_%d") + dd4hep::_toString(i3,"_%d") + dd4hep::_toString(i4,"_%d");
dd4hep::Material strip_mat(theDetector.material(x_strip.materialStr()));
@@ -160,7 +154,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::Material surface_mat, BC420_mat, cut1_mat, cut2_mat, cut3_mat, SiPM_mat;
xml_dim_t surface_pos, cut1_pos, BC420_pos, cut3_pos, cut2_pos, SiPM_pos;
xml_dim_t surface_dim, cut1_dim, BC420_dim, cut3_dim, cut2_dim, SiPM_dim;
- for(xml_coll_t dcModule(x_strip,_U(module)); dcModule; dcModule++)
+ for(xml_coll_t dcModule(x_strip,Unicode("component")); dcModule; dcModule++)
{
xml_comp_t x_module = dcModule;
@@ -178,7 +172,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
surface_pos = s_pos;
surface_dim = s_dim;
- xml_coll_t dcCut1(x_module,_U(section));
+ xml_coll_t dcCut1(x_module,Unicode("cut"));
xml_comp_t x_cut1 = dcCut1;
cut1_name = x_cut1.nameStr();
cut1_vis = x_cut1.visStr();
@@ -198,7 +192,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
BC420_pos = b_pos;
BC420_dim = b_dim;
- xml_coll_t dcCut3(x_module,_U(section));
+ xml_coll_t dcCut3(x_module,Unicode("cut"));
xml_comp_t x_cut3 = dcCut3;
cut3_name = x_cut3.nameStr();
cut3_vis = x_cut3.visStr();
@@ -208,7 +202,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
cut3_pos = c3_pos;
cut3_dim = c3_dim;
- xml_coll_t dcCut2(x_cut3,_U(section));
+ xml_coll_t dcCut2(x_cut3,Unicode("comb"));
xml_comp_t x_cut2 = dcCut2;
cut2_name = x_cut2.nameStr();
cut2_vis = x_cut2.visStr();
@@ -246,7 +240,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
dd4hep::Volume surface_vol(surface_name, surface_solid, surface_mat);
surface_vol.setVisAttributes(theDetector.visAttributes(surface_vis));
- surface_vol.setSensitiveDetector(sens);
+ //surface_vol.setSensitiveDetector(sens);
dd4hep::Volume cut1_vol(cut1_name, cut1_solid, cut1_mat);
cut1_vol.setVisAttributes(theDetector.visAttributes(cut1_vis));
@@ -267,7 +261,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
BC420_vol.placeVolume(cut2_vol,cut2_transform);
BC420_vol.placeVolume(cut3_vol,cut3_transform);
dd4hep::PlacedVolume cladding_place, core_place;
- for(xml_coll_t dcSection(x_strip,_U(section)); dcSection; dcSection++)
+ for(xml_coll_t dcSection(x_strip,Unicode("fiber")); dcSection; dcSection++)
{
xml_comp_t x_section = dcSection;
std::string section_name = x_section.nameStr();
@@ -292,21 +286,22 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
}
surface_vol.placeVolume(cut1_vol,cut1_transform);
dd4hep::PlacedVolume BC420_place = surface_vol.placeVolume(BC420_vol,BC420_transform);
- BC420_place.addPhysVolID("Stripe",i4+1);
+ //BC420_place.addPhysVolID("Stripe",i4+1);
dd4hep::PlacedVolume surf_place = strip_vol.placeVolume(surface_vol,surface_transform);
- surf_place.addPhysVolID("Layer",i3+1);
- surf_place.addPhysVolID("SiPM",0);
+ //surf_place.addPhysVolID("Layer",i3+1);
+ //surf_place.addPhysVolID("SiPM",0);
dd4hep::PlacedVolume SiPM_place0 = strip_vol.placeVolume(SiPM_vol,SiPM_transform0);
SiPM_place0.addPhysVolID("SiPM",1);
dd4hep::PlacedVolume SiPM_place1 = strip_vol.placeVolume(SiPM_vol,SiPM_transform1);
SiPM_place1.addPhysVolID("SiPM",2);
- Al_vol.placeVolume(strip_vol,strip_transform);
+ dd4hep::PlacedVolume strip_place = Al_vol.placeVolume(strip_vol,strip_transform);
+ strip_place.addPhysVolID("Stripe",i4+1).addPhysVolID("Layer",i3+1);
dd4hep::OpticalSurfaceManager surfMgr = theDetector.surfaceManager();
std::string optical_surf = strip_name + "_surf";
std::string optical_fiber = strip_name + "_fiber";
- dd4hep::OpticalSurface Surf_stripe = surfMgr.opticalSurface("Surf__stripe");
- dd4hep::OpticalSurface Surf_fiber = surfMgr.opticalSurface("Surf__fiber");
+ dd4hep::OpticalSurface Surf_stripe = surfMgr.opticalSurface("Muon_surf_stripe");
+ dd4hep::OpticalSurface Surf_fiber = surfMgr.opticalSurface("Muon_surf_fiber");
dd4hep::BorderSurface surface_stripe( theDetector, sdet, optical_surf, Surf_stripe, BC420_place, surf_place);
dd4hep::BorderSurface surface_fiber( theDetector, sdet, optical_fiber, Surf_fiber, core_place, cladding_place);
}
@@ -321,7 +316,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
env_place.addPhysVolID("Env",i0+1);
}
}
- dd4hep::Transform3D pv(dd4hep::Rotation3D(),dd4hep::Position(0,0,0));
+ dd4hep::Transform3D pv(dd4hep::Rotation3D(dd4hep::RotationX(90*dd4hep::degree)),dd4hep::Position(0,0,0));
dd4hep::PlacedVolume phv = motherVol.placeVolume(envelope,pv);
sdet.setPlacement(phv);
@@ -329,4 +324,4 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
return sdet;
}
-DECLARE_DETELEMENT(Muon_Barrel_v01, create_detector)
+DECLARE_DETELEMENT(Muon_Barrel_v01_01, create_detector)
diff --git a/Detector/DetCRD/src/Muon/Muon_Endcap_v01.cpp b/Detector/DetCRD/src/Muon/Muon_Endcap_v01.cpp
deleted file mode 100644
index 797dca0b5b93c8301068419ecec33486ff4ad898..0000000000000000000000000000000000000000
--- a/Detector/DetCRD/src/Muon/Muon_Endcap_v01.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-//====================================================================
-// Detector description implementation for Chunxiu Liu's EcalMatrix
-//--------------------------------------------------------------------
-//
-// Author : Tao Lin
-// Examples from lcgeo
-// lcgeo/detector/calorimeter/
-//
-//====================================================================
-#include "DD4hep/DetFactoryHelper.h"
-#include "DD4hep/OpticalSurfaces.h"
-#include "XML/Utilities.h"
-#include "DDRec/DetectorData.h"
-#include "DDSegmentation/Segmentation.h"
-#include <cmath>
-
-#define MYDEBUG(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << x << std::endl;
-#define MYDEBUGVAL(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << #x << ": " << x << std::endl;
-
-using dd4hep::rec::LayeredCalorimeterData;
-static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
- xml_h e,
- dd4hep::SensitiveDetector sens) {
-
- xml_det_t x_det = e;
-
- std::string det_name = x_det.nameStr();
- std::string det_type = x_det.typeStr();
- MYDEBUGVAL(det_name);
- MYDEBUGVAL(det_type);
- xml_dim_t pos (x_det.child(_U(position)));
- xml_dim_t dim (x_det.child(_U(dimensions)));
-
- double env_rmax = theDetector.constant<double>("Fe_x1") * std::sqrt( ( 1.5 * 1.5 + ( 3 + 1.5 * std::sqrt(3) ) * ( 3 + 1.5 * std::sqrt(3) ) ) );
-
- dd4hep::Material det_mat(theDetector.material(x_det.materialStr()));
-
- dd4hep::Assembly assembly(det_name);
-
- dd4hep::DetElement sdet("envelope", 1);
-
- dd4hep::Volume envelope( "envelope", dd4hep::Tube( dim.rmin(), theDetector.constant<double>( "multiple" ) * env_rmax, dim.dz() ), det_mat);
- envelope.setVisAttributes(theDetector.visAttributes(x_det.visStr()));
-
- sens.setType("muonendcap");
-
-// dd4hep::Readout readout = sens.readout();
-// dd4hep::Segmentation seg = readout.segmentation();
- for (int i0 = 0; i0 < theDetector.constant<int>("env_num_endcap"); i0++)
- {
- std::string env_name = "part" + dd4hep::_toString(i0,"_%d");
- dd4hep::Tube env_solid( dim.rmin(), theDetector.constant<double>( "multiple" ) * env_rmax, dim.dz(), 0, 90 * dd4hep::degree);
- dd4hep::Volume env_vol( env_name, env_solid, det_mat);
- env_vol.setVisAttributes(theDetector.visAttributes(x_det.visStr()));
- dd4hep::Transform3D env_transform(dd4hep::Rotation3D(dd4hep::RotationZ(i0 * 90 * dd4hep::degree)),dd4hep::Position());
- for (int i1 = 0; i1 < theDetector.constant<int>("layer_num"); i1++ )
- {
- for ( int i2 = 0; i2 < theDetector.constant<int>("strip_num_endcap"); i2++)
- {
- double strip_posX, strip_posY, strip_posZ;
- double strip_sizeZ, surface_halfZ, BC420_halfZ, fiber_halfZ, cut_halfZ;
- dd4hep::Rotation3D strip_rot;
- if ( i1 == 1 )
- {
- strip_rot = dd4hep::Rotation3D( dd4hep::RotationX( 90 * dd4hep::degree ) );
- strip_posX = theDetector.constant<double>("strip_x") * ( i2 + 0.5 );
- strip_posZ = 0.5 * ( 1 - 2 * ( i0 % 2 ) ) * theDetector.constant<double>("strip_y");
- if ( i2 < theDetector.constant<int>("strip_num_cut") )
- {
- strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") ) - std::sqrt( dim.rmin() * dim.rmin() - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") );
- strip_posY = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") ) - 0.5 * strip_sizeZ;
- }
- if ( i2 >= theDetector.constant<int>("strip_num_cut") )
- {
- strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") );
- strip_posY = 0.5 * strip_sizeZ;
- }
- }
- if ( i1 == 0 )
- {
- strip_rot = dd4hep::Rotation3D( dd4hep::RotationX( 90 * dd4hep::degree ) * dd4hep::RotationY( 90 * dd4hep::degree ) );
- strip_posY = theDetector.constant<double>("strip_x") * ( i2 + 0.5 );
- strip_posZ = 0.5 * ( 2 * ( i0 % 2 ) - 1 ) * theDetector.constant<double>("strip_y");
- if ( i2 < theDetector.constant<int>("strip_num_cut") )
- {
- strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") ) - std::sqrt( dim.rmin() * dim.rmin() - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") );
- strip_posX = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") ) - 0.5 * strip_sizeZ;
- }
- if ( i2 >= theDetector.constant<int>("strip_num_cut") )
- {
- strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("strip_x") * i2 * theDetector.constant<double>("strip_x") );
- strip_posX = 0.5 * strip_sizeZ;
- }
- }
- double strip_halfZ = 0.5 * strip_sizeZ;
- double SiPM_posZ = strip_halfZ + theDetector.constant<double>("surf");
- surface_halfZ = BC420_halfZ = fiber_halfZ = cut_halfZ = strip_halfZ - theDetector.constant<double>("surf");
- xml_coll_t dcStrip(x_det,_U(module));
- xml_comp_t x_strip = dcStrip;
- std::string strip_name = x_strip.nameStr() + dd4hep::_toString(i0,"_%d") + dd4hep::_toString(i1,"_%d") + dd4hep::_toString(i2,"_%d");
- dd4hep::Material strip_mat(theDetector.material(x_strip.materialStr()));
- xml_dim_t strip_dim(x_strip.child(_U(dimensions)));
-
- dd4hep::Box strip_solid(strip_dim.dx(),strip_dim.dy(),strip_halfZ);
- dd4hep::Volume strip_vol(strip_name,strip_solid,strip_mat);
- strip_vol.setVisAttributes(theDetector.visAttributes(x_strip.visStr()));
- dd4hep::Transform3D strip_transform(strip_rot,dd4hep::Position(strip_posX,strip_posY,strip_posZ));
-
- std::string surface_name, BC420_name, cut1_name, cut2_name, cut3_name, SiPM_name;
- std::string surface_vis, BC420_vis, cut1_vis, cut2_vis, cut3_vis, SiPM_vis;
- dd4hep::Material surface_mat, BC420_mat, cut1_mat, cut2_mat, cut3_mat, SiPM_mat;
- xml_dim_t surface_pos, cut1_pos, BC420_pos, cut3_pos, cut2_pos, SiPM_pos;
- xml_dim_t surface_dim, cut1_dim, BC420_dim, cut3_dim, cut2_dim, SiPM_dim;
- for(xml_coll_t dcModule(x_strip,_U(module)); dcModule; dcModule++)
- {
- xml_comp_t x_module = dcModule;
-
- xml_dim_t module_pos(x_module.child(_U(position)));
- xml_dim_t module_dim(x_module.child(_U(dimensions)));
-
- dd4hep::Box module_solid(module_dim.dx(),module_dim.dy(),module_dim.dz());
- if(x_module.id()==0)
- {
- surface_name = x_module.nameStr();
- surface_vis = x_module.visStr();
- surface_mat = theDetector.material(x_module.materialStr());
- xml_dim_t s_pos(x_module.child(_U(position)));
- xml_dim_t s_dim(x_module.child(_U(dimensions)));
- surface_pos = s_pos;
- surface_dim = s_dim;
-
- xml_coll_t dcCut1(x_module,_U(section));
- xml_comp_t x_cut1 = dcCut1;
- cut1_name = x_cut1.nameStr();
- cut1_vis = x_cut1.visStr();
- cut1_mat = theDetector.material(x_cut1.materialStr());
- xml_dim_t c1_pos(x_cut1.child(_U(position)));
- xml_dim_t c1_dim(x_cut1.child(_U(dimensions)));
- cut1_pos = c1_pos;
- cut1_dim = c1_dim;
- }
- if(x_module.id()==1)
- {
- BC420_name = x_module.nameStr();
- BC420_vis = x_module.visStr();
- BC420_mat = theDetector.material(x_module.materialStr());
- xml_dim_t b_pos(x_module.child(_U(position)));
- xml_dim_t b_dim(x_module.child(_U(dimensions)));
- BC420_pos = b_pos;
- BC420_dim = b_dim;
-
- xml_coll_t dcCut3(x_module,_U(section));
- xml_comp_t x_cut3 = dcCut3;
- cut3_name = x_cut3.nameStr();
- cut3_vis = x_cut3.visStr();
- cut3_mat = theDetector.material(x_cut3.materialStr());
- xml_dim_t c3_pos(x_cut3.child(_U(position)));
- xml_dim_t c3_dim(x_cut3.child(_U(dimensions)));
- cut3_pos = c3_pos;
- cut3_dim = c3_dim;
-
- xml_coll_t dcCut2(x_cut3,_U(section));
- xml_comp_t x_cut2 = dcCut2;
- cut2_name = x_cut2.nameStr();
- cut2_vis = x_cut2.visStr();
- cut2_mat = theDetector.material(x_cut2.materialStr());
- xml_dim_t c2_pos(x_cut2.child(_U(position)));
- xml_dim_t c2_dim(x_cut2.child(_U(dimensions)));
- cut2_pos = c2_pos;
- cut2_dim = c2_dim;
- }
- if(x_module.id()==2)
- {
- SiPM_name = x_module.nameStr();
- SiPM_vis = x_module.visStr();
- SiPM_mat = theDetector.material(x_module.materialStr());
- xml_dim_t S_pos(x_module.child(_U(position)));
- xml_dim_t S_dim(x_module.child(_U(dimensions)));
- SiPM_pos = S_pos;
- SiPM_dim = S_dim;
- }
- }
- dd4hep::Box surface_solid(surface_dim.dx(),surface_dim.dy(),surface_halfZ);
- dd4hep::Box cut1_solid(cut1_dim.dx(),cut1_dim.dy(),cut_halfZ);
- dd4hep::Box BC420_solid(BC420_dim.dx(),BC420_dim.dy(),BC420_halfZ);
- dd4hep::Tube cut3_solid(cut3_dim.rmin(),cut3_dim.rmax(),cut_halfZ);
- dd4hep::Box cut2_solid(cut2_dim.dx(),cut2_dim.dy(),cut_halfZ);
- dd4hep::Box SiPM_solid(SiPM_dim.dx(),SiPM_dim.dy(),SiPM_dim.dz());
-
- dd4hep::Transform3D surface_transform(dd4hep::Rotation3D(),dd4hep::Position(surface_pos.x(),surface_pos.y(),surface_pos.z()));
- dd4hep::Transform3D cut1_transform(dd4hep::Rotation3D(),dd4hep::Position(cut1_pos.x(),cut1_pos.y(),cut1_pos.z()));
- dd4hep::Transform3D BC420_transform(dd4hep::Rotation3D(),dd4hep::Position(BC420_pos.x(),BC420_pos.y(),BC420_pos.z()));
- dd4hep::Transform3D cut2_transform(dd4hep::Rotation3D(),dd4hep::Position(cut2_pos.x(),cut2_pos.y(),cut2_pos.z()));
- dd4hep::Transform3D cut3_transform(dd4hep::Rotation3D(),dd4hep::Position(cut3_pos.x(),cut3_pos.y(),cut3_pos.z()));
- dd4hep::Transform3D SiPM_transform1(dd4hep::Rotation3D(),dd4hep::Position(SiPM_pos.x(),SiPM_pos.y(),SiPM_posZ));
- dd4hep::Transform3D SiPM_transform2(dd4hep::Rotation3D(),dd4hep::Position(SiPM_pos.x(),SiPM_pos.y(), -1 * SiPM_posZ));
-
- dd4hep::Volume surface_vol(surface_name, surface_solid, surface_mat);
- surface_vol.setVisAttributes(theDetector.visAttributes(surface_vis));
- surface_vol.setSensitiveDetector(sens);
-
- dd4hep::Volume cut1_vol(cut1_name, cut1_solid, cut1_mat);
- cut1_vol.setVisAttributes(theDetector.visAttributes(cut1_vis));
-
- dd4hep::Volume cut2_vol(cut2_name, cut2_solid, cut2_mat);
- cut2_vol.setVisAttributes(theDetector.visAttributes(cut2_vis));
-
- dd4hep::Volume cut3_vol(cut3_name, cut3_solid, cut3_mat);
- cut3_vol.setVisAttributes(theDetector.visAttributes(cut3_vis));
-
- dd4hep::Volume BC420_vol(BC420_name,BC420_solid,BC420_mat);
- BC420_vol.setVisAttributes(theDetector.visAttributes(BC420_vis));
-
- dd4hep::Volume SiPM_vol(SiPM_name, SiPM_solid, SiPM_mat);
- SiPM_vol.setVisAttributes(theDetector.visAttributes(SiPM_vis));
- SiPM_vol.setSensitiveDetector(sens);
-
- BC420_vol.placeVolume(cut2_vol,cut2_transform);
- BC420_vol.placeVolume(cut3_vol,cut3_transform);
- dd4hep::PlacedVolume cladding_place, core_place;
- for(xml_coll_t dcSection(x_strip,_U(section)); dcSection; dcSection++)
- {
- xml_comp_t x_section = dcSection;
- std::string section_name = x_section.nameStr();
- dd4hep::Material section_mat = theDetector.material(x_section.materialStr());
-
- xml_dim_t section_pos(x_section.child(_U(position)));
- xml_dim_t section_dim(x_section.child(_U(dimensions)));
-
- dd4hep::Tube section_solid(section_dim.rmin(),section_dim.rmax(),fiber_halfZ);
- dd4hep::Volume section_vol(section_name,section_solid,section_mat);
- section_vol.setVisAttributes(theDetector.visAttributes(x_section.visStr()));
-
- dd4hep::Transform3D section_transform(dd4hep::Rotation3D(),dd4hep::Position(section_pos.x(),section_pos.y(),section_pos.z()));
- if (x_section.id() == 0)
- {
- cladding_place = BC420_vol.placeVolume(section_vol,section_transform);
- }
- if (x_section.id() == 1)
- {
- core_place = BC420_vol.placeVolume(section_vol,section_transform);
- }
- }
- surface_vol.placeVolume(cut1_vol,cut1_transform);
- dd4hep::PlacedVolume BC420_place = surface_vol.placeVolume(BC420_vol,BC420_transform);
- BC420_place.addPhysVolID("Stripe",i2+1);
- dd4hep::PlacedVolume surf_place = strip_vol.placeVolume(surface_vol,surface_transform);
- int lnum = ( ( 2 * ( i0 % 2 ) - 1 ) * ( 2 * i1 - 1 ) + 1 ) / 2;
- surf_place.addPhysVolID("Layer", lnum+1);
- surf_place.addPhysVolID("SiPM",0);
- dd4hep::PlacedVolume SiPM_place1 = strip_vol.placeVolume(SiPM_vol,SiPM_transform1);
- SiPM_place1.addPhysVolID("SiPM",1);
- dd4hep::PlacedVolume SiPM_place2 = strip_vol.placeVolume(SiPM_vol,SiPM_transform2);
- SiPM_place2.addPhysVolID("SiPM",2);
- env_vol.placeVolume(strip_vol,strip_transform);
- dd4hep::OpticalSurfaceManager surfMgr = theDetector.surfaceManager();
- std::string optical_surf = strip_name + "_surf";
- std::string optical_fiber = strip_name + "_fiber";
- dd4hep::OpticalSurface Surf_stripe = surfMgr.opticalSurface("Surf__stripe");
- dd4hep::OpticalSurface Surf_fiber = surfMgr.opticalSurface("Surf__fiber");
- dd4hep::BorderSurface surface_stripe( theDetector, sdet, optical_surf, Surf_stripe, BC420_place, surf_place);
- dd4hep::BorderSurface surface_fiber( theDetector, sdet, optical_fiber, Surf_fiber, core_place, cladding_place);
- }
- }
- dd4hep::PlacedVolume env_place = envelope.placeVolume(env_vol,env_transform);
- env_place.addPhysVolID("Env",i0+1);
- }
- dd4hep::PlacedVolume pv;
- dd4hep::DetElement both_endcaps(det_name,0);
- dd4hep::Volume motherVol = theDetector.pickMotherVolume(both_endcaps);
- dd4hep::DetElement sdetA = sdet;
- dd4hep::Ref_t(sdetA)->SetName((det_name+"_A").c_str());
- dd4hep::DetElement sdetB = sdet.clone(det_name+"_B",3);
- pv = assembly.placeVolume(envelope,dd4hep::Transform3D(dd4hep::Rotation3D(dd4hep::RotationX(90*dd4hep::degree)),dd4hep::Position(0,pos.y(),0)));
- pv.addPhysVolID("Endcap",1);
-
- sdetA.setPlacement(pv);
-
- pv = assembly.placeVolume(envelope,dd4hep::Transform3D(dd4hep::Rotation3D(dd4hep::RotationX(90*dd4hep::degree)),dd4hep::Position(0,-1*pos.y(),0)));
- pv.addPhysVolID("Endcap",2);
-
- sdetB.setPlacement(pv);
-
- pv = motherVol.placeVolume(assembly);
-// pv.addPhysVolID("system",x_det.id());
- both_endcaps.setPlacement(pv);
- both_endcaps.add(sdetA);
- both_endcaps.add(sdetB);
-
- MYDEBUG("create_detector DONE. ");
- return both_endcaps;
-}
-
-DECLARE_DETELEMENT(Muon_Endcap_v01, create_detector)
diff --git a/Detector/DetCRD/src/Muon/Muon_Endcap_v01_01.cpp b/Detector/DetCRD/src/Muon/Muon_Endcap_v01_01.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..336222d04fc237419523b7b411fed8aab60f0eae
--- /dev/null
+++ b/Detector/DetCRD/src/Muon/Muon_Endcap_v01_01.cpp
@@ -0,0 +1,303 @@
+//====================================================================
+// Detector description implementation for Chunxiu Liu's EcalMatrix
+//--------------------------------------------------------------------
+//
+// Author : Tao Lin
+// Examples from lcgeo
+// lcgeo/detector/calorimeter/
+//
+//====================================================================
+#include "DD4hep/DetFactoryHelper.h"
+#include "DD4hep/OpticalSurfaces.h"
+#include "XML/Utilities.h"
+#include "DDRec/DetectorData.h"
+#include "DDSegmentation/Segmentation.h"
+#include <cmath>
+
+#define MYDEBUG(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << x << std::endl;
+#define MYDEBUGVAL(x) std::cout << __FILE__ << ":" << __LINE__ << ": " << #x << ": " << x << std::endl;
+
+using dd4hep::rec::LayeredCalorimeterData;
+static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
+ xml_h e,
+ dd4hep::SensitiveDetector sens) {
+
+ xml_det_t x_det = e;
+
+ std::string det_name = x_det.nameStr();
+ std::string det_type = x_det.typeStr();
+ MYDEBUGVAL(det_name);
+ MYDEBUGVAL(det_type);
+ xml_dim_t pos (x_det.child(_U(position)));
+ xml_dim_t dim (x_det.child(_U(dimensions)));
+
+ double env_rmax = theDetector.constant<double>("Muon_standard_scale") * std::sqrt( ( 1.5 * 1.5 + ( 3 + 1.5 * std::sqrt(3) ) * ( 3 + 1.5 * std::sqrt(3) ) ) );
+
+ dd4hep::Material det_mat(theDetector.material(x_det.materialStr()));
+
+ dd4hep::Assembly assembly(det_name);
+
+ dd4hep::DetElement sdet("envelope", 1);
+
+ dd4hep::Volume envelope( "envelope", dd4hep::Tube( dim.rmin(), theDetector.constant<double>( "Muon_endcap_magnification" ) * env_rmax, dim.dz() ), det_mat);
+ envelope.setVisAttributes(theDetector.visAttributes(x_det.visStr()));
+
+ sens.setType("muonendcap");
+
+// dd4hep::Readout readout = sens.readout();
+// dd4hep::Segmentation seg = readout.segmentation();
+ for (int i = 0; i < theDetector.constant<int>("Muon_endcap_superlayer_num"); i++)
+ {
+ std::string superlayer_name = "superlayer" + dd4hep::_toString(i,"_%d");
+ dd4hep::Assembly superlayer_vol(superlayer_name);
+ dd4hep::Transform3D superlayer_transform(dd4hep::Rotation3D(),dd4hep::Position(0,0,theDetector.constant<double>("Muon_endcap_iron_gap") * ( i + 1 ) + theDetector.constant<double>("Muon_strip_y") * ( i + 0.5 ) - 0.5 * theDetector.constant<double>("Muon_endcap_endcap_z")));
+ for (int i0 = 0; i0 < theDetector.constant<int>("Muon_endcap_part_num"); i0++)
+ {
+ std::string env_name = "part" + dd4hep::_toString(i0,"_%d");
+ dd4hep::Tube env_solid( dim.rmin(), theDetector.constant<double>( "Muon_endcap_magnification" ) * env_rmax, dim.dz(), 0, 90 * dd4hep::degree);
+ dd4hep::Volume env_vol( env_name, env_solid, det_mat);
+ env_vol.setVisAttributes(theDetector.visAttributes(x_det.visStr()));
+ dd4hep::Transform3D env_transform(dd4hep::Rotation3D(dd4hep::RotationZ(i0 * 90 * dd4hep::degree)),dd4hep::Position());
+ for (int i1 = 0; i1 < theDetector.constant<int>("Muon_endcap_layer_num"); i1++ )
+ {
+ for ( int i2 = 0; i2 < theDetector.constant<int>("Muon_endcap_strip_num"); i2++)
+ {
+ double strip_posX, strip_posY, strip_posZ;
+ double strip_sizeZ, surface_halfZ, BC420_halfZ, fiber_halfZ, cut_halfZ;
+ dd4hep::Rotation3D strip_rot;
+ if ( i1 == 1 )
+ {
+ strip_rot = dd4hep::Rotation3D( dd4hep::RotationX( 90 * dd4hep::degree ) );
+ strip_posX = theDetector.constant<double>("Muon_strip_x") * ( i2 + 0.5 );
+ strip_posZ = 0.5 * ( 1 - 2 * ( i0 % 2 ) ) * theDetector.constant<double>("Muon_strip_y");
+ if ( i2 < theDetector.constant<int>("Muon_endcap_strip_num_cut") )
+ {
+ strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") ) - std::sqrt( dim.rmin() * dim.rmin() - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") );
+ strip_posY = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") ) - 0.5 * strip_sizeZ;
+ }
+ if ( i2 >= theDetector.constant<int>("Muon_endcap_strip_num_cut") )
+ {
+ strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") );
+ strip_posY = 0.5 * strip_sizeZ;
+ }
+ }
+ if ( i1 == 0 )
+ {
+ strip_rot = dd4hep::Rotation3D( dd4hep::RotationX( 90 * dd4hep::degree ) * dd4hep::RotationY( 90 * dd4hep::degree ) );
+ strip_posY = theDetector.constant<double>("Muon_strip_x") * ( i2 + 0.5 );
+ strip_posZ = 0.5 * ( 2 * ( i0 % 2 ) - 1 ) * theDetector.constant<double>("Muon_strip_y");
+ if ( i2 < theDetector.constant<int>("Muon_endcap_strip_num_cut") )
+ {
+ strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") ) - std::sqrt( dim.rmin() * dim.rmin() - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") );
+ strip_posX = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") ) - 0.5 * strip_sizeZ;
+ }
+ if ( i2 >= theDetector.constant<int>("Muon_endcap_strip_num_cut") )
+ {
+ strip_sizeZ = std::sqrt( env_rmax * env_rmax - i2 * theDetector.constant<double>("Muon_strip_x") * i2 * theDetector.constant<double>("Muon_strip_x") );
+ strip_posX = 0.5 * strip_sizeZ;
+ }
+ }
+ double strip_halfZ = 0.5 * strip_sizeZ;
+ double SiPM_posZ = strip_halfZ - 0.5 * theDetector.constant<double>("Muon_strip_surf");
+ surface_halfZ = BC420_halfZ = fiber_halfZ = cut_halfZ = strip_halfZ - theDetector.constant<double>("Muon_strip_surf");
+ xml_coll_t dcStrip(x_det,Unicode("stripe"));
+ xml_comp_t x_strip = dcStrip;
+ std::string strip_name = x_strip.nameStr() + dd4hep::_toString(i,"_%d") + dd4hep::_toString(i0,"_%d") + dd4hep::_toString(i1,"_%d") + dd4hep::_toString(i2,"_%d");
+ dd4hep::Material strip_mat(theDetector.material(x_strip.materialStr()));
+ xml_dim_t strip_dim(x_strip.child(_U(dimensions)));
+
+ dd4hep::Box strip_solid(strip_dim.dx(),strip_dim.dy(),strip_halfZ);
+ dd4hep::Volume strip_vol(strip_name,strip_solid,strip_mat);
+ strip_vol.setVisAttributes(theDetector.visAttributes(x_strip.visStr()));
+ dd4hep::Transform3D strip_transform(strip_rot,dd4hep::Position(strip_posX,strip_posY,strip_posZ));
+
+ std::string surface_name, BC420_name, cut1_name, cut2_name, cut3_name, SiPM_name;
+ std::string surface_vis, BC420_vis, cut1_vis, cut2_vis, cut3_vis, SiPM_vis;
+ dd4hep::Material surface_mat, BC420_mat, cut1_mat, cut2_mat, cut3_mat, SiPM_mat;
+ xml_dim_t surface_pos, cut1_pos, BC420_pos, cut3_pos, cut2_pos, SiPM_pos;
+ xml_dim_t surface_dim, cut1_dim, BC420_dim, cut3_dim, cut2_dim, SiPM_dim;
+ for(xml_coll_t dcModule(x_strip,Unicode("component")); dcModule; dcModule++)
+ {
+ xml_comp_t x_module = dcModule;
+
+ xml_dim_t module_pos(x_module.child(_U(position)));
+ xml_dim_t module_dim(x_module.child(_U(dimensions)));
+
+ dd4hep::Box module_solid(module_dim.dx(),module_dim.dy(),module_dim.dz());
+ if(x_module.id()==0)
+ {
+ surface_name = x_module.nameStr();
+ surface_vis = x_module.visStr();
+ surface_mat = theDetector.material(x_module.materialStr());
+ xml_dim_t s_pos(x_module.child(_U(position)));
+ xml_dim_t s_dim(x_module.child(_U(dimensions)));
+ surface_pos = s_pos;
+ surface_dim = s_dim;
+
+ xml_coll_t dcCut1(x_module,Unicode("cut"));
+ xml_comp_t x_cut1 = dcCut1;
+ cut1_name = x_cut1.nameStr();
+ cut1_vis = x_cut1.visStr();
+ cut1_mat = theDetector.material(x_cut1.materialStr());
+ xml_dim_t c1_pos(x_cut1.child(_U(position)));
+ xml_dim_t c1_dim(x_cut1.child(_U(dimensions)));
+ cut1_pos = c1_pos;
+ cut1_dim = c1_dim;
+ }
+ if(x_module.id()==1)
+ {
+ BC420_name = x_module.nameStr();
+ BC420_vis = x_module.visStr();
+ BC420_mat = theDetector.material(x_module.materialStr());
+ xml_dim_t b_pos(x_module.child(_U(position)));
+ xml_dim_t b_dim(x_module.child(_U(dimensions)));
+ BC420_pos = b_pos;
+ BC420_dim = b_dim;
+
+ xml_coll_t dcCut3(x_module,Unicode("cut"));
+ xml_comp_t x_cut3 = dcCut3;
+ cut3_name = x_cut3.nameStr();
+ cut3_vis = x_cut3.visStr();
+ cut3_mat = theDetector.material(x_cut3.materialStr());
+ xml_dim_t c3_pos(x_cut3.child(_U(position)));
+ xml_dim_t c3_dim(x_cut3.child(_U(dimensions)));
+ cut3_pos = c3_pos;
+ cut3_dim = c3_dim;
+
+ xml_coll_t dcCut2(x_cut3,Unicode("comb"));
+ xml_comp_t x_cut2 = dcCut2;
+ cut2_name = x_cut2.nameStr();
+ cut2_vis = x_cut2.visStr();
+ cut2_mat = theDetector.material(x_cut2.materialStr());
+ xml_dim_t c2_pos(x_cut2.child(_U(position)));
+ xml_dim_t c2_dim(x_cut2.child(_U(dimensions)));
+ cut2_pos = c2_pos;
+ cut2_dim = c2_dim;
+ }
+ if(x_module.id()==2)
+ {
+ SiPM_name = x_module.nameStr();
+ SiPM_vis = x_module.visStr();
+ SiPM_mat = theDetector.material(x_module.materialStr());
+ xml_dim_t S_pos(x_module.child(_U(position)));
+ xml_dim_t S_dim(x_module.child(_U(dimensions)));
+ SiPM_pos = S_pos;
+ SiPM_dim = S_dim;
+ }
+ }
+ dd4hep::Box surface_solid(surface_dim.dx(),surface_dim.dy(),surface_halfZ);
+ dd4hep::Box cut1_solid(cut1_dim.dx(),cut1_dim.dy(),cut_halfZ);
+ dd4hep::Box BC420_solid(BC420_dim.dx(),BC420_dim.dy(),BC420_halfZ);
+ dd4hep::Tube cut3_solid(cut3_dim.rmin(),cut3_dim.rmax(),cut_halfZ);
+ dd4hep::Box cut2_solid(cut2_dim.dx(),cut2_dim.dy(),cut_halfZ);
+ dd4hep::Box SiPM_solid(SiPM_dim.dx(),SiPM_dim.dy(),SiPM_dim.dz());
+
+ dd4hep::Transform3D surface_transform(dd4hep::Rotation3D(),dd4hep::Position(surface_pos.x(),surface_pos.y(),surface_pos.z()));
+ dd4hep::Transform3D cut1_transform(dd4hep::Rotation3D(),dd4hep::Position(cut1_pos.x(),cut1_pos.y(),cut1_pos.z()));
+ dd4hep::Transform3D BC420_transform(dd4hep::Rotation3D(),dd4hep::Position(BC420_pos.x(),BC420_pos.y(),BC420_pos.z()));
+ dd4hep::Transform3D cut2_transform(dd4hep::Rotation3D(),dd4hep::Position(cut2_pos.x(),cut2_pos.y(),cut2_pos.z()));
+ dd4hep::Transform3D cut3_transform(dd4hep::Rotation3D(),dd4hep::Position(cut3_pos.x(),cut3_pos.y(),cut3_pos.z()));
+ dd4hep::Transform3D SiPM_transform1(dd4hep::Rotation3D(),dd4hep::Position(SiPM_pos.x(),SiPM_pos.y(),SiPM_posZ));
+ dd4hep::Transform3D SiPM_transform2(dd4hep::Rotation3D(),dd4hep::Position(SiPM_pos.x(),SiPM_pos.y(), -1 * SiPM_posZ));
+
+ dd4hep::Volume surface_vol(surface_name, surface_solid, surface_mat);
+ surface_vol.setVisAttributes(theDetector.visAttributes(surface_vis));
+ //surface_vol.setSensitiveDetector(sens);
+
+ dd4hep::Volume cut1_vol(cut1_name, cut1_solid, cut1_mat);
+ cut1_vol.setVisAttributes(theDetector.visAttributes(cut1_vis));
+
+ dd4hep::Volume cut2_vol(cut2_name, cut2_solid, cut2_mat);
+ cut2_vol.setVisAttributes(theDetector.visAttributes(cut2_vis));
+
+ dd4hep::Volume cut3_vol(cut3_name, cut3_solid, cut3_mat);
+ cut3_vol.setVisAttributes(theDetector.visAttributes(cut3_vis));
+
+ dd4hep::Volume BC420_vol(BC420_name,BC420_solid,BC420_mat);
+ BC420_vol.setVisAttributes(theDetector.visAttributes(BC420_vis));
+
+ dd4hep::Volume SiPM_vol(SiPM_name, SiPM_solid, SiPM_mat);
+ SiPM_vol.setVisAttributes(theDetector.visAttributes(SiPM_vis));
+ SiPM_vol.setSensitiveDetector(sens);
+
+ BC420_vol.placeVolume(cut2_vol,cut2_transform);
+ BC420_vol.placeVolume(cut3_vol,cut3_transform);
+ dd4hep::PlacedVolume cladding_place, core_place;
+ for(xml_coll_t dcSection(x_strip,Unicode("fiber")); dcSection; dcSection++)
+ {
+ xml_comp_t x_section = dcSection;
+ std::string section_name = x_section.nameStr();
+ dd4hep::Material section_mat = theDetector.material(x_section.materialStr());
+
+ xml_dim_t section_pos(x_section.child(_U(position)));
+ xml_dim_t section_dim(x_section.child(_U(dimensions)));
+
+ dd4hep::Tube section_solid(section_dim.rmin(),section_dim.rmax(),fiber_halfZ);
+ dd4hep::Volume section_vol(section_name,section_solid,section_mat);
+ section_vol.setVisAttributes(theDetector.visAttributes(x_section.visStr()));
+
+ dd4hep::Transform3D section_transform(dd4hep::Rotation3D(),dd4hep::Position(section_pos.x(),section_pos.y(),section_pos.z()));
+ if (x_section.id() == 0)
+ {
+ cladding_place = BC420_vol.placeVolume(section_vol,section_transform);
+ }
+ if (x_section.id() == 1)
+ {
+ core_place = BC420_vol.placeVolume(section_vol,section_transform);
+ }
+ }
+ surface_vol.placeVolume(cut1_vol,cut1_transform);
+ dd4hep::PlacedVolume BC420_place = surface_vol.placeVolume(BC420_vol,BC420_transform);
+ //BC420_place.addPhysVolID("Stripe",i2+1);
+ dd4hep::PlacedVolume surf_place = strip_vol.placeVolume(surface_vol,surface_transform);
+ int lnum = ( ( 2 * ( i0 % 2 ) - 1 ) * ( 2 * i1 - 1 ) + 1 ) / 2;
+ //surf_place.addPhysVolID("Layer", lnum+1);
+ //surf_place.addPhysVolID("SiPM",0);
+ dd4hep::PlacedVolume SiPM_place1 = strip_vol.placeVolume(SiPM_vol,SiPM_transform1);
+ SiPM_place1.addPhysVolID("SiPM",1);
+ dd4hep::PlacedVolume SiPM_place2 = strip_vol.placeVolume(SiPM_vol,SiPM_transform2);
+ SiPM_place2.addPhysVolID("SiPM",2);
+ dd4hep::PlacedVolume strip_place = env_vol.placeVolume(strip_vol,strip_transform);
+ strip_place.addPhysVolID("Stripe", i2+1).addPhysVolID("Layer", lnum+1);
+ dd4hep::OpticalSurfaceManager surfMgr = theDetector.surfaceManager();
+ std::string optical_surf = strip_name + "_surf";
+ std::string optical_fiber = strip_name + "_fiber";
+ dd4hep::OpticalSurface Surf_stripe = surfMgr.opticalSurface("Muon_surf_stripe");
+ dd4hep::OpticalSurface Surf_fiber = surfMgr.opticalSurface("Muon_surf_fiber");
+ dd4hep::BorderSurface surface_stripe( theDetector, sdet, optical_surf, Surf_stripe, BC420_place, surf_place);
+ dd4hep::BorderSurface surface_fiber( theDetector, sdet, optical_fiber, Surf_fiber, core_place, cladding_place);
+ }
+ }
+ dd4hep::PlacedVolume env_place = superlayer_vol.placeVolume(env_vol,env_transform);
+ env_place.addPhysVolID("Env",i0+1);
+ }
+ dd4hep::PlacedVolume superlayer_place = envelope.placeVolume(superlayer_vol,superlayer_transform);
+ superlayer_place.addPhysVolID("Superlayer",i+1);
+ }
+ dd4hep::PlacedVolume pv;
+ dd4hep::DetElement both_endcaps(det_name,2000);
+ dd4hep::Volume motherVol = theDetector.pickMotherVolume(both_endcaps);
+ dd4hep::DetElement sdetA = sdet;
+ dd4hep::Ref_t(sdetA)->SetName((det_name+"_A").c_str());
+ dd4hep::DetElement sdetB = sdet.clone(det_name+"_B",2002);
+ pv = assembly.placeVolume(envelope,dd4hep::Transform3D(dd4hep::Rotation3D(dd4hep::RotationZ(90*dd4hep::degree)),dd4hep::Position(0,0,pos.y())));
+ pv.addPhysVolID("Endcap",1);
+
+ sdetA.setPlacement(pv);
+
+ pv = assembly.placeVolume(envelope,dd4hep::Transform3D(dd4hep::Rotation3D(dd4hep::RotationZ(90*dd4hep::degree)),dd4hep::Position(0,0,-1 * pos.y())));
+ pv.addPhysVolID("Endcap",2);
+
+ sdetB.setPlacement(pv);
+
+ pv = motherVol.placeVolume(assembly);
+// pv.addPhysVolID("system",x_det.id());
+ both_endcaps.setPlacement(pv);
+ both_endcaps.add(sdetA);
+ both_endcaps.add(sdetB);
+
+ MYDEBUG("create_detector DONE. ");
+ return both_endcaps;
+}
+
+DECLARE_DETELEMENT(Muon_Endcap_v01_01, create_detector)
diff --git a/Simulation/DetSimSD/CMakeLists.txt b/Simulation/DetSimSD/CMakeLists.txt
index 0c2d5a844ac33b203b1d33507f9e198fe8e6334b..b3d444c7778cf765c846d87d2a4c1ca52aac582f 100644
--- a/Simulation/DetSimSD/CMakeLists.txt
+++ b/Simulation/DetSimSD/CMakeLists.txt
@@ -7,6 +7,8 @@ gaudi_add_library(DetSimSDLib
src/TimeProjectionChamberSensitiveDetector.cpp
src/GenericTrackerSensitiveDetector.cpp
src/TrackerCombineSensitiveDetector.cpp
+ src/MuonBarrelSensitiveDetector.cpp
+ src/MuonEndcapSensitiveDetector.cpp
LINK DetSimInterface
DetInterface
${DD4hep_COMPONENT_LIBRARIES}
@@ -25,6 +27,8 @@ gaudi_add_module(DetSimSD
src/DriftChamberSensDetTool.cpp
src/TimeProjectionChamberSensDetTool.cpp
src/GenericTrackerSensDetTool.cpp
+ src/MuonBarrelSensDetTool.cpp
+ src/MuonEndcapSensDetTool.cpp
LINK DetSimInterface
DetSimSDLib
DetInterface
diff --git a/Simulation/DetSimSD/src/MuonBarrelSensitiveDetector.cpp b/Simulation/DetSimSD/src/MuonBarrelSensitiveDetector.cpp
index 56a2606152af8fda56dce14d317e4c3db025c20b..b386d132d15a534d6f7e4f167b94173df13592ad 100644
--- a/Simulation/DetSimSD/src/MuonBarrelSensitiveDetector.cpp
+++ b/Simulation/DetSimSD/src/MuonBarrelSensitiveDetector.cpp
@@ -29,7 +29,7 @@ G4bool MuonBarrelSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory
auto pname = currentTrack->GetParticleDefinition()->GetParticleName();
auto touchable = step->GetPreStepPoint()->GetTouchable();
auto physical = touchable->GetVolume();
- if ( physical->GetName() == "surface" )
+/* if ( physical->GetName() == "surface" )
{
if ( pname == "opticalphoton" )
{
@@ -39,7 +39,7 @@ G4bool MuonBarrelSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory
currentTrack->SetTrackStatus(fStopAndKill);
}
}
- }
+ } */
dd4hep::sim::Geant4StepHandler h(step);
if (fabs(h.trackDef()->GetPDGCharge()) < 0.01) return true;
@@ -61,12 +61,7 @@ G4bool MuonBarrelSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory
h.track->GetGlobalTime());
if ( hit ) {
- int i = 0;
- if ( pname == "opticalphoton" && physical->GetName() == "SiPM")
- {
- i = 1;
- }
- hit->cellID = i * getCellID( step ) ;
+ hit->cellID = getCellID( step ) ;
hit->energyDeposit = step->GetTotalEnergyDeposit();
hit->position = position;
hit->momentum = direction;
diff --git a/Simulation/DetSimSD/src/MuonEndcapSensitiveDetector.cpp b/Simulation/DetSimSD/src/MuonEndcapSensitiveDetector.cpp
index 0efa231f13b23b03ddbb208699c9093c4880615b..03904cc875f75b9d593a8e9830a4a750e33a8d61 100644
--- a/Simulation/DetSimSD/src/MuonEndcapSensitiveDetector.cpp
+++ b/Simulation/DetSimSD/src/MuonEndcapSensitiveDetector.cpp
@@ -29,7 +29,7 @@ G4bool MuonEndcapSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory
auto pname = currentTrack->GetParticleDefinition()->GetParticleName();
auto touchable = step->GetPreStepPoint()->GetTouchable();
auto physical = touchable->GetVolume();
- if ( physical->GetName() == "surface" )
+/* if ( physical->GetName() == "surface" )
{
if ( pname == "opticalphoton" )
{
@@ -39,7 +39,7 @@ G4bool MuonEndcapSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory
currentTrack->SetTrackStatus(fStopAndKill);
}
}
- }
+ }*/
dd4hep::sim::Geant4StepHandler h(step);
if (fabs(h.trackDef()->GetPDGCharge()) < 0.01) return true;
@@ -61,12 +61,7 @@ G4bool MuonEndcapSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory
h.track->GetGlobalTime());
if ( hit ) {
- int i = 0;
- if ( pname == "opticalphoton" && physical->GetName() == "SiPM")
- {
- i = 1;
- }
- hit->cellID = i * getCellID( step ) ;
+ hit->cellID = getCellID( step ) ;
hit->energyDeposit = step->GetTotalEnergyDeposit();
hit->position = position;
hit->momentum = direction;