Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • maxt/CEPCSW
  • zyjonah/CEPCSW
  • wanjw03/CEPCSW
  • yudian2002/CEPCSW
  • starr136a/CEPCSW
  • fucd/CEPCSW
  • shuohan/CEPCSW
  • glliu/CEPCSW
  • zhangjinxian/CEPCSW_20250110
  • zhangyz/CEPCSW
  • zhangyang98/cepcsw-official
  • shuxian/CEPCSW
  • lihp29/CEPCSW
  • zhangkl/CEPCSW
  • laipz/CEPCSW
  • lizhihao/CEPCSW
  • yudian2002/cepcsw-otk-endcap-update-01
  • xuchj7/CEPCSW
  • wuchonghao9612/CEPCSW
  • chenye/CEPCSW
  • zhangxm/CEPCSW
  • mengwq/CEPCSW
  • yudian2002/cepcsw-geo-upgrade-v-2
  • fangwx/CEPCSW
  • yudian2002/cepcsw-geo-upgrade
  • jiangxj/CEPCSW
  • yudian2002/cepcsw-otk-end-cap-development
  • guolei/CEPCSW
  • chenbp/CEPCSW
  • dhb112358/CEPCSW
  • tangyb/CEPCSW
  • luhc/CEPCSW
  • songwz/cepcsw-tdr
  • yudian2002/cepcsw-ote-development
  • yudian2002/cepcsw-otb-development
  • dudejing/CEPCSW
  • shexin/CEPCSW
  • sunwy/CEPCSW
  • 1810337/CEPCSW
  • cepcsw/CEPCSW
  • tyzhang/CEPCSW
  • fucd/CEPCSW1
  • xiaolin.wang/CEPCSW
  • wangchu/CEPCSW
  • 201840277/CEPCSW
  • zhaog/CEPCSW
  • shihy/cepcsw-dose
  • myliu/CEPCSW
  • thinking/CEPCSW
  • lihn/CEPCSW
  • 221840222/CEPCSW
  • gongjd1119/CEPCSW
  • tanggy/CEPCSW
  • lintao/CEPCSW
  • guofangyi/cepcsw-release
  • shihy/CEPCSW
  • 1365447033/CEPCSW
  • lizhan/CEPCSW
  • shixin/CEPCSW
  • cepc/CEPCSW
