diff --git a/Detector/DetCRD/CMakeLists.txt b/Detector/DetCRD/CMakeLists.txt index 8597988da9a6938899fb635e9025ebff4b0ff99c..3bdd6f88554a66e520204d2350dad67825f3597b 100644 --- a/Detector/DetCRD/CMakeLists.txt +++ b/Detector/DetCRD/CMakeLists.txt @@ -21,6 +21,7 @@ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetCRD) set(DetCRD_src src/Calorimeter/CRDEcal.cpp + src/Other/CRDBeamPipe_v01_geo.cpp ) gaudi_add_module(DetCRD diff --git a/Detector/DetCRD/compact/CRD_common_v01/Beampipe_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Beampipe_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..58c49be508361d1e5241bf4e77fda26bb9d177ba --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/Beampipe_v01_01.xml @@ -0,0 +1,66 @@ +<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> + <constant name="ForkAsymThickness" value="BeamPipe_Dnstream_inner_radius+BeamPipe_Cu_thickness-BeamPipe_Upstream_inner_radius"/> + </define> + + <detectors> + <detector name="BeamPipe" type="DD4hep_CRDBeamPipe_v01" vis="BeamPipeVis"> + <parameter crossingangle="CrossingAngle" /> + <envelope vis="BlueVis"> + <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"/> + </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"/> + </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"/> + </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"/> + </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"/> + </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"/> + </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" + 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"/> + </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--> + <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"/> + </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"/> + </section> + </detector> + </detectors> +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..3b843fc94fe3ce620f80727b73373a3353d259eb --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/DC_Simple_v01_01.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lccdd> + + <info name="DriftChamber" + title="Test with Drift Chamber" + author="Tao Lin" + url="http://github.com/cepc/CEPCSW" + status="development" + version="v0"> + <comment>Test with Drift Chamber</comment> + </info> + + <define> + <constant name="SDT_radius_min" value="InnerTracker_inner_radius"/> + <constant name="SDT_radius_max" value="OuterTracker_outer_radius"/> + <constant name="SDT_half_length" value="MainTracker_half_length"/> + <constant name="SDT_length" value="SDT_half_length*2"/> + + <constant name="SDT_inner_chamber_radius_min" value="SDT_radius_min"/> + <constant name="SDT_inner_chamber_radius_max" value="InnerTracker_outer_radius"/> + <constant name="SDT_inner_chamber_length" value="SDT_length"/> + + <constant name="SDT_outer_chamber_radius_min" value="OuterTracker_inner_radius"/> + <constant name="SDT_outer_chamber_radius_max" value="SDT_radius_max"/> + <constant name="SDT_outer_chamber_length" value="SDT_length"/> + + <constant name="SDT_inner_chamber_layer_number" value="67"/> + <constant name="SDT_outer_chamber_layer_number" value="63"/> + <constant name="SDT_chamber_layer_width" value="10*mm"/> + <constant name="Epsilon" value="0*deg"/> + </define> + + <detectors> + <detector id="DetID_DC" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="BlueVis" sensitive="true" insideTrackingVolume="true"> + <envelope vis="SeeThrough"> + <shape type="BooleanShape" operation="Union" material="Air"> + <shape type="Tube" rmin="SDT_inner_chamber_radius_min" rmax="SDT_inner_chamber_radius_max" dz="SDT_half_length" /> + <shape type="Tube" rmin="SDT_outer_chamber_radius_min" rmax="SDT_outer_chamber_radius_max" dz="SDT_half_length" /> + </shape> + </envelope> + + <type_flags type="DetType_TRACKER + DetType_BARREL + DetType_GASEOUS + DetType_WIRE"/> + + <!-- Use cm as unit if you want to use Pandora for reconstruction --> + <sensitive type="SimpleDriftChamber"/> + </detector> + </detectors> + + <readouts> + <readout name="DriftChamberHitsCollection"> + <segmentation type="GridDriftChamber" cell_size="10*mm" epsilon0="Epsilon" detector_length="SDT_length" identifier_phi="cellID" /> + + <id>system:8,chamber:1,layer:8,cellID:16</id> + </readout> + </readouts> + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..b408c7a37428fe631e4889ba64ca262b970ff4df --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lccdd> + <define> + <constant name="ecalbarrel_inner_radius" value="Ecal_barrel_inner_radius"/> + <constant name="ecalbarrel_thickness" value="Ecal_barrel_thickness"/> <!--Must be n*10*mm! --> + <constant name="ecalbarrel_zlength" value="Ecal_barrel_half_length*2"/> <!--Must be n*10*mm! --> + </define> + + <detectors> + <detector id="DetID_ECAL" name="CaloDetector" type="CRDEcalBarrel" readout="EcalBarrelCollection" vis="Invisible" sensitive="true"> + <!-- Use cm as unit if you want to use Pandora for reconstruction --> + </detector> + </detectors> + + <readouts> + <readout name="EcalBarrelCollection"> + <!-- <segmentation type="NoSegmentation"/> --> + + <!--segmentation type="CartesianGridXYZ" + grid_size_x="1*cm" + grid_size_y="1*cm" + grid_size_z="1*cm"/--> + <id>system:4,layer:6,block:8,bar:10</id> + </readout> + </readouts> + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v01/FTD_SimpleStaggered_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/FTD_SimpleStaggered_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..dce464bf8f2dc60523562d475579e2bb696c818c --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/FTD_SimpleStaggered_v01_01.xml @@ -0,0 +1,77 @@ +<lccdd> + <define> + <constant name="FTD_inner_radius" value="BeamPipe_VertexRegion_rmax + FTD_BeamPipe_cable_clearance"/> + <constant name="FTD_outer_radius" value="InnerTracker_inner_radius - FTD_InnerTracker_gap"/> + <constant name="FTD_outer_radius_1" value="SIT1_inner_radius - env_safety"/> + <constant name="FTD_outer_radius_2" value="FTD_outer_radius - env_safety"/> + <constant name="FTD_half_length" value="InnerTracker_half_length"/> + <constant name="FTD_min_z_0" value="Vertex_half_length + env_safety"/> + <constant name="FTD_min_z_2" value="SIT1_half_length + env_safety"/> + <constant name="FTD_cone_min_z" value="BeamPipe_CentralAl_zmax"/> + <constant name="FTD_cone_radius" value="FTD_half_length*tan(CrossingAngle/2) + BeamPipe_Dnstream_inner_radius + BeamPipe_Cu_thickness + FTD_BeamPipe_cable_clearance/2"/> + <!--FTD_inner_radius/(BeamPipe_ConeAl_zmax-BeamPipe_CentralAl_zmax)*(FTD_half_length-BeamPipe_CentralAl_zmax)"/--> + <constant name="petal_cp_support_thickness" value="2.0*mm"/> + <constant name="petal_support_zoffset" value="1.5*mm"/> + <constant name="FTD1_vtx3_distance_z" value="95*mm"/> + <constant name="FTD7_ecal_distance_z" value="200*mm"/> + <constant name="FTD_disk2_zPosRelToDCLength" value="0.158004*2350*mm/InnerTracker_half_length"/> + <constant name="FTD_disk3_zPosRelToDCLength" value="0.273577*2350*mm/InnerTracker_half_length"/> + <constant name="FTD_disk4_zPosRelToDCLength" value="0.359149*2350*mm/InnerTracker_half_length"/> + <constant name="FTD_disk5_zPosRelToDCLength" value="0.393600*2350*mm/InnerTracker_half_length"/> + </define> + + <detectors> + <detector id="DetID_FTD" name="FTD" type="FTD_Simple_Staggered" vis="FTDVis" readout="FTDCollection" insideTrackingVolume="true"> + <envelope vis="FTDVis"> + <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" > + <shape type="Tube" rmin="FTD_inner_radius" rmax="FTD_outer_radius" dz="FTD_half_length" /> + <shape type="Tube" rmin="0." rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_0" /> + </shape> + <shape type="Tube" rmin="FTD_outer_radius_1" rmax="FTD_outer_radius+env_safety" dz="FTD_min_z_2" /> + </shape> + <shape type="Cone" rmin1="0" rmax1="FTD_inner_radius" rmin2="0" rmax2="FTD_cone_radius" + z="(FTD_half_length-FTD_cone_min_z)/2. + env_safety "/> + <position x="0" y="0" z="FTD_cone_min_z+(FTD_half_length-FTD_cone_min_z)/2."/> + </shape> + <shape type="Cone" rmin1="0" rmax1="FTD_inner_radius" rmin2="0" rmax2="FTD_cone_radius" + z="(FTD_half_length-FTD_cone_min_z)/2. + env_safety "/> + <position x="0" y="0" z="-FTD_cone_min_z-(FTD_half_length-FTD_cone_min_z)/2."/> + <rotation x="0" y="180.*deg" z="0" /> + </shape> + </envelope> + + <type_flags type="DetType_TRACKER + DetType_ENDCAP + DetType_PIXEL + DetType_STRIP "/> + + <!-- SQL command: "select * from common_parameters;" --> + <common_parameters ftd1_vtx3_distance_z="FTD1_vtx3_distance_z" + ftd7_ecal_distance_z="FTD7_ecal_distance_z" ftd1_sit1_radial_diff="-1*mm" ftd2_sit1_radial_diff="-1*mm" ftd3_sit2_radial_diff="-FTD_InnerTracker_gap" + ftd4to7_tpc_radial_gap="FTD_InnerTracker_gap" beamtube_clearance="FTD_BeamPipe_gap" cables_thickness="0.08*mm" cable_shield_thickness="0.1*mm" + outer_cylinder_total_thickness="1*mm" petal_half_angle_support="11.25*deg" petal_y_ratio="0.5015" + support_spaceframe_width="10*mm"/> + + <!-- SQL command: "select * from extended_reconstruction_parameters;" --> + <extended_reconstruction_parameters strip_width="0.001*mm" strip_length="250*mm" strip_pitch="0.01*mm" strip_angle="5*deg" /> + + <!-- SQL command: "select * from disks;" --> + <disk disk_number="1" z_position_ReltoTPCLength="0" disk_si_thickness="0.02*mm" petal_cp_support_dxMax="71.9*mm" padUp_Si_dxMax="68*mm" petal_cp_support_thickness="1*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="1" double_sided="0" /> + <disk disk_number="2" z_position_ReltoTPCLength="FTD_disk2_zPosRelToDCLength" disk_si_thickness="0.02*mm" petal_cp_support_dxMax="71.9*mm" padUp_Si_dxMax="68*mm" petal_cp_support_thickness="1*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="1" double_sided="0" /> + <disk disk_number="3" z_position_ReltoTPCLength="FTD_disk3_zPosRelToDCLength" disk_si_thickness="0.2*mm" petal_cp_support_dxMax="103.49*mm" padUp_Si_dxMax="99.46*mm" petal_cp_support_thickness="2*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="0" double_sided="1" /> + <disk disk_number="4" z_position_ReltoTPCLength="FTD_disk4_zPosRelToDCLength" disk_si_thickness="0.2*mm" petal_cp_support_dxMax="103.49*mm" padUp_Si_dxMax="99.46*mm" petal_cp_support_thickness="2*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="0" double_sided="1" /> + <disk disk_number="5" z_position_ReltoTPCLength="FTD_disk5_zPosRelToDCLength" disk_si_thickness="0.2*mm" petal_cp_support_dxMax="103.49*mm" padUp_Si_dxMax="99.46*mm" petal_cp_support_thickness="2*mm" petal_support_zoffset="1.5*mm" sensor_is_pixel="0" double_sided="1" /> + + </detector> + + </detectors> + + <readouts> + <readout name="FTDCollection"> + <!-- fixme: for now DD4hep cannot handle signed values - side should actually be "-2" --> + <id>system:5,side:2,layer:9,module:8,sensor:8</id> + </readout> + </readouts> + + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v01/SET_SimplePlanar_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/SET_SimplePlanar_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..5e39151764a31333ceb947a390e291c08082e015 --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/SET_SimplePlanar_v01_01.xml @@ -0,0 +1,45 @@ +<lccdd> + <define> + <constant name="SET_inner_radius" value="OuterTracker_outer_radius + env_safety"/> + <constant name="SET_outer_radius" value="Ecal_barrel_inner_radius - env_safety "/> + <constant name="SET_half_length" value="OuterTracker_half_length"/> + </define> + + <detectors> + <detector id="DetID_SET" name="SET" type="SET_Simple_Planar" vis="SETVis" readout="SETCollection" insideTrackingVolume="true"> + <envelope vis="SETVis"> + <shape type="Tube" rmin="SET_inner_radius" rmax="SET_outer_radius" dz="SET_half_length" material = "Air" /> + </envelope> + + <type_flags type="DetType_TRACKER + DetType_BARREL + DetType_STRIP "/> + + <!-- database : set_simple_planar_sensors_01 --> + + <!-- SQL command: "select * from extended_reconstruction_parameters;" --> + <reconstruction strip_width="0.0125*mm" strip_length="92*mm" strip_pitch="0.05*mm" strip_angle="7*deg" /> + + <!-- SQL command: "select * from global;" --> + <global sensitive_thickness="0.2*mm" support_thickness="1*mm" sensor_length="92*mm" sensitive_mat="G4_Si" + support_mat="G4_C" sensitive_threshold_KeV="64*keV" /> + + <!-- SQL command: "select * from set_layers;" --> + + <layer layer_id="0" sensitive_distance_from_tpc="3*mm" coverage_of_TPC_Ecal_Hcal_barrel="0.98" + n_ladders="24" ladder_clearance="0.1*mm" faces_IP="1" /> + + <layer layer_id="1" sensitive_distance_from_tpc="5.5*mm" coverage_of_TPC_Ecal_Hcal_barrel="0.98" + n_ladders="24" ladder_clearance="0.1*mm" faces_IP="0" /> + + </detector> + + </detectors> + + <readouts> + <readout name="SETCollection"> + <id>system:5,side:-2,layer:9,module:8,sensor:8,barrelside:-2</id> + </readout> + </readouts> + + +</lccdd> + diff --git a/Detector/DetCRD/compact/CRD_common_v01/SIT_SimplePlanar_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/SIT_SimplePlanar_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..857af3277bbada91568cbb05352dc6e3a7c50bc3 --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/SIT_SimplePlanar_v01_01.xml @@ -0,0 +1,56 @@ +<lccdd> + <define> + <constant name="SIT_sensitive_thickness" value="0.2*mm"/> + <constant name="SIT_inner_radius" value="SIT1_inner_radius"/> + <constant name="SIT_inner_radius_1" value="SIT_inner_radius + env_safety"/> + <constant name="SIT_outer_radius_1" value="SIT_inner_radius_1/cos(pi/8)"/> + <constant name="SIT_inner_radius_2" value="InnerTracker_outer_radius + env_safety"/> + <constant name="SIT_outer_radius" value="OuterTracker_inner_radius"/> + <constant name="SIT_half_length" value="SIT2_half_length"/> + <constant name="SIT_half_length_1" value="SIT1_half_length"/> + <constant name="SIT_layer_gap" value="2.5*mm"/> + </define> + + <detectors> + <detector id="DetID_SIT" name="SIT" type="SIT_Simple_Planar" vis="SITVis" readout="SITCollection" insideTrackingVolume="true"> + <envelope vis="SeeThrough"> + <shape type="BooleanShape" operation="Union" material="Air" > + <shape type="Tube" rmin="SIT_inner_radius" rmax="SIT_outer_radius_1" dz="SIT_half_length_1" /> + <shape type="Tube" rmin="SIT_inner_radius_2" rmax="SIT_outer_radius" dz="SIT_half_length" /> + </shape> + </envelope> + + <type_flags type="DetType_TRACKER + DetType_BARREL + DetType_STRIP "/> + + <!-- database : sit_simple_planar_sensors_03 --> + + <!-- SQL command: "select * from extended_reconstruction_parameters;" --> + <reconstruction strip_width="0." strip_length="92*mm" strip_pitch="0." strip_angle="0*deg" /> + + <!-- SQL command: "select * from global;" --> + <global sensitive_thickness="SIT_sensitive_thickness" support_thickness="1*mm" sensor_length="92*mm" + sensitive_mat="G4_Si" support_mat="G4_C" sensitive_threshold_KeV="64*keV" /> + + <!-- SQL command: "select * from sit_layers;" --> + <layer layer_id="0" sensitive_radius="SIT_inner_radius_1+0.5*SIT_sensitive_thickness" n_sensors_per_ladder="8" n_ladders="10" + ladder_clearance="0.1*mm" faces_IP="1" is_SIT1="1" is_SIT2="0" /> + + <layer layer_id="1" sensitive_radius="SIT_inner_radius_1+0.5*SIT_sensitive_thickness+SIT_layer_gap" n_sensors_per_ladder="8" n_ladders="10" + ladder_clearance="0.1*mm" faces_IP="0" is_SIT1="0" is_SIT2="0" /> + + <layer layer_id="2" sensitive_radius="SIT_inner_radius_2+0.5*SIT_sensitive_thickness" n_sensors_per_ladder="48" n_ladders="24" + ladder_clearance="0.1*mm" faces_IP="1" is_SIT1="0" is_SIT2="1" /> + + <layer layer_id="3" sensitive_radius="SIT_inner_radius_2+0.5*SIT_sensitive_thickness+SIT_layer_gap" n_sensors_per_ladder="48" n_ladders="24" + ladder_clearance="0.1*mm" faces_IP="0" is_SIT1="0" is_SIT2="0" /> + + </detector> + </detectors> + + <readouts> + <readout name="SITCollection"> + <id>system:5,side:-2,layer:9,module:8,sensor:8,barrelside:-2</id> + </readout> + </readouts> + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v01/VXD_v01_01.xml b/Detector/DetCRD/compact/CRD_common_v01/VXD_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..07298268222aa5f6381b550a256519b5f3d01732 --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/VXD_v01_01.xml @@ -0,0 +1,107 @@ +<lccdd> + <define> + <constant name="VXD_inner_radius" value="Vertex_inner_radius"/> + <constant name="VXD_outer_radius" value="Vertex_outer_radius"/> + <constant name="VXD_half_length" value="Vertex_half_length"/> + <constant name="VXD_inner_radius_1" value="BeamPipe_VertexRegion_rmax"/> + <constant name="VXD_radius_r1" value="16*mm"/> + <constant name="VXD_radius_r3" value="37*mm"/> + <constant name="VXD_radius_r5" value="58*mm"/> + <constant name="VXD_length_r1" value="62.5*mm"/> + <constant name="VXD_length_r3" value="125*mm"/> + <constant name="VXD_length_r5" value="125*mm"/> + <constant name="VXD_cone_max_z" value="Vertex_half_length-10*mm"/> + <constant name="VXD_cone_min_z" value="VXD_length_r5+10*mm"/> + </define> + + <detectors> + <detector id="DetID_VXD" name="VXD" type="VXD04" vis="VXDVis" readout="VXDCollection" insideTrackingVolume="true"> + <envelope vis="VXDVis"> + <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" > + <shape type="Tube" rmin="VXD_inner_radius" rmax="VXD_outer_radius" dz="VXD_half_length" /> + <shape type="Tube" rmin="0." rmax="VXD_inner_radius_1" dz="(VXD_half_length - VXD_cone_max_z)/2. + env_safety " /> + <position x="0" y="0" z="VXD_half_length-(VXD_half_length - VXD_cone_max_z)/2.+ env_safety"/> + </shape> + <shape type="Tube" rmin="0." rmax="VXD_inner_radius_1" dz="(VXD_half_length - VXD_cone_max_z)/2. + env_safety " /> + <position x="0" y="0" z="- ( VXD_half_length-(VXD_half_length - VXD_cone_max_z)/2.+ env_safety ) "/> + <rotation x="0" y="180.*deg" z="0" /> + </shape> + <shape type="Cone" rmin1="0" rmax1="VXD_inner_radius" rmin2="0" rmax2="VXD_inner_radius_1" + z="(VXD_cone_max_z-VXD_cone_min_z)/2. + env_safety "/> + <position x="0" y="0" z="VXD_cone_min_z+(VXD_cone_max_z-VXD_cone_min_z)/2."/> + </shape> + <shape type="Cone" rmin1="0" rmax1="VXD_inner_radius" rmin2="0" rmax2="VXD_inner_radius_1" + z="(VXD_cone_max_z-VXD_cone_min_z)/2. + env_safety "/> + <position x="0" y="0" z="-(VXD_cone_min_z+(VXD_cone_max_z-VXD_cone_min_z)/2.)"/> + <rotation x="0" y="180.*deg" z="0" /> + </shape> + </envelope> + + <!-- set the detecor type flag - note: using the '+' operator here as the evaluator does not understand '|' + -> be carefull not to add any flags twice !!! --> + <type_flags type=" DetType_TRACKER + DetType_PIXEL + DetType_VERTEX "/> + + <!-- database : TMP_DB10 --> + <!-- SQL command: "select * from layers_common_parameters;" --> + <layers_common_parameters id="1" + electronics_structure_thickness="0.1*mm" + active_silicon_thickness="0.05*mm" + support_structure_radial_thickness="0.49392*mm" + end_electronics_half_z="5*mm" + strip_final_beampipe_radious="VXD_inner_radius_1" + side_band_electronics_option="1" + end_ladd_electronics_option="1" + side_band_electronics_width="0.5*mm" + side_band_electronics_thickness="0.05*mm" + active_side_band_electronics_option="0" + layer_gap="2*mm" + flex_cable_material="G4_KAPTON" + flex_cable_thickness="0.05*mm" + foam_spacer_material="SiC_foam" + foam_spacer_thickness="0.94*mm" + metal_traces_material="G4_Al" + metal_traces_thickness="0.01*mm" + cool_pipe_material="titanium" + cool_pipe_inner_radius="0.75*mm" + cool_pipe_outer_radius="1*mm" + external_kapton_thickness="0.05*mm" + 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" + 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" + offset_ladder_block="0.28224*mm" beryllium_ladder_block_length="5*mm" beryllium_ladder_block_thickness="0.25*mm" shell_endplate_thickness="2*mm" forward_shell_half_z="6.5*mm" /> + <!-- SQL command: "select * from layer;" --> + <layer id="0" layer_radius="VXD_radius_r1" ladder_length="VXD_length_r1" ladder_width="5.5*mm" nb_ladder="10" ladder_gap="0" strip_line_final_z="150*mm" end_electronics_width="5.5*mm" + initial_kapton_striplines_thickness="0.04566*mm" final_kapton_striplines_thickness="0.02435*mm" initial_metal_striplines_thickness="0.00806*mm" + final_metal_striplines_thickness="0.0043*mm" support_width="4.5*mm" /> + <layer id="1" layer_radius="VXD_radius_r1" ladder_length="VXD_length_r1" ladder_width="5.5*mm" nb_ladder="10" ladder_gap="0" strip_line_final_z="150*mm" end_electronics_width="5.5*mm" + initial_kapton_striplines_thickness="0.04566*mm" final_kapton_striplines_thickness="0.02435*mm" initial_metal_striplines_thickness="0.00806*mm" + final_metal_striplines_thickness="0.0043*mm" support_width="4.5*mm" /> + <layer id="2" layer_radius="VXD_radius_r3" ladder_length="VXD_length_r3" ladder_width="11*mm" nb_ladder="11" ladder_gap="0*mm" strip_line_final_z="150*mm" end_electronics_width="11*mm" + initial_kapton_striplines_thickness="0.04102*mm" final_kapton_striplines_thickness="0.05059*mm" initial_metal_striplines_thickness="0.00724*mm" + final_metal_striplines_thickness="0.00893*mm" support_width="10*mm" /> + <layer id="3" layer_radius="VXD_radius_r3" ladder_length="VXD_length_r3" ladder_width="11*mm" nb_ladder="11" ladder_gap="0*mm" strip_line_final_z="150*mm" end_electronics_width="11*mm" + initial_kapton_striplines_thickness="0.04102*mm" final_kapton_striplines_thickness="0.05059*mm" initial_metal_striplines_thickness="0.00724*mm" + final_metal_striplines_thickness="0.00893*mm" support_width="10*mm" /> + <layer id="4" layer_radius="VXD_radius_r5" ladder_length="VXD_length_r3" ladder_width="11*mm" nb_ladder="17" ladder_gap="0*mm" strip_line_final_z="150*mm" end_electronics_width="11*mm" + initial_kapton_striplines_thickness="0.04044*mm" final_kapton_striplines_thickness="0.07819*mm" initial_metal_striplines_thickness="0.00714*mm" + final_metal_striplines_thickness="0.0138*mm" support_width="10*mm" /> + <layer id="5" layer_radius="VXD_radius_r5" ladder_length="VXD_length_r3" ladder_width="11*mm" nb_ladder="17" ladder_gap="0*mm" strip_line_final_z="150*mm" end_electronics_width="11*mm" + initial_kapton_striplines_thickness="0.04044*mm" final_kapton_striplines_thickness="0.07819*mm" initial_metal_striplines_thickness="0.00714*mm" + final_metal_striplines_thickness="0.0138*mm" support_width="10*mm" /> + </detector> + + </detectors> + + <readouts> + <readout name="VXDCollection"> + <id>system:5,side:-2,layer:9,module:8,sensor:8,barrelside:-2</id> + </readout> + </readouts> +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_common_v01/materials.xml b/Detector/DetCRD/compact/CRD_common_v01/materials.xml new file mode 100644 index 0000000000000000000000000000000000000000..74b3f3fa8dca29cc34b251fc38fc82d09884af1c --- /dev/null +++ b/Detector/DetCRD/compact/CRD_common_v01/materials.xml @@ -0,0 +1,565 @@ + <materials> + <isotope N="1" Z="1" name="H1"> + <atom unit="g/mole" value="1.00782503081372"/> + </isotope> + <isotope N="2" Z="1" name="H2"> + <atom unit="g/mole" value="2.01410199966617"/> + </isotope> + <element name="H"> + <fraction n="0.999885" ref="H1"/> + <fraction n="0.000115" ref="H2"/> + </element> + <isotope N="12" Z="6" name="C12"> + <atom unit="g/mole" value="12"/> + </isotope> + <isotope N="13" Z="6" name="C13"> + <atom unit="g/mole" value="13.0034"/> + </isotope> + <element name="C"> + <fraction n="0.9893" ref="C12"/> + <fraction n="0.0107" ref="C13"/> + </element> + <isotope N="14" Z="7" name="N14"> + <atom unit="g/mole" value="14.0031"/> + </isotope> + <isotope N="15" Z="7" name="N15"> + <atom unit="g/mole" value="15.0001"/> + </isotope> + <element name="N"> + <fraction n="0.99632" ref="N14"/> + <fraction n="0.00368" ref="N15"/> + </element> + <isotope N="16" Z="8" name="O16"> + <atom unit="g/mole" value="15.9949"/> + </isotope> + <isotope N="17" Z="8" name="O17"> + <atom unit="g/mole" value="16.9991"/> + </isotope> + <isotope N="18" Z="8" name="O18"> + <atom unit="g/mole" value="17.9992"/> + </isotope> + <element name="O"> + <fraction n="0.99757" ref="O16"/> + <fraction n="0.00038" ref="O17"/> + <fraction n="0.00205" ref="O18"/> + </element> + <material name="G4_KAPTON" state="solid"> + <MEE unit="eV" value="79.6"/> + <D unit="g/cm3" value="1.42"/> + <fraction n="0.026362" ref="H"/> + <fraction n="0.691133" ref="C"/> + <fraction n="0.07327" ref="N"/> + <fraction n="0.209235" ref="O"/> + </material> + <isotope N="28" Z="14" name="Si28"> + <atom unit="g/mole" value="27.9769"/> + </isotope> + <isotope N="29" Z="14" name="Si29"> + <atom unit="g/mole" value="28.9765"/> + </isotope> + <isotope N="30" Z="14" name="Si30"> + <atom unit="g/mole" value="29.9738"/> + </isotope> + <element name="Si"> + <fraction n="0.922296077703922" ref="Si28"/> + <fraction n="0.0468319531680468" ref="Si29"/> + <fraction n="0.0308719691280309" ref="Si30"/> + </element> + <material name="SiC_foam" state="solid"> + <MEE unit="eV" value="137.77733431141"/> + <D unit="g/cm3" value="0.19"/> + <fraction n="0.299548759813591" ref="C"/> + <fraction n="0.700451240186409" ref="Si"/> + </material> + <material Z="13" name="G4_Al" state="solid"> + <MEE unit="eV" value="166"/> + <D unit="g/cm3" value="2.699"/> + <atom unit="g/mole" value="26.9815"/> + <fraction n="1" ref="Al"/> + </material> + <material name="G4_Si" state="solid"> + <MEE unit="eV" value="173"/> + <D unit="g/cm3" value="2.33"/> + <fraction n="1" ref="Si"/> + </material> + <isotope N="63" Z="29" name="Cu63"> + <atom unit="g/mole" value="62.9296"/> + </isotope> + <isotope N="65" Z="29" name="Cu65"> + <atom unit="g/mole" value="64.9278"/> + </isotope> + <element name="Cu"> + <fraction n="0.6917" ref="Cu63"/> + <fraction n="0.3083" ref="Cu65"/> + </element> + <material name="G4_Cu" state="solid"> + <MEE unit="eV" value="322"/> + <D unit="g/cm3" value="8.96"/> + <fraction n="1" ref="Cu"/> + </material> + <material Z="4" name="G4_Be" state="solid"> + <MEE unit="eV" value="63.7"/> + <D unit="g/cm3" value="1.848"/> + <atom unit="g/mole" value="9.01218"/> + <fraction n="1" ref="Be"/> + </material> + <isotope N="46" Z="22" name="Ti46"> + <atom unit="g/mole" value="45.9526"/> + </isotope> + <isotope N="47" Z="22" name="Ti47"> + <atom unit="g/mole" value="46.9518"/> + </isotope> + <isotope N="48" Z="22" name="Ti48"> + <atom unit="g/mole" value="47.9479"/> + </isotope> + <isotope N="49" Z="22" name="Ti49"> + <atom unit="g/mole" value="48.9479"/> + </isotope> + <isotope N="50" Z="22" name="Ti50"> + <atom unit="g/mole" value="49.9448"/> + </isotope> + <element name="Ti"> + <fraction n="0.0825" ref="Ti46"/> + <fraction n="0.0744" ref="Ti47"/> + <fraction n="0.7372" ref="Ti48"/> + <fraction n="0.0541" ref="Ti49"/> + <fraction n="0.0518" ref="Ti50"/> + </element> + <material name="G4_Ti" state="solid"> + <MEE unit="eV" value="233"/> + <D unit="g/cm3" value="4.54"/> + <fraction n="1" ref="Ti"/> + </material> + <material name="styropor" state="solid"> + <MEE unit="eV" value="65.9436601819466"/> + <D unit="g/cm3" value="0.025"/> + <fraction n="0.922577329294378" ref="C"/> + <fraction n="0.0774226707056217" ref="H"/> + </material> + <material name="GroundOrHVMix" state="solid"> + <MEE unit="eV" value="259.806022507979"/> + <D unit="g/cm3" value="5.19"/> + <fraction n="0.00360636223506744" ref="H"/> + <fraction n="0.0945480597302505" ref="C"/> + <fraction n="0.0100234489402697" ref="N"/> + <fraction n="0.0286236705202312" ref="O"/> + <fraction n="0.863198458574181" ref="Cu"/> + </material> + <isotope N="35" Z="17" name="Cl35"> + <atom unit="g/mole" value="34.9689"/> + </isotope> + <isotope N="37" Z="17" name="Cl37"> + <atom unit="g/mole" value="36.9659"/> + </isotope> + <element name="Cl"> + <fraction n="0.7578" ref="Cl35"/> + <fraction n="0.2422" ref="Cl37"/> + </element> + <material name="siPCBMix" state="solid"> + <MEE unit="eV" value="262.475002085268"/> + <D unit="g/cm3" value="5.05076923076923"/> + <fraction n="0.014498933901919" ref="Cl"/> + <fraction n="0.083477099995865" ref="O"/> + <fraction n="0.0654857498400853" ref="Si"/> + <fraction n="0.00351122019083304" ref="H"/> + <fraction n="0.0142636698452849" ref="C"/> + <fraction n="0.818763326226013" ref="Cu"/> + </material> + <isotope N="36" Z="18" name="Ar36"> + <atom unit="g/mole" value="35.9675"/> + </isotope> + <isotope N="38" Z="18" name="Ar38"> + <atom unit="g/mole" value="37.9627"/> + </isotope> + <isotope N="40" Z="18" name="Ar40"> + <atom unit="g/mole" value="39.9624"/> + </isotope> + <element name="Ar"> + <fraction n="0.003365" ref="Ar36"/> + <fraction n="0.000632" ref="Ar38"/> + <fraction n="0.996003" ref="Ar40"/> + </element> + <material name="G4_AIR" state="gas"> + <MEE unit="eV" value="85.7"/> + <D unit="g/cm3" value="0.00120479"/> + <fraction n="0.000124000124000124" ref="C"/> + <fraction n="0.755267755267755" ref="N"/> + <fraction n="0.231781231781232" ref="O"/> + <fraction n="0.0128270128270128" ref="Ar"/> + </material> + <material name="Vacuum" state="gas"> + <D unit="g/cm3" value="0.00000000001"/> + <fraction n="1" ref="G4_AIR"/> + </material> + <material name="Air" state="gas"> + <D unit="g/cm3" value="0.00120479"/> + <fraction n="1" ref="G4_AIR"/> + </material> + <material name="ThinAir" state="gas"> + <D unit="g/cm3" value="0.00120479*1e-2"/> + <fraction n="1" ref="G4_AIR"/> + </material> + <isotope N="180" Z="74" name="W180"> + <atom unit="g/mole" value="179.947"/> + </isotope> + <isotope N="182" Z="74" name="W182"> + <atom unit="g/mole" value="181.948"/> + </isotope> + <isotope N="183" Z="74" name="W183"> + <atom unit="g/mole" value="182.95"/> + </isotope> + <isotope N="184" Z="74" name="W184"> + <atom unit="g/mole" value="183.951"/> + </isotope> + <isotope N="186" Z="74" name="W186"> + <atom unit="g/mole" value="185.954"/> + </isotope> + <element name="W"> + <fraction n="0.0012" ref="W180"/> + <fraction n="0.265" ref="W182"/> + <fraction n="0.1431" ref="W183"/> + <fraction n="0.3064" ref="W184"/> + <fraction n="0.2843" ref="W186"/> + </element> + <material name="G4_W" state="solid"> + <MEE unit="eV" value="727"/> + <D unit="g/cm3" value="19.3"/> + <fraction n="1" ref="W"/> + </material> + <material name="g10" state="solid"> + <MEE unit="eV" value="114.378463512112"/> + <D unit="g/cm3" value="1.7"/> + <fraction n="0.08" ref="Cl"/> + <fraction n="0.460597175271302" ref="O"/> + <fraction n="0.361327255" ref="Si"/> + <fraction n="0.0193736737588317" ref="H"/> + <fraction n="0.078701895969866" ref="C"/> + </material> + <isotope N="54" Z="26" name="Fe54"> + <atom unit="g/mole" value="53.9396"/> + </isotope> + <isotope N="56" Z="26" name="Fe56"> + <atom unit="g/mole" value="55.9349"/> + </isotope> + <isotope N="57" Z="26" name="Fe57"> + <atom unit="g/mole" value="56.9354"/> + </isotope> + <isotope N="58" Z="26" name="Fe58"> + <atom unit="g/mole" value="57.9333"/> + </isotope> + <element name="Fe"> + <fraction n="0.05845" ref="Fe54"/> + <fraction n="0.91754" ref="Fe56"/> + <fraction n="0.02119" ref="Fe57"/> + <fraction n="0.00282" ref="Fe58"/> + </element> + <isotope N="50" Z="24" name="Cr50"> + <atom unit="g/mole" value="49.946"/> + </isotope> + <isotope N="52" Z="24" name="Cr52"> + <atom unit="g/mole" value="51.9405"/> + </isotope> + <isotope N="53" Z="24" name="Cr53"> + <atom unit="g/mole" value="52.9407"/> + </isotope> + <isotope N="54" Z="24" name="Cr54"> + <atom unit="g/mole" value="53.9389"/> + </isotope> + <element name="Cr"> + <fraction n="0.04345" ref="Cr50"/> + <fraction n="0.83789" ref="Cr52"/> + <fraction n="0.09501" ref="Cr53"/> + <fraction n="0.02365" ref="Cr54"/> + </element> + <isotope N="58" Z="28" name="Ni58"> + <atom unit="g/mole" value="57.9353"/> + </isotope> + <isotope N="60" Z="28" name="Ni60"> + <atom unit="g/mole" value="59.9308"/> + </isotope> + <isotope N="61" Z="28" name="Ni61"> + <atom unit="g/mole" value="60.9311"/> + </isotope> + <isotope N="62" Z="28" name="Ni62"> + <atom unit="g/mole" value="61.9283"/> + </isotope> + <isotope N="64" Z="28" name="Ni64"> + <atom unit="g/mole" value="63.928"/> + </isotope> + <element name="Ni"> + <fraction n="0.680769" ref="Ni58"/> + <fraction n="0.262231" ref="Ni60"/> + <fraction n="0.011399" ref="Ni61"/> + <fraction n="0.036345" ref="Ni62"/> + <fraction n="0.009256" ref="Ni64"/> + </element> + <material name="stainless_steel" state="solid"> + <MEE unit="eV" value="282.929693036223"/> + <D unit="g/cm3" value="7.87"/> + <fraction n="0.70611" ref="Fe"/> + <fraction n="0.18784" ref="Cr"/> + <fraction n="0.10605" ref="Ni"/> + </material> + <material name="fanele2" state="solid"> + <MEE unit="eV" value="75.3984269235952"/> + <D unit="g/cm3" value="2.04"/> + <fraction n="0.0814736540216391" ref="H"/> + <fraction n="0.543350389498575" ref="C"/> + <fraction n="0.257623229207059" ref="O"/> + <fraction n="0.0266436363636364" ref="N"/> + <fraction n="0.0909090909090909" ref="Cu"/> + </material> + <material name="fanele1" state="solid"> + <MEE unit="eV" value="83.6887639821308"/> + <D unit="g/cm3" value="2.61666666666667"/> + <fraction n="0.0746841828531692" ref="H"/> + <fraction n="0.498071190373694" ref="C"/> + <fraction n="0.236154626773137" ref="O"/> + <fraction n="0.0244233333333333" ref="N"/> + <fraction n="0.166666666666667" ref="Cu"/> + </material> + <material name="G4_POLYSTYRENE" state="solid"> + <MEE unit="eV" value="68.7"/> + <D unit="g/cm3" value="1.06"/> + <fraction n="0.077418" ref="H"/> + <fraction n="0.922582" ref="C"/> + </material> + <isotope N="79" Z="35" name="Br79"> + <atom unit="g/mole" value="78.9183"/> + </isotope> + <isotope N="81" Z="35" name="Br81"> + <atom unit="g/mole" value="80.9163"/> + </isotope> + <element name="Br"> + <fraction n="0.5069" ref="Br79"/> + <fraction n="0.4931" ref="Br81"/> + </element> + <material name="PCB" state="solid"> + <MEE unit="eV" value="88.255598548367"/> + <D unit="g/cm3" value="1.7"/> + <fraction n="0.180774" ref="Si"/> + <fraction n="0.405633" ref="O"/> + <fraction n="0.278042" ref="C"/> + <fraction n="0.0684428" ref="H"/> + <fraction n="0.0671091" ref="Br"/> + </material> + <material name="G4_Fe" state="solid"> + <MEE unit="eV" value="286"/> + <D unit="g/cm3" value="7.874"/> + <fraction n="1" ref="Fe"/> + </material> + <material name="beam" state="gas"> + <P unit="pascal" value="6.25e-06"/> + <MEE unit="eV" value="38.5760755714278"/> + <D unit="g/cm3" value="1.7e-14"/> + <fraction n="0.36264" ref="H"/> + <fraction n="0.36276" ref="N"/> + <fraction n="0.117748421296248" ref="C"/> + <fraction n="0.156851578703752" ref="O"/> + </material> + <material name="TDR_gas" state="gas"> + <MEE unit="eV" value="177.374841770826"/> + <D unit="g/cm3" value="0.001731"/> + <fraction n="0.95667" ref="Ar"/> + <fraction n="0.00519198196" ref="H"/> + <fraction n="0.02165502376" ref="C"/> + <fraction n="0.01648299428" ref="O"/> + </material> + <material name="epoxy" state="solid"> + <MEE unit="eV" value="60.8292941662115"/> + <D unit="g/cm3" value="1.3"/> + <fraction n="0.131793699039672" ref="H"/> + <fraction n="0.535387047414054" ref="C"/> + <fraction n="0.332819253546274" ref="O"/> + </material> + <material name="G4_C" state="solid"> + <MEE unit="eV" value="81"/> + <D unit="g/cm3" value="2"/> + <fraction n="1" ref="C"/> + </material> + <isotope N="27" Z="13" name="Al27"> + <atom unit="g/mole" value="26.9815"/> + </isotope> + <element name="Al"> + <fraction n="1" ref="Al27"/> + </element> + +<!-- + <material name="TPC_endplate_mix"> + <! D value="1.7" unit="g/cm3"/ > + <composite n="74" ref="G4_AIR"/> + <composite n="12" ref="g10"/> + <composite n="14" ref="G4_Al"/> + </material> +--> + + <material name="TPC_endplate_mix" state="solid"> + <MEE unit="eV" value="97.0754229107761"/> + <D unit="g/cm3" value="0.5827515446"/> + <fraction n="0.00953598760814401" ref="C"/> + <fraction n="0.558898138898139" ref="N"/> + <fraction n="0.226789772550668" ref="O"/> + <fraction n="0.00949198949198949" ref="Ar"/> + <fraction n="0.14" ref="Al"/> + <fraction n="0.0096" ref="Cl"/> + <fraction n="0.0433592706" ref="Si"/> + <fraction n="0.00232484085105981" ref="H"/> + </material> + <material name="CarbonFiber" state="solid"> + <MEE unit="eV" value="70.7270877537631"/> + <D unit="g/cm3" value="1.46666666666667"/> + <fraction n="0.794091986922138" ref="C"/> + <fraction n="0.058408571165309" ref="H"/> + <fraction n="0.147499441912553" ref="O"/> + </material> + <material name="CarbonFiber_25percent"> + <D type="density" value="0.375" unit="g/cm3"/> + <fraction n="1.0" ref="CarbonFiber"/> + </material> + <material name="CarbonFiber_15percent"> + <D type="density" value="0.225" unit="g/cm3"/> + <fraction n="1.0" ref="CarbonFiber"/> + </material> + <material name="G4_GRAPHITE" state="solid"> + <MEE unit="eV" value="78"/> + <D unit="g/cm3" value="2.21"/> + <fraction n="1" ref="C"/> + </material> + <material name="diamond" state="solid"> + <MEE unit="eV" value="81"/> + <D unit="g/cm3" value="3.51"/> + <fraction n="1" ref="C"/> + </material> + <material Z="79" name="G4_Au" state="solid"> + <MEE unit="eV" value="790"/> + <D unit="g/cm3" value="19.32"/> + <atom unit="g/mole" value="196.967"/> + </material> + <material name="G4_POLYETHYLENE" state="solid"> + <MEE unit="eV" value="57.4"/> + <D unit="g/cm3" value="0.94"/> + <fraction n="0.143711" ref="H"/> + <fraction n="0.856289" ref="C"/> + </material> + <isotope N="55" Z="25" name="Mn55"> + <atom unit="g/mole" value="54.938"/> + </isotope> + <element name="Mn"> + <fraction n="1" ref="Mn55"/> + </element> + <material name="Steel235" state="solid"> + <MEE unit="eV" value="285.146562707739"/> + <D unit="g/cm3" value="7.87"/> + <fraction n="0.9843" ref="Fe"/> + <fraction n="0.0017" ref="C"/> + <fraction n="0.014" ref="Mn"/> + </material> + + <comment> materials introduced for the BeamCal</comment> + <material name="TungstenDens24"> + <D value="17.8" unit="g/cm3"/> + <fraction n="0.93" ref="W"/> + <fraction n="0.061" ref="Ni"/> + <fraction n="0.009" ref="Fe"/> + </material> + + <material name="Kapton"> + <D value="1.43" unit="g/cm3" /> + <composite n="22" ref="C"/> + <composite n="10" ref="H" /> + <composite n="2" ref="N" /> + <composite n="5" ref="O" /> + </material> + + <comment> materials for the SemiDigital Hadronic calorimeter</comment> + <material name="RPCGAS2" > + <!-- C2H2F4 (TFE) 0.93% + IsoButane 0.05% + SF6 0.02% --> + <!-- <D value="0.00421" unit="g/cm3" /> --> + <D value="0.00449" unit="g/cm3" /> + <fraction n="0.70828" ref="F"/> + <fraction n="0.26054" ref="C"/> + <fraction n="0.01928" ref="H"/> + <fraction n="0.00439" ref="S"/> + </material> + + <material name="FloatGlass" > +<!-- <D value="2.44" unit="g/cm3" /> --> + <D value="2.49" unit="g/cm3" /> + <fraction n="0.46645" ref="O"/> + <fraction n="0.34125" ref="Si"/> + <fraction n="0.06432" ref="Ca"/> + <fraction n="0.02412" ref="Mg"/> + <fraction n="0.10386" ref="Na"/> + </material> + + <material name="mylar"> + <D value="1.4" unit="g/cm3" /> + <fraction n="0.333025" ref="O"/> + <fraction n="0.041959" ref="H"/> + <fraction n="0.625016" ref="C"/> + </material> + + <material name="Nylon" > + <!-- Nylon-6-6 --> +<!-- <MEE unit="eV" value="63.9"/> --> + <D value="1.14" unit="g/cm3" /> + <fraction n="0.097976" ref="H"/> + <fraction n="0.636856" ref="C"/> + <fraction n="0.123779" ref="N"/> + <fraction n="0.141389" ref="O"/> + </material> + + <material name="PEEK-GF30" > + <D value="1.51" unit="g/cm3" /> + <fraction n="0.554056" ref="C"/> + <fraction n="0.116535" ref="O"/> + <fraction n="0.029408" ref="H"/> + <fraction n="0.333333" ref="Si"/> + </material> + + <material name="g10-RPC"> +<!-- <MEE unit="eV" value="114.378463512112"/> --> + <D value="1.80" unit="g/cm3" /> + <fraction n="0.07868" ref="C"/> + <fraction n="0.46056" ref="O"/> + <fraction n="0.02045" ref="H"/> + <fraction n="0.46056" ref="Si"/> + <fraction n="0.080" ref="Cl"/> + </material> + + <material name="graphite"> + <MEE unit="eV" value="78"/> + <D value="2.21" unit="g/cm3" /> + <fraction n="1.00" ref="C"/> + </material> + + <material name="Steel304L"> + <D type="density" value="8.00" unit="g/cm3" /> + <fraction n="0.695" ref="Fe" /> + <fraction n="0.185" ref="Cr" /> + <fraction n="0.100" ref="Ni" /> + <fraction n="0.020" ref="Mn" /> + </material> + + <!-- to model beampipe with 2mm Be + 0.7mm Cu cables (calc by DJeans) --> + <material name="BeampipeBeCableMix"> + <D type="density" value="3.69" unit="g/cm3" /> + <fraction n="0.806" ref="Be" /> + <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="G4_BGO" state="solid"> + <MEE unit="eV" value="534.1"/> + <D value="7.13" unit="g/cm3" /> + <fraction n="0.154126" ref="O"/> + <fraction n="0.174820" ref="Ge" /> + <fraction n="0.671054" ref="Bi" /> + </material> + + </materials> diff --git a/Detector/DetCRD/compact/CRD_o1_v01/CRD_Dimensions_v01_01.xml b/Detector/DetCRD/compact/CRD_o1_v01/CRD_Dimensions_v01_01.xml new file mode 100644 index 0000000000000000000000000000000000000000..0c1d96af5a4b36b0ed192ffa84bda86e09fe830c --- /dev/null +++ b/Detector/DetCRD/compact/CRD_o1_v01/CRD_Dimensions_v01_01.xml @@ -0,0 +1,222 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd"> + + <info name="CRDDimensions" + title="master file with includes and world dimension" + author="C.D.Fu, " + url="no" + status="development" + version="1.0"> + <comment> + undeterminded parameters + </comment> + </info> + + <define> + <constant name="CrossingAngle" value="0.033*rad"/> + + <constant name="GlobalTrackerReadoutID_DCH" type="string" value="system:8,chamber:1,layer:7,phi:16"/> + <constant name="GlobalTrackerReadoutID" type="string" value="system:5,side:-2,layer:9,module:8,sensor:8,barrelside:-2"/> + + <constant name="Field_nominal_value" value="3*tesla"/> + <constant name="Field_outer_nominal_value" value="-1.3*tesla"/> + + <constant name="env_safety" value="0.1*mm"/> + + <constant name="DetID_NOTUSED" value=" 0"/> + <constant name="DetID_VXD" value=" 1"/> + <constant name="DetID_SIT" value=" 2"/> + <constant name="DetID_FTD" value=" 3"/> + <constant name="DetID_TPC" value=" 4"/> + <constant name="DetID_SET" value=" 5"/> + <constant name="DetID_ETD" value=" 6"/> + <constant name="DetID_DC" value=" 7"/> + + <constant name="DetID_ECAL" value=" 20"/> + <constant name="DetID_ECAL_PLUG" value=" 21"/> + <constant name="DetID_HCAL" value=" 22"/> + <constant name="DetID_HCAL_RING" value=" 23"/> + <constant name="DetID_LCAL" value=" 24"/> + <constant name="DetID_BCAL" value=" 25"/> + <constant name="DetID_LHCAL" value=" 26"/> + <constant name="DetID_YOKE" value=" 27"/> + <constant name="DetID_COIL" value=" 28"/> + <constant name="DetID_ECAL_ENDCAP" value=" 29"/> + <constant name="DetID_HCAL_ENDCAP" value=" 30"/> + <constant name="DetID_YOKE_ENDCAP" value=" 31"/> + + <constant name="DetID_bwd" value="-1"/> + <constant name="DetID_barrel" value=" 0"/> + <constant name="DetID_fwd" value="+1"/> + + <constant name="BeamPipe_Be_inner_thickness" value="0.5*mm"/> + <constant name="BeamPipe_Cooling_thickness" value="0.5*mm"/> + <constant name="BeamPipe_Be_outer_thickness" value="0.3*mm"/> + <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_CentralBe_zmax" value="120*mm"/> + <constant name="BeamPipe_CentralAl_zmax" value="205*mm"/> + <constant name="BeamPipe_ConeAl_zmax" value="655*mm"/> + <constant name="BeamPipe_LinkerAl_zmax" value="700*mm"/> + <constant name="BeamPipe_LinkerCu_zmax" value="780*mm"/> + <constant name="BeamPipe_Waist_zmax" value="805*mm"/> + <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_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_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"/> + + <constant name="Vertex_inner_radius" value="BeamPipe_Central_inner_radius+BeamPipe_Be_total_thickness"/> + <constant name="Vertex_outer_radius" value="101*mm"/> + <constant name="Vertex_half_length" value="200*mm"/> + + <constant name="MainTracker_half_length" value="2225*mm" /> + <constant name="InnerTracker_half_length" value="MainTracker_half_length" /> + <constant name="InnerTracker_inner_radius" value="235*mm"/> + <constant name="InnerTracker_outer_radius" value="909*mm"/> + <constant name="OuterTracker_half_length" value="MainTracker_half_length"/> + <constant name="OuterTracker_inner_radius" value="1085*mm"/> + <constant name="OuterTracker_outer_radius" value="1716*mm"/> + + <constant name="SIT1_inner_radius" value="152.90*mm"/> + <constant name="SIT1_half_length" value="368.00*mm"/> + <constant name="SIT2_inner_radius" value="InnerTracker_outer_radius + env_safety"/> + <constant name="SIT2_half_length" value="InnerTracker_half_length"/> + + <constant name="FTD_BeamPipe_cable_clearance" value="10*mm"/> + <constant name="FTD_BeamPipe_gap" value="15*mm"/> + <constant name="FTD_InnerTracker_gap" value="5*mm"/> + + <!--obseleted constance, used by old construct, should be removed while creating new constrcut--> + <constant name="TPC_Ecal_Hcal_barrel_halfZ" value="MainTracker_half_length"/> + <constant name="TPC_inner_radius" value="InnerTracker_inner_radius"/> + <constant name="TPC_outer_radius" value="OuterTracker_outer_radius"/> + <constant name="SIT1_Radius" value="SIT1_inner_radius"/> + <constant name="SIT1_Half_Length_Z" value="SIT1_half_length"/> + <constant name="SIT2_Radius" value="InnerTracker_inner_radius"/> <!--fake, used by FTD_Simple_Staggered and FTD_cepc, now should be determined by inner tracker--> + <constant name="SIT2_Half_Length_Z" value="SIT2_half_length"/> + <constant name="TUBE_IPOuterTube_end_z" value="BeamPipe_CentralAl_zmax"/> + <constant name="TUBE_IPOuterTube_end_radius" value="BeamPipe_Central_inner_radius+BeamPipe_Al_thickness"/> + <constant name="TUBE_IPOuterBulge_end_z" value="BeamPipe_Crotch_zmax"/><!--"BeamPipe_ConeAl_zmax"/--> + <constant name="TUBE_IPOuterBulge_end_radius" value="BeamPipe_Crotch_zmax*tan(CrossingAngle/2)+BeamPipe_Dnstream_inner_radius+BeamPipe_Cu_thickness"/> + <!--"BeamPipe_Expanded_inner_radius+BeamPipe_Al_thickness+5*mm"/--> + + <constant name="Ecal_barrel_inner_radius" value="1800*mm"/> + <constant name="Ecal_barrel_thickness" value="280*mm"/> + <constant name="Ecal_barrel_outer_radius" value="(Ecal_barrel_inner_radius+Ecal_barrel_thickness)/cos(pi/8)"/> + <constant name="Ecal_barrel_half_length" value="2300*mm"/> + <constant name="Ecal_barrel_symmetry" value="8"/> + + <constant name="Ecal_endcap_inner_radius" value="340*mm"/> + <constant name="Ecal_endcap_outer_radius" value="Ecal_barrel_outer_radius"/> + <constant name="Ecal_endcap_zmin" value="2260*mm"/> + <constant name="Ecal_endcap_zmax" value="2540*mm"/> + <constant name="Ecal_endcap_symmetry" value="8"/> + + <constant name="Solenoid_inner_radius" value="2250*mm"/> + <constant name="Solenoid_outer_radius" value="2550*mm"/> + <constant name="Solenoid_half_length" value="3000*mm"/> + <constant name="SolenoidCoil_half_length" value="2900*mm"/> + <constant name="SolenoidCoil_radius" value="2300*mm"/> + <constant name="SolenoidCoil_center_radius" value="(Solenoid_inner_radius+Solenoid_outer_radius)/2"/> + + <constant name="Hcal_barrel_inner_radius" value="2600*mm"/> + <constant name="Hcal_barrel_outer_radius" value="3700*mm"/> + <constant name="Hcal_barrel_half_length" value="3000*mm"/> + <constant name="Hcal_barrel_symmetry" value="8"/> + + <constant name="Hcal_endcap_inner_radius" value="340*mm"/> + <constant name="Hcal_endcap_outer_radius" value="Hcal_barrel_outer_radius"/> + <constant name="Hcal_endcap_zmin" value="3010*mm"/> + <constant name="Hcal_endcap_zmax" value="4110*mm"/> + <constant name="Hcal_endcap_symmetry" value="8"/> + + <constant name="Hcal_ring_inner_radius" value="Hcal_endcap_inner_radius"/> + <constant name="Hcal_ring_outer_radius" value="Solenoid_inner_radius"/> + <constant name="Hcal_ring_zmin" value="2600*mm"/> + <constant name="Hcal_ring_zmax" value="Hcal_endcap_zmin"/> + <constant name="Hcal_ring_symmetry" value="8"/> + + <constant name="Yoke_barrel_inner_radius" value="3710*mm"/> + <constant name="Yoke_barrel_outer_radius" value="5170*mm"/> + <constant name="Yoke_barrel_half_length" value="3650*mm"/> + <constant name="Yoke_barrel_symmetry" value="8"/> + + <constant name="Yoke_endcap_inner_radius" value="400*mm"/> + <constant name="Yoke_endcap_outer_radius" value="5170*mm"/> + <constant name="Yoke_endcap_zmin" value="4150*mm"/> + <constant name="Yoke_endcap_zmax" value="5610*mm"/> + <constant name="Yoke_endcap_outer_symmetry" value="8"/> + <constant name="Yoke_endcap_inner_symmetry" value="0"/> + + <constant name="LumiCal_zmax" value="805*mm" /> + <constant name="LumiCal_zmin" value="700*mm"/> + <constant name="LumiCal_thickness" value="(LumiCal_zmax-LumiCal_zmin)/2.0"/> + <constant name="LumiCal_inner_radius" value="35.0*mm"/> + <constant name="LumiCal_outer_radius" value="100.0*mm- env_safety"/> + + <constant name="tracker_region_zmax" value="OuterTracker_half_length"/> + <constant name="tracker_region_rmax" value="OuterTracker_outer_radius"/> + + </define> + + <limits> + <limitset name="cal_limits"> + <limit name="step_length_max" particles="*" value="5.0" unit="mm" /> + </limitset> + <limitset name="dc_limits"> + <limit name="step_length_max" particles="*" value="10.0" unit="mm" /> + </limitset> + <limitset name="tracker_limits"> + <limit name="step_length_max" particles="*" value="5.0" unit="mm" /> + </limitset> + </limits> + + <regions> + <region name="BeampipeRegion"/> + <region name="VertexRegion"/> + <region name="ForwardRegion"/> + </regions> + + <display> + <vis name="VXDVis" alpha="0.1" r="0.1" g=".5" b=".5" showDaughters="true" visible="true"/> + <vis name="VXDLayerVis" alpha="1.0" r="0.1" g=".5" b=".5" showDaughters="true" visible="true"/> + <vis name="VXDSupportVis" alpha="1.0" r="0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/> + <vis name="FTDVis" alpha="1.0" r="0.0" g="0.1" b="0.0" showDaughters="true" visible="false"/> + <vis name="FTDSensitiveVis" alpha="1.0" r="1.0" g="1.0" b="0.45" showDaughters="true" visible="true"/> + <vis name="FTDSupportVis" alpha="1.0" r="1.0" g="0.5" b="0.5" showDaughters="true" visible="true"/> + <vis name="SITVis" alpha="1.0" r="0.54" g="0.43" b="0.04" showDaughters="true" visible="true"/> + <vis name="SETVis" alpha="1.0" r="0.8" g="0.8" b="0.4" showDaughters="true" visible="false"/> + <vis name="ECALVis" alpha="1.0" r="0.2" g="0.6" b="0" showDaughters="true" visible="true"/> + <vis name="HCALVis" alpha="1.0" r="0.078" g="0.01176" b="0.588" showDaughters="true" visible="true"/> + <vis name="SOLVis" alpha="1.0" r="0.4" g="0.4" b="0.4" showDaughters="true" visible="true"/> + <vis name="YOKEVis" alpha="1.0" r="0.6" g="0.0" b="0.0" showDaughters="true" visible="true"/> + <vis name="LCALVis" alpha="1.0" r="0.25" g="0.88" b="0.81" showDaughters="true" visible="true"/> + <vis name="SupportVis" alpha="1.0" r="0.2" g="0.2" b="0.2" showDaughters="true" visible="true"/> + + <vis name="WhiteVis" alpha="0.0" r=".96" g=".96" b=".96" showDaughters="true" visible="true"/> + <vis name="LightGrayVis" alpha="0.0" r=".75" g=".75" b=".75" showDaughters="true" visible="true"/> + <vis name="Invisible" alpha="0.0" r="0.0" g="0.0" b="0.0" showDaughters="false" visible="false"/> + <vis name="SeeThrough" alpha="0.0" r="0.0" g="0.0" b="0.0" showDaughters="true" visible="false"/> + <vis name="RedVis" alpha="1.0" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/> + <vis name="GreenVis" alpha="1.0" r="0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/> + <vis name="BlueVis" alpha="1.0" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/> + <vis name="CyanVis" alpha="1.0" r="0.0" g="1.0" b="1.0" showDaughters="true" visible="true"/> + <vis name="MagentaVis" alpha="1.0" r="1.0" g="0.0" b="1.0" showDaughters="true" visible="true"/> + <vis name="YellowVis" alpha="1.0" r="1.0" g="1.0" b="0.0" showDaughters="true" visible="true"/> + <vis name="BlackVis" alpha="1.0" r="0.0" g="0.0" b="0.0" showDaughters="true" visible="true"/> + <vis name="GrayVis" alpha="1.0" r="0.5" g="0.5" b="0.5" showDaughters="true" visible="true"/> + </display> + +</lccdd> diff --git a/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01.xml b/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01.xml new file mode 100644 index 0000000000000000000000000000000000000000..d264a40d004528055692ba1de56706e7f009986f --- /dev/null +++ b/Detector/DetCRD/compact/CRD_o1_v01/CRD_o1_v01.xml @@ -0,0 +1,51 @@ +<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd"> + <info name="CRD_i1_v01" + title="CepC reference detctor with coil inside Hcal" + author="C.D.Fu, " + url="http://cepc.ihep.ac.cn" + status="developing" + version="v01"> + <comment>CepC reference detector simulation models used for detector study </comment> + </info> + + <includes> + <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/elements.xml"/> + <gdmlFile ref="../CRD_common_v01/materials.xml"/> + </includes> + + <define> + <constant name="world_size" value="25*m"/> + <constant name="world_x" value="world_size"/> + <constant name="world_y" value="world_size"/> + <constant name="world_z" value="world_size"/> + + <include ref="${DD4hepINSTALL}/DDDetectors/compact/detector_types.xml"/> + </define> + + <include ref="./CRD_Dimensions_v01_01.xml"/> + + <include ref="../CRD_common_v01/Beampipe_v01_01.xml"/> + <include ref="../CRD_common_v01/VXD_v01_01.xml"/> + <include ref="../CRD_common_v01/FTD_SimpleStaggered_v01_01.xml"/> + <include ref="../CRD_common_v01/SIT_SimplePlanar_v01_01.xml"/> + <include ref="../CRD_common_v01/DC_Simple_v01_01.xml"/> + <include ref="../CRD_common_v01/SET_SimplePlanar_v01_01.xml"/> + <include ref="../CRD_common_v01/Ecal_Crystal_Barrel_v01_01.xml"/> + <!--include ref="../CRD_common_v01/Ecal_Crystal_Endcap_v01_01.xml"/--> + <!--include ref="../CRD_common_v01/Coil_v01_01.xml"/--> + <!--include ref="../CRD_common_v01/Hcal_v01_01.xml"/--> + <!--include ref="../CRD_common_v01/Yoke_v01_01.xml"/--> + <!--include ref="../CRD_common_v01/Lcal_v01_01.xml"/--> + + <fields> + <field name="GlobalSolenoid" type="solenoid" + inner_field="Field_nominal_value" + outer_field="Field_outer_nominal_value" + zmax="SolenoidCoil_half_length" + outer_radius="SolenoidCoil_center_radius"> + </field> + </fields> + +</lccdd> diff --git a/Detector/DetCRD/compact/README.md b/Detector/DetCRD/compact/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3ca82e71804c4139861744be371791a2b1464e23 --- /dev/null +++ b/Detector/DetCRD/compact/README.md @@ -0,0 +1,40 @@ +# CRD detector models - Overview + +The following CRD detector models are available in CEPCSW + +| Model | Description | MainTracker | Ecal | Hcal | Status | +| ------------- | -----------------------------|------------ |---------|------|----------------| +| CRD_o1_v01 | coil inside simulation model | DC | crystal | RPC | developing | +| ------------- | -----------------------------|-------------|---------|------|----------------| + +## Details + +### CRD_o1_v01 (first preliminary import, to update) + - coil inside CRD model + - BeamPipe + - with center pipe + crotch link to doubly-pipe + - Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp + - Vertex + - with silicon ladders (VXD + SIT12) + - Detector/DetCEPCv4/src/tracker/VXD04_geo.cpp + - Detector/DetCEPCv4/src/tracker/SIT_Simple_Planar_geo.cpp + - MainTracker + - with Dirft Chamber + silicon layer between inner and outer chambers (DC + SIT34 + SET) + - DC_outer_radius = 1716*mm + - Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp + - Detector/DetCEPCv4/src/tracker/SET_Simple_Planar_geo.cpp + - EndcapTracker + - with silicon pestals (FTDPixel + FTDStrip) + - Detector/DetCEPCv4/src/tracker/FTD_Simple_Staggered_geo.cpp + - Ecal + - with crystal + - Detector/DetCRD/src/Calorimeter/CRDEcal.cpp + - Hcal (TODO) + - with scintillator **and** RPC readout + - creates two sets of hit collections + - Coil (TODO) + - Yoke (TODO) + - compact files: + - [./CRD_o1_v01/CRD_o1_v01.xml](./CRD_o1_v01/CRD_o1_v01.xml) + + diff --git a/Detector/DetCRD/compact/ecalBarrel.xml b/Detector/DetCRD/compact/ecalBarrel.xml deleted file mode 100644 index 5868a6e88708f27696869d35ce6a9cd9bc62d1b7..0000000000000000000000000000000000000000 --- a/Detector/DetCRD/compact/ecalBarrel.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<lccdd> - - <includes> - <gdmlFile ref="elements.xml"/> - <gdmlFile ref="materials.xml"/> - </includes> - - <define> - <constant name="world_size" value="30*m"/> - <constant name="world_x" value="world_size"/> - <constant name="world_y" value="world_size"/> - <constant name="world_z" value="world_size"/> - <constant name="ecalbarrel_inner_radius" value="1800*mm"/> - <constant name="ecalbarrel_thickness" value="280*mm"/> <!--Must be n*10*mm! --> - <constant name="ecalbarrel_zlength" value="4600*mm"/> <!--Must be n*10*mm! --> - </define> - - <display> - <vis name="Invisible" showDaughters="false" visible="false"/> - <vis name="InvisibleWithChildren" showDaughters="true" visible="false"/> - <vis name="VisibleRed" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/> - <vis name="VisibleBlue" r="0.0" g="0.0" b="1.0" showDaughters="false" visible="true"/> - <vis name="VisibleGreen" alpha="1.0" r="0.0" g="1.0" b="0.0" drawingStyle="solid" lineStyle="solid" showDaughters="true" visible="true"/> - </display> - - <detectors> - <detector id="1" name="CaloDetector" type="CRDEcalBarrel" readout="CaloHitsCollection" vis="Invisible" sensitive="true"> - <!-- Use cm as unit if you want to use Pandora for reconstruction --> - </detector> - </detectors> - - <readouts> - <readout name="CaloHitsCollection"> - <!-- <segmentation type="NoSegmentation"/> --> - - <!--segmentation type="CartesianGridXYZ" - grid_size_x="1*cm" - grid_size_y="1*cm" - grid_size_z="1*cm"/--> - <id>system:4,layer:6,block:8,bar:10</id> - </readout> - </readouts> - -</lccdd> diff --git a/Detector/DetCRD/scripts/sim_CRD.py b/Detector/DetCRD/scripts/sim_CRD.py new file mode 100644 index 0000000000000000000000000000000000000000..666d0e45ffbf3fc0ce0003ffaf668f08cab5896c --- /dev/null +++ b/Detector/DetCRD/scripts/sim_CRD.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +from Gaudi.Configuration import * + +from Configurables import K4DataSvc +dsvc = K4DataSvc("EventDataSvc") + +from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_ +# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi +rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_() # The default engine in Geant4 +rndmengine.SetSingleton = True +rndmengine.Seeds = [10] + +geometry_option = "CRD_o1_v01/CRD_o1_v01.xml" + +if not os.getenv("DETCRDROOT"): + print("Can't find the geometry. Please setup envvar DETCRDROOT." ) + sys.exit(-1) + +geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact", geometry_option) +if not os.path.exists(geometry_path): + print("Can't find the compact geometry file: %s"%geometry_path) + sys.exit(-1) + +from Configurables import GeomSvc +geosvc = GeomSvc("GeomSvc") +geosvc.compact = geometry_path + +############################################################################## +# Physics Generator +############################################################################## +from Configurables import GenAlgo +from Configurables import GtGunTool +from Configurables import StdHepRdr +from Configurables import SLCIORdr +from Configurables import HepMCRdr +from Configurables import GenPrinter +gun = GtGunTool("GtGunTool") +gun.Particles = ["mu-"] +gun.EnergyMins = [100.] # GeV +gun.EnergyMaxs = [100.] # GeV +gun.ThetaMins = [0] # deg +gun.ThetaMaxs = [180] # deg +gun.PhiMins = [0] # deg +gun.PhiMaxs = [360] # deg +# stdheprdr = StdHepRdr("StdHepRdr") +# stdheprdr.Input = "/cefs/data/stdhep/CEPC250/2fermions/E250.Pbhabha.e0.p0.whizard195/bhabha.e0.p0.00001.stdhep" +# lciordr = SLCIORdr("SLCIORdr") +# lciordr.Input = "/cefs/data/stdhep/lcio250/signal/Higgs/E250.Pbbh.whizard195/E250.Pbbh_X.e0.p0.whizard195/Pbbh_X.e0.p0.00001.slcio" +# hepmcrdr = HepMCRdr("HepMCRdr") +# hepmcrdr.Input = "example_UsingIterators.txt" + +genprinter = GenPrinter("GenPrinter") + +genalg = GenAlgo("GenAlgo") +genalg.GenTools = ["GtGunTool"] +#genalg.GenTools = ["StdHepRdr"] +# genalg.GenTools = ["StdHepRdr", "GenPrinter"] +# genalg.GenTools = ["SLCIORdr", "GenPrinter"] +# genalg.GenTools = ["HepMCRdr", "GenPrinter"] + +############################################################################## +# Detector Simulation +############################################################################## +from Configurables import DetSimSvc +detsimsvc = DetSimSvc("DetSimSvc") + +from Configurables import DetSimAlg +detsimalg = DetSimAlg("DetSimAlg") +# detsimalg.VisMacs = ["vis.mac"] +detsimalg.RunCmds = [ +# "/tracking/verbose 1", +] +detsimalg.AnaElems = [ + # example_anatool.name() + # "ExampleAnaElemTool" + "Edm4hepWriterAnaElemTool" +] +detsimalg.RootDetElem = "WorldDetElemTool" + +from Configurables import PodioOutput +out = PodioOutput("outputalg") +out.filename = "CRD-o1-v01-sim00.root" +out.outputCommands = ["keep *"] + +# ApplicationMgr +from Configurables import ApplicationMgr +ApplicationMgr( + TopAlg = [genalg, detsimalg, out], + EvtSel = 'NONE', + EvtMax = 100, + ExtSvc = [rndmengine, dsvc, geosvc], + OutputLevel=INFO +) diff --git a/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp b/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9edde760ce8deba88dc8bd7079b4045662e862f5 --- /dev/null +++ b/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp @@ -0,0 +1,550 @@ +//==================================================================== +// CepC BeamPipe models in DD4hep +//-------------------------------------------------------------------- +#include "OtherDetectorHelpers.h" +#include "TGeoScaledShape.h" + +#include "DD4hep/DetFactoryHelper.h" +#include "DD4hep/DD4hepUnits.h" +#include "DD4hep/DetType.h" +#include "DD4hep/detail/Handle.inl" +#include "DDRec/DetectorData.h" +#include "DDRec/Surface.h" +#include "XML/Utilities.h" +#include <cmath> +#include <map> +#include <string> + +using dd4hep::Assembly; +using dd4hep::BUILD_ENVELOPE; +using dd4hep::DetElement; +using dd4hep::Detector; +using dd4hep::PlacedVolume; +using dd4hep::Ref_t; +using dd4hep::SensitiveDetector; +using dd4hep::Volume; + +using dd4hep::rec::ConicalSupportData; +using dd4hep::rec::SurfaceType; +using dd4hep::rec::Vector3D; +using dd4hep::rec::VolCylinder; +using dd4hep::rec::VolCylinderImpl; +using dd4hep::rec::VolSurface; +using dd4hep::rec::volSurfaceList; + +//BeamPipe +static Ref_t create_detector(Detector& theDetector, + xml_h element, + SensitiveDetector /*sens*/) { + + std::cout << "This is the Beampipe:" << std::endl; + + //Access to the XML File + xml_det_t x_beampipe = element; + const std::string name = x_beampipe.nameStr(); + + DetElement tube( name, x_beampipe.id() ) ; + + // --- create an envelope volume and position it into the world --------------------- + Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector, element , tube ) ; + + dd4hep::xml::setDetectorTypeFlag( element, tube ) ; + + if( theDetector.buildType() == BUILD_ENVELOPE ) return tube ; + + //----------------------------------------------------------------------------------- + ConicalSupportData* beampipeData = new ConicalSupportData ; + + const double phi0 = 0 ; + const double dPhi = 360.0*dd4hep::degree; + + //Parameters we have to know about + dd4hep::xml::Component xmlParameter = x_beampipe.child(_Unicode(parameter)); + const double crossingAngle = xmlParameter.attr< double >(_Unicode(crossingangle)); + std::cout << "Crossing angle = " << crossingAngle << std::endl; + + for(xml_coll_t si( x_beampipe ,Unicode("section")); si; ++si) { + xml_comp_t x_section(si); + + CEPC::ECrossType type = CEPC::getCrossType(x_section.attr< std::string >(_Unicode(type))); + + const double zstart = x_section.attr< double > (_Unicode(zStart)); + const double zend = x_section.attr< double > (_Unicode(zEnd)); + const double rInnerStart = x_section.attr< double > (_Unicode(rStart)); + double rInnerEnd=0, size=0, shift=0; + try{ + rInnerEnd = x_section.attr< double > (_Unicode(rEnd)); + } + catch(std::runtime_error& e){ + rInnerEnd = rInnerStart; + } + if(type==CEPC::kWaist || type==CEPC::kFatWaist || type==CEPC::kCrotch || type==CEPC::kCrotchAsymUp || type==CEPC::kCrotchAsymDn){ + try{ + size = x_section.attr< double > (_Unicode(size)); + } + catch(std::runtime_error& e){ + std::cout << "The maximum distance of runway is not set, will be calculated automatically by crossing angle" <<std::endl; + } + try{ + shift = x_section.attr< double > (_Unicode(shift)); + } + catch(std::runtime_error& e){ + shift = 0; + } + } + + const std::string volName = "BeamPipe_" + x_section.nameStr(); + + std::cout << "section: " + << std::setw(8) << zstart /dd4hep::mm + << std::setw(8) << zend /dd4hep::mm + << std::setw(8) << rInnerStart /dd4hep::mm + << std::setw(8) << rInnerEnd /dd4hep::mm + << std::setw(8) << size /dd4hep::mm + << std::setw(8) << type + << std::setw(35) << volName + << std::endl; + + const double angle = crossingAngle; + const double zHalf = fabs(zend - zstart) * 0.5; + const double zCenter = fabs(zend + zstart) * 0.5; + dd4hep::Material beamMaterial = theDetector.material("beam"); + + double clipSize = 100*dd4hep::mm; + if(type==CEPC::kFlareLegUp || type==CEPC::kFlareLegDn){ + double total = rInnerStart, totalEnd = rInnerEnd; + for(xml_coll_t li(x_section,_U(layer)); li; ++li) { + xml_comp_t x_layer(li); + const double thickness = x_layer.thickness(); + total += thickness; + double thicknessEnd = 0; + try{ + thicknessEnd = x_layer.attr< double > (_Unicode(thicknessEnd)); + } + catch(std::runtime_error& e){ + thicknessEnd = thickness; + } + totalEnd += thicknessEnd; + } + clipSize = std::max(total, totalEnd)*tan(0.5*angle); + } + + int ilayer = 0; + double radius = rInnerStart; + double radiusEnd = rInnerEnd; + double pipeRadius = 0; + double pipeThickness = 0; + double pipeThicknessRel = 0; + double pipeRadiusEnd = 0; + double pipeThicknessEnd = 0; + double pipeThicknessRelEnd = 0; + for(xml_coll_t li(x_section,_U(layer)); li; ++li, ++ilayer) { + xml_comp_t x_layer(li); + double thickness = x_layer.thickness(); + dd4hep::Material material = theDetector.material( x_layer.materialStr() ); + double thicknessEnd = 0; + try{ + thicknessEnd = x_layer.attr< double > (_Unicode(thicknessEnd)); + } + catch(std::runtime_error& e){ + thicknessEnd = thickness; + } + std::cout << " layer: " << std::setw(8) << thickness/dd4hep::mm << std::setw(8) << thicknessEnd/dd4hep::mm << std::setw(15) << material.name() << std::endl; + + char suffix[20]; + sprintf(suffix,"_%d",ilayer); + std::string layerName = volName + suffix; + if(type==CEPC::kCenter || type==CEPC::kCenterSide){ + dd4hep::ConeSegment subLayer(zHalf, radius, radius+thickness, radiusEnd, radiusEnd+thicknessEnd, phi0, dPhi); + dd4hep::Volume subLayerLog(volName, subLayer, material); + dd4hep::Transform3D transformer(dd4hep::RotationY(0), dd4hep::Position(0, 0, zCenter)); + dd4hep::Transform3D transmirror(dd4hep::RotationY(180*dd4hep::degree), dd4hep::RotateY(dd4hep::Position(0, 0, zCenter), 180*dd4hep::degree)); + envelope.placeVolume(subLayerLog, transformer); + envelope.placeVolume(subLayerLog, transmirror); + + if(material.radLength()<10000*dd4hep::mm) subLayerLog.setVisAttributes(theDetector, "TubeVis"); + else subLayerLog.setVisAttributes(theDetector, "VacVis"); + + if(material.radLength()<10000*dd4hep::mm){ + double tEff = thickness/material.radLength()*theDetector.material("G4_Be").radLength(); + double tEffEnd = thicknessEnd/material.radLength()*theDetector.material("G4_Be").radLength(); + if(pipeRadius==0) pipeRadius = radius; + if(pipeRadiusEnd==0) pipeRadiusEnd = radiusEnd; + pipeThickness += tEff; + pipeThicknessEnd += tEffEnd; + pipeThicknessRel += thickness; + pipeThicknessRelEnd += thicknessEnd; + } + } + else if(type==CEPC::kLegs){ + double clipAngle = 0.5*angle; + double lowNorml[3] = { sin(clipAngle), 0, -cos(clipAngle)}; + double highNorml[3] = {-sin(clipAngle), 0, cos(clipAngle)}; + dd4hep::CutTube subLayer(radius, radius+thickness, zHalf/cos(clipAngle), phi0, dPhi, lowNorml[0], lowNorml[1], lowNorml[2], highNorml[0], highNorml[1], highNorml[2]); + dd4hep::Volume subLayerLog(volName, subLayer, material); + dd4hep::Transform3D plusUpTransformer(dd4hep::RotationY(clipAngle), dd4hep::RotateY(dd4hep::Position(0,0,zCenter/cos(clipAngle)), clipAngle)); + dd4hep::Transform3D plusDownTransformer(dd4hep::RotationZYX(180*dd4hep::degree, -clipAngle, 0), dd4hep::RotateY(dd4hep::Position(0,0,zCenter/cos(clipAngle)), -clipAngle)); + dd4hep::Transform3D minusUpTransformer(dd4hep::RotationY(clipAngle), dd4hep::RotateY(dd4hep::Position(0,0,-zCenter/cos(clipAngle)), clipAngle)); + dd4hep::Transform3D minusDownTransformer(dd4hep::RotationZYX(180*dd4hep::degree, -clipAngle, 0), dd4hep::RotateY(dd4hep::Position(0,0,-zCenter/cos(clipAngle)), -clipAngle)); + envelope.placeVolume(subLayerLog, plusUpTransformer); + envelope.placeVolume(subLayerLog, plusDownTransformer); + envelope.placeVolume(subLayerLog, minusUpTransformer); + envelope.placeVolume(subLayerLog, minusDownTransformer); + + if(material.radLength()<10000*dd4hep::mm) subLayerLog.setVisAttributes(theDetector, "TubeVis"); + else subLayerLog.setVisAttributes(theDetector, "VacVis"); + } + else if(type==CEPC::kFlareLegUp || type==CEPC::kFlareLegDn){ + double clipAngle = (type==CEPC::kFlareLegUp)?0.5*angle:-0.5*angle; + double rOuter = radius+thickness; + double rOuterEnd = radiusEnd+thicknessEnd; + dd4hep::Tube clipSolid(0, zHalf*tan(0.5*angle)+clipSize/sin(0.5*angle), zHalf, phi0, dPhi); + dd4hep::Transform3D clipTransformer(dd4hep::RotationY(-clipAngle), dd4hep::Position(0, 0, 0)); + dd4hep::Transform3D placementTransformer(dd4hep::RotationY(clipAngle), dd4hep::RotateY(dd4hep::Position(0, 0, zCenter/cos(clipAngle)), clipAngle)); + dd4hep::Transform3D placementTransmirror(dd4hep::RotationZYX(0, clipAngle, 180*dd4hep::degree), dd4hep::RotateY(dd4hep::Position(0, 0, -zCenter/cos(clipAngle)), -clipAngle)); + dd4hep::ConeSegment wholeSolid(zHalf + clipSize, radius, rOuter, radiusEnd, rOuterEnd, phi0, dPhi); + dd4hep::IntersectionSolid layerSolid(wholeSolid, clipSolid, clipTransformer); + dd4hep::Volume subLayerLog(volName, layerSolid, material); + + envelope.placeVolume(subLayerLog, placementTransformer); + envelope.placeVolume(subLayerLog, placementTransmirror); + + if(material.radLength()<10000*dd4hep::mm) subLayerLog.setVisAttributes(theDetector, "TubeVis"); + else subLayerLog.setVisAttributes(theDetector, "VacVis"); + } + else if(type==CEPC::kCrotch){ + double beamAngle = 0.5*angle; + if(size==0) size = (zstart*tan(beamAngle)+radius)*2; + double x1 = 0.5*size - radius; + double x2 = zend*tan(beamAngle); + double y1 = radius + thickness; + double y2 = y1; + double axisAngle = atan((x2-x1)/zHalf/2); + if(fabs(beamAngle-axisAngle)>1e-12){ + std::cout << "Warning! axis angle not equal to beam angle. beam=" << beamAngle << " VS axis=" << axisAngle << ", user defined design and workable" << std::endl; + } + double zSide = 2*zHalf/cos(axisAngle)+y1*tan(axisAngle)+y2*tan(axisAngle); + double xshift = 0.5*(x1+x2); + dd4hep::Trd2 body1(x1, x2, y1, y2, zHalf); + dd4hep::Trd2 cut1(x1+y1/cos(axisAngle), x2+y2/cos(axisAngle), y1, y2, zHalf); + dd4hep::EllipticalTube side1(y1*cos(axisAngle), y1, 0.5*zSide); + dd4hep::Transform3D unionTransformer1(dd4hep::RotationY(axisAngle), dd4hep::Position(xshift, 0, 0)); + dd4hep::Transform3D unionTransformer2(dd4hep::RotationY(-axisAngle), dd4hep::Position(-xshift, 0, 0)); + dd4hep::Transform3D sameTransformer(dd4hep::RotationY(0), dd4hep::Position(0, 0, 0)); + dd4hep::UnionSolid tmp1Solid(body1, side1, unionTransformer1); + dd4hep::UnionSolid tmp2Solid(tmp1Solid, side1, unionTransformer2); + dd4hep::IntersectionSolid shell(tmp2Solid, cut1, sameTransformer); + dd4hep::Volume shellLog(volName+"Shell", shell, material); + envelope.placeVolume(shellLog, dd4hep::Position(0, 0, zCenter)); + envelope.placeVolume(shellLog, dd4hep::Transform3D(dd4hep::RotationY(180*dd4hep::degree), dd4hep::Position(0, 0, -zCenter))); + + double yHole = y1-thickness; + dd4hep::Trd2 body2(x1, x2, yHole, yHole, zHalf); + dd4hep::Trd2 cut2(0, x2, yHole, yHole, zHalf); + dd4hep::SubtractionSolid tmp3Solid(body2, cut2, sameTransformer); + dd4hep::EllipticalTube side2(yHole*cos(axisAngle), yHole, zSide); + dd4hep::UnionSolid tmp4Solid(tmp3Solid, side2, unionTransformer1); + dd4hep::UnionSolid tmp5Solid(tmp4Solid, side2, unionTransformer2); + double x1shift = radius-shift; + double crotchAngle = atan(0.5*(x2-x1shift)/zHalf); + dd4hep::EllipticalTube side3(yHole*cos(crotchAngle), yHole, zSide); + dd4hep::Transform3D unionTransformer3(dd4hep::RotationY(crotchAngle), dd4hep::Position(0.5*(x2+x1shift), 0, 0)); + dd4hep::Transform3D unionTransformer4(dd4hep::RotationY(-crotchAngle), dd4hep::Position(-0.5*(x2+x1shift), 0, 0)); + dd4hep::UnionSolid tmp6Solid(tmp5Solid, side3, unionTransformer3); + dd4hep::UnionSolid tmp7Solid(tmp6Solid, side3, unionTransformer4); + dd4hep::IntersectionSolid vacuumPipe(tmp7Solid, cut1, sameTransformer); + dd4hep::Volume pipeLog(volName+"Vacuum", vacuumPipe, beamMaterial); + shellLog.placeVolume(pipeLog, dd4hep::Position(0, 0, 0)); + + shellLog.setVisAttributes(theDetector, "TubeVis"); + pipeLog.setVisAttributes(theDetector, "VacVis"); + } + else if(type==CEPC::kCrotchAsymUp || type==CEPC::kCrotchAsymDn){ + double beamAngle = 0.5*angle; + double xC2 = (shift==0)?zend*tan(beamAngle):shift; + if(radiusEnd==0) radiusEnd = radius; + if(thicknessEnd==0) thicknessEnd = thickness; + if(size==0) size = 2*radius; + double rOuter = radius+thickness; + double rOuterEnd = radiusEnd+thicknessEnd; + double xMaxEnd = xC2+rOuterEnd; + double yMax = 0.5*size+thickness; + dd4hep::Trd2 body(0, xC2, yMax, rOuterEnd, zHalf); + + double expandAngle = atan(xC2/(2*zHalf)); + double edge1ToZAngle = atan((xMaxEnd-rOuter)/(2*zHalf)); + double edge2ToZAngle = atan((xC2-rOuterEnd+rOuter)/(2*zHalf)); + double edge2ToXAngle = 90*dd4hep::degree - edge2ToZAngle; + double bottomAngle = 0.5*(180*dd4hep::degree-(edge2ToZAngle-edge1ToZAngle)); + double rotateAngle = 0.5*(edge1ToZAngle+edge2ToZAngle); + double edge1ToCAngle = asin(sin(90*dd4hep::degree+edge1ToZAngle)/(xC2/sin(expandAngle))*(rOuter-rOuterEnd)); + double CToEConeAxisAngle = edge1ToCAngle-0.5*(edge2ToZAngle-edge1ToZAngle); + if(fabs(rotateAngle-(expandAngle-CToEConeAxisAngle))>1e-12){ + std::cout << "Warning! rotate angle was not calculated rightly. Please check input parameters whether satisfy the Waist case." << std::endl; + } + double a1 = rOuter/sin(bottomAngle)*sin(90*dd4hep::degree-edge1ToZAngle); + double a2 = rOuterEnd/sin(180*dd4hep::degree-bottomAngle)*sin(90*dd4hep::degree-edge2ToZAngle); + double zC1 = rOuter/sin(edge1ToCAngle)*sin(90*dd4hep::degree+edge1ToZAngle)*cos(CToEConeAxisAngle); + double zC2 = rOuterEnd/rOuter*zC1; + double zBottom = a1*tan(bottomAngle); + double aC1 = a1/zBottom*zC1; + double aC2 = a1/zBottom*zC2; + double xC1InECone = zC1*tan(CToEConeAxisAngle); + double xC2InECone = zC2*tan(CToEConeAxisAngle); + double bC1 = sqrt(rOuter*rOuter/(1-xC1InECone*xC1InECone/aC1/aC1)); + double bC2 = sqrt(rOuterEnd*rOuterEnd/(1-xC2InECone*xC2InECone/aC2/aC2)); + double b1 = bC1/zC1*zBottom; + if(fabs(bC1/zC1-bC2/zC2)>1e-12){ + std::cout << "Warning! bC1/zC1 not equal to bC2/zC2. Please tell Chengdong(fucd@ihep.ac.cn)." << std::endl; + } + double pzTopCut = 0.5*(a1-a2)*tan(bottomAngle); + double thetaCut1 = atan((0.5*(xC2+rOuterEnd)-0.5*rOuter)/(2*zHalf)); + double xcenterCut1 = 0.5*(0.5*(xC2+rOuterEnd)+0.5*rOuter); + dd4hep::Trap cut1(zHalf, thetaCut1, 0, yMax, 0.5*rOuter, 0.5*rOuter, 0, rOuterEnd, 0.5*(xC2+rOuterEnd), 0.5*(xC2+rOuterEnd), 0); + TGeoCone* pCone1 = new TGeoCone(pzTopCut, 0, a1, 0, a2); + //double factor = + TGeoScale* pScale1 = new TGeoScale(1, b1/a1, 1); + TGeoScaledShape* pScaledShape1 = new TGeoScaledShape(pCone1, pScale1); + dd4hep::Solid_type<TGeoScaledShape> side1(pScaledShape1); + + double xshift = 0.5*(xMaxEnd-a2*cos(rotateAngle)-rOuter+a1*cos(bottomAngle-edge2ToXAngle)); + double zshift = 0.5*(a2-a1)*sin(rotateAngle); + dd4hep::Transform3D unionTransformer1(dd4hep::RotationY(rotateAngle), dd4hep::Position(xshift, 0, zshift)); + dd4hep::Transform3D cutTransformer1(dd4hep::RotationY(0), dd4hep::Position(xcenterCut1, 0, 0)); + dd4hep::UnionSolid tmp1Solid(body, side1, unionTransformer1); + dd4hep::IntersectionSolid shell(tmp1Solid, cut1, cutTransformer1); + dd4hep::Volume shellLog(volName, shell, material); + if(type==CEPC::kCrotchAsymUp){ + envelope.placeVolume(shellLog, dd4hep::Position(0, 0, zCenter)); + envelope.placeVolume(shellLog, dd4hep::Transform3D(dd4hep::RotationX(180*dd4hep::degree), dd4hep::Position(0, 0, -zCenter))); + } + else{ + envelope.placeVolume(shellLog, dd4hep::Transform3D(dd4hep::RotationZ(180*dd4hep::degree), dd4hep::Position(0, 0, zCenter))); + envelope.placeVolume(shellLog, dd4hep::Transform3D(dd4hep::RotationY(180*dd4hep::degree), dd4hep::Position(0, 0,-zCenter))); + } + + double edge1ToZ = atan((xMaxEnd-thicknessEnd-radius)/(2*zHalf)); + double edge2ToZ = atan((xC2-radiusEnd+radius)/(2*zHalf)); + double edge2ToX = 90*dd4hep::degree - edge2ToZ; + double bottom = 0.5*(180*dd4hep::degree-(edge2ToZ-edge1ToZ)); + double rotate = 0.5*(edge1ToZ+edge2ToZ); + double edge1ToC = asin(sin(90*dd4hep::degree+edge1ToZ)/(xC2/sin(expandAngle))*(radius-radiusEnd)); + double CToEConeAxis = edge1ToC-0.5*(edge2ToZ-edge1ToZ); + if(fabs(rotate-(expandAngle-CToEConeAxis))>1e-12){ + std::cout << "Warning! rotate angle was not calculated rightly. Please check input parameters whether satisfy the Waist case." << std::endl; + } + double a1Hole = radius/sin(bottom)*sin(90*dd4hep::degree-edge1ToZ); + double a2Hole = radiusEnd/sin(180*dd4hep::degree-bottom)*sin(90*dd4hep::degree-edge2ToZ); + double zC1Hole = radius/sin(edge1ToC)*sin(90*dd4hep::degree+edge1ToZ)*cos(CToEConeAxis); + double zC2Hole = radiusEnd/radius*zC1Hole; + double zBottomHole = a1Hole*tan(bottom); + double aC1Hole = a1Hole/zBottomHole*zC1Hole; + double aC2Hole = a1Hole/zBottomHole*zC2Hole; + double xC1InEConeHole = zC1Hole*tan(CToEConeAxis); + double xC2InEConeHole = zC2Hole*tan(CToEConeAxis); + double bC1Hole = sqrt(radius*radius/(1-xC1InEConeHole*xC1InEConeHole/aC1Hole/aC1Hole)); + double bC2Hole = sqrt(radiusEnd*radiusEnd/(1-xC2InEConeHole*xC2InEConeHole/aC2Hole/aC2Hole)); + double b1Hole = bC1Hole/zC1Hole*zBottomHole; + if(fabs(bC1Hole/zC1Hole-bC2Hole/zC2Hole)>1e-12){ + std::cout << "Warning! bC1/zC1 not equal to bC2/zC2 for Hole. Please tell Chengdong(fucd@ihep.ac.cn)." << std::endl; + } + double pzTopCutHole = 0.5*(a1Hole-a2Hole)*tan(bottom); + dd4hep::Trd2 body2(0, xC2, yMax-thickness, radiusEnd, zHalf); + double thetaCut2 = atan((xC2-0.5*radius)/(2*zHalf)); + double xcenterCut2 = 0.5*radius+0.5*(xC2-0.5*radius); + dd4hep::Trap cut2(zHalf, thetaCut2, 0, yMax-thickness, 0.5*radius, 0.5*radius, 0, radiusEnd, radiusEnd, radiusEnd, 0); + TGeoCone* pCone2 = new TGeoCone(pzTopCutHole, 0, a1Hole, 0, a2Hole); + TGeoScale* pScale2 = new TGeoScale(1, b1Hole/a1Hole, 1); + TGeoScaledShape* pScaledShape2 = new TGeoScaledShape(pCone2, pScale2); + dd4hep::Solid_type<TGeoScaledShape> side2(pScaledShape2); + double xshiftHole = 0.5*(xMaxEnd-thicknessEnd-a2Hole*cos(rotate)-radius+a1Hole*cos(bottom-edge2ToX)); + double zshiftHole = 0.5*(a2Hole-a1Hole)*sin(rotate); + dd4hep::Transform3D cutTransformer2(dd4hep::RotationY(rotate), dd4hep::Position(xshiftHole-xcenterCut2, 0, zshiftHole)); + dd4hep::IntersectionSolid vacuumPipe(cut2, side2, cutTransformer2); + dd4hep::Volume pipeLog(volName, vacuumPipe, beamMaterial); + shellLog.placeVolume(pipeLog, dd4hep::Position(xcenterCut2, 0, 0)); + + shellLog.setVisAttributes(theDetector, "TubeVis"); + pipeLog.setVisAttributes(theDetector, "VacVis"); + } + else if(type==CEPC::kWaist){ + double beamAngle = 0.5*angle; + if(radiusEnd==0) radiusEnd = radius; + if(size==0) size = (zend*tan(beamAngle)+radiusEnd)*2; + if(thicknessEnd==0) thicknessEnd = thickness; + double xC2 = 0.5*size - radiusEnd; + double rOuter = radius+thickness; + double rOuterEnd = radiusEnd+thicknessEnd; + double rMaxEnd = 0.5*size+thicknessEnd; + dd4hep::Trd2 body1(0, xC2, rOuter, rOuterEnd, zHalf); + dd4hep::Trd2 cut(rOuter, rMaxEnd, rOuter, rOuterEnd, zHalf); + + double expandAngle = atan(xC2/(2*zHalf)); + double edge1ToZAngle = atan((rMaxEnd-rOuter)/(2*zHalf)); + double edge2ToZAngle = atan((xC2-rOuterEnd+rOuter)/(2*zHalf)); + double edge2ToXAngle = 90*dd4hep::degree - edge2ToZAngle; + double bottomAngle = 0.5*(180*dd4hep::degree-(edge2ToZAngle-edge1ToZAngle)); + double rotateAngle = 0.5*(edge1ToZAngle+edge2ToZAngle); + double edge1ToCAngle = asin(sin(90*dd4hep::degree+edge1ToZAngle)/(xC2/sin(expandAngle))*(rOuter-rOuterEnd)); + double CToEConeAxisAngle = edge1ToCAngle-0.5*(edge2ToZAngle-edge1ToZAngle); + if(fabs(rotateAngle-(expandAngle-CToEConeAxisAngle))>1e-12){ + std::cout << "Warning! rotate angle was not calculated rightly. Please check input parameters whether satisfy the Waist case." << std::endl; + } + double a1 = rOuter/sin(bottomAngle)*sin(90*dd4hep::degree-edge1ToZAngle); + double a2 = rOuterEnd/sin(180*dd4hep::degree-bottomAngle)*sin(90*dd4hep::degree-edge2ToZAngle); + double zC1 = rOuter/sin(edge1ToCAngle)*sin(90*dd4hep::degree+edge1ToZAngle)*cos(CToEConeAxisAngle); + double zC2 = rOuterEnd/rOuter*zC1; + double zBottom = a1*tan(bottomAngle); + double aC1 = a1/zBottom*zC1; + double aC2 = a1/zBottom*zC2; + double xC1InECone = zC1*tan(CToEConeAxisAngle); + double xC2InECone = zC2*tan(CToEConeAxisAngle); + double bC1 = sqrt(rOuter*rOuter/(1-xC1InECone*xC1InECone/aC1/aC1)); + double bC2 = sqrt(rOuterEnd*rOuterEnd/(1-xC2InECone*xC2InECone/aC2/aC2)); + double b1 = bC1/zC1*zBottom; + if(fabs(bC1/zC1-bC2/zC2)>1e-12){ + std::cout << "Warning! bC1/zC1 not equal to bC2/zC2." << std::endl; + } + double pzTopCut = 0.5*(a1-a2)*tan(bottomAngle); + TGeoCone* pCone1 = new TGeoCone(pzTopCut, 0, a1, 0, a2); + TGeoScale* pScale1 = new TGeoScale(1, b1/a1, 1); + TGeoScaledShape* pScaledShape1 = new TGeoScaledShape(pCone1,pScale1); + dd4hep::Solid_type<TGeoScaledShape> side1(pScaledShape1); + + double xshift = 0.5*(rMaxEnd-a2*cos(rotateAngle)-rOuter+a1*cos(bottomAngle-edge2ToXAngle)); + double zshift = 0.5*(a2-a1)*sin(rotateAngle); + dd4hep::Transform3D unionTransformer1(dd4hep::RotationY(rotateAngle), dd4hep::Position(xshift, 0, zshift)); + dd4hep::Transform3D unionTransformer2(dd4hep::RotationY(-rotateAngle), dd4hep::Position(-xshift, 0, zshift)); + dd4hep::Transform3D sameTransformer(dd4hep::RotationY(0), dd4hep::Position(0, 0, 0)); + dd4hep::UnionSolid tmp1Solid(body1, side1, unionTransformer1); + dd4hep::UnionSolid tmp2Solid(tmp1Solid, side1, unionTransformer2); + dd4hep::IntersectionSolid shell(tmp2Solid, cut, sameTransformer); + dd4hep::Volume shellLog(volName+"Shell", shell, material); + envelope.placeVolume(shellLog, dd4hep::Position(0, 0, zCenter)); + envelope.placeVolume(shellLog, dd4hep::Transform3D(dd4hep::RotationY(180*dd4hep::degree), dd4hep::Position(0, 0, -zCenter))); + + double edge1ToZ = atan((0.5*size-radius)/(2*zHalf)); + double edge2ToZ = atan((xC2-radiusEnd+radius)/(2*zHalf)); + double edge2ToX = 90*dd4hep::degree - edge2ToZ; + double bottom = 0.5*(180*dd4hep::degree-(edge2ToZ-edge1ToZ)); + double rotate = 0.5*(edge1ToZ+edge2ToZ); + double edge1ToC = asin(sin(90*dd4hep::degree+edge1ToZ)/(xC2/sin(expandAngle))*(radius-radiusEnd)); + double CToEConeAxis = edge1ToC-0.5*(edge2ToZ-edge1ToZ); + if(fabs(rotate-(expandAngle-CToEConeAxis))>1e-12){ + std::cout << "Warning! rotate angle was not calculated rightly. Please check input parameters whether satisfy the Waist case." << std::endl; + } + double a1Hole = radius/sin(bottom)*sin(90*dd4hep::degree-edge1ToZ); + double a2Hole = radiusEnd/sin(180*dd4hep::degree-bottom)*sin(90*dd4hep::degree-edge2ToZ); + double zC1Hole = radius/sin(edge1ToC)*sin(90*dd4hep::degree+edge1ToZ)*cos(CToEConeAxis); + double zC2Hole = radiusEnd/radius*zC1Hole; + double zBottomHole = a1Hole*tan(bottom); + double aC1Hole = a1Hole/zBottomHole*zC1Hole; + double aC2Hole = a1Hole/zBottomHole*zC2Hole; + double xC1InEConeHole = zC1Hole*tan(CToEConeAxis); + double xC2InEConeHole = zC2Hole*tan(CToEConeAxis); + double bC1Hole = sqrt(radius*radius/(1-xC1InEConeHole*xC1InEConeHole/aC1Hole/aC1Hole)); + double bC2Hole = sqrt(radiusEnd*radiusEnd/(1-xC2InEConeHole*xC2InEConeHole/aC2Hole/aC2Hole)); + double b1Hole = bC1Hole/zC1Hole*zBottomHole; + if(fabs(bC1Hole/zC1Hole-bC2Hole/zC2Hole)>1e-12){ + std::cout << "Warning! bC1/zC1 not equal to bC2/zC2 for Hole." << std::endl; + } + double pzTopCutHole = 0.5*(a1Hole-a2Hole)*tan(bottom); + dd4hep::Trd2 body2(0, xC2, radius, radiusEnd, zHalf); + dd4hep::Trd2 cut2(radius, 0.5*size, radius, radiusEnd, zHalf); + TGeoCone* pCone2 = new TGeoCone(pzTopCutHole, 0, a1Hole, 0, a2Hole); + TGeoScale* pScale2 = new TGeoScale(1, b1Hole/a1Hole, 1); + TGeoScaledShape* pScaledShape2 = new TGeoScaledShape(pCone2,pScale2); + dd4hep::Solid_type<TGeoScaledShape> side2(pScaledShape2); + + double xshiftHole = 0.5*(0.5*size-a2Hole*cos(rotate)-radius+a1Hole*cos(bottom-edge2ToX)); + double zshiftHole = 0.5*(a2Hole-a1Hole)*sin(rotate); + dd4hep::Transform3D unionTransformer3(dd4hep::RotationY(rotate), dd4hep::Position(xshiftHole, 0, zshiftHole)); + dd4hep::Transform3D unionTransformer4(dd4hep::RotationY(-rotate), dd4hep::Position(-xshiftHole, 0, zshiftHole)); + dd4hep::UnionSolid tmp3Solid(body2, side2, unionTransformer3); + dd4hep::UnionSolid tmp4Solid(tmp3Solid, side2, unionTransformer4); + dd4hep::IntersectionSolid vacuumPipe(tmp4Solid, cut, sameTransformer); + dd4hep::Volume pipeLog(volName+"Vacuum", vacuumPipe, beamMaterial); + shellLog.placeVolume(pipeLog, dd4hep::Position(0, 0, 0)); + + shellLog.setVisAttributes(theDetector, "TubeVis"); + pipeLog.setVisAttributes(theDetector, "VacVis"); + } + else if(type == CEPC::kFatWaist){ + double beamAngle = 0.5*angle; + if(radiusEnd==0) radiusEnd = radius; + if(size==0) size = (zend*tan(beamAngle)+radiusEnd)*2; + if(thicknessEnd==0) thicknessEnd = thickness; + double rOuter = radius+thickness; + double rOuterEnd = radiusEnd+thicknessEnd; + double yMaxEnd = 0.5*size+thicknessEnd; + dd4hep::Transform3D sameTransformer(dd4hep::RotationY(0), dd4hep::Position(0, 0, 0)); + + dd4hep::Trd2 body1(rOuter, rOuterEnd, rOuter, yMaxEnd, zHalf); + dd4hep::ConeSegment cone1(zHalf, 0, rOuter, 0, rOuterEnd, phi0, dPhi); + dd4hep::IntersectionSolid shell(cone1, body1, sameTransformer); + dd4hep::Volume shellLog(volName, shell, material); + envelope.placeVolume(shellLog, dd4hep::Position(0, 0, zCenter)); + envelope.placeVolume(shellLog, dd4hep::Transform3D(dd4hep::RotationY(180*dd4hep::degree), dd4hep::Position(0, 0, -zCenter))); + + dd4hep::Trd2 body2(radius, radiusEnd, radius, 0.5*size, zHalf); + dd4hep::ConeSegment cone2(zHalf, 0, radius, 0, radius, phi0, dPhi); + dd4hep::IntersectionSolid vacuumPipe(cone2, body2, sameTransformer); + dd4hep::Volume pipeLog(volName, vacuumPipe, beamMaterial); + shellLog.placeVolume(pipeLog, dd4hep::Position(0, 0, 0)); + + shellLog.setVisAttributes(theDetector, "TubeVis"); + pipeLog.setVisAttributes(theDetector, "VacVis"); + } + radius += thickness; + radiusEnd += thicknessEnd; + } + if( type == CEPC::kCenter ) { // store only the central sections ! + ConicalSupportData::Section section ; + section.rInner = pipeRadius + 0.5*(pipeThicknessRel-pipeThickness) ; + section.rOuter = section.rInner + pipeThickness; + section.zPos = zstart ; + + ConicalSupportData::Section sectionEnd ; + sectionEnd.rInner = pipeRadiusEnd + 0.5*(pipeThicknessRelEnd-pipeThicknessEnd) ; + sectionEnd.rOuter = sectionEnd.rInner + pipeThicknessEnd; + sectionEnd.zPos = zend ; + + if(beampipeData->sections.size()!=0){ + ConicalSupportData::Section last = beampipeData->sections.back(); + if(last.rInner != section.rInner || last.rOuter != section.rOuter){ + section.zPos = zstart + 1e-9*dd4hep::mm ; + beampipeData->sections.push_back( section ); + } + } + else beampipeData->sections.push_back( section ); + beampipeData->sections.push_back( sectionEnd ) ; + } + }//for all xmlSections + + // add a surface just inside the beampipe for tracking: + double rInner = beampipeData->sections[0].rInner; + double rOuter = beampipeData->sections[0].rOuter; + Vector3D oCyl( 0.5*(rInner+rOuter) , 0. , 0. ) ; + VolCylinder pipeSurf( envelope , SurfaceType( SurfaceType::Helper ) , + 0.5*(rOuter-rInner) , 0.5*(rOuter-rInner), oCyl ) ; + volSurfaceList( tube )->push_back( pipeSurf ) ; + + tube.addExtension< ConicalSupportData >( beampipeData ) ; + + //-------------------------------------- + tube.setVisAttributes( theDetector, x_beampipe.visStr(), envelope ); + + //debug + std::cout << "============ConicalSupportData============" << std::endl; + for(unsigned int i=0;i<beampipeData->sections.size();i++){ + std::cout << std::setw(8) << beampipeData->sections[i].zPos /dd4hep::mm + << std::setw(8) << beampipeData->sections[i].rInner /dd4hep::mm + << std::setw(8) << beampipeData->sections[i].rOuter /dd4hep::mm + << std::endl; + } + + return tube; +} +DECLARE_DETELEMENT(DD4hep_CRDBeamPipe_v01, create_detector) + +DD4HEP_INSTANTIATE_SHAPE_HANDLE(TGeoScaledShape); diff --git a/Detector/DetCRD/src/Other/OtherDetectorHelpers.h b/Detector/DetCRD/src/Other/OtherDetectorHelpers.h new file mode 100644 index 0000000000000000000000000000000000000000..7e7569af39dce2667afad5ff75dcf58813a7f5e9 --- /dev/null +++ b/Detector/DetCRD/src/Other/OtherDetectorHelpers.h @@ -0,0 +1,43 @@ +#ifndef Other_Helpers_hh +#define Other_Helpers_hh 1 + +#include <iostream> +#include <map> +#include <stdexcept> + +namespace CEPC { + typedef enum { + kCenter = 0, + kCenterSide = 1, + kWaist = 2, + kFatWaist = 3, + kCrotch = 4, + kCrotchAsymUp = 5, + kCrotchAsymDn = 6, + kLegs = 7, + kFlareLegUp = 8, + kFlareLegDn = 9 + } ECrossType; + + inline ECrossType getCrossType( std::string const & type) { + std::map< std::string, CEPC::ECrossType > CrossTypes; + CrossTypes["Center"] = CEPC::kCenter; + CrossTypes["CenterSide"] = CEPC::kCenterSide; + CrossTypes["Waist"] = CEPC::kWaist; + CrossTypes["FatWaist"] = CEPC::kFatWaist; + CrossTypes["Crotch"] = CEPC::kCrotch; + CrossTypes["CrotchAsymUp"] = CEPC::kCrotchAsymUp; + CrossTypes["CrotchAsymDn"] = CEPC::kCrotchAsymDn; + CrossTypes["Legs"] = CEPC::kLegs; + CrossTypes["FlareLegUp"] = CEPC::kFlareLegUp; + CrossTypes["FlareLegDn"] = CEPC::kFlareLegDn; + + std::map < std::string, CEPC::ECrossType>::const_iterator it = CrossTypes.find(type); + if ( it == CrossTypes.end() ) { + std::string ms = "Unknown Crossing Type for this geometry " + type; + throw std::runtime_error(ms.c_str()); + } + return it->second; + } +} +#endif // Other_Helpers_hh diff --git a/Detector/DetDriftChamber/compact/det.xml b/Detector/DetDriftChamber/compact/det.xml index f6d0a84d8e0f68f95fe2ec2a5f05ce8a3e6b923c..f588fd48c9811cde95ae3577cc4991f6875b9e93 100644 --- a/Detector/DetDriftChamber/compact/det.xml +++ b/Detector/DetDriftChamber/compact/det.xml @@ -52,6 +52,14 @@ <detectors> <detector id="1" name="DriftChamber" type="DriftChamber" readout="DriftChamberHitsCollection" vis="VisibleBlue" sensitive="true"> + <envelope vis="SeeThrough"> + <shape type="BooleanShape" operation="Union" material="Air"> + <shape type="Tube" rmin="SDT_inner_chamber_radius_min" rmax="SDT_inner_chamber_radius_max" dz="SDT_half_length" /> + <shape type="Tube" rmin="SDT_outer_chamber_radius_min" rmax="SDT_outer_chamber_radius_max" dz="SDT_half_length" /> + </shape> + </envelope> + + <type_flags type="DetType_TRACKER + DetType_BARREL + DetType_GASEOUS + DetType_WIRE"/> <!-- Use cm as unit if you want to use Pandora for reconstruction --> <sensitive type="SimpleDriftChamber"/> </detector> diff --git a/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp b/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp index 144dd7ddeed10d022b04baf1a00396b2c9bd931c..79df65c47ef2a552b91127e6f9caf1592754e277 100644 --- a/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp +++ b/Detector/DetDriftChamber/src/driftchamber/DriftChamber.cpp @@ -68,13 +68,17 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, dd4hep::DetElement sdet(det_name, x_det.id()); - dd4hep::Volume motherVol = theDetector.pickMotherVolume(sdet); + Volume envelope = dd4hep::xml::createPlacedEnvelope( theDetector, e , sdet ) ; + + dd4hep::xml::setDetectorTypeFlag( e, sdet ) ; + + if( theDetector.buildType() == BUILD_ENVELOPE ) return sdet ; + dd4hep::Material det_mat(theDetector.material("Air")); // - global - dd4hep::Tube det_solid(chamber_radius_min, chamber_radius_max, chamber_length*0.5); - dd4hep::Volume det_vol(det_name+"_vol", det_solid, det_mat); + Assembly det_vol( det_name+"_assembly" ) ; // - inner dd4hep::Tube det_inner_chamber_solid(inner_chamber_radius_min, inner_chamber_radius_max, inner_chamber_length*0.5); @@ -141,6 +145,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, dd4hep::Position(0,0,0)); dd4hep::PlacedVolume det_inner_chamber_phy = det_vol.placeVolume(det_inner_chamber_vol, transform_inner_chamber); + det_inner_chamber_phy.addPhysVolID("chamber", 0); // outer @@ -148,19 +153,19 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector, dd4hep::Position(0,0,0)); dd4hep::PlacedVolume det_outer_chamber_phy = det_vol.placeVolume(det_outer_chamber_vol, transform_inner_chamber); + det_outer_chamber_phy.addPhysVolID("chamber", 1); // - place in world dd4hep::Transform3D transform(dd4hep::Rotation3D(), dd4hep::Position(0,0,0)); - dd4hep::PlacedVolume phv = motherVol.placeVolume(det_vol,transform); - + dd4hep::PlacedVolume phv = envelope.placeVolume(det_vol,transform); if ( x_det.hasAttr(_U(id)) ) { phv.addPhysVolID("system",x_det.id()); } - - sdet.setPlacement(phv); + DetElement assDE( sdet , det_name+"_assembly" , x_det.id() ) ; + assDE.setPlacement(phv); MYDEBUG("Build Detector Drift Chamber successfully."); return sdet;