60 results
Show changes
Showing
with 2284 additions and 95 deletions
......@@ -10,6 +10,7 @@
<constant name="BeamPipe_Be_total_thickness" value="BeamPipe_Be_inner_thickness+BeamPipe_Cooling_thickness+BeamPipe_Be_outer_thickness"/>
<constant name="BeamPipe_Al_thickness" value="BeamPipe_Be_total_thickness"/>
<constant name="BeamPipe_Cu_thickness" value="2.0*mm"/>
<constant name="BeamPipe_Iron_thickness" value="2.5*mm"/>
<constant name="BeamPipe_CentralBe_zmax" value="120*mm"/>
<constant name="BeamPipe_CentralAl_zmax" value="205*mm"/>
......@@ -20,12 +21,16 @@
<constant name="BeamPipe_Crotch_zmax" value="855*mm"/>
<constant name="BeamPipe_FirstSeparated_zmax" value="1110*mm"/>
<constant name="BeamPipe_SecondSeparated_zmax" value="2200*mm"/>
<constant name="BeamPipe_end_z" value="12*m"/>
<constant name="BeamPipe_QD0_zmax" value="3950*mm"/>
<constant name="BeamPipe_QF1_zmin" value="4450*mm"/>
<constant name="BeamPipe_QF1_zmax" value="5910*mm"/>
<constant name="BeamPipe_end_z" value="7050*mm"/>
<constant name="BeamPipe_Central_inner_radius" value="14*mm"/>
<constant name="BeamPipe_Expanded_inner_radius" value="20*mm"/>
<constant name="BeamPipe_Upstream_inner_radius" value="6*mm"/>
<constant name="BeamPipe_Dnstream_inner_radius" value="10*mm"/>
<constant name="BeamPipe_QF1_inner_radius" value="20.5*mm"/>
<constant name="BeamPipe_Crotch_hole_height" value="30.67*mm"/>
<constant name="BeamPipe_VertexRegion_rmax" value="BeamPipe_Central_inner_radius+BeamPipe_Al_thickness"/>
<constant name="BeamPipe_ForwardRegion_rmax" value="BeamPipe_Expanded_inner_radius+BeamPipe_Cu_thickness"/>
......@@ -34,53 +39,182 @@
</define>
<detectors>
<detector name="BeamPipe" type="DD4hep_CRDBeamPipe_v01" vis="BeamPipeVis">
<detector name="BeamPipe" type="CRDBeamPipe_v01" vis="BeamPipeVis">
<parameter crossingangle="CepC_Main_Crossing_Angle" />
<envelope vis="BlueVis">
<envelope>
<shape type="Assembly"/>
</envelope>
<section type ="Center" name="IPInnerTube" zStart="0" zEnd="BeamPipe_CentralBe_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius"/>
<layer material="G4_Be" thickness="BeamPipe_Be_inner_thickness"/>
<layer material="beam" thickness="BeamPipe_Central_inner_radius" vis="VacVis"/>
<layer material="G4_Be" thickness="BeamPipe_Be_inner_thickness" vis="BeamPipeVis"/>
<layer material="G4_PARAFFIN" thickness="BeamPipe_Cooling_thickness"/>
<layer material="G4_Be" thickness="BeamPipe_Be_outer_thickness"/>
<layer material="G4_Be" thickness="BeamPipe_Be_outer_thickness" vis="BeamPipeVis"/>
</section>
<section type="Center" name="IPAl" zStart="BeamPipe_CentralBe_zmax" zEnd="BeamPipe_CentralAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness"/>
<layer material="beam" thickness="BeamPipe_Central_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="BeamPipeVis"/>
</section>
<section type="Center" name="ExpandPipe" zStart="BeamPipe_CentralAl_zmax" zEnd="BeamPipe_ConeAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius" thicknessEnd="BeamPipe_Expanded_inner_radius"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" thicknessEnd="BeamPipe_Al_thickness"/>
<layer material="beam" thickness="BeamPipe_Central_inner_radius" thicknessEnd="BeamPipe_Expanded_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" thicknessEnd="BeamPipe_Al_thickness" vis="BeamPipeVis"/>
</section>
<section type="Center" name="ThickPipe" zStart="BeamPipe_ConeAl_zmax" zEnd="BeamPipe_LinkerAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness"/>
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="OutsideLink" zStart="BeamPipe_LinkerAl_zmax" zEnd="BeamPipe_LinkerCu_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="BeamPipeVis"/>
</section>
<section type="FatWaist" name="Waist" zStart="BeamPipe_LinkerCu_zmax" zEnd="BeamPipe_Waist_zmax" rStart="BeamPipe_Expanded_inner_radius" size="BeamPipe_Crotch_hole_height">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="BeamPipeVis"/>
</section>
<!--CrotchAsymUp&CrotchAsymDn not work to fix, because of problem on convert from TGeo to Geant4-->
<!--section type="CrotchAsymUp" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
<section type="CrotchAsymUp" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
rStart="BeamPipe_Expanded_inner_radius" rEnd="BeamPipe_Upstream_inner_radius" size="BeamPipe_Crotch_hole_height">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" thicknessEnd="ForkAsymThickness"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" thicknessEnd="ForkAsymThickness" vis="BeamPipeVis"/>
</section>
<section type="CrotchAsymDn" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
rStart="BeamPipe_Expanded_inner_radius" rEnd="BeamPipe_Dnstream_inner_radius" size="BeamPipe_Crotch_hole_height">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
</section-->
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="BeamPipeVis"/>
</section>
<section type="FlareLegUp" name="FirstDoublePipe" zStart="BeamPipe_Crotch_zmax" zEnd="BeamPipe_FirstSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Upstream_inner_radius" thicknessEnd="BeamPipe_Dnstream_inner_radius"/>
<layer material="G4_Cu" thickness="ForkAsymThickness" thicknessEnd="BeamPipe_Cu_thickness"/>
<layer material="beam" thickness="BeamPipe_Upstream_inner_radius" thicknessEnd="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="ForkAsymThickness" thicknessEnd="BeamPipe_Cu_thickness" vis="BeamPipeVis"/>
</section>
<section type="FlareLegDn" name="FirstDoublePipe" zStart="BeamPipe_Crotch_zmax" zEnd="BeamPipe_FirstSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="BeamPipeVis"/>
</section>
<section type="Legs" name="QD0Link" zStart="BeamPipe_FirstSeparated_zmax" zEnd="BeamPipe_SecondSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="BeamPipeVis"/>
</section>
<section type="Legs" name="QD0" zStart="BeamPipe_SecondSeparated_zmax" zEnd="BeamPipe_QD0_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="BeamPipeVis"/>
<layer material="G4_Cu" thickness="3.5*mm" vis="BeamPipeVis"/>
<layer material="superconductor" thickness="6.0*mm" vis="BeamPipeVis"/>
<layer material="stainless_steel" thickness="8.0*mm" vis="BeamPipeVis"/>
</section>
<section type="Legs" name="QF1Link" zStart="BeamPipe_QD0_zmax" zEnd="BeamPipe_QF1_zmin" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" thicknessEnd="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="BeamPipeVis"/>
</section>
<section type="Legs" name="QF1" zStart="BeamPipe_QF1_zmin" zEnd="BeamPipe_QF1_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="BeamPipeVis"/>
<layer material="G4_Cu" thickness="3.0*mm" vis="BeamPipeVis"/>
<layer material="superconductor" thickness="6.0*mm" vis="BeamPipeVis"/>
<layer material="stainless_steel" thickness="8.0*mm" vis="BeamPipeVis"/>
</section>
<section type="Legs" name="Farest" zStart="BeamPipe_QF1_zmax" zEnd="BeamPipe_end_z" rStart="0">
<layer material="beam" thickness="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="BeamPipeVis"/>
</section>
<!-- Magnets and their cooling, support -->
<section type="CenterSide" name="Magnet_1" zStart="1160*mm" zEnd="1900*mm" rStart="90*mm">
<layer material="superconductor" thickness="20*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="Magnet_2" zStart="1930*mm" zEnd="3964*mm" rStart="120*mm">
<layer material="superconductor" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="Magnet_3" zStart="3970*mm" zEnd="7000*mm" rStart="185*mm">
<layer material="superconductor" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetShell_1" zStart="970*mm" zEnd="1110*mm" rStart="31*mm">
<layer material="stainless_steel" thickness="1.5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetShell_2" zStart="1110*mm" zEnd="1115*mm" rStart="50.0*mm">
<layer material="stainless_steel" thickness="91.25*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetShell_3" zStart="1115*mm" zEnd="1900*mm" rStart="130.75*mm" rEnd="175*mm">
<layer material="stainless_steel" thickness="10.5*mm" thicknessEnd="65*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetShell_4" zStart="1900*mm" zEnd="3800*mm" rStart="175*mm">
<layer material="stainless_steel" thickness="65*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetShell_5" zStart="3800*mm" zEnd="3910*mm" rStart="175*mm">
<layer material="stainless_steel" thickness="135*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetShell_6" zStart="3910*mm" zEnd="7160*mm" rStart="240*mm">
<layer material="stainless_steel" thickness="70*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_1" zStart="1130*mm" zEnd="1135*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="50*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_2i" zStart="1135*mm" zEnd="1925*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_2o" zStart="1135*mm" zEnd="1900*mm" rStart="120*mm">
<layer material="stainless_steel" thickness="5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_3l" zStart="1900*mm" zEnd="1905*mm" rStart="120*mm">
<layer material="stainless_steel" thickness="25*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_3r" zStart="1925*mm" zEnd="1930*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="35*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_4i" zStart="1930*mm" zEnd="4000*mm" rStart="105*mm">
<layer material="stainless_steel" thickness="5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_4o" zStart="1905*mm" zEnd="3940*mm" rStart="140*mm">
<layer material="stainless_steel" thickness="5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_5l" zStart="3940*mm" zEnd="3945*mm" rStart="140*mm">
<layer material="stainless_steel" thickness="70*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_5r" zStart="4000*mm" zEnd="4005*mm" rStart="105*mm">
<layer material="stainless_steel" thickness="70*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_6i" zStart="4005*mm" zEnd="7050*mm" rStart="170*mm">
<layer material="stainless_steel" thickness="5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_6o" zStart="3945*mm" zEnd="7050*mm" rStart="205*mm">
<layer material="stainless_steel" thickness="5*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_7" zStart="7050*mm" zEnd="7055*mm" rStart="170*mm">
<layer material="stainless_steel" thickness="40*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1l" zStart="1135*mm" zEnd="1160*mm" rStart="80*mm">
<layer material="lN2" thickness="40*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1i" zStart="1160*mm" zEnd="1900*mm" rStart="80*mm">
<layer material="lN2" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1o" zStart="1160*mm" zEnd="1900*mm" rStart="110*mm">
<layer material="lN2" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1r" zStart="1900*mm" zEnd="1925*mm" rStart="80*mm">
<layer material="lN2" thickness="40*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2l" zStart="1905*mm" zEnd="1930*mm" rStart="120*mm">
<layer material="lN2" thickness="20*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2i" zStart="1925*mm" zEnd="3964*mm" rStart="110*mm">
<layer material="lN2" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2o" zStart="1930*mm" zEnd="3945*mm" rStart="130*mm">
<layer material="lN2" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2r1" zStart="3964*mm" zEnd="4000*mm" rStart="110*mm">
<layer material="lN2" thickness="65*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2r2" zStart="3945*mm" zEnd="3964*mm" rStart="130*mm">
<layer material="lN2" thickness="45*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3l" zStart="3945*mm" zEnd="3970*mm" rStart="175*mm">
<layer material="lN2" thickness="30*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3i" zStart="3970*mm" zEnd="7000*mm" rStart="175*mm">
<layer material="lN2" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3o" zStart="3970*mm" zEnd="7000*mm" rStart="195*mm">
<layer material="lN2" thickness="10*mm" vis="BeamPipeVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3r" zStart="7000*mm" zEnd="7050*mm" rStart="175*mm">
<layer material="lN2" thickness="30*mm" vis="BeamPipeVis"/>
</section>
</detector>
</detectors>
......
......@@ -9,7 +9,7 @@
<shape type="BooleanShape" operation="Subtraction" material="Air">
<shape type="Box" dx="Ecal_endcap_center_box_size/2.0" dy="Ecal_endcap_center_box_size/2.0"
dz="EcalEndcapRing_max_z"/>
<shape type="Tube" rmin="0" rmax="EcalEndcapRing_inner_radius - env_safety" dz="2.0*EcalEndcapRing_max_z + env_safety"/>
<shape type="Tube" rmin="0" rmax="EcalEndcapRing_inner_radius" dz="2.0*EcalEndcapRing_max_z + env_safety"/>
<position x="0.5*(EcalEndcapRing_min_z + EcalEndcapRing_max_z)*tan(Ecal_ECRing_Crossing_Angle/2)" y="0" z="0"/>
<!-- position x="0" y="0" z="0"/ -->
......
......@@ -9,7 +9,8 @@
<detector name="FTD" type="FTD_cepc" vis="FTDVis" id="ILDDetID_FTD" limits="Tracker_limits" readout="FTDCollection" insideTrackingVolume="true">
<envelope vis="ILD_FTDVis">
<shape type="BooleanShape" operation="Subtraction" material="Air" >
<shape type="Assembly"/>
<!--shape type="BooleanShape" operation="Subtraction" material="Air" >
<shape type="BooleanShape" operation="Subtraction" material="Air" >
<shape type="BooleanShape" operation="Subtraction" material="Air" >
<shape type="BooleanShape" operation="Subtraction" material="Air" >
......@@ -29,7 +30,7 @@
z="(FTD_half_length-BeamPipe_CentralAl_zmax)/2. + env_safety "/>
<position x="0" y="0" z="-BeamPipe_CentralAl_zmax-(FTD_half_length-BeamPipe_CentralAl_zmax)/2."/>
<rotation x="0" y="180.*deg" z="0" />
</shape>
</shape-->
</envelope>
<type_flags type="DetType_TRACKER + DetType_ENDCAP + DetType_PIXEL + DetType_STRIP "/>
......
......@@ -548,5 +548,20 @@
<fraction n="0.194" ref="Cu" />
</material>
<material name="G4_PARAFFIN">
<D type="density" value="0.93" unit="g/cm3" />
<fraction n="0.148605" ref="H" />
<fraction n="0.851395" ref="C" />
</material>
<material name="superconductor">
<D type="density" value="6.78" unit="g/cm3" />
<fraction n="0.56" ref="Ni" />
<fraction n="0.44" ref="Ti" />
</material>
<material name="lN2">
<D type="density" value="0.807" unit="g/cm3" />
<fraction n="1" ref="N" />
</material>
</materials>
......@@ -14,7 +14,7 @@
<constant name="Field_outer_thickness" value="2550*mm"/>
<!-- VXD -->
<constant name="top_VXD_inner_radius" value="15*mm "/>
<constant name="top_VXD_inner_radius" value="15.5*mm "/>
<constant name="top_VXD_outer_radius" value="101*mm "/>
<constant name="top_VXD_half_length" value="200*mm "/>
......
......@@ -6,7 +6,7 @@
<detectors>
<detector name="TPC" type="TPC10" vis="TPCVis" id="ILDDetID_TPC" limits="Tracker_limits" readout="TPCCollection" insideTrackingVolume="true">
<detector name="TPC" type="TPC10" vis="TPCVis" id="ILDDetID_TPC" limits="TPC_limits" readout="TPCCollection" insideTrackingVolume="true">
<envelope vis="ILD_TPCVis">
......@@ -86,7 +86,7 @@
<readouts>
<readout name="TPCCollection">
<id>system:5,side:-2,layer:9,module:8,sensor:8</id>
<id>system:5,side:-2,layer:13,module:8,sensor:8</id>
</readout>
</readouts>
......
......@@ -61,7 +61,7 @@
external_metal_thickness="0.009*mm" />
<!-- SQL command: "SELECT * FROM cryostat;" -->
<cryostat id="1" alu_skin_inner_radious="100*mm" alu_skin_tickness="0.5*mm" foam_inner_radious="90*mm" foam_tickness="10*mm" foam_half_z="166.6*mm"
endplate_inner_radious="VXD_inner_radius_1+5.6*mm"
endplate_inner_radious="VXD_inner_radius_1"
cryostat_option="1" cryostat_apperture="30*mm" cryostat_apperture_radius="1.5*mm" />
<!-- SQL command: "select * from support_shell;" -->
<support_shell id="0" inner_radious="65*mm" half_z="145*mm" thickess="0.49392*mm" endplate_inner_radious="30*mm" endplate_inner_radius_L1="15.7*mm" endplate_outer_radius_L1="20*mm"
......
//====================================================================
// DD4hep Geometry driver for HcalBarrel
//--------------------------------------------------------------------
// S.Lu, DESY
// F. Gaede, DESY : v04 : prepare for multi segmentation
// 18.04.2017 - copied from SHcalSc04_Barrel_v01.cpp
// - add optional parameter <subsegmentation key="" value=""/>
// defines the segmentation to be used in reconstruction
//====================================================================
#include "DD4hep/Printout.h"
#include "DD4hep/DetFactoryHelper.h"
#include "XML/Utilities.h"
#include "DDRec/DetectorData.h"
#include "DDSegmentation/BitField64.h"
#include "DDSegmentation/TiledLayerGridXY.h"
#include "DDSegmentation/Segmentation.h"
#include "DDSegmentation/MultiSegmentation.h"
#include "LcgeoExceptions.h"
#include <iostream>
#include <vector>
using namespace std;
using dd4hep::_toString;
using dd4hep::Box;
using dd4hep::BUILD_ENVELOPE;
using dd4hep::Detector;
using dd4hep::DetElement;
using dd4hep::IntersectionSolid;
using dd4hep::Material;
using dd4hep::PlacedVolume;
using dd4hep::Position;
using dd4hep::Readout;
using dd4hep::Ref_t;
using dd4hep::Rotation3D;
using dd4hep::RotationZ;
using dd4hep::RotationZYX;
using dd4hep::SensitiveDetector;
using dd4hep::Transform3D;
using dd4hep::Trapezoid;
using dd4hep::Tube;
using dd4hep::Volume;
using dd4hep::rec::LayeredCalorimeterData;
// After reading in all the necessary parameters.
// To check the radius range and the space for placing the total layers
static bool validateEnvelope(double rInner, double rOuter, double radiatorThickness, double layerThickness, int layerNumber, int nsymmetry)
{
bool Error = false;
bool Warning = false;
double spaceAllowed = rOuter * cos(M_PI / nsymmetry) - rInner;
double spaceNeeded = (radiatorThickness + layerThickness) * layerNumber;
double spaceToleranted = (radiatorThickness + layerThickness) * (layerNumber + 1);
double rOuterRecommaned = (rInner + spaceNeeded) / cos(M_PI / 16.);
int layerNumberRecommaned = floor((spaceAllowed) / (radiatorThickness + layerThickness));
if (spaceNeeded > spaceAllowed)
{
printout(dd4hep::ERROR, "SHcalSc04_Barrel_v04", " Layer number is more than it can be built! ");
Error = true;
}
else if (spaceToleranted < spaceAllowed)
{
printout(dd4hep::WARNING, "SHcalSc04_Barrel_v04", " Layer number is less than it is able to build!");
Warning = true;
}
else
{
printout(dd4hep::DEBUG, "SHcalSc04_Barrel_v04", " has been validated and start to build it.");
Error = false;
Warning = false;
}
if (Error)
{
cout << "\n ============> First Help Documentation <=============== \n"
<< " When you see this message, that means you are crashing the module. \n"
<< " Please take a cup of cafe, and think about what you want to do! \n"
<< " Here are few FirstAid# for you. Please read them carefully. \n"
<< " \n"
<< " ### FirstAid 1: ###\n"
<< " If you want to build HCAL within the rInner and rOuter range, \n"
<< " please reduce the layer number to " << layerNumberRecommaned << " \n"
<< " with the current layer thickness structure. \n"
<< " \n"
<< " You may redisgn the layer structure and thickness, too. \n"
<< " \n"
<< " ### FirstAid 2: ###\n"
<< " If you want to build HCAL with this layer number and the layer thickness, \n"
<< " you have to update rOuter to " << rOuterRecommaned * 10. << "*mm \n"
<< " and to inform other subdetector, you need this space for building your design. \n"
<< " \n"
<< " ### FirstAid 3: ###\n"
<< " Do you think that you are looking for another type of HCAL driver? \n"
<< " \n"
<< endl;
throw lcgeo::GeometryException("SHcalSc04_Barrel: Error: Layer number is more than it can be built!");
}
else if (Warning)
{
cout << "\n ============> First Help Documentation <=============== \n"
<< " When you see this warning message, that means you are changing the module. \n"
<< " Please take a cup of cafe, and think about what you want to do! \n"
<< " Here are few FirstAid# for you. Please read them carefully. \n"
<< " \n"
<< " ### FirstAid 1: ###\n"
<< " If you want to build HCAL within the rInner and rOuter range, \n"
<< " You could build the layer number up to " << layerNumberRecommaned << " \n"
<< " with the current layer thickness structure. \n"
<< " \n"
<< " You may redisgn the layer structure and thickness, too. \n"
<< " \n"
<< " ### FirstAid 2: ###\n"
<< " If you want to build HCAL with this layer number and the layer thickness, \n"
<< " you could reduce rOuter to " << rOuterRecommaned * 10. << "*mm \n"
<< " and to reduce the back plate thickness, which you may not need for placing layer. \n"
<< " \n"
<< " ### FirstAid 3: ###\n"
<< " Do you think that you are looking for another type of HCAL driver? \n"
<< " \n"
<< endl;
return Warning;
}
else
{
return true;
}
}
static Ref_t create_detector(Detector &theDetector, xml_h element, SensitiveDetector sens)
{
double boundarySafety = 0.0001;
xml_det_t x_det = element;
string det_name = x_det.nameStr();
int det_id = x_det.id();
DetElement sdet(det_name, det_id);
// --- create an envelope volume and position it into the world ---------------------
Volume envelope = dd4hep::xml::createPlacedEnvelope(theDetector, element, sdet);
dd4hep::xml::setDetectorTypeFlag(element, sdet);
if (theDetector.buildType() == BUILD_ENVELOPE)
return sdet;
//-----------------------------------------------------------------------------------
xml_comp_t x_staves = x_det.staves(); // absorber
Material stavesMaterial = theDetector.material(x_staves.materialStr());
Material air = theDetector.air();
PlacedVolume pv;
sens.setType("calorimeter");
//====================================================================
//
// Read all the constant from ILD_o1_v05.xml
// Use them to build HcalBarrel
//
//====================================================================
double Hcal_inner_radius = theDetector.constant<double>("Hcal_inner_radius");
double Hcal_outer_radius = theDetector.constant<double>("Hcal_outer_radius");
double Hcal_half_length = theDetector.constant<double>("Hcal_half_length");
int Hcal_inner_symmetry = theDetector.constant<int>("Hcal_inner_symmetry");
int Hcal_outer_symmetry = 0; // Fixed shape for Tube, and not allow to modify from compact xml
double Hcal_cell_size = theDetector.constant<double>("Hcal_cell_size");
double Hcal_cell_size_abnormal = theDetector.constant<double>("Hcal_cell_size_abnormal");
double Hcal_scintillator_air_gap = theDetector.constant<double>("Hcal_scintillator_air_gap");
double Hcal_scintillator_ESR_thickness = theDetector.constant<double>("Hcal_scintillator_ESR_thickness");
double Hcal_scintillator_thickness = theDetector.constant<double>("Hcal_scintillator_thickness");
double Hcal_radiator_thickness = theDetector.constant<double>("Hcal_radiator_thickness");
double Hcal_chamber_thickness = theDetector.constant<double>("Hcal_chamber_thickness");
double Hcal_back_plate_thickness = theDetector.constant<double>("Hcal_back_plate_thickness");
double Hcal_lateral_plate_thickness = theDetector.constant<double>("Hcal_lateral_structure_thickness");
double Hcal_stave_gaps = theDetector.constant<double>("Hcal_stave_gaps");
// double Hcal_modules_gap = theDetector.constant<double>("Hcal_modules_gap");
double Hcal_middle_stave_gaps = theDetector.constant<double>("Hcal_middle_stave_gaps");
double Hcal_layer_air_gap = theDetector.constant<double>("Hcal_layer_air_gap");
// double Hcal_cells_size = theDetector.constant<double>("Hcal_cells_size");
int Hcal_nlayers = theDetector.constant<int>("Hcal_nlayers");
//=================================================================================
// if Hcal_outer_radius stands for the radius of circumcircle, comment next line
Hcal_outer_radius /= cos(M_PI / Hcal_inner_symmetry);
//=================================================================================
printout(dd4hep::INFO, "SHcalSc04_Barrel_v04", "Hcal_inner_radius : %e - Hcal_outer_radius %e ", Hcal_inner_radius, Hcal_outer_radius);
validateEnvelope(Hcal_inner_radius, Hcal_outer_radius, Hcal_radiator_thickness, Hcal_chamber_thickness, Hcal_nlayers, Hcal_inner_symmetry);
// fg: this is a bit tricky: we first have to check whether a multi segmentation is used and then, if so, we
// will check the <subsegmentation key="" value=""/> element, for which subsegmentation to use for filling the
// DDRec:LayeredCalorimeterData information.
// Additionally, we need to figure out if there is a TiledLayerGridXY instance defined -
// and in case, there is more than one defined, we need to pick the correct one specified via the
// <subsegmentation key="" value=""/> element.
// This involves a lot of casting: review the API in DD4hep !!
// check if we have a multi segmentation :
//========== fill data for reconstruction ============================
LayeredCalorimeterData *caloData = new LayeredCalorimeterData;
caloData->layoutType = LayeredCalorimeterData::BarrelLayout;
caloData->inner_symmetry = Hcal_inner_symmetry;
caloData->outer_symmetry = Hcal_outer_symmetry;
caloData->phi0 = 0; // fg: also hardcoded below
/// extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ] in mm.
caloData->extent[0] = Hcal_inner_radius;
caloData->extent[1] = Hcal_outer_radius;
caloData->extent[2] = 0.; // Barrel zmin is "0" by default.
caloData->extent[3] = Hcal_half_length;
//====================================================================
//
// general calculated parameters
//
//====================================================================
double Hcal_total_dim_y = Hcal_nlayers * (Hcal_radiator_thickness + Hcal_chamber_thickness) + Hcal_back_plate_thickness;
// double Hcal_y_dim1_for_x = Hcal_outer_radius * cos(M_PI / Hcal_inner_symmetry) - Hcal_inner_radius;
double Hcal_bottom_dim_x = 2. * Hcal_inner_radius * tan(M_PI / Hcal_inner_symmetry) - Hcal_lateral_plate_thickness * 2 - Hcal_stave_gaps;
// double Hcal_normal_dim_z = (2 * Hcal_half_length - Hcal_modules_gap) / 2.;
double Hcal_normal_dim_z = Hcal_half_length;
// only the middle has the steel plate.
// double Hcal_regular_chamber_dim_z = Hcal_normal_dim_z - Hcal_lateral_plate_thickness;
double Hcal_regular_chamber_dim_z = Hcal_normal_dim_z;
// double Hcal_cell_dim_x = Hcal_cells_size;
// double Hcal_cell_dim_z = Hcal_regular_chamber_dim_z / floor (Hcal_regular_chamber_dim_z/Hcal_cell_dim_x);
// ========= Create Hcal Barrel stave ====================================
// It will be the volume for palcing the Hcal Barrel Chamber(i.e. Layers).
// Itself will be placed into the world volume.
// ==========================================================================
// stave modules shaper parameters
double BHX = (Hcal_bottom_dim_x + Hcal_lateral_plate_thickness * 2 + Hcal_stave_gaps) / 2.;
double THX = (Hcal_total_dim_y + Hcal_inner_radius) * tan(M_PI / Hcal_inner_symmetry);
double YXH = Hcal_total_dim_y / 2.;
// double DHZ = (Hcal_normal_dim_z - Hcal_lateral_plate_thickness) / 2.;
double DHZ = Hcal_normal_dim_z;
Trapezoid stave_shaper(THX, BHX, DHZ, DHZ, YXH);
Tube solidCaloTube(0, Hcal_outer_radius, DHZ + boundarySafety);
RotationZYX mrot(0, 0, M_PI / 2.);
Rotation3D mrot3D(mrot);
Position mxyzVec(0, 0, (Hcal_inner_radius + Hcal_total_dim_y / 2.));
Transform3D mtran3D(mrot3D, mxyzVec);
IntersectionSolid barrelModuleSolid(stave_shaper, solidCaloTube, mtran3D);
Volume EnvLogHcalModuleBarrel(det_name + "_module", barrelModuleSolid, stavesMaterial);
EnvLogHcalModuleBarrel.setAttributes(theDetector, x_staves.regionStr(), x_staves.limitsStr(), x_staves.visStr());
// stave modules lateral plate shaper parameters
// double BHX_LP = BHX;
// double THX_LP = THX;
// double YXH_LP = YXH;
// // build lateral palte here to simulate lateral plate in the middle of barrel.
// double DHZ_LP = Hcal_lateral_plate_thickness / 2.0;
// Trapezoid stave_shaper_LP(THX_LP, BHX_LP, DHZ_LP, DHZ_LP, YXH_LP);
// Tube solidCaloTube_LP(0, Hcal_outer_radius, DHZ_LP + boundarySafety);
// IntersectionSolid Module_lateral_plate(stave_shaper_LP, solidCaloTube_LP, mtran3D);
// Volume EnvLogHcalModuleBarrel_LP(det_name + "_Module_lateral_plate", Module_lateral_plate, stavesMaterial);
// EnvLogHcalModuleBarrel_LP.setAttributes(theDetector, x_det.regionStr(), x_det.limitsStr(), x_det.visStr());
#ifdef SHCALSC04_DEBUG
std::cout << " ==> Hcal_outer_radius: " << Hcal_outer_radius << std::endl;
#endif
//====================================================================
//
// Chambers in the HCAL BARREL
//
//====================================================================
// Build Layer Chamber fill with air, which include the tolarance space at the two side
// place the slice into the Layer Chamber
// Place the Layer Chamber into the Stave module
// place the Stave module into the asembly Volume
// place the module middle lateral plate into asembly Volume
double x_halflength; // dimension of an Hcal barrel layer on the x-axis
double y_halfheight; // dimension of an Hcal barrel layer on the y-axis
double z_halfwidth; // dimension of an Hcal barrel layer on the z-axis
x_halflength = 0.; // Each Layer the x_halflength has new value.
y_halfheight = Hcal_chamber_thickness / 2.;
z_halfwidth = Hcal_regular_chamber_dim_z;
double xOffset = 0.; // the x_halflength of a barrel layer is calculated as a
// barrel x-dimension plus (bottom barrel) or minus
//(top barrel) an x-offset, which depends on the angle M_PI/Hcal_inner_symmetry
double xShift = 0.; // Geant4 draws everything in the barrel related to the
// center of the bottom barrel, so we need to shift the layers to
// the left (or to the right) with the quantity xShift
// read sensitive cell parameters and create it
// xml_comp_t x_scintillator = x_det.solid();
// Material sensitiveMaterial = theDetector.material(x_scintillator.materialStr());
// xml_comp_t x_ESR = x_det.shape();
// Material ladderMaterial = theDetector.material(x_ESR.materialStr());
Volume cell_vol;
Volume scintillator_vol;
Volume cell_vol_abnormal;
Volume scintillator_vol_abnormal;
xml_comp_t x_layer_tmp(x_det.child(_U(layer)));
for (xml_coll_t k(x_layer_tmp, _U(slice)); k; ++k)
{
xml_comp_t x_slice = k;
if (x_slice.isSensitive())
{
// child elements: ladder and sensitive
xml_comp_t x_sensitive(x_slice.child(_U(sensitive)));
xml_comp_t x_ladder(x_slice.child(_U(ladder)));
Material sensitiveMaterial = theDetector.material(x_sensitive.materialStr());
Material ladderMaterial = theDetector.material(x_ladder.materialStr());
// Store scintillator thickness
double cell_thickness = Hcal_scintillator_thickness + 2 * Hcal_scintillator_ESR_thickness;
double cell_size = 2 * Hcal_scintillator_ESR_thickness + Hcal_cell_size;
// place sensitive cell into ESR cell
string cell_name = "cell";
string scintillator_name = cell_name + "_scintillator";
// create sensitive cell with ESR
Box cell_box(cell_size / 2., cell_size / 2., cell_thickness / 2.);
// string cell_name=
// Volume cell_vol_tmp(cell_name, cell_box, ladderMaterial);
cell_vol = Volume(cell_name, cell_box, ladderMaterial);
cell_vol.setAttributes(theDetector, x_ladder.regionStr(), x_ladder.limitsStr(), x_ladder.visStr());
Box scintillator_box(Hcal_cell_size / 2., Hcal_cell_size / 2., Hcal_scintillator_thickness / 2.);
// Volume scintillator_vol_tmp(scintillator_name, scintillator_box, sensitiveMaterial);
scintillator_vol = Volume(scintillator_name, scintillator_box, sensitiveMaterial);
scintillator_vol.setAttributes(theDetector, x_sensitive.regionStr(), x_sensitive.limitsStr(), x_sensitive.visStr());
scintillator_vol.setSensitiveDetector(sens);
cell_vol.placeVolume(scintillator_vol, Position(0., 0., 0.));
// cout << x_ladder.visStr() << " " << x_sensitive.visStr() << endl;
///////////////////////////////
// abnormal cell //
///////////////////////////////
double cell_size_abnormal = 2 * Hcal_scintillator_ESR_thickness + Hcal_cell_size_abnormal;
// place sensitive cell into ESR cell
string cell_name_abnormal = "cell_abnormal";
string scintillator_name_abnormal = cell_name_abnormal + "_scintillator_abnormal";
// create sensitive cell with ESR
Box cell_box_abnormal(cell_size_abnormal / 2., cell_size / 2., cell_thickness / 2.);
// string cell_name=
// Volume cell_vol_tmp_abnormal(cell_name_abnormal, cell_box_abnormal, ladderMaterial);
cell_vol_abnormal = Volume(cell_name_abnormal, cell_box_abnormal, ladderMaterial);
cell_vol_abnormal.setAttributes(theDetector, x_ladder.regionStr(), x_ladder.limitsStr(), x_ladder.visStr());
Box scintillator_box_abnormal(Hcal_cell_size_abnormal / 2., Hcal_cell_size / 2., Hcal_scintillator_thickness / 2.);
// Volume scintillator_vol_tmp_abnormal(scintillator_name_abnormal, scintillator_box_abnormal, sensitiveMaterial);
scintillator_vol_abnormal = Volume(scintillator_name_abnormal, scintillator_box_abnormal, sensitiveMaterial);
scintillator_vol_abnormal.setAttributes(theDetector, x_sensitive.regionStr(), x_sensitive.limitsStr(), x_sensitive.visStr());
scintillator_vol_abnormal.setSensitiveDetector(sens);
cell_vol_abnormal.placeVolume(scintillator_vol_abnormal, Position(0., 0., 0.));
}
}
// sensitive cell creating done
//-------------------- start loop over HCAL layers ----------------------
// int n_x_layer_1 = 0;
for (int layer_id = 1; layer_id <= (Hcal_nlayers); layer_id++)
{
double TanPiDiv8 = tan(M_PI / Hcal_inner_symmetry);
double x_total = 0.;
// double x_halfLength;
x_halflength = 0.;
// int layer_id = 0;
// if ((layer_id < Hcal_nlayers) || (layer_id > Hcal_nlayers && layer_id < (2 * Hcal_nlayers)))
// layer_id = layer_id % Hcal_nlayers;
// else if ((layer_id == Hcal_nlayers) || (layer_id == 2 * Hcal_nlayers))
// layer_id = Hcal_nlayers;
//---- bottom barrel------------------------------------------------------------
// if (layer_id * (Hcal_radiator_thickness + Hcal_chamber_thickness) < (Hcal_outer_radius * cos(M_PI / Hcal_inner_symmetry) - Hcal_inner_radius))
// {
xOffset = (layer_id * Hcal_radiator_thickness + (layer_id - 1) * Hcal_chamber_thickness) * TanPiDiv8;
x_total = Hcal_bottom_dim_x - Hcal_middle_stave_gaps + xOffset * 2;
x_halflength = x_total - 2 * Hcal_layer_air_gap;
// x_halfLength = x_halflength / 2.;
// }
// else
// { //----- top barrel -------------------------------------------------
// double y_layerID = layer_id * (Hcal_radiator_thickness + Hcal_chamber_thickness) + Hcal_inner_radius;
// double ro_layer = Hcal_outer_radius - Hcal_radiator_thickness;
// x_total = sqrt(ro_layer * ro_layer - y_layerID * y_layerID);
// x_halflength = x_total - Hcal_middle_stave_gaps;
// x_halfLength = x_halflength / 2.;
// xOffset = (layer_id * Hcal_radiator_thickness + (layer_id - 1) * Hcal_chamber_thickness - Hcal_y_dim1_for_x) / TanPiDiv8 + Hcal_chamber_thickness / TanPiDiv8;
// }
x_halflength = x_halflength / 2.;
LayeredCalorimeterData::Layer caloLayer;
caloLayer.cellSize0 = Hcal_cell_size;
caloLayer.cellSize1 = Hcal_cell_size;
//--------------------------------------------------------------------------------
// build chamber box, with the calculated dimensions
//-------------------------------------------------------------------------------
printout(dd4hep::DEBUG, "SHcalSc04_Barrel_v04", " \n Start to build layer chamber - layer_id: %d", layer_id);
printout(dd4hep::DEBUG, "SHcalSc04_Barrel_v04", " chamber x:y:z: %e:%e:%e", x_halflength * 2., z_halfwidth * 2., y_halfheight * 2.);
// check if x_halflength (scintillator length) is divisible with x_integerTileSize
Box ChamberSolid((x_halflength + Hcal_layer_air_gap), // x + air gaps at two side, do not need to build air gaps individualy.
z_halfwidth, // z attention!
y_halfheight); // y attention!
string ChamberLogical_name = det_name + _toString(layer_id, "_layer%d");
Volume ChamberLogical(ChamberLogical_name, ChamberSolid, air);
ChamberLogical.setAttributes(theDetector, x_layer_tmp.regionStr(), x_layer_tmp.limitsStr(), x_layer_tmp.visStr());
double layer_thickness = y_halfheight * 2.;
double nRadiationLengths = 0.;
double nInteractionLengths = 0.;
double thickness_sum = 0;
nRadiationLengths = Hcal_radiator_thickness / (stavesMaterial.radLength());
nInteractionLengths = Hcal_radiator_thickness / (stavesMaterial.intLength());
thickness_sum = Hcal_radiator_thickness;
//====================================================================
// Create Hcal Barrel Chamber without radiator
// Place into the Hcal Barrel stave, after each radiator
//====================================================================
xml_coll_t c(x_det, _U(layer));
xml_comp_t x_layer = c;
string layer_name = det_name + _toString(layer_id, "_layer%d");
// Create the slices (sublayers) within the Hcal Barrel Chamber.
double slice_pos_z = layer_thickness / 2.;
int slice_number = 0;
for (xml_coll_t k(x_layer, _U(slice)); k; ++k)
{
xml_comp_t x_slice = k;
string slice_name = layer_name + _toString(slice_number, "_slice%d");
double slice_thickness = x_slice.thickness();
Material slice_material = theDetector.material(x_slice.materialStr());
DetElement slice(layer_name, _toString(slice_number, "slice%d"), x_det.id());
slice_pos_z -= slice_thickness / 2.;
// Slice volume & box
Volume slice_vol(slice_name, Box(x_halflength, z_halfwidth, slice_thickness / 2.), slice_material);
slice_vol.setAttributes(theDetector, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
nRadiationLengths += slice_thickness / (2. * slice_material.radLength());
nInteractionLengths += slice_thickness / (2. * slice_material.intLength());
thickness_sum += slice_thickness / 2;
if (x_slice.isSensitive())
{
// Store "inner" quantities
caloLayer.inner_nRadiationLengths = nRadiationLengths;
caloLayer.inner_nInteractionLengths = nInteractionLengths;
caloLayer.inner_thickness = thickness_sum;
// Store scintillator thickness
caloLayer.sensitive_thickness = Hcal_scintillator_thickness;
double cell_size = 2 * Hcal_scintillator_ESR_thickness + Hcal_cell_size;
double cell_size_abnormal = 2 * Hcal_scintillator_ESR_thickness + Hcal_cell_size_abnormal;
double cell_x_offset = 0, cell_z_offset = 0, cell_y_offset = 0;
// place cell into slice one by one
double total_cell_size = cell_size + Hcal_scintillator_air_gap; // include air gap
double total_cell_size_abnormal = cell_size_abnormal + Hcal_scintillator_air_gap; // include air gap
int n_x = (2 * x_halflength) / total_cell_size;
int n_z = (2 * z_halfwidth) / total_cell_size;
int nx_abnormal = (2 * x_halflength - n_x * total_cell_size) / (total_cell_size_abnormal - total_cell_size);
n_x -= nx_abnormal;
// if(layer_id==1){n_x_layer_1=n_x;}
// else{
// n_x=(n_x-n_x_layer_1)/2;
// n_x=n_x*2+n_x_layer_1;
// }
for (int index_cell_z = 0; index_cell_z < n_z; index_cell_z++)
{
cell_x_offset = (n_x * total_cell_size + nx_abnormal * total_cell_size_abnormal) / 2.;
cell_z_offset = (n_z / 2. - index_cell_z - 0.5) * total_cell_size;
for (int index_cell_x = 0; index_cell_x < n_x; index_cell_x++)
{
cell_x_offset -= total_cell_size / 2.;
int cell_number = index_cell_x + 100 * index_cell_z;
string cell_name = slice_name + _toString(cell_number, "_cell%d");
string scintillator_name = cell_name + "_scintillator";
// cell_y_offset = slice_thickness / 2.;
PlacedVolume cell_phv = slice_vol.placeVolume(cell_vol, Position(cell_x_offset, cell_z_offset, cell_y_offset));
cell_phv.addPhysVolID("tile", cell_number);
DetElement cell(cell_name, _toString(cell_number, "cell%d"), cell_number);
cell.setPlacement(cell_phv);
cell_x_offset -= total_cell_size / 2.;
}
for (int index_cell_x = 0; index_cell_x < nx_abnormal; index_cell_x++)
{
cell_x_offset -= total_cell_size_abnormal / 2.;
int cell_number = index_cell_x + n_x + 100 * index_cell_z;
string cell_name = slice_name + _toString(cell_number, "_cell%d");
string scintillator_name = cell_name + "_scintillator";
// cell_y_offset = slice_thickness / 2.;
PlacedVolume cell_phv = slice_vol.placeVolume(cell_vol_abnormal, Position(cell_x_offset, cell_z_offset, cell_y_offset));
cell_phv.addPhysVolID("tile", cell_number);
DetElement cell(cell_name, _toString(cell_number, "cell%d"), cell_number);
cell.setPlacement(cell_phv);
cell_x_offset -= total_cell_size_abnormal / 2.;
}
}
//printf("layerID: %2d, x_length: %3.3lf, x_cell: %3.3lf, x_cell_abnormal: %3.3lf, x_dead: %3.3lf, z_length: %3.3lf,z_cell: %3.3lf, z_dead: %3.3lf,\n", layer_id, 2 * x_halflength, n_x * total_cell_size, nx_abnormal * total_cell_size_abnormal, 2 * x_halflength - n_x * total_cell_size - nx_abnormal * total_cell_size_abnormal, 2 * z_halfwidth, n_z * total_cell_size, 2 * z_halfwidth - n_z * total_cell_size);
// Reset counters to measure "outside" quantitites
nRadiationLengths = 0.;
nInteractionLengths = 0.;
thickness_sum = 0.;
// }
}
nRadiationLengths += slice_thickness / (2. * slice_material.radLength());
nInteractionLengths += slice_thickness / (2. * slice_material.intLength());
thickness_sum += slice_thickness / 2;
// Set region, limitset, and vis.
// slice_vol.setAttributes(theDetector, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
// slice PlacedVolume
PlacedVolume slice_phv = ChamberLogical.placeVolume(slice_vol, Position(0., 0., slice_pos_z));
slice_phv.addPhysVolID("layer", layer_id);
slice.setPlacement(slice_phv);
// Increment z position for next slice.
slice_pos_z -= slice_thickness / 2.;
// Increment slice number.
++slice_number;
}
// Store "outer" quantities
caloLayer.outer_nRadiationLengths = nRadiationLengths;
caloLayer.outer_nInteractionLengths = nInteractionLengths;
caloLayer.outer_thickness = thickness_sum;
//--------------------------- Chamber Placements -----------------------------------------
double chamber_x_offset, chamber_y_offset, chamber_z_offset;
chamber_x_offset = xShift;
chamber_z_offset = 0;
chamber_y_offset = -(-Hcal_total_dim_y / 2. + (layer_id - 1) * (Hcal_chamber_thickness + Hcal_radiator_thickness) + Hcal_radiator_thickness + Hcal_chamber_thickness / 2.);
pv = EnvLogHcalModuleBarrel.placeVolume(ChamberLogical,
Position(chamber_x_offset, chamber_z_offset, chamber_y_offset));
//-----------------------------------------------------------------------------------------
if (layer_id <= Hcal_nlayers)
{ // add the first set of layers to the reconstruction data
caloLayer.distance = Hcal_inner_radius + Hcal_total_dim_y / 2.0 - chamber_y_offset - caloLayer.inner_thickness;
// Will be added later at "DDMarlinPandora/DDGeometryCreator.cc:226" to get center of sensitive element
caloLayer.absorberThickness = Hcal_radiator_thickness;
caloData->layers.push_back(caloLayer);
}
//-----------------------------------------------------------------------------------------
} // end loop over HCAL nlayers;
//====================================================================
// Place HCAL Barrel stave module into the envelope
//====================================================================
double stave_phi_offset, module_z_offset = 0;
double Y = Hcal_inner_radius + Hcal_total_dim_y / 2.;
stave_phi_offset = M_PI / Hcal_inner_symmetry - M_PI / 2.;
//-------- start loop over HCAL BARREL staves ----------------------------
for (int stave_id = 1; stave_id <= Hcal_inner_symmetry; stave_id++)
{
double phirot = stave_phi_offset;
RotationZYX srot(0, phirot, M_PI * 0.5);
Rotation3D srot3D(srot);
// for (int module_id = 1; module_id <= 2; module_id++)
// {
Position sxyzVec(-Y * sin(phirot), Y * cos(phirot), module_z_offset);
Transform3D stran3D(srot3D, sxyzVec);
// Place Hcal Barrel volume into the envelope volume
pv = envelope.placeVolume(EnvLogHcalModuleBarrel, stran3D);
pv.addPhysVolID("stave", stave_id);
// pv.addPhysVolID("module", module_id);
pv.addPhysVolID("system", det_id);
// const int staveCounter = (stave_id - 1) * 2 + module_id - 1;
const int staveCounter = stave_id - 1;
DetElement stave(sdet, _toString(staveCounter, "stave%d"), staveCounter);
stave.setPlacement(pv);
// Position xyzVec_LP(-Y * sin(phirot), Y * cos(phirot), lateral_plate_z_offset);
// Transform3D tran3D_LP(srot3D, xyzVec_LP);
// pv = envelope.placeVolume(EnvLogHcalModuleBarrel_LP, tran3D_LP);
// module_z_offset = -module_z_offset;
// lateral_plate_z_offset = -lateral_plate_z_offset;
// }
stave_phi_offset -= M_PI * 2.0 / Hcal_inner_symmetry;
} //-------- end loop over HCAL BARREL staves ----------------------------
sdet.addExtension<LayeredCalorimeterData>(caloData);
return sdet;
}
DECLARE_DETELEMENT(SHcalSc04_Barrel_v04, create_detector)
//====================================================================
// AIDA Detector description implementation
// for LDC AHCAL Endcap
//--------------------------------------------------------------------
//
// Author : S.Lu
// F. Gaede, DESY : v01 : prepare for multi segmentation
// 18.04.2017 - copied from SHcalSc04_Barrel_v01.cpp
// - add optional parameter <subsegmentation key="" value=""/>
// defines the segmentation to be used in reconstruction
//
// Basic idea:
// 1. Create the Hcal Endcap module envelope (16 modules).
// Note: with default material Steel235.
//
// 2. Create the Hcal Endcap Chamber(i.e. Layer) for each module.
// Create the Layer with slices (Polystyrene,Cu,FR4,air).
// Place each slice into the chamber with the right position,
// And registry the IDs for slice
//
// 3. Place the same Layer into the endcap module envelope.
// It will be repeated repeat 48 times.
// And registry the IDs for layer, and endcapID.
//
// 4. Place the endcap module into the world volume,
// with the right position and rotation.
// And registry the IDs for stave,module and endcapID.
//
// 5. Customer material FR4 and Steel235 defined in materials.xml
//
//====================================================================
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/DetType.h"
#include "XML/Layering.h"
#include "XML/Utilities.h"
#include "DDRec/DetectorData.h"
#include "DDSegmentation/BitField64.h"
#include "DDSegmentation/Segmentation.h"
#include "DDSegmentation/MultiSegmentation.h"
#include "LcgeoExceptions.h"
using namespace std;
using dd4hep::BUILD_ENVELOPE;
using dd4hep::BitField64;
using dd4hep::Box;
using dd4hep::DetElement;
using dd4hep::DetType;
using dd4hep::Detector;
using dd4hep::Layering;
using dd4hep::Material;
using dd4hep::PlacedVolume;
using dd4hep::Position;
using dd4hep::Readout;
using dd4hep::Ref_t;
using dd4hep::RotationX;
using dd4hep::Segmentation;
using dd4hep::SensitiveDetector;
using dd4hep::Transform3D;
using dd4hep::Translation3D;
using dd4hep::Volume;
using dd4hep::_toString;
using dd4hep::rec::LayeredCalorimeterData;
static Ref_t create_detector(Detector& theDetector, xml_h element, SensitiveDetector sens) {
xml_det_t x_det = element;
Layering layering(x_det);
xml_dim_t dim = x_det.dimensions();
string det_name = x_det.nameStr();
Material air = theDetector.air();
Material stavesMaterial = theDetector.material(x_det.materialStr());
int numSides = dim.numsides();
int det_id = x_det.id();
DetElement sdet(det_name,det_id);
PlacedVolume pVol;
// --- create an envelope volume and position it into the world ---------------------
Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector, element , sdet ) ;
sdet.setTypeFlag( DetType::CALORIMETER | DetType::ENDCAP | DetType::HADRONIC ) ;
if( theDetector.buildType() == BUILD_ENVELOPE ) return sdet ;
//-----------------------------------------------------------------------------------
sens.setType("calorimeter");
DetElement stave_det("module0stave0",det_id);
// The way to reaad constant from XML/Detector file.
double Hcal_radiator_thickness = theDetector.constant<double>("Hcal_radiator_thickness");
double Hcal_endcap_lateral_structure_thickness = theDetector.constant<double>("Hcal_endcap_lateral_structure_thickness");
double Hcal_endcap_layer_air_gap = theDetector.constant<double>("Hcal_endcap_layer_air_gap");
//double Hcal_cells_size = theDetector.constant<double>("Hcal_cells_size");
double HcalEndcap_inner_radius = theDetector.constant<double>("Hcal_endcap_inner_radius");
double HcalEndcap_outer_radius = theDetector.constant<double>("Hcal_endcap_outer_radius");
double HcalEndcap_min_z = theDetector.constant<double>("Hcal_endcap_zmin");
double HcalEndcap_max_z = theDetector.constant<double>("Hcal_endcap_zmax");
double Hcal_steel_cassette_thickness = theDetector.constant<double>("Hcal_steel_cassette_thickness");
double HcalServices_outer_FR4_thickness = theDetector.constant<double>("Hcal_services_outer_FR4_thickness");
double HcalServices_outer_Cu_thickness = theDetector.constant<double>("Hcal_services_outer_Cu_thickness");
double Hcal_endcap_services_module_width = theDetector.constant<double>("Hcal_endcap_services_module_width");
Material stainless_steel = theDetector.material("stainless_steel");
Material PCB = theDetector.material("PCB");
Material copper = theDetector.material("Cu");
std::cout <<"\n HcalEndcap_inner_radius = "
<<HcalEndcap_inner_radius/dd4hep::mm <<" mm"
<<"\n HcalEndcap_outer_radius = "
<<HcalEndcap_outer_radius/dd4hep::mm <<" mm"
<<"\n HcalEndcap_min_z = "
<<HcalEndcap_min_z/dd4hep::mm <<" mm"
<<"\n HcalEndcap_max_z = "
<<HcalEndcap_max_z/dd4hep::mm <<" mm"
<<std::endl;
Readout readout = sens.readout();
Segmentation seg = readout.segmentation();
BitField64 encoder = seg.decoder();
encoder.setValue(0) ;
// we first have to check whether a multi segmentation is used and then, if so, we
// will check the <subsegmentation key="" value=""/> element, for which subsegmentation to use for filling the
// DDRec:LayeredCalorimeterData information.
// check if we have a multi segmentation :
dd4hep::DDSegmentation::MultiSegmentation* multiSeg =
dynamic_cast< dd4hep::DDSegmentation::MultiSegmentation*>( seg.segmentation() ) ;
int sensitive_slice_number = -1 ;
if( multiSeg ){
try{
// check if we have an entry for the subsegmentation to be used
xml_comp_t segxml = x_det.child( _Unicode( subsegmentation ) ) ;
std::string keyStr = segxml.attr<std::string>( _Unicode(key) ) ;
int keyVal = segxml.attr<int>( _Unicode(value) ) ;
encoder[ keyStr ] = keyVal ;
// if we have a multisegmentation that uses the slice as key, we need to know for the
// computation of the layer parameters in LayeredCalorimeterData::Layer below
if( keyStr == "slice" ){
sensitive_slice_number = keyVal ;
}
} catch(const std::runtime_error &) {
throw lcgeo::GeometryException( "SHcalSc04_Endcaps_v01: Error: MultiSegmentation specified but no "
" <subsegmentation key="" value=""/> element defined for detector ! " ) ;
}
}
//========== fill data for reconstruction ============================
LayeredCalorimeterData* caloData = new LayeredCalorimeterData ;
caloData->layoutType = LayeredCalorimeterData::EndcapLayout ;
caloData->inner_symmetry = 4 ; // hard code cernter box hole
caloData->outer_symmetry = 0 ; // outer tube, or 8 for Octagun
caloData->phi0 = 0 ;
/// extent of the calorimeter in the r-z-plane [ rmin, rmax, zmin, zmax ] in mm.
caloData->extent[0] = HcalEndcap_inner_radius ;
caloData->extent[1] = HcalEndcap_outer_radius ;
caloData->extent[2] = HcalEndcap_min_z ;
caloData->extent[3] = HcalEndcap_max_z ;
int endcapID = 0;
for(xml_coll_t c(x_det.child(_U(dimensions)),_U(dimensions)); c; ++c)
{
xml_comp_t l(c);
double dim_x = l.attr<double>(_Unicode(dim_x));
double dim_y = l.attr<double>(_Unicode(dim_y));
double dim_z = l.attr<double>(_Unicode(dim_z));
double pos_y = l.attr<double>(_Unicode(y_offset));
// Hcal Endcap module shape
double box_half_x= dim_x/2.0; // module width, all are same
double box_half_y= dim_y/2.0; // module length, changing
double box_half_z= dim_z/2.0; // total thickness, all are same
double x_offset = box_half_x*numSides-box_half_x*endcapID*2.0-box_half_x;
double y_offset = pos_y;
Box EndcapModule(box_half_x,box_half_y,box_half_z);
// define the name of each endcap Module
string envelopeVol_name = det_name+_toString(endcapID,"_EndcapModule%d");
Volume envelopeVol(envelopeVol_name,EndcapModule,stavesMaterial);
// Set envelope volume attributes.
envelopeVol.setAttributes(theDetector,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
double FEE_half_x = box_half_x-Hcal_endcap_services_module_width/2.0;
double FEE_half_y = Hcal_endcap_services_module_width/2.0;
double FEE_half_z = box_half_z;
Box FEEBox(FEE_half_x,FEE_half_y,FEE_half_z);
Volume FEEModule("Hcal_endcap_FEE",FEEBox,air);
double FEELayer_thickness = Hcal_steel_cassette_thickness + HcalServices_outer_FR4_thickness + HcalServices_outer_Cu_thickness;
Box FEELayerBox(FEE_half_x,FEE_half_y,FEELayer_thickness/2.0);
Volume FEELayer("FEELayer",FEELayerBox,air);
Box FEELayerSteelBox(FEE_half_x,FEE_half_y,Hcal_steel_cassette_thickness/2.0);
Volume FEELayerSteel("FEELayerSteel",FEELayerSteelBox,stainless_steel);
pVol = FEELayer.placeVolume(FEELayerSteel,
Position(0,
0,
(-FEELayer_thickness/2.0
+Hcal_steel_cassette_thickness/2.0)));
Box FEELayerFR4Box(FEE_half_x,FEE_half_y,HcalServices_outer_FR4_thickness/2.0);
Volume FEELayerFR4("FEELayerFR4",FEELayerFR4Box,PCB);
pVol = FEELayer.placeVolume(FEELayerFR4,
Position(0,
0,
(-FEELayer_thickness/2.0+Hcal_steel_cassette_thickness
+HcalServices_outer_FR4_thickness/2.0)));
Box FEELayerCuBox(FEE_half_x,FEE_half_y,HcalServices_outer_Cu_thickness/2.0);
Volume FEELayerCu("FEELayerCu",FEELayerCuBox,copper);
pVol = FEELayer.placeVolume(FEELayerCu,
Position(0,
0,
(-FEELayer_thickness/2.0+Hcal_steel_cassette_thickness+HcalServices_outer_FR4_thickness +HcalServices_outer_Cu_thickness/2.0)));
// ========= Create Hcal Chamber (i.e. Layers) ==============================
// It will be the sub volume for placing the slices.
// Itself will be placed into the Hcal Endcap modules envelope.
// ==========================================================================
// create Layer (air) and place the slices (Polystyrene,Cu,FR4,air) into it.
// place the Layer into the Hcal Endcap Modules envelope (stavesMaterial).
// First Hcal Chamber position, start after first radiator
double layer_pos_z = - box_half_z + Hcal_radiator_thickness;
// Create Hcal Endcap Chamber without radiator
// Place into the Hcal Encap module envelope, after each radiator
int layer_num = 1;
for(xml_coll_t m(x_det,_U(layer)); m; ++m) {
xml_comp_t x_layer = m;
int repeat = x_layer.repeat(); // Get number of layers.
double layer_thickness = layering.layer(layer_num)->thickness();
string layer_name = envelopeVol_name+"_layer";
DetElement layer(stave_det,layer_name,det_id);
// Active Layer box & volume
double active_layer_dim_x = box_half_x - Hcal_endcap_lateral_structure_thickness - Hcal_endcap_layer_air_gap;
double active_layer_dim_y = box_half_y;
double active_layer_dim_z = layer_thickness/2.0;
// Build chamber including air gap
// The Layer will be filled with slices,
Volume layer_vol(layer_name, Box((active_layer_dim_x + Hcal_endcap_layer_air_gap),
active_layer_dim_y,active_layer_dim_z), air);
encoder["layer"] = layer_num ;
std::vector<double> cellSizeVector = seg.segmentation()->cellDimensions( encoder.getValue() );
LayeredCalorimeterData::Layer caloLayer ;
caloLayer.cellSize0 = cellSizeVector[0];
caloLayer.cellSize1 = cellSizeVector[1];
// ========= Create sublayer slices =========================================
// Create and place the slices into Layer
// ==========================================================================
// Create the slices (sublayers) within the Hcal Chamber.
double slice_pos_z = -(layer_thickness / 2.0);
int slice_number = 0;
double nRadiationLengths=0.;
double nInteractionLengths=0.;
double thickness_sum=0;
nRadiationLengths = Hcal_radiator_thickness/(stavesMaterial.radLength());
nInteractionLengths = Hcal_radiator_thickness/(stavesMaterial.intLength());
thickness_sum = Hcal_radiator_thickness;
for(xml_coll_t k(x_layer,_U(slice)); k; ++k) {
xml_comp_t x_slice = k;
string slice_name = layer_name + _toString(slice_number,"_slice%d");
double slice_thickness = x_slice.thickness();
Material slice_material = theDetector.material(x_slice.materialStr());
DetElement slice(layer,_toString(slice_number,"slice%d"),det_id);
slice_pos_z += slice_thickness / 2.0;
// Slice volume & box
Volume slice_vol(slice_name,Box(active_layer_dim_x,active_layer_dim_y,slice_thickness/2.0),slice_material);
nRadiationLengths += slice_thickness/(2.*slice_material.radLength());
nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
thickness_sum += slice_thickness/2;
if ( x_slice.isSensitive() ) {
slice_vol.setSensitiveDetector(sens);
// if we have a multisegmentation based on slices, we need to use the correct slice here
if ( sensitive_slice_number<0 || sensitive_slice_number == slice_number ) {
//Store "inner" quantities
caloLayer.inner_nRadiationLengths = nRadiationLengths;
caloLayer.inner_nInteractionLengths = nInteractionLengths;
caloLayer.inner_thickness = thickness_sum;
//Store scintillator thickness
caloLayer.sensitive_thickness = slice_thickness;
//Reset counters to measure "outside" quantitites
nRadiationLengths=0.;
nInteractionLengths=0.;
thickness_sum = 0.;
}
}
nRadiationLengths += slice_thickness/(2.*slice_material.radLength());
nInteractionLengths += slice_thickness/(2.*slice_material.intLength());
thickness_sum += slice_thickness/2;
// Set region, limitset, and vis.
slice_vol.setAttributes(theDetector,x_slice.regionStr(),x_slice.limitsStr(),x_slice.visStr());
// slice PlacedVolume
PlacedVolume slice_phv = layer_vol.placeVolume(slice_vol,Position(0,0,slice_pos_z));
slice_phv.addPhysVolID("slice",slice_number);
slice.setPlacement(slice_phv);
// Increment Z position for next slice.
slice_pos_z += slice_thickness / 2.0;
// Increment slice number.
++slice_number;
}
// Set region, limitset, and vis.
layer_vol.setAttributes(theDetector,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
//Store "outer" quantities
caloLayer.outer_nRadiationLengths = nRadiationLengths;
caloLayer.outer_nInteractionLengths = nInteractionLengths;
caloLayer.outer_thickness = thickness_sum;
// ========= Place the Layer (i.e. Chamber) =================================
// Place the Layer into the Hcal Endcap module envelope.
// with the right position and rotation.
// Registry the IDs (layer, stave, module).
// Place the same layer 48 times into Endcap module
// ==========================================================================
for (int j = 0; j < repeat; j++) {
// Layer position in y within the Endcap Modules.
layer_pos_z += layer_thickness / 2.0;
PlacedVolume layer_phv = envelopeVol.placeVolume(layer_vol,
Position(0,0,layer_pos_z));
// registry the ID of Layer, stave and module
layer_phv.addPhysVolID("layer",layer_num);
// then setPlacement for it.
layer.setPlacement(layer_phv);
pVol = FEEModule.placeVolume(FEELayer,
Position(0,0,layer_pos_z));
//-----------------------------------------------------------------------------------------
if ( caloData->layers.size() < (unsigned int)repeat ) {
caloLayer.distance = HcalEndcap_min_z + box_half_z + layer_pos_z
- caloLayer.inner_thickness ; // Will be added later at "DDMarlinPandora/DDGeometryCreator.cc:226" to get center of sensitive element
caloLayer.absorberThickness = Hcal_radiator_thickness ;
caloData->layers.push_back( caloLayer ) ;
}
//-----------------------------------------------------------------------------------------
// ===== Prepare for next layer (i.e. next Chamber) =========================
// Prepare the chamber placement position and the chamber dimension
// ==========================================================================
// Increment the layer_pos_y
// Place Hcal Chamber after each radiator
layer_pos_z += layer_thickness / 2.0;
layer_pos_z += Hcal_radiator_thickness;
++layer_num;
}
}
// =========== Place Hcal Endcap envelope ===================================
// Finally place the Hcal Endcap envelope into the world volume.
// Registry the stave(up/down), module(left/right) and endcapID.
// ==========================================================================
// Acording to the number of staves and modules,
// Place the same Hcal Endcap module volume into the world volume
// with the right position and rotation.
for(int stave_num=0;stave_num<2;stave_num++){
double EndcapModule_pos_x = 0;
double EndcapModule_pos_y = 0;
double EndcapModule_pos_z = 0;
double rot_EM = 0;
double EndcapModule_center_pos_z = HcalEndcap_min_z + box_half_z;
double FEEModule_pos_x = 0;
double FEEModule_pos_y = 0;
double FEEModule_pos_z = 0;
double FEEModule_center_pos_z = HcalEndcap_min_z + box_half_z;
switch (stave_num)
{
case 0 :
EndcapModule_pos_x = x_offset;
EndcapModule_pos_y = y_offset;
FEEModule_pos_x = x_offset;
FEEModule_pos_y = y_offset + box_half_y + Hcal_endcap_services_module_width/2.0;
break;
case 1 :
EndcapModule_pos_x = -x_offset;
EndcapModule_pos_y = -y_offset;
FEEModule_pos_x = -x_offset;
FEEModule_pos_y = -y_offset - box_half_y - Hcal_endcap_services_module_width/2.0;
break;
}
for(int module_num=0;module_num<2;module_num++) {
int module_id = (module_num==0)? 0:6;
rot_EM = (module_id==0)?M_PI:0;
EndcapModule_pos_z = (module_id==0)? -EndcapModule_center_pos_z:EndcapModule_center_pos_z;
PlacedVolume env_phv = envelope.placeVolume(envelopeVol,
Transform3D(RotationX(rot_EM),
Translation3D(EndcapModule_pos_x,
EndcapModule_pos_y,
EndcapModule_pos_z)));
env_phv.addPhysVolID("tower",endcapID);
env_phv.addPhysVolID("stave",stave_num); // y: up /down
env_phv.addPhysVolID("module",module_id); // z: -/+ 0/6
env_phv.addPhysVolID("system",det_id);
FEEModule_pos_z = (module_id==0)? -FEEModule_center_pos_z:FEEModule_center_pos_z;
if (!(endcapID==0))
env_phv = envelope.placeVolume(FEEModule,
Transform3D(RotationX(rot_EM),
Translation3D(FEEModule_pos_x,
FEEModule_pos_y,
FEEModule_pos_z)));
DetElement sd = (module_num==0&&stave_num==0) ? stave_det : stave_det.clone(_toString(module_id,"module%d")+_toString(stave_num,"stave%d"));
sd.setPlacement(env_phv);
}
}
endcapID++;
}
sdet.addExtension< LayeredCalorimeterData >( caloData ) ;
return sdet;
}
DECLARE_DETELEMENT(SHcalSc04_Endcaps_v01, create_detector)
//================================================================================
// Description — End-Cap AHCAL
//--------------------------------------------------------------------------------
// Author: Ji-Yuan CHEN (SJTU; jy_chen@sjtu.edu.cn)
//--------------------------------------------------------------------------------
//
// End-cap AHCAL with 40×40×3 mm³ scintillator tiles.
// Adding the dead materials (cassette, PCB and electronic components, ESR wrapper and steel absorber) and including the air gaps, the size of each cell becomes 40.3×40.3×27.2 mm³.
//
// The inner radius, end-cap thickness, unit size, etc. are directly read from XML file.
//
// Structure in a layer: Cassette → ESR → scintillator → ESR → PCB (including electronic components) → cassette → steel absorber.
//
// Default layout: The absorber is designed as a whole with some space left for the sensitive units (the cross-section is not a polygon); steel frame on the edges of each module; 16 modules (called 'staves' in this program), 48 layers; 72 rows in r direction, with uniform granularity. For a schematic diagram, see Page 3 of <https://indico.ihep.ac.cn/event/22010/contributions/153187/attachments/77666/96430/2024_0324_Calorimeter_Endcaps.pdf> (the design on the left; the numbers have been modified).
//================================================================================
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/DD4hepUnits.h"
#include "DD4hep/Shapes.h"
#include "DD4hep/DetType.h"
#include "XML/Layering.h"
#include "XML/Utilities.h"
#include "DDRec/DetectorData.h"
#include "DDSegmentation/Segmentation.h"
#include <sstream>
#include <cassert>
using std::cout;
using std::endl;
using std::string;
using std::vector;
using std::to_string;
#define MYDEBUG(x) cout << __FILE__ << ":" << __LINE__ << ": " << x << endl;
#define MYDEBUGVAL(x) cout << __FILE__ << ":" << __LINE__ << ": "<< #x << ": " << x << endl;
using dd4hep::Ref_t;
using dd4hep::Detector;
using dd4hep::SensitiveDetector;
using dd4hep::pi;
using dd4hep::mm;
using dd4hep::Material;
using dd4hep::DetElement;
using dd4hep::Volume;
using dd4hep::PolyhedraRegular;
using dd4hep::Tube;
using dd4hep::UnionSolid;
using dd4hep::Trapezoid;
using dd4hep::Box;
using dd4hep::SubtractionSolid;
using dd4hep::PlacedVolume;
using dd4hep::Position;
using dd4hep::RotationX;
using dd4hep::_toString;
using dd4hep::Transform3D;
using dd4hep::RotationZ;
using dd4hep::RotationY;
static Ref_t create_detector(Detector& theDetector, xml_h e, SensitiveDetector sens)
{
xml_det_t x_det = e;
const string det_name = x_det.nameStr();
const string det_type = x_det.typeStr();
const int det_id = x_det.id();
MYDEBUGVAL(det_name)
MYDEBUGVAL(det_type)
MYDEBUGVAL(det_id)
// To prevent overlapping
const double boundary_safety = theDetector.constant<double>("boundary_safety");
// Global geometry
const double r_in = theDetector.constant<double>("hcalendcap_inner_radius");
const double r_out = theDetector.constant<double>("hcalendcap_outer_radius");
const double module_thickness = theDetector.constant<double>("hcalendcap_thickness");
const double pos_z = theDetector.constant<double>("hcalendcap_z");
const int Nmodules = theDetector.constant<int>("Nmodules");
const double angle = 2 * pi / Nmodules;
// Unit size
const double scintillator_xy = theDetector.constant<double>("scintillator_xy");
const double scintillator_z = theDetector.constant<double>("scintillator_z");
const double wrapped_scintillator_xy = theDetector.constant<double>("wrapped_scintillator_xy");
const double wrapped_scintillator_z = theDetector.constant<double>("wrapped_scintillator_z");
// Dead materials
const double cassette_thickness = theDetector.constant<double>("cassette_thickness");
const double esr_thickness = theDetector.constant<double>("esr_thickness"); // Wrapper
[[maybe_unused]] const double sipm_xy = theDetector.constant<double>("sipm_xy");
[[maybe_unused]] const double sipm_z = theDetector.constant<double>("sipm_z");
const double pcb_thickness = theDetector.constant<double>("pcb_thickness");
const double absorber_thickness = theDetector.constant<double>("absorber_thickness");
const double air_gap_xy = 0.5 * (wrapped_scintillator_xy - scintillator_xy) - esr_thickness;
[[maybe_unused]] const double air_gap_z = 0.5 * (wrapped_scintillator_z - scintillator_z) - esr_thickness;
// Odd-shaped cells
const int Nodd = theDetector.constant<int>("Nodd");
const double short_elongation_1 = theDetector.constant<double>("short_elongation_1");
const double short_elongation_2 = theDetector.constant<double>("short_elongation_2");
const double short_elongation_3 = theDetector.constant<double>("short_elongation_3");
const double short_elongation_4 = theDetector.constant<double>("short_elongation_4");
const double short_elongation_5 = theDetector.constant<double>("short_elongation_5");
const double elongation_angle_esr_out = wrapped_scintillator_xy * tan(0.5 * angle); // Elongation of the outer edge of ESR: long side - short side
const double elongation_angle_esr_in = (wrapped_scintillator_xy - esr_thickness / cos(0.5 * angle)) * tan(0.5 * angle); // Elongation of the inner edge of ESR: long side - short side
const double elongation_angle_sc = scintillator_xy * tan(0.5 * angle); // Elongation of the scintillator: long side - short side
const vector<double> short_elongation_esr_out = { short_elongation_1, short_elongation_2, short_elongation_3, short_elongation_4, short_elongation_5 };
assert(Nodd == short_elongation_esr_out.size());
vector<double> short_elongation_sc(short_elongation_esr_out.size()), long_elongation_sc(short_elongation_esr_out.size()), short_elongation_esr_in(short_elongation_esr_out.size()), long_elongation_esr_in(short_elongation_esr_out.size()), long_elongation_esr_out(short_elongation_esr_out.size());
for (int i = 0; i < Nodd; ++i)
{
short_elongation_sc.at(i) = short_elongation_esr_out.at(i) - (air_gap_xy + esr_thickness) / cos(0.5 * angle);
long_elongation_sc.at(i) = short_elongation_sc.at(i) + elongation_angle_sc;
short_elongation_esr_in.at(i) = short_elongation_esr_out.at(i) - esr_thickness / cos(0.5 * angle);
long_elongation_esr_in.at(i) = short_elongation_esr_in.at(i) + elongation_angle_esr_in;
long_elongation_esr_out.at(i) = short_elongation_esr_out.at(i) + elongation_angle_esr_out;
}
// Mechanical structure
const double inner_structure_thickness = theDetector.constant<double>("inner_structure_thickness");
[[maybe_unused]] const double outer_structure_width = theDetector.constant<double>("outer_structure_width");
[[maybe_unused]] const double outer_structure_thickness = theDetector.constant<double>("outer_structure_thickness");
const double frame_thickness = theDetector.constant<double>("frame_thickness");
const double layer_thickness = wrapped_scintillator_z + pcb_thickness + 2 * cassette_thickness + absorber_thickness + 5 * boundary_safety;
const double non_absorber_thickness = wrapped_scintillator_z + pcb_thickness + 3 * boundary_safety;
MYDEBUGVAL(layer_thickness)
// Module size
const double dim_in_frame = (r_in + inner_structure_thickness + frame_thickness) * tan(0.5 * angle);
const double dim_out_frame = r_out * sin(0.5 * angle);
const double dim_in = dim_in_frame - frame_thickness / cos(0.5 * angle);
const double dim_out = dim_out_frame - frame_thickness / cos(0.5 * angle);
const double height = r_out * cos(0.5 * angle) - r_in - inner_structure_thickness;
const double r0 = r_in + inner_structure_thickness + 0.5 * height; // Rotation radius for placing the modules
const int Nrows = (int) (height / (wrapped_scintillator_xy + boundary_safety));
const int Nlayers = (int) (module_thickness / layer_thickness);
int Ncells_phi;
MYDEBUGVAL(Nrows)
MYDEBUGVAL(Nlayers)
// Materials
Material mat_air(theDetector.material("Air"));
Material mat_PCB(theDetector.material("PCB"));
[[maybe_unused]] Material mat_SiPM(theDetector.material("G4_Si"));
Material mat_sensitive(theDetector.material( x_det.materialStr() ));
Material mat_ESR(theDetector.material("G4_ESR"));
Material mat_steel(theDetector.material("Steel235"));
// The detector and mother volumes (world)
DetElement AHCAL(det_name, det_id);
Volume motherVol = theDetector.pickMotherVolume(AHCAL);
// Create two tube-like envelopes to represent the end-cap volumes
// PolyhedraRegular envelope_side(Nmodules, 0.5 * angle, r_in + inner_structure_thickness, r_out, module_thickness);
Tube envelope_side(r_in, r_out, 0.5 * module_thickness);
UnionSolid envelope(envelope_side, envelope_side, Position(0, 0, 2 * pos_z));
Volume envelopeVol(det_name, envelope, mat_steel);
PlacedVolume envelopePlv = motherVol.placeVolume(envelopeVol, Position(0, 0, -pos_z));
envelopePlv.addPhysVolID("system", det_id);
envelopeVol.setVisAttributes(theDetector, "SeeThrough");
AHCAL.setPlacement(envelopePlv);
DetElement stave_det(AHCAL, "sector", det_id);
// Module (stave)
Trapezoid stave(dim_in, dim_out, 0.5 * module_thickness, 0.5 * module_thickness, 0.5 * height);
Volume stave_vol("stave_vol", stave, mat_steel);
stave_vol.setVisAttributes(theDetector, "BlueVis");
// Layer with only wrapped scintillators, electronic components and PCB
Trapezoid layer(dim_in, dim_out, 0.5 * non_absorber_thickness, 0.5 * non_absorber_thickness, 0.5 * height);
Volume layer_vol("layer_vol", layer, mat_steel);
layer_vol.setVisAttributes(theDetector, "SeeThrough");
// Scintillator, ESR, SiPM, PCB, cassette, and absorber
Box normal_scintillator(0.5 * scintillator_xy, 0.5 * scintillator_z, 0.5 * scintillator_xy);
Volume scintillator("scintillator", normal_scintillator, mat_sensitive); // Order: phi → z → r
scintillator.setVisAttributes(theDetector, "SeeThrough");
scintillator.setSensitiveDetector(sens);
[[maybe_unused]] Volume sipm("SiPM", Box(0.5 * sipm_xy, 0.5 * sipm_xy, 0.5 * sipm_z), mat_SiPM);
sipm.setVisAttributes(theDetector, "CyanVis");
Box esr_out(0.5 * wrapped_scintillator_xy, 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_xy);
Box esr_in(0.5 * wrapped_scintillator_xy - esr_thickness, 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
Volume esr("esr", SubtractionSolid(esr_out, esr_in, Position(0, 0, 0)), mat_ESR);
esr.setVisAttributes(theDetector, "SeeThrough");
// Odd-shaped scintillators
Trapezoid odd_add_0_scintillator(0, long_elongation_sc.at(0) - short_elongation_sc.at(0), 0.5 * scintillator_z, 0.5 * scintillator_z, 0.5 * scintillator_xy);
Trapezoid odd_add_45_scintillator(short_elongation_sc.at(1), long_elongation_sc.at(1), 0.5 * scintillator_z, 0.5 * scintillator_z, 0.5 * scintillator_xy);
Trapezoid odd_add_9_scintillator(short_elongation_sc.at(2), long_elongation_sc.at(2), 0.5 * scintillator_z, 0.5 * scintillator_z, 0.5 * scintillator_xy);
Trapezoid odd_add_14_scintillator(short_elongation_sc.at(3), long_elongation_sc.at(3), 0.5 * scintillator_z, 0.5 * scintillator_z, 0.5 * scintillator_xy);
Trapezoid odd_add_17_scintillator(short_elongation_sc.at(4), long_elongation_sc.at(4), 0.5 * scintillator_z, 0.5 * scintillator_z, 0.5 * scintillator_xy);
Box odd_scintillator_0_rect(0.5 * (scintillator_xy + short_elongation_sc.at(0)), 0.5 * scintillator_z, 0.5 * scintillator_xy);
Volume odd_0_scintillator("odd_0_scintillator", UnionSolid(odd_scintillator_0_rect, odd_add_0_scintillator, Position(0.5 * (scintillator_xy + short_elongation_sc.at(0)), 0, 0)), mat_sensitive);
odd_0_scintillator.setVisAttributes(theDetector, "SeeThrough");
odd_0_scintillator.setSensitiveDetector(sens);
Volume odd_45_scintillator("odd_45_scintillator", UnionSolid(normal_scintillator, odd_add_45_scintillator, Position(0.5 * scintillator_xy, 0, 0)), mat_sensitive);
odd_45_scintillator.setVisAttributes(theDetector, "SeeThrough");
odd_45_scintillator.setSensitiveDetector(sens);
Volume odd_9_scintillator("odd_9_scintillator", UnionSolid(normal_scintillator, odd_add_9_scintillator, Position(0.5 * scintillator_xy, 0, 0)), mat_sensitive);
odd_9_scintillator.setVisAttributes(theDetector, "SeeThrough");
odd_9_scintillator.setSensitiveDetector(sens);
Volume odd_14_scintillator("odd_14_scintillator", UnionSolid(normal_scintillator, odd_add_14_scintillator, Position(0.5 * scintillator_xy, 0, 0)), mat_sensitive);
odd_14_scintillator.setVisAttributes(theDetector, "SeeThrough");
odd_14_scintillator.setSensitiveDetector(sens);
Volume odd_17_scintillator("odd_17_scintillator", UnionSolid(normal_scintillator, odd_add_17_scintillator, Position(0.5 * scintillator_xy, 0, 0)), mat_sensitive);
odd_17_scintillator.setVisAttributes(theDetector, "SeeThrough");
odd_17_scintillator.setSensitiveDetector(sens);
// Odd-shaped ESR
// Outer edge
Trapezoid odd_add_0_esr_out(short_elongation_esr_out.at(0), long_elongation_esr_out.at(0), 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_xy);
Trapezoid odd_add_45_esr_out(short_elongation_esr_out.at(1), long_elongation_esr_out.at(1), 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_xy);
Trapezoid odd_add_9_esr_out(short_elongation_esr_out.at(2), long_elongation_esr_out.at(2), 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_xy);
Trapezoid odd_add_14_esr_out(short_elongation_esr_out.at(3), long_elongation_esr_out.at(3), 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_xy);
Trapezoid odd_add_17_esr_out(short_elongation_esr_out.at(4), long_elongation_esr_out.at(4), 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_z, 0.5 * wrapped_scintillator_xy);
UnionSolid odd_0_esr_out(esr_out, odd_add_0_esr_out, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_45_esr_out(esr_out, odd_add_45_esr_out, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_9_esr_out(esr_out, odd_add_9_esr_out, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_14_esr_out(esr_out, odd_add_14_esr_out, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_17_esr_out(esr_out, odd_add_17_esr_out, Position(0.5 * wrapped_scintillator_xy, 0, 0));
// Inner edge
Trapezoid odd_add_0_esr_in(0, long_elongation_esr_in.at(0) - short_elongation_esr_in.at(0), 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
Trapezoid odd_add_45_esr_in(short_elongation_esr_in.at(1), long_elongation_esr_in.at(1), 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
Trapezoid odd_add_9_esr_in(short_elongation_esr_in.at(2), long_elongation_esr_in.at(2), 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
Trapezoid odd_add_14_esr_in(short_elongation_esr_in.at(3), long_elongation_esr_in.at(3), 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
Trapezoid odd_add_17_esr_in(short_elongation_esr_in.at(4), long_elongation_esr_in.at(4), 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
Box odd_esr_in_0_rect(0.5 * (wrapped_scintillator_xy - 2 * esr_thickness + short_elongation_esr_in.at(0)), 0.5 * wrapped_scintillator_z - esr_thickness, 0.5 * wrapped_scintillator_xy - esr_thickness);
UnionSolid odd_0_esr_in(odd_esr_in_0_rect, odd_add_0_esr_in, Position(0.5 * (wrapped_scintillator_xy + short_elongation_esr_in.at(0)), 0, 0));
UnionSolid odd_45_esr_in(esr_in, odd_add_45_esr_in, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_9_esr_in(esr_in, odd_add_9_esr_in, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_14_esr_in(esr_in, odd_add_14_esr_in, Position(0.5 * wrapped_scintillator_xy, 0, 0));
UnionSolid odd_17_esr_in(esr_in, odd_add_17_esr_in, Position(0.5 * wrapped_scintillator_xy, 0, 0));
// Odd-shaped ESR, from the subtraction of outer and inner frames
Volume odd_0_esr("odd_0_esr", SubtractionSolid(odd_0_esr_out, odd_0_esr_in, Position(0, 0, 0)), mat_ESR);
Volume odd_45_esr("odd_45_esr", SubtractionSolid(odd_45_esr_out, odd_45_esr_in, Position(0, 0, 0)), mat_ESR);
Volume odd_9_esr("odd_9_esr", SubtractionSolid(odd_9_esr_out, odd_9_esr_in, Position(0, 0, 0)), mat_ESR);
Volume odd_14_esr("odd_14_esr", SubtractionSolid(odd_14_esr_out, odd_14_esr_in, Position(0, 0, 0)), mat_ESR);
Volume odd_17_esr("odd_17_esr", SubtractionSolid(odd_17_esr_out, odd_17_esr_in, Position(0, 0, 0)), mat_ESR);
// Positions
const double scintillator_pos_z = -0.5 * non_absorber_thickness + boundary_safety + 0.5 * wrapped_scintillator_z;
const double esr_pos_z = scintillator_pos_z;
const double pcb_pos_z = esr_pos_z + 0.5 * wrapped_scintillator_z + boundary_safety + 0.5 * pcb_thickness;
// Loop for placing the units in a layer
for (int ir = 1; ir <= Nrows; ++ir)
{
const double layer_length = dim_in + (ir - 1) * wrapped_scintillator_xy * tan(0.5 * angle);
Ncells_phi = (int) (2 * layer_length / wrapped_scintillator_xy);
const double layer_phi = Ncells_phi * wrapped_scintillator_xy;
const double single_elongation = layer_length - 0.5 * layer_phi;
Volume slice("slice", Trapezoid(layer_length, layer_length + elongation_angle_esr_out, 0.5 * non_absorber_thickness, 0.5 * non_absorber_thickness, 0.5 * (wrapped_scintillator_xy + boundary_safety)), mat_air);
slice.setVisAttributes(theDetector, "SeeThrough");
string slicename = "Slice_" + to_string(ir);
DetElement sd(stave_det, slicename, det_id);
Volume slice_pcb("slice_pcb", Box(0.5 * layer_phi, 0.5 * pcb_thickness, 0.5 * wrapped_scintillator_xy), mat_PCB);
slice_pcb.setVisAttributes(theDetector, "SeeThrough");
PlacedVolume pcb_unit = slice.placeVolume(slice_pcb, Position(0, pcb_pos_z, 0));
pcb_unit.addPhysVolID("row", ir);
for (int iphi = 1; iphi <= Ncells_phi; ++iphi)
{
PlacedVolume scintillator_unit;
PlacedVolume esr_unit;
Position position_scintillator((-0.5 * (Ncells_phi + 1) + iphi) * wrapped_scintillator_xy, scintillator_pos_z, 0);
Position position_esr((-0.5 * (Ncells_phi + 1) + iphi) * wrapped_scintillator_xy, esr_pos_z, 0);
Transform3D transform_scintillator(RotationZ(pi), position_scintillator);
Transform3D transform_esr(RotationZ(pi), position_esr);
if (iphi == 1)
{
if (single_elongation >= short_elongation_esr_out.at(4))
{
scintillator_unit = slice.placeVolume(odd_17_scintillator, transform_scintillator);
esr_unit = slice.placeVolume(odd_17_esr, transform_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(3))
{
scintillator_unit = slice.placeVolume(odd_14_scintillator, transform_scintillator);
esr_unit = slice.placeVolume(odd_14_esr, transform_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(2))
{
scintillator_unit = slice.placeVolume(odd_9_scintillator, transform_scintillator);
esr_unit = slice.placeVolume(odd_9_esr, transform_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(1))
{
scintillator_unit = slice.placeVolume(odd_45_scintillator, transform_scintillator);
esr_unit = slice.placeVolume(odd_45_esr, transform_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(0))
{
scintillator_unit = slice.placeVolume(odd_0_scintillator, Transform3D(RotationZ(pi),
Position((-0.5 * (Ncells_phi + 1) + iphi) * wrapped_scintillator_xy - 0.5 * short_elongation_esr_in.at(0),
scintillator_pos_z,
0)));
esr_unit = slice.placeVolume(odd_0_esr, transform_esr);
}
}
else if (iphi == Ncells_phi)
{
if (single_elongation >= short_elongation_esr_out.at(4))
{
scintillator_unit = slice.placeVolume(odd_17_scintillator, position_scintillator);
esr_unit = slice.placeVolume(odd_17_esr, position_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(3))
{
scintillator_unit = slice.placeVolume(odd_14_scintillator, position_scintillator);
esr_unit = slice.placeVolume(odd_14_esr, position_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(2))
{
scintillator_unit = slice.placeVolume(odd_9_scintillator, position_scintillator);
esr_unit = slice.placeVolume(odd_9_esr, position_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(1))
{
scintillator_unit = slice.placeVolume(odd_45_scintillator, position_scintillator);
esr_unit = slice.placeVolume(odd_45_esr, position_esr);
}
else if (single_elongation >= short_elongation_esr_out.at(0))
{
scintillator_unit = slice.placeVolume(odd_0_scintillator,
Position((-0.5 * (Ncells_phi + 1) + iphi) * wrapped_scintillator_xy + 0.5 * short_elongation_esr_in.at(0),
scintillator_pos_z,
0));
esr_unit = slice.placeVolume(odd_0_esr, position_esr);
}
}
else
{
scintillator_unit = slice.placeVolume(scintillator, position_scintillator);
esr_unit = slice.placeVolume(esr, position_esr);
}
scintillator_unit.addPhysVolID("row", ir).addPhysVolID("phi", iphi);
esr_unit.addPhysVolID("row", ir).addPhysVolID("phi", iphi);
string scintillator_name = "Scintillator_" + to_string(ir) + "_" + to_string(iphi);
DetElement unit(sd, scintillator_name, det_id);
unit.setPlacement(scintillator_unit);
}
PlacedVolume plv = layer_vol.placeVolume(slice, Position(0, 0, (-0.5 * (Nrows + 1) + ir) * (wrapped_scintillator_xy + boundary_safety)));
plv.addPhysVolID("row", ir);
sd.setPlacement(plv);
}
// Loop for placing the layers in a module
for (int ilayer = 1; ilayer <= Nlayers; ++ilayer)
{
PlacedVolume plv = stave_vol.placeVolume(layer_vol, Position(0, (ilayer - 1) * layer_thickness + cassette_thickness + 0.5 * non_absorber_thickness - 0.5 * module_thickness, 0));
plv.addPhysVolID("layer", ilayer);
DetElement sd(stave_det, _toString(ilayer, "layer_%3d"), det_id);
sd.setPlacement(plv);
}
// Loop for placing the modules
for (int i = 0; i < Nmodules; ++i)
{
const double m_rot = i * angle;
const double posx = -r0 * sin(m_rot);
const double posy = r0 * cos(m_rot);
Transform3D transform_neg(RotationZ(m_rot) * RotationX(-0.5 * pi), Position(posx, posy, 0));
Transform3D transform_pos(RotationZ(m_rot) * RotationY(pi) * RotationX(-0.5 * pi), Position(posx, posy, 2 * pos_z));
PlacedVolume plv_neg = envelopeVol.placeVolume(stave_vol, transform_neg);
PlacedVolume plv_pos = envelopeVol.placeVolume(stave_vol, transform_pos);
plv_neg.addPhysVolID("stave", i);
plv_pos.addPhysVolID("stave", i + Nmodules);
DetElement sd_neg(AHCAL, _toString(i, "sector%3d"), det_id);
DetElement sd_pos(AHCAL, _toString(i + Nmodules, "sector%3d"), det_id);
sd_neg.setPlacement(plv_neg);
sd_pos.setPlacement(plv_pos);
}
sens.setType("calorimeter");
MYDEBUG("create_detector FINISHED.");
return AHCAL;
}
DECLARE_DETELEMENT(SHcalSc04_Endcaps_v02, create_detector)
......@@ -327,7 +327,13 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
PlacedVolume pv;
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
// --- create assembly and DetElement for support and service volumes
......@@ -1016,7 +1022,11 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
petalSupport(theDetector, ftd, valuesDict, FTDPetalAirLogical ) ;
VolVec volV = petalSensor( theDetector, ftd, sens, valuesDict, FTDPetalAirLogical );
if (x_det.hasAttr(_U(limits))) {
for (auto vol : volV) {
vol.first.setLimitSet(theDetector, x_det.limitsStr());
}
}
//---- meassurement surface vectors
......@@ -1274,7 +1284,9 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
ftd.addExtension< ZDiskPetalsData >( zDiskPetalsData ) ;
//--------------------------------------
if ( x_det.hasAttr(_U(combineHits)) ) {
ftd.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
return ftd;
}
......
......@@ -327,7 +327,13 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
PlacedVolume pv;
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
// --- create assembly and DetElement for support and service volumes
......@@ -563,6 +569,9 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
{
_dbParDisk.ZStartOuterCylinder = _z_position;
}
_dbParDisk.ZStopOuterCylinder = _zEnd;
_dbParDisk.ZStopInnerCylinder = _zEnd;
break;
case 7:
......@@ -1015,7 +1024,11 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
petalSupport(theDetector, ftd, valuesDict, FTDPetalAirLogical ) ;
VolVec volV = petalSensor( theDetector, ftd, sens, valuesDict, FTDPetalAirLogical );
if (x_det.hasAttr(_U(limits))) {
for (auto vol : volV) {
vol.first.setLimitSet(theDetector, x_det.limitsStr());
}
}
//---- meassurement surface vectors
......@@ -1273,7 +1286,9 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
ftd.addExtension< ZDiskPetalsData >( zDiskPetalsData ) ;
//--------------------------------------
if ( x_det.hasAttr(_U(combineHits)) ) {
ftd.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
return ftd;
}
......
......@@ -77,9 +77,13 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
//PlacedVolume pv;
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
dd4hep::rec::ZPlanarData* zPlanarData = new ZPlanarData ;
......@@ -297,7 +301,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
dd4hep::Volume setSenLogical( dd4hep:: _toString( layer_id,"SET_SenLogical_%02d"), setSenSolid,sensitiveMat ) ;
setSenLogical.setSensitiveDetector(sens);
if (x_det.hasAttr(_U(limits))) setSenLogical.setLimitSet(theDetector, x_det.limitsStr());
//====== create the meassurement surface ===================
......@@ -456,6 +460,10 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
set.setVisAttributes( theDetector, x_det.visStr(), envelope );
if ( x_det.hasAttr(_U(combineHits)) ) {
set.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
return set;
}
......
......@@ -84,9 +84,13 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
dd4hep::PlacedVolume pv;
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
dd4hep::rec::ZPlanarData* zPlanarData = new dd4hep::rec::ZPlanarData ;
......@@ -311,7 +315,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
dd4hep::Volume sitSenLogical( name + dd4hep::_toString( layer_id,"_SenLogical_%02d"), sitSenSolid,sensitiveMat ) ;
sitSenLogical.setSensitiveDetector(sens);
if (x_det.hasAttr(_U(limits))) sitSenLogical.setLimitSet(theDetector, x_det.limitsStr());
//====== create the meassurement surface ===================
dd4hep::rec::Vector3D u,v,n ;
......
......@@ -84,9 +84,13 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
dd4hep::PlacedVolume pv;
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
dd4hep::rec::ZPlanarData* zPlanarData = new dd4hep::rec::ZPlanarData ;
......@@ -307,7 +311,7 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
dd4hep::Volume sitSenLogical( dd4hep::_toString( layer_id,"SIT_SenLogical_%02d"), sitSenSolid,sensitiveMat ) ;
sitSenLogical.setSensitiveDetector(sens);
if (x_det.hasAttr(_U(limits))) sitSenLogical.setLimitSet(theDetector, x_det.limitsStr());
//====== create the meassurement surface ===================
dd4hep::rec::Vector3D u,v,n ;
......@@ -473,6 +477,10 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h
//--------------------------------------
sit.setVisAttributes( theDetector, x_det.visStr(), envelope );
if ( x_det.hasAttr(_U(combineHits)) ) {
sit.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
return sit;
}
......
......@@ -26,7 +26,7 @@ using dd4hep::rec::SurfaceType;
using dd4hep::rec::volSurfaceList;
using dd4hep::rec::VolPlane;
using dd4hep::rec::FixedPadSizeTPCData;
using dd4hep::rec::ConicalSupportData;
/** Construction of TPC detector, ported from Mokka driver TPC10.cc
* Mokka History:
* - modified version of TPC driver by Ties Behnke
......@@ -68,7 +68,13 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
PlacedVolume pv;
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
std::cout << " ** building TPC10_geo in lcgeo " << lcgeo::versionString() << std::endl ;
......@@ -476,7 +482,10 @@ Material endplate_MaterialMix = theDetector.material( "TPC_endplate_mix" ) ;
lowerlayerLog.setSensitiveDetector(sens);
upperlayerLog.setSensitiveDetector(sens);
if (x_det.hasAttr(_U(limits))) {
lowerlayerLog.setLimitSet(theDetector, x_det.limitsStr());
upperlayerLog.setLimitSet(theDetector, x_det.limitsStr());
}
#else
// create just one volume per pad ring
......@@ -506,7 +515,9 @@ Material endplate_MaterialMix = theDetector.material( "TPC_endplate_mix" ) ;
layerDEbwd.setPlacement( pv ) ;
layerLog.setSensitiveDetector(sens);
if (x_det.hasAttr(_U(limits))) {
layerLog.setLimitSet(theDetector, x_det.limitsStr());
}
#endif
}
......@@ -620,9 +631,27 @@ Material endplate_MaterialMix = theDetector.material( "TPC_endplate_mix" ) ;
tpcData->driftLength = dz_Sensitive + dz_Cathode/2.0; // SJA: cathode has to be added as the sensitive region does not start at 0.00
tpcData->zMinReadout = dz_Cathode/2.0;
// tpcData.z_anode = dzTotal - dz_Endplate; // the edge of the readout terminating the drift volume
tpc.addExtension< FixedPadSizeTPCData >( tpcData ) ;
ConicalSupportData* supportData = new ConicalSupportData;
ConicalSupportData::Section section0;
section0.rInner = rMin_GasVolume;
section0.rOuter = rMax_GasVolume;
section0.zPos = dz_GasVolume - dz_Readout;
ConicalSupportData::Section section1;
section1.rInner = rMin_GasVolume;
section1.rOuter = rMax_GasVolume;
section1.zPos = dz_GasVolume;
ConicalSupportData::Section section2;
section2.rInner = rInner;
section2.rOuter = rOuter;
section2.zPos = dz_GasVolume + dz_Endplate;
supportData->sections.push_back(section0);
supportData->sections.push_back(section1);
supportData->sections.push_back(section2);
tpc.addExtension< FixedPadSizeTPCData >( tpcData ) ;
tpc.addExtension< ConicalSupportData > (supportData);
//######################################################################################################################################################################
......
......@@ -74,7 +74,13 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
//-----------------------------------------------------------------------------------
sens.setType("tracker");
if (x_det.hasChild(_U(sensitive))) {
xml_dim_t sd_typ = x_det.child(_U(sensitive));
sens.setType(sd_typ.typeStr());
}
else {
sens.setType("tracker");
}
// --- create assembly and DetElement for support and service volumes
......@@ -1071,7 +1077,7 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
vxd.setVisAttributes(theDetector, "BlueVis" , SiActiveLayerLogical ) ;
SiActiveLayerLogical.setSensitiveDetector(sens);
if (x_det.hasAttr(_U(limits))) SiActiveLayerLogical.setLimitSet(theDetector, x_det.limitsStr());
//====== create the meassurement surface ===================
Vector3D u( 1. , 0. , 0. ) ;
......@@ -1582,10 +1588,12 @@ static Ref_t create_element(Detector& theDetector, xml_h e, SensitiveDetector se
//--------------------------------------
vxd.setVisAttributes( theDetector, x_det.visStr(), envelope );
if ( x_det.hasAttr(_U(combineHits)) ) {
vxd.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
return vxd;
}
DECLARE_DETELEMENT(VXD04,create_element)
......@@ -3,26 +3,47 @@
# CEPC Reference Detector (CRD)
################################################################################
find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED)
# find_package(DD4hep)
find_package(Geant4)
include(${Geant4_USE_FILE})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake )
include( DD4hep )
find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED)
# install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetCRD)
gaudi_add_module(DetCRD
SOURCES src/Calorimeter/CRDEcal_v01.cpp
src/Calorimeter/LongCrystalBarBarrelCalorimeter32Polygon_v01.cpp
src/Calorimeter/LongCrystalBarBarrelCalorimeter32Polygon_v02.cpp
src/Calorimeter/LongCrystalBarEndcapCalorimeter_v01.cpp
src/Calorimeter/LongCrystalBarEndcapCalorimeter_v02.cpp
src/Calorimeter/LongCrystalBarEndcapCalorimeter_v03.cpp
src/Calorimeter/LongCrystalBarEndcapCalorimeter_v04.cpp
src/Calorimeter/CRDEcal_Short_v02.cpp
src/Calorimeter/CRDEcal_Endcap_Short_v01.cpp
src/Calorimeter/RotatedPolyhedraBarrelCalorimeter_v01_geo.cpp
src/Calorimeter/RotatedCrystalCalorimeter_v01_geo.cpp
src/Calorimeter/Lumical_v01_geo.cpp
src/Other/Lumical_v01_geo_beampipe.cpp
src/Other/CRDBeamPipe_v01_geo.cpp
src/Muon/Muon_Barrel_v01_04.cpp
src/Muon/Muon_Endcap_v01_02.cpp
src/Tracker/SiTrackerSkewRing_v01_geo.cpp
src/Tracker/ITK_EndCap_v01.cpp
src/Tracker/SiTrackerStitching_v01_geo.cpp
src/Tracker/SiTrackerStaggeredLadder_v01_geo.cpp
src/Tracker/SiTrackerStaggeredLadder_v02_geo.cpp
src/Tracker/SiTrackerStaggeredLadder_v03_geo.cpp
src/Tracker/SiTrackerComposite_v01_geo.cpp
src/Tracker/SiTrackerComposite_v02_geo.cpp
src/Tracker/SiTrackerComposite_v03_geo.cpp
src/Tracker/TPC_Simple_o1_v01.cpp
src/Tracker/TPC_ModularEndcap_o1_v01.cpp
src/Tracker/SiTracker_itkbarrel_v01_geo.cpp
src/Tracker/SiTracker_itkbarrel_v02_geo.cpp
src/Tracker/SiTracker_otkbarrel_v01_geo.cpp
src/Tracker/SiTracker_otkbarrel_v02_geo.cpp
src/Tracker/SiTracker_otkendcap_v02_geo.cpp
src/Tracker/SiTracker_otkendcap_v01_geo.cpp
src/Tracker/SiTracker_otkbarrel_v02_geo.cpp
src/Tracker/SiTracker_otkendcap_v02_geo.cpp
src/Other/ParaffinEndcap_v01.cpp
src/Other/ConcreteWall_v01.cpp
LINK ${DD4hep_COMPONENT_LIBRARIES}
DetIdentifier
)
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
......@@ -34,3 +55,49 @@ install(TARGETS DetCRD
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
COMPONENT dev)
################################################################################
# Add tests
################################################################################
foreach(detoption TDR_o1_v01 TDR_o1_v02)
add_test(
NAME Test_${detoption}_Sim
COMMAND gaudirun.py Detector/DetCRD/scripts/${detoption}/sim.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
add_test(
NAME Test_${detoption}_Rec
COMMAND gaudirun.py Detector/DetCRD/scripts/${detoption}/tracking.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
add_test(
NAME Test_${detoption}_DD4hep2TGeo
COMMAND geoConverter -compact2tgeo
-input Detector/DetCRD/compact/${detoption}/${detoption}.xml
-output ${detoption}.tgeo.root
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
endforeach()
add_test(
NAME Test_TDR_o1_v01_CaloDigi
COMMAND gaudirun.py Detector/DetCRD/scripts/TDR_o1_v01/calodigi.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
add_test(
NAME Test_TDR_o1_v01_PFA
COMMAND gaudirun.py Detector/DetCRD/scripts/TDR_o1_v01/rec.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
foreach(detoption TDR_o1_v01)
add_test(
NAME Test_${detoption}_Geo
COMMAND checkOverlaps -c Detector/DetCRD/compact/${detoption}/${detoption}.xml -t 0.001
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
endforeach()
......@@ -10,56 +10,190 @@
<define>
<constant name="ForkAsymThickness" value="BeamPipe_Dnstream_inner_radius+BeamPipe_Cu_thickness-BeamPipe_Upstream_inner_radius"/>
<constant name="BeamPipe_QD0_zmax" value="3950*mm"/>
<constant name="BeamPipe_QF1_zmin" value="4450*mm"/>
<constant name="BeamPipe_QF1_zmax" value="5910*mm"/>
<constant name="BeamPipe_QF1_inner_radius" value="20.5*mm"/>
<constant name="BeamPipe_Iron_thickness" value="2.5*mm"/>
</define>
<detectors>
<detector name="BeamPipe" type="DD4hep_CRDBeamPipe_v01" vis="BeamPipeVis">
<detector name="BeamPipe" type="CRDBeamPipe_v01" vis="VacVis">
<parameter crossingangle="CrossingAngle" />
<envelope>
<shape type="Assembly"/>
</envelope>
<section type ="Center" name="IPInnerTube" zStart="0" zEnd="BeamPipe_CentralBe_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius"/>
<layer material="G4_Be" thickness="BeamPipe_Be_inner_thickness"/>
<layer material="G4_PARAFFIN" thickness="BeamPipe_Cooling_thickness"/>
<layer material="G4_Be" thickness="BeamPipe_Be_outer_thickness"/>
<layer material="beam" thickness="BeamPipe_Central_inner_radius" vis="VacVis"/>
<layer material="G4_Be" thickness="BeamPipe_Be_inner_thickness" vis="TubeVis"/>
<layer material="G4_PARAFFIN" thickness="BeamPipe_Cooling_thickness" vis="GrayVis"/>
<layer material="G4_Be" thickness="BeamPipe_Be_outer_thickness" vis="TubeVis"/>
</section>
<section type="Center" name="IPAl" zStart="BeamPipe_CentralBe_zmax" zEnd="BeamPipe_CentralAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness"/>
<layer material="beam" thickness="BeamPipe_Central_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="TubeVis"/>
</section>
<section type="Center" name="ExpandPipe" zStart="BeamPipe_CentralAl_zmax" zEnd="BeamPipe_ConeAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius" thicknessEnd="BeamPipe_Expanded_inner_radius"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" thicknessEnd="BeamPipe_Al_thickness"/>
<layer material="beam" thickness="BeamPipe_Central_inner_radius" thicknessEnd="BeamPipe_Expanded_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" thicknessEnd="BeamPipe_Al_thickness" vis="TubeVis"/>
</section>
<section type="Center" name="ThickPipe" zStart="BeamPipe_ConeAl_zmax" zEnd="BeamPipe_LinkerAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness"/>
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="TubeVis"/>
</section>
<section type="CenterSide" name="OutsideLink" zStart="BeamPipe_LinkerAl_zmax" zEnd="BeamPipe_LinkerCu_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
<layer material="beam" thickness="BeamPipe_Expanded_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="FatWaist" name="Waist" zStart="BeamPipe_LinkerCu_zmax" zEnd="BeamPipe_Waist_zmax" rStart="BeamPipe_Expanded_inner_radius" size="BeamPipe_Crotch_hole_height">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<!--CrotchAsymUp&CrotchAsymDn not work to fix, because of problem on convert from TGeo to Geant4-->
<!--section type="CrotchAsymUp" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
<section type="CrotchAsymUp" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
rStart="BeamPipe_Expanded_inner_radius" rEnd="BeamPipe_Upstream_inner_radius" size="BeamPipe_Crotch_hole_height">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" thicknessEnd="ForkAsymThickness"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" thicknessEnd="ForkAsymThickness" vis="TubeVis"/>
</section>
<section type="CrotchAsymDn" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
rStart="BeamPipe_Expanded_inner_radius" rEnd="BeamPipe_Dnstream_inner_radius" size="BeamPipe_Crotch_hole_height">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
</section-->
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="FlareLegUp" name="FirstDoublePipe" zStart="BeamPipe_Crotch_zmax" zEnd="BeamPipe_FirstSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Upstream_inner_radius" thicknessEnd="BeamPipe_Dnstream_inner_radius"/>
<layer material="G4_Cu" thickness="ForkAsymThickness" thicknessEnd="BeamPipe_Cu_thickness"/>
<layer material="beam" thickness="BeamPipe_Upstream_inner_radius" thicknessEnd="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="ForkAsymThickness" thicknessEnd="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="FlareLegDn" name="FirstDoublePipe" zStart="BeamPipe_Crotch_zmax" zEnd="BeamPipe_FirstSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness"/>
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="QD0Link" zStart="BeamPipe_FirstSeparated_zmax" zEnd="BeamPipe_SecondSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="QD0" zStart="BeamPipe_SecondSeparated_zmax" zEnd="BeamPipe_QD0_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
<layer material="G4_Cu" thickness="3.5*mm" vis="TubeVis"/>
<layer material="superconductor" thickness="6.0*mm" vis="MagentaVis"/>
<layer material="stainless_steel" thickness="8.0*mm" vis="ShellVis"/>
</section>
<section type="Legs" name="QF1Link" zStart="BeamPipe_QD0_zmax" zEnd="BeamPipe_QF1_zmin" rStart="0">
<layer material="beam" thickness="BeamPipe_Dnstream_inner_radius" thicknessEnd="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="QF1" zStart="BeamPipe_QF1_zmin" zEnd="BeamPipe_QF1_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
<layer material="G4_Cu" thickness="3.0*mm" vis="TubeVis"/>
<layer material="superconductor" thickness="6.0*mm" vis="MagentaVis"/>
<layer material="stainless_steel" thickness="8.0*mm" vis="ShellVis"/>
</section>
<section type="Legs" name="Farest" zStart="BeamPipe_QF1_zmax" zEnd="BeamPipe_end_z" rStart="0">
<layer material="beam" thickness="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
</section>
<!-- Magnets and their cooling, support -->
<section type="CenterSide" name="Magnet_1" zStart="1160*mm" zEnd="1900*mm" rStart="90*mm">
<layer material="superconductor" thickness="20*mm" vis="MagentaVis"/>
</section>
<section type="CenterSide" name="Magnet_2" zStart="1930*mm" zEnd="3964*mm" rStart="120*mm">
<layer material="superconductor" thickness="10*mm" vis="MagentaVis"/>
</section>
<section type="CenterSide" name="Magnet_3" zStart="3970*mm" zEnd="7000*mm" rStart="185*mm">
<layer material="superconductor" thickness="10*mm" vis="MagentaVis"/>
</section>
<section type="CenterSide" name="MagnetShell_1" zStart="970*mm" zEnd="1110*mm" rStart="31*mm">
<layer material="stainless_steel" thickness="1.5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_2" zStart="1110*mm" zEnd="1115*mm" rStart="50.0*mm">
<layer material="stainless_steel" thickness="91.25*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_3" zStart="1115*mm" zEnd="1900*mm" rStart="130.75*mm" rEnd="175*mm">
<layer material="stainless_steel" thickness="10.5*mm" thicknessEnd="65*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_4" zStart="1900*mm" zEnd="3800*mm" rStart="175*mm">
<layer material="stainless_steel" thickness="65*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_5" zStart="3800*mm" zEnd="3910*mm" rStart="175*mm">
<layer material="stainless_steel" thickness="135*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_6" zStart="3910*mm" zEnd="7160*mm" rStart="240*mm">
<layer material="stainless_steel" thickness="70*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_1" zStart="1130*mm" zEnd="1135*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="50*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_2i" zStart="1135*mm" zEnd="1925*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_2o" zStart="1135*mm" zEnd="1900*mm" rStart="120*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_3l" zStart="1900*mm" zEnd="1905*mm" rStart="120*mm">
<layer material="stainless_steel" thickness="25*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_3r" zStart="1925*mm" zEnd="1930*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="35*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_4i" zStart="1930*mm" zEnd="4000*mm" rStart="105*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_4o" zStart="1905*mm" zEnd="3940*mm" rStart="140*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_5l" zStart="3940*mm" zEnd="3945*mm" rStart="140*mm">
<layer material="stainless_steel" thickness="70*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_5r" zStart="4000*mm" zEnd="4005*mm" rStart="105*mm">
<layer material="stainless_steel" thickness="70*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_6i" zStart="4005*mm" zEnd="7050*mm" rStart="170*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_6o" zStart="3945*mm" zEnd="7050*mm" rStart="205*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_7" zStart="7050*mm" zEnd="7055*mm" rStart="170*mm">
<layer material="stainless_steel" thickness="40*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1l" zStart="1135*mm" zEnd="1160*mm" rStart="80*mm">
<layer material="lN2" thickness="40*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1i" zStart="1160*mm" zEnd="1900*mm" rStart="80*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1o" zStart="1160*mm" zEnd="1900*mm" rStart="110*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1r" zStart="1900*mm" zEnd="1925*mm" rStart="80*mm">
<layer material="lN2" thickness="40*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2l" zStart="1905*mm" zEnd="1930*mm" rStart="120*mm">
<layer material="lN2" thickness="20*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2i" zStart="1925*mm" zEnd="3964*mm" rStart="110*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2o" zStart="1930*mm" zEnd="3945*mm" rStart="130*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2r1" zStart="3964*mm" zEnd="4000*mm" rStart="110*mm">
<layer material="lN2" thickness="65*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2r2" zStart="3945*mm" zEnd="3964*mm" rStart="130*mm">
<layer material="lN2" thickness="45*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3l" zStart="3945*mm" zEnd="3970*mm" rStart="175*mm">
<layer material="lN2" thickness="30*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3i" zStart="3970*mm" zEnd="7000*mm" rStart="175*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3o" zStart="3970*mm" zEnd="7000*mm" rStart="195*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3r" zStart="7000*mm" zEnd="7050*mm" rStart="175*mm">
<layer material="lN2" thickness="30*mm" vis="BlueVis"/>
</section>
</detector>
</detectors>
......
<lccdd>
<info name="CRD" title="CRD Beam pipe" author="Chengdong Fu" url="no" status="development" version="1.0">
<comment>A beampipe for CRD</comment>
</info>
<display>
<vis name="TubeVis" alpha="0.1" r="1.0" g="0.7" b="0.5" showDaughters="true" visible="true"/>
<vis name="VacVis" alpha="1.0" r="0.0" g="0.0" b="0.0" showDaughters="true" visible="false"/>
</display>
<define>
<!--only needed for asymetry double pipe-->
<!--constant name="ForkAsymThickness" value="BeamPipe_Dnstream_inner_radius+BeamPipe_Cu_thickness-BeamPipe_Upstream_inner_radius"/-->
<constant name="BeamPipe_QD0_zmax" value="3950*mm"/>
<constant name="BeamPipe_QF1_zmin" value="4450*mm"/>
<constant name="BeamPipe_QF1_zmax" value="5910*mm"/>
<constant name="BeamPipe_QF1_inner_radius" value="20.5*mm"/>
<constant name="BeamPipe_Iron_thickness" value="2.5*mm"/>
</define>
<detectors>
<detector name="BeamPipe" type="CRDBeamPipe_v01" vis="VacVis">
<parameter crossingangle="CrossingAngle" />
<envelope>
<shape type="Assembly"/>
</envelope>
<section type ="Center" name="IPInnerTube" zStart="0" zEnd="BeamPipe_CentralBe_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius" vis="VacVis"/>
<layer material="G4_Be" thickness="BeamPipe_Be_inner_thickness" vis="TubeVis"/>
<layer material="G4_PARAFFIN" thickness="BeamPipe_Cooling_thickness" vis="GrayVis"/>
<layer material="G4_Be" thickness="BeamPipe_Be_outer_thickness" vis="TubeVis"/>
</section>
<section type="Center" name="IPAl" zStart="BeamPipe_CentralBe_zmax" zEnd="BeamPipe_CentralAl_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Central_inner_radius" vis="VacVis"/>
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="TubeVis"/>
</section>
<section type="Waist" name="Waist1st" zStart="BeamPipe_CentralAl_zmax" zEnd="BeamPipe_ExpandAl_zmax" rStart="BeamPipe_Central_inner_radius" size="BeamPipe_FirstExpand_width">
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="TubeVis"/>
</section>
<section type="Runway" name="Waist2nd" zStart="BeamPipe_ExpandAl_zmax" zEnd="BeamPipe_Linker_zmin" rStart="BeamPipe_Central_inner_radius" size="BeamPipe_FirstExpand_width">
<layer material="G4_Al" thickness="BeamPipe_Al_thickness" vis="TubeVis"/>
</section>
<section type="Runway" name="Waist3rd" zStart="BeamPipe_Linker_zmin" zEnd="BeamPipe_Linker_zmax" rStart="BeamPipe_Central_inner_radius" size="BeamPipe_FirstExpand_width">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Runway" name="Waist4th" zStart="BeamPipe_Linker_zmax" zEnd="BeamPipe_Waist_zmax" rStart="BeamPipe_Central_inner_radius" size="BeamPipe_FirstExpand_width"
shift="BeamPipe_SecondExpand_width-BeamPipe_FirstExpand_width">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Crotch" name="Fork" zStart="BeamPipe_Waist_zmax" zEnd="BeamPipe_Crotch_zmax"
rStart="BeamPipe_Central_inner_radius" rEnd="BeamPipe_Central_inner_radius" size="BeamPipe_SecondExpand_width">
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="FirstDoublePipe" zStart="BeamPipe_Crotch_zmax" zEnd="BeamPipe_FirstSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Fork_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="BeforeMask" zStart="BeamPipe_FirstSeparated_zmax" zEnd="BeamPipe_Mask_zmin" rStart="0">
<layer material="beam" thickness="BeamPipe_Fork_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="Mask" zStart="BeamPipe_Mask_zmin" zEnd="BeamPipe_Mask_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Mask_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness+BeamPipe_Fork_inner_radius-BeamPipe_Mask_inner_radius" vis="TubeVis"/>
</section>
<section type="Legs" name="SecondDoublePipe" zStart="BeamPipe_Mask_zmax" zEnd="BeamPipe_SecondSeparated_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Fork_inner_radius" vis="VacVis"/>
<layer material="G4_Cu" thickness="BeamPipe_Cu_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="QD0" zStart="BeamPipe_SecondSeparated_zmax" zEnd="BeamPipe_QD0_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_Fork_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
<layer material="G4_Cu" thickness="3.5*mm" vis="TubeVis"/>
<layer material="superconductor" thickness="6.0*mm" vis="MagentaVis"/>
<layer material="stainless_steel" thickness="8.0*mm" vis="ShellVis"/>
</section>
<section type="Legs" name="QF1Linker" zStart="BeamPipe_QD0_zmax" zEnd="BeamPipe_QF1_zmin" rStart="0">
<layer material="beam" thickness="BeamPipe_Fork_inner_radius" thicknessEnd="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
</section>
<section type="Legs" name="QF1" zStart="BeamPipe_QF1_zmin" zEnd="BeamPipe_QF1_zmax" rStart="0">
<layer material="beam" thickness="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
<layer material="G4_Cu" thickness="3.0*mm" vis="TubeVis"/>
<layer material="superconductor" thickness="6.0*mm" vis="MagentaVis"/>
<layer material="stainless_steel" thickness="8.0*mm" vis="ShellVis"/>
</section>
<section type="Legs" name="Farest" zStart="BeamPipe_QF1_zmax" zEnd="BeamPipe_end_z" rStart="0">
<layer material="beam" thickness="BeamPipe_QF1_inner_radius" vis="VacVis"/>
<layer material="stainless_steel" thickness="BeamPipe_Iron_thickness" vis="TubeVis"/>
</section>
<!-- Magnets and their cooling, support -->
<section type="CenterSide" name="Magnet_1" zStart="1160*mm" zEnd="1900*mm" rStart="90*mm">
<layer material="superconductor" thickness="20*mm" vis="MagentaVis"/>
</section>
<section type="CenterSide" name="Magnet_2" zStart="1930*mm" zEnd="3964*mm" rStart="120*mm">
<layer material="superconductor" thickness="10*mm" vis="MagentaVis"/>
</section>
<section type="CenterSide" name="Magnet_3" zStart="3970*mm" zEnd="7000*mm" rStart="185*mm">
<layer material="superconductor" thickness="10*mm" vis="MagentaVis"/>
</section>
<!--TO DO: overlap with Lumical-->
<!--section type="CenterSide" name="MagnetShell_1" zStart="970*mm" zEnd="1110*mm" rStart="33*mm">
<layer material="stainless_steel" thickness="1.5*mm" vis="ShellVis"/>
</section-->
<section type="CenterSide" name="MagnetShell_2" zStart="1110*mm" zEnd="1115*mm" rStart="50.0*mm">
<layer material="stainless_steel" thickness="91.25*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_3" zStart="1115*mm" zEnd="1900*mm" rStart="130.75*mm" rEnd="175*mm">
<layer material="stainless_steel" thickness="10.5*mm" thicknessEnd="65*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_4" zStart="1900*mm" zEnd="3800*mm" rStart="175*mm">
<layer material="stainless_steel" thickness="65*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_5" zStart="3800*mm" zEnd="3910*mm" rStart="175*mm">
<layer material="stainless_steel" thickness="135*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetShell_6" zStart="3910*mm" zEnd="7160*mm" rStart="240*mm">
<layer material="stainless_steel" thickness="70*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_1" zStart="1130*mm" zEnd="1135*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="50*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_2i" zStart="1135*mm" zEnd="1925*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_2o" zStart="1135*mm" zEnd="1900*mm" rStart="120*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_3l" zStart="1900*mm" zEnd="1905*mm" rStart="120*mm">
<layer material="stainless_steel" thickness="25*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_3r" zStart="1925*mm" zEnd="1930*mm" rStart="75*mm">
<layer material="stainless_steel" thickness="35*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_4i" zStart="1930*mm" zEnd="4000*mm" rStart="105*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_4o" zStart="1905*mm" zEnd="3940*mm" rStart="140*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_5l" zStart="3940*mm" zEnd="3945*mm" rStart="140*mm">
<layer material="stainless_steel" thickness="70*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_5r" zStart="4000*mm" zEnd="4005*mm" rStart="105*mm">
<layer material="stainless_steel" thickness="70*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_6i" zStart="4005*mm" zEnd="7050*mm" rStart="170*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_6o" zStart="3945*mm" zEnd="7050*mm" rStart="205*mm">
<layer material="stainless_steel" thickness="5*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetSupport_7" zStart="7050*mm" zEnd="7055*mm" rStart="170*mm">
<layer material="stainless_steel" thickness="40*mm" vis="ShellVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1l" zStart="1135*mm" zEnd="1160*mm" rStart="80*mm">
<layer material="lN2" thickness="40*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1i" zStart="1160*mm" zEnd="1900*mm" rStart="80*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1o" zStart="1160*mm" zEnd="1900*mm" rStart="110*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_1r" zStart="1900*mm" zEnd="1925*mm" rStart="80*mm">
<layer material="lN2" thickness="40*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2l" zStart="1905*mm" zEnd="1930*mm" rStart="120*mm">
<layer material="lN2" thickness="20*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2i" zStart="1925*mm" zEnd="3964*mm" rStart="110*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2o" zStart="1930*mm" zEnd="3945*mm" rStart="130*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2r1" zStart="3964*mm" zEnd="4000*mm" rStart="110*mm">
<layer material="lN2" thickness="65*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_2r2" zStart="3945*mm" zEnd="3964*mm" rStart="130*mm">
<layer material="lN2" thickness="45*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3l" zStart="3945*mm" zEnd="3970*mm" rStart="175*mm">
<layer material="lN2" thickness="30*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3i" zStart="3970*mm" zEnd="7000*mm" rStart="175*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3o" zStart="3970*mm" zEnd="7000*mm" rStart="195*mm">
<layer material="lN2" thickness="10*mm" vis="BlueVis"/>
</section>
<section type="CenterSide" name="MagnetCooling_3r" zStart="7000*mm" zEnd="7050*mm" rStart="175*mm">
<layer material="lN2" thickness="30*mm" vis="BlueVis"/>
</section>
</detector>
</detectors>
</lccdd>