From bdfe96bd6ea63a7aa5b610b4ba207a9fb85eefc5 Mon Sep 17 00:00:00 2001 From: FU Chengdong <fucd@ihep.ac.cn> Date: Mon, 10 Mar 2025 05:08:38 +0000 Subject: [PATCH] fix some issues in tdr25.3 --- .../compact/CRD_common_v01/OTKBarrel_v02.xml | 22 +- .../compact/CRD_common_v01/OTKEndcap_v02.xml | 26 +- .../compact/CRD_common_v02/ITK_EndCap_v01.xml | 6 +- .../CRD_common_v02/VXD_Composite_v01_03.xml | 40 ++-- .../compact/CRD_common_v02/materials.xml | 2 +- Detector/DetCRD/compact/README.md | 56 +++-- Detector/DetCRD/scripts/TDR_o1_v01/sim.py | 4 +- .../DetCRD/scripts/TDR_o1_v01/tracking.py | 5 +- .../DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp | 16 +- .../DetCRD/src/Tracker/ITK_EndCap_v01.cpp | 10 +- .../Tracker/SiTrackerComposite_v03_geo.cpp | 8 +- Digitization/DigiSimple/src/SmearDigiTool.cpp | 2 +- .../RecSiTracking/src/SiliconTrackingAlg.cpp | 6 +- .../src/FitterTool/KalTestTool.cpp | 28 +-- .../FullLDCTracking/FullLDCTrackingAlg.cpp | 8 +- .../src/FullLDCTracking/FullLDCTrackingAlg.h | 1 + Service/GearSvc/src/GearSvc.cpp | 50 ++-- .../src/ild/etd/CEPCOTKEndcapKalDetector.cc | 15 +- .../src/ild/ftd/CEPCITKEndcapKalDetector.cc | 117 +++++---- .../KalDet/src/ild/set/CEPCOTKKalDetector.cc | 224 +++++++++++++----- .../KalDet/src/ild/sit/CEPCITKKalDetector.cc | 171 ++++++++++--- .../src/ild/support/ILDSupportKalDetector.cc | 2 +- .../KalDet/src/ild/tpc/ILDTPCKalDetector.cc | 12 +- .../KalDet/src/ild/vxd/CEPCVTXKalDetector.cc | 201 ++++++++++------ 24 files changed, 681 insertions(+), 351 deletions(-) diff --git a/Detector/DetCRD/compact/CRD_common_v01/OTKBarrel_v02.xml b/Detector/DetCRD/compact/CRD_common_v01/OTKBarrel_v02.xml index bdc66337..0f9a29bb 100644 --- a/Detector/DetCRD/compact/CRD_common_v01/OTKBarrel_v02.xml +++ b/Detector/DetCRD/compact/CRD_common_v01/OTKBarrel_v02.xml @@ -40,18 +40,18 @@ <module name="OTKBarrel_module" thickness="OTKBarrel_module_thickness" repeat="4" width="OTKBarrel_module_width" length_inner="OTKBarrel_module_length_inner" length_outer="OTKBarrel_module_length_outer" vis="SeeThrough"> - <layer name="carbon_fiber_plane_inner" width="100.40*mm" thickness="0.3*mm" material="CF_ITK" vis="BlackVis"/> - <layer name="carbon_fiber_honeycomb" width="100.40*mm" thickness="6000*um" material="GraphiteFoam_OTK" vis="BlackVis"/> - <layer name="cooling_fluid" width="100.40*mm" thickness="35.76*0.105*100*um" material="G4_WATER" vis="BlackVis"/> - <layer name="cooling_tube_wall" width="100.40*mm" thickness="3.560*0.169*100*um" material="G4_Ti" vis="BlackVis"/> - <layer name="carbon_fiber_plane_outer" width="100.40*mm" thickness="0.3*mm" material="CF_ITK" vis="BlackVis"/> - <layer name="glue" width="100.40*mm" thickness="300*um" material="CER_ITK" vis="BlackVis"/> + <layer name="carbon_fiber_plane_inner" width="100.40*mm" thickness="0.3*mm" material="CF_ITK" vis="GrayVis"/> + <layer name="carbon_fiber_honeycomb" width="100.40*mm" thickness="6000*um" material="GraphiteFoam_OTK" vis="GrayVis"/> + <layer name="cooling_fluid" width="100.40*mm" thickness="35.76*0.105*100*um" material="G4_WATER" vis="GrayVis"/> + <layer name="cooling_tube_wall" width="100.40*mm" thickness="3.560*0.169*100*um" material="G4_Ti" vis="GrayVis"/> + <layer name="carbon_fiber_plane_outer" width="100.40*mm" thickness="0.3*mm" material="CF_ITK" vis="GrayVis"/> + <layer name="glue" width="100.40*mm" thickness="300*um" material="CER_ITK" vis="GrayVis"/> <layer name="sensor" sensitive="True" width="OTKBarrel_module_width" thickness="0.3*mm" material="G4_Si" vis="FTDSensitiveVis"/> - <layer name="glue_2" width="100.40*mm" thickness="100*um" material="CER_ITK" vis="BlackVis"/> - <layer name="pcb_insulating_layers" width="100.40*mm" thickness="28.41*0.07*100*um" material="Polyimide_ITK" vis="BlackVis"/> - <layer name="pcb_metal_layers" width="100.40*mm" thickness="1.436*0.2*100*um" material="G4_Cu" vis="BlackVis"/> - <layer name="other_electronic" width="100.40*mm" thickness="32.6437*0.1*100*um" material="Kapton" vis="BlackVis"/> - <data_aggregation name="first_data_aggregation" width="104*mm" thickness="2*mm" length="7.0*mm" vis="SeeThrough"> + <layer name="glue_2" width="100.40*mm" thickness="100*um" material="CER_ITK" vis="LightGrayVis"/> + <layer name="pcb_insulating_layers" width="100.40*mm" thickness="28.41*0.07*100*um" material="Polyimide_ITK" vis="OrangeVis"/> + <layer name="pcb_metal_layers" width="100.40*mm" thickness="1.436*0.2*100*um" material="G4_Cu" vis="OrangeVis"/> + <layer name="other_electronic" width="100.40*mm" thickness="32.6437*0.1*100*um" material="Kapton" vis="OrangeVis"/> + <data_aggregation name="first_data_aggregation" width="104*mm" thickness="2*mm" length="7.0*mm" vis="OrangeVis"> <layer name="PCB" thickness="1*mm" width="OTKBarrel_module_width" length="7.0*mm" vis="GreenVis"/> <DC name="DC-DC" thickness="1*mm" width="10.0*mm" length="3.0*mm" vis="YellowVis"/> </data_aggregation> diff --git a/Detector/DetCRD/compact/CRD_common_v01/OTKEndcap_v02.xml b/Detector/DetCRD/compact/CRD_common_v01/OTKEndcap_v02.xml index d79d5ced..4c27e652 100644 --- a/Detector/DetCRD/compact/CRD_common_v01/OTKEndcap_v02.xml +++ b/Detector/DetCRD/compact/CRD_common_v01/OTKEndcap_v02.xml @@ -29,11 +29,11 @@ </shape> </envelope> <rings zmax="OTKEndcap_zmax"> - <ring name="A1" inner_radius="406*mm" outer_radius="(534-0.2)*mm" repeat="16*5" aggregation="2" vis="SeeThrough"/> - <ring name="A2" inner_radius="534*mm" outer_radius="(662-0.5)*mm" repeat="16*5" aggregation="2" vis="SeeThrough"/> - <ring name="B1" inner_radius="662*mm" outer_radius="(790-0.2)*mm" repeat="16*7" aggregation="2" vis="SeeThrough"/> - <ring name="B2" inner_radius="790*mm" outer_radius="(862-0.2)*mm" repeat="16*7" aggregation="1" vis="SeeThrough"/> - <ring name="B3" inner_radius="862*mm" outer_radius="(1008-0.5)*mm" repeat="16*7" aggregation="2" vis="SeeThrough"/> + <ring name="A1" inner_radius=" 406*mm" outer_radius="( 534-0.2)*mm" repeat="16* 5" aggregation="2" vis="SeeThrough"/> + <ring name="A2" inner_radius=" 534*mm" outer_radius="( 662-0.5)*mm" repeat="16* 5" aggregation="2" vis="SeeThrough"/> + <ring name="B1" inner_radius=" 662*mm" outer_radius="( 790-0.2)*mm" repeat="16* 7" aggregation="2" vis="SeeThrough"/> + <ring name="B2" inner_radius=" 790*mm" outer_radius="( 862-0.2)*mm" repeat="16* 7" aggregation="1" vis="SeeThrough"/> + <ring name="B3" inner_radius=" 862*mm" outer_radius="(1008-0.5)*mm" repeat="16* 7" aggregation="2" vis="SeeThrough"/> <ring name="C1" inner_radius="1008*mm" outer_radius="(1123-0.2)*mm" repeat="16*10" aggregation="2" vis="SeeThrough"/> <ring name="C2" inner_radius="1123*mm" outer_radius="(1255-0.2)*mm" repeat="16*10" aggregation="2" vis="SeeThrough"/> <ring name="C3" inner_radius="1255*mm" outer_radius="(1324-0.2)*mm" repeat="16*10" aggregation="1" vis="SeeThrough"/> @@ -44,17 +44,17 @@ <ring name="D4" inner_radius="1668*mm" outer_radius="(1816-0.2)*mm" repeat="16*14" aggregation="2" vis="SeeThrough"/> </rings> <layers thickness="11.4*mm"> - <layer name="other_electronic" width="100.40*mm" thickness="32.6437*0.1*100*um" material="Kapton" vis="BlackVis"/> + <layer name="other_electronic" width="100.40*mm" thickness="32.6437*0.1*100*um" material="Kapton" vis="OrangeVis"/> <layer name="PCB_metal_layers" thickness="1.436*0.2*100*um" material="G4_Cu" vis="FTDSupportVis"/> <layer name="PCB_insulating_layers" thickness="28.41*0.07*100*um" material="Polyimide_ITK" vis="FTDSupportVis"/> - <layer name="glue_1" thickness="100*um" material="CER_ITK" vis="FTDSupportVis"/> + <layer name="glue_1" thickness="100*um" material="CER_ITK" vis="LightGrayVis"/> <layer name="sensor" sensitive="True" thickness="0.3*mm" material="G4_Si" vis="FTDSensitiveVis"/> - <layer name="glue_2" thickness="200*um" material="Polyimide_ITK" vis="FTDSupportVis"/> - <layer name="carbon_fiber_plane" thickness="0.3*mm" material="CF_ITK" vis="FTDSupportVis"/> - <layer name="cooling_tube_wall" thickness="3.560*0.169*100*um" material="G4_Ti" vis="FTDSupportVis"/> - <layer name="cooling_fluid" thickness="35.76*0.105*100*um" material="G4_WATER" vis="FTDSupportVis"/> - <layer name="graphite_foam_Honeycom" thickness="6000*um" material="GraphiteFoam_OTK" vis="FTDSupportVis"/> - <layer name="carbon_fiber_back_plate" thickness="0.3*mm" material="CF_ITK" vis="FTDSupportVis"/> + <layer name="glue_2" thickness="200*um" material="Polyimide_ITK" vis="LightGrayVis"/> + <layer name="carbon_fiber_plane" thickness="0.3*mm" material="CF_ITK" vis="GrayVis"/> + <layer name="cooling_tube_wall" thickness="3.560*0.169*100*um" material="G4_Ti" vis="GrayVis"/> + <layer name="cooling_fluid" thickness="35.76*0.105*100*um" material="G4_WATER" vis="GrayVis"/> + <layer name="graphite_foam_Honeycom" thickness="6000*um" material="GraphiteFoam_OTK" vis="GrayVis"/> + <layer name="carbon_fiber_back_plate" thickness="0.3*mm" material="CF_ITK" vis="GrayVis"/> </layers> </detector> </detectors> diff --git a/Detector/DetCRD/compact/CRD_common_v02/ITK_EndCap_v01.xml b/Detector/DetCRD/compact/CRD_common_v02/ITK_EndCap_v01.xml index 11318e83..9a57883b 100644 --- a/Detector/DetCRD/compact/CRD_common_v02/ITK_EndCap_v01.xml +++ b/Detector/DetCRD/compact/CRD_common_v02/ITK_EndCap_v01.xml @@ -24,13 +24,13 @@ <slice name="Carbon_fiber_front" material="CF_ITK" thickness="150*um" vis="GrayVis"/> <slice name="Cooling_tube_wall" material="G4_Ti" thickness="3.560*0.013*100*um" vis="GrayVis"/> <slice name="Cooling_fluid" material="G4_WATER" thickness="35.76*0.105*100*um" vis="GrayVis"/> - <slice name="Graphite_foam_Honeycomb" material="GraphiteFoam_OTK" thickness="2000*um" vis="YellowVis"/> + <slice name="Graphite_foam_Honeycomb" material="GraphiteFoam_OTK" thickness="2000*um" vis="GrayVis"/> <slice name="Carbon_fiber_back" material="CF_ITK" thickness="150*um" vis="GrayVis"/> </support> <sensor> - <slice name="GlueF" material="CER_ITK" thickness="200*um" vis="YellowVis"/> - <slice name="Sensor" material="G4_Si" thickness="150*um" sensitive="true" vis="GreenVis"/> + <slice name="GlueF" material="CER_ITK" thickness="200*um" vis="SeeThrough"/> + <slice name="Sensor" material="G4_Si" thickness="150*um" sensitive="true" vis="OrangeVis"/> <slice name="GlueB" material="CER_ITK" thickness="100*um" vis="SeeThrough"/> <slice name="FPC_Insulating_layers" material="Polyimide_ITK" thickness="100*um" vis="SeeThrough"/> <slice name="FPC_metal_layer" material="G4_Al" thickness="50*um" vis="SeeThrough"/> diff --git a/Detector/DetCRD/compact/CRD_common_v02/VXD_Composite_v01_03.xml b/Detector/DetCRD/compact/CRD_common_v02/VXD_Composite_v01_03.xml index 63f20c4f..e9279e61 100644 --- a/Detector/DetCRD/compact/CRD_common_v02/VXD_Composite_v01_03.xml +++ b/Detector/DetCRD/compact/CRD_common_v02/VXD_Composite_v01_03.xml @@ -18,8 +18,10 @@ <!--stitching parameter--> <constant name="VXD_sensor_backbone" value="0.055*mm"/> <constant name="VXD_sensor_switches" value="0.019*mm"/> - <constant name="VXD_sensor_bias" value="0.106*mm"/> - <constant name="VXD_sensor_periphery" value="0.177*mm"/> + <constant name="VXD_sensor_bias" value="0.106*mm"/> + <constant name="VXD_sensor_periphery" value="0.177*mm"/> + <!--equivalent to CFRP_CMS--> + <constant name="VXD_flex_thickness" value="1.3*um"/> </define> <detectors> @@ -41,8 +43,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="45*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+45*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="1.385*mm" material="Kapton" vis="BlueVis"/> @@ -52,8 +54,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="45*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+45*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="1.385*mm" material="Kapton" vis="BlueVis"/> @@ -65,8 +67,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0.5*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="32*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+32*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="1.385*mm" material="Kapton" vis="BlueVis"/> @@ -76,8 +78,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0.5*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="32*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+32*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="1.385*mm" material="Kapton" vis="BlueVis"/> @@ -89,8 +91,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0.5*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="31*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+31*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="4.155*mm" material="Kapton" vis="BlueVis"/> @@ -100,8 +102,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0.5*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="31*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+31*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="4.155*mm" material="Kapton" vis="BlueVis"/> @@ -113,8 +115,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0.5*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="29*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+29*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="4.155*mm" material="Kapton" vis="BlueVis"/> @@ -124,8 +126,8 @@ bias="VXD_sensor_bias" periphery="VXD_sensor_periphery" mechanical_gap="0.5*mm" material="G4_Si"> <sensor thickness="50*um" width="8.409*mm" length="3.296*mm" material="G4_Si" vis="VXDVis"/> <flex vis="GrayVis"> - <slice thickness="0.4*um" material="G4_Al"/> - <slice thickness="29*um" material="CFRP_CMS"/> + <!--slice thickness="0.4*um" material="G4_Al"/--> + <slice thickness="VXD_flex_thickness+29*um" material="CFRP_CMS"/> </flex> <readout thickness="50*um" width="4.155*mm" material="Kapton" vis="RedVis"/> <driver thickness="50*um" width="4.155*mm" material="Kapton" vis="BlueVis"/> @@ -159,7 +161,7 @@ <slice length="VXD_ladder_length" thickness="12.5*um" width="VXD_ladder_flex_width" mat="Acrylicglue"/> <!--glue between flex and sensor/support--> </flex> <sensor n_sensors="26" gap="0.1*mm" thickness="50*um" active_length="25.6*mm" active_width="12.8*mm" dead_width="2*mm" sensor_mat="G4_Si" - deadwire_length="(26*(25.6+0.1)-0.1)*mm" deadwire_width="2.6*mm" deadwire_thickness="(50/10)*um" deadwire_mat="G4_Al"/> + deadwire_length="(26*(25.6+0.1)-0.1)*mm" deadwire_width="2.5*mm" deadwire_thickness="(50/10)*um" deadwire_mat="G4_Al"/> </ladder> </layer> </detector> diff --git a/Detector/DetCRD/compact/CRD_common_v02/materials.xml b/Detector/DetCRD/compact/CRD_common_v02/materials.xml index 0f9bc69e..0a89e4af 100644 --- a/Detector/DetCRD/compact/CRD_common_v02/materials.xml +++ b/Detector/DetCRD/compact/CRD_common_v02/materials.xml @@ -882,7 +882,7 @@ <fraction n="1.0" ref="Graphite_ITK"/> <fraction n="1.0" ref="CF_ITK"/> </material> - Graphite_ITK + </materials> <surfaces> diff --git a/Detector/DetCRD/compact/README.md b/Detector/DetCRD/compact/README.md index 2885e745..83bf9f85 100644 --- a/Detector/DetCRD/compact/README.md +++ b/Detector/DetCRD/compact/README.md @@ -11,23 +11,10 @@ The following CRD detector models are available in CEPCSW | CRD_o1_v04 | smaller center beam pipe | SIT+DC+SET | crystal | RPC | Scint | developing | | CRD_o1_v05 | Use Ref-Det ECAL and HCAL | SIT+TPC+SET | crystal | Glass| Scint | developing | | ------------- | -----------------------------|-------------|---------|------|-------|----------------| - -# 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 | SIT+DC+SET | crystal | RPC | developing | -| CRD_o1_v02 | strip SET | SIT+DC+SET | crystal | RPC | developing | -| CRD_o1_v03 | MOST2 vertex | SIT+DC+SET | crystal | RPC | developing | -| CRD_o1_v04 | smaller center beam pipe | SIT+DC+SET | crystal | RPC | developing | -| CRD_o1_v05 | Use Ref-Det ECAL and HCAL | SIT+TPC+SET | crystal | Glass| developing | -| ------------- | -----------------------------|-------------|---------|------|----------------| -| TDR_o1_v01 | stitching and planar VXD, TPC| ITK+TPC+OTK | crystal | Glass| developing | -| TDR_o1_v02 | short barrel vertex, TPC | SIT+TPC+SET | crystal | Glass| developing | -| TDR_o2_v01 | long barrel vertex, DC | SIT+DC +SET | crystal | Glass| developing | -| TDR_o2_v02 | short barrel vertex, DC | SIT+DC +SET | crystal | Glass| developing | +| TDR_o1_v01 | stitching and planar VXD, TPC| ITK+TPC+OTK | crystal | Glass| Scint | developing | +| TDR_o1_v02 | short barrel vertex, TPC | SIT+TPC+SET | crystal | Glass| Scint | developing | +| TDR_o2_v01 | long barrel vertex, DC | SIT+DC +SET | crystal | Glass| Scint | developing | +| TDR_o2_v02 | short barrel vertex, DC | SIT+DC +SET | crystal | Glass| Scint | developing | ## Details @@ -90,7 +77,40 @@ The following CRD detector models are available in CEPCSW - compact files: - [./CRD_o1_v05/CRD_o1_v05.xml] -### TDR_o1_v01 (TODO) +### TDR_o1_v01 + - coil outside Hcal ref-TDR detector model + - BeamPipe + - with center pipe + crotch link to doubly-pipe + - CRD_common_v02/Beampipe_v01_07.xml: Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp + - Vertex + - with silicon ladders (sitiching 4 layers + ladder double layers) + - CRD_common_v02/VXD_Composite_v01_03.xml: Detector/DetCRD/src/Tracker/SiTrackerComposite_v03_geo.cpp + - MainTracker + - with TPC + pixel silicon detector + - CRD_common_v02/TPC_ModularEndcap_o1_v02.xml: Detector/DetCRD/src/Tracker/TPC_ModularEndcap_o1_v01.cpp + - CRD_common_v02/ITK_StaggeredStave_v03_01.xml: Detector/DetCRD/src/Tracker/SiTrackerStaggeredLadder_v03_geo.cpp + - CRD_common_v02/ITK_EndCap_v01.xml: Detector/DetCRD/src/Tracker/ITK_EndCap_v01.cpp + - TOF & outer tracker + - with AC-LCAD + - OTKBarrel_v02.xml: Detector/DetCRD/src/Tracker/Detector/DetCRD/src/Tracker/SiTracker_otkbarrel_v02_geo.cpp + - OTKEndcap_v02.xml: Detector/DetCRD/src/Tracker/Detector/DetCRD/src/Tracker/SiTracker_otkendcap_v02_geo.cpp + - Ecal + - with crystal + - Ecal_Crystal_Barrel_v02_02.xml: Detector/DetCRD/src/Calorimeter/LongCrystalBarBarrelCalorimeter32Polygon_v02.cpp + - Ecal_Crystal_Endcap_v02_01.xml: Detector/DetCRD/src/Calorimeter/LongCrystalBarEndcapCalorimeter_v03.cpp + - Hcal + - with glass sensitive + - SHcalGlass_Barrel_v05.xml: Detector/DetCEPCv4/src/calorimeter/SHcalSc04_Barrel_v04.cpp + - SHcalGlass_Endcaps_v01.xml: Detector/DetCEPCv4/src/calorimeter/SHcalSc04_Endcaps_v01.cpp + - Coil + - sub-layers using DD4hep_TubeSegment + - Coil_Simple_v01_03.xml + - Yoke & muon + - CRD_common_v01/Muon_Barrel_v01_04.xml: Detector/DetCRD/src/Muon/Muon_Barrel_v01_04.cpp + - CRD_common_v01/Muon_Endcap_v01_02.xml: Detector/DetCRD/src/Muon/Muon_Endcap_v01_02.cpp + - LumiCal + - CRD_common_v01/Lumical_o1_v01.xml: Detector/DetCRD/src/Calorimeter/Lumical_v01_geo.cpp + - Service & others (TODO) ### TDR_o1_v02 (TODO) diff --git a/Detector/DetCRD/scripts/TDR_o1_v01/sim.py b/Detector/DetCRD/scripts/TDR_o1_v01/sim.py index fa0e1ead..17dddfd3 100644 --- a/Detector/DetCRD/scripts/TDR_o1_v01/sim.py +++ b/Detector/DetCRD/scripts/TDR_o1_v01/sim.py @@ -68,8 +68,8 @@ detsimsvc = DetSimSvc("DetSimSvc") from Configurables import Edm4hepWriterAnaElemTool edm4hep_writer = Edm4hepWriterAnaElemTool("Edm4hepWriterAnaElemTool") -#edm4hep_writer.TrackerCollections = ["VXD", "ITKBarrel", "ITKEndcap", "TPC", "TPCLowPt", "TPCSpacePoint", -# "OTKBarrel", "OTKEndcap", "COIL", "MuonBarrel", "MuonEndcap"] +edm4hep_writer.TrackerCollections = ["VXD", "ITKBarrel", "ITKEndcap", "TPC", "TPCLowPt", "TPCSpacePoint", + "OTKBarrel", "OTKEndcap", "COIL", "MuonBarrel", "MuonEndcap"] from Configurables import DetSimAlg detsimalg = DetSimAlg("DetSimAlg") diff --git a/Detector/DetCRD/scripts/TDR_o1_v01/tracking.py b/Detector/DetCRD/scripts/TDR_o1_v01/tracking.py index 9430d694..07d03c49 100644 --- a/Detector/DetCRD/scripts/TDR_o1_v01/tracking.py +++ b/Detector/DetCRD/scripts/TDR_o1_v01/tracking.py @@ -273,7 +273,8 @@ full.OutputTracks = "CompleteTracks" # default name full.FTDHitToTrackDistance = 5. full.SITHitToTrackDistance = 3. full.SETHitToTrackDistance = 5. -full.ETDHitToTrackDistance = 15. +#according to particle gun +full.ETDHitToTrackDistance = 40. full.MinChi2ProbForSiliconTracks = 0 full.MaxChi2PerHit = 200 full.ForceSiTPCMerging = True @@ -293,7 +294,7 @@ tpr = TrackParticleRelationAlg("Track2Particle") tpr.MCParticleCollection = "MCParticle" tpr.TrackList = ["CompleteTracks"] tpr.TrackerAssociationList = ["VXDTrackerHitAssociation", "ITKBarrelTrackerHitAssociation", "ITKEndcapTrackerHitAssociation", - "OTKBarrelTrackerHitAssociation", "OTKEndcapTrackerHitAssociation"] + "OTKBarrelTrackerHitAssociation", "OTKEndcapTrackerHitAssociation", "TPCTrackerHitAss"] #tpr.OutputLevel = DEBUG diff --git a/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp b/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp index 5415e7a3..311562d2 100644 --- a/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp +++ b/Detector/DetCRD/src/Other/CRDBeamPipe_v01_geo.cpp @@ -552,15 +552,17 @@ static Ref_t create_detector(Detector& theDetector, 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 ); + if (beampipeData->sections.size()<4) { + 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 ) ; } - else beampipeData->sections.push_back( section ); - beampipeData->sections.push_back( sectionEnd ) ; } }//for all xmlSections diff --git a/Detector/DetCRD/src/Tracker/ITK_EndCap_v01.cpp b/Detector/DetCRD/src/Tracker/ITK_EndCap_v01.cpp index 52215d51..67bff078 100644 --- a/Detector/DetCRD/src/Tracker/ITK_EndCap_v01.cpp +++ b/Detector/DetCRD/src/Tracker/ITK_EndCap_v01.cpp @@ -135,7 +135,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s std::string sensor_name = ring_vol_name + "_petal"; Volume sensor_vol(sensor_name, sensor_box, air); DetElement sensor_det(sensor_name, det_id); - sensor_vol = sensor_vol.setVisAttributes(description.visAttributes("SeeThrough")); + sensor_vol = sensor_vol.setVisAttributes(description.visAttributes(vis)); double sensitive_thickness = 0; double glue_thickness = 0; @@ -186,7 +186,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s double r_offset = ring_inner_r + module_dr / 2.0; for (int i = 0; i < nmodule; ++i) { - double angle = phi0 - i * 2 * M_PI / nmodule; + double angle = phi0 + i * 2 * M_PI / nmodule; double rotated_x = r_offset * cos(angle); double rotated_y = r_offset * sin(angle); auto transform = Transform3D(RotationZ(angle), Position(rotated_x, rotated_y, 0)); @@ -202,7 +202,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s positive_even_sensor_det.setPlacement(pv); ringPosF_det.add(positive_even_sensor_det); - angle -= M_PI / nmodule; + angle += M_PI / nmodule; rotated_x = r_offset * cos(angle); rotated_y = r_offset * sin(angle); transform = Transform3D(RotationZ(angle), Position(rotated_x, rotated_y, 0)); @@ -230,12 +230,12 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ringPosF_det.setPlacement(pv); layer_det.add(ringPosF_det); - pv = layerNeg_vol.placeVolume(ringNegR_vol, Position(0, 0, +(SupportThickness + SiliconThickness) / 2.0)); + pv = layerNeg_vol.placeVolume(ringNegR_vol, Position(0, 0, -(SupportThickness + SiliconThickness) / 2.0)); pv = pv.addPhysVolID("sensor", std::stoi(ring_id)); ringNegR_det.setPlacement(pv); layerNeg_det.add(ringNegR_det); - pv = layerNeg_vol.placeVolume(ringNegF_vol, Position(0, 0, -(SupportThickness + SiliconThickness) / 2.0)); + pv = layerNeg_vol.placeVolume(ringNegF_vol, Position(0, 0, +(SupportThickness + SiliconThickness) / 2.0)); pv = pv.addPhysVolID("sensor", std::stoi(ring_id)); ringNegF_det.setPlacement(pv); layerNeg_det.add(ringNegF_det); diff --git a/Detector/DetCRD/src/Tracker/SiTrackerComposite_v03_geo.cpp b/Detector/DetCRD/src/Tracker/SiTrackerComposite_v03_geo.cpp index 98a9e29e..22998b89 100644 --- a/Detector/DetCRD/src/Tracker/SiTrackerComposite_v03_geo.cpp +++ b/Detector/DetCRD/src/Tracker/SiTrackerComposite_v03_geo.cpp @@ -528,8 +528,8 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h topLayer.zHalfSupport = support_length / 2.0; topLayer.distanceSensitive = ladder_distance + support_height / 2.0 + flex_thickness; topLayer.thicknessSensitive = sensor_thickness; - topLayer.offsetSensitive = ladder_offset + (support_width/2.0 - sensor_active_width/2.0); - topLayer.widthSensitive = sensor_active_width; + topLayer.offsetSensitive = ladder_offset + (support_width/2.0 - sensor_active_width/2.0 - sensor_dead_width/2.0); + topLayer.widthSensitive = sensor_active_width + sensor_dead_width; topLayer.zHalfSensitive = (n_sensors_per_side*(sensor_active_len + dead_gap) - dead_gap) / 2.0; bottomLayer.ladderNumber = n_ladders; @@ -543,8 +543,8 @@ static dd4hep::Ref_t create_element(dd4hep::Detector& theDetector, xml_h e, dd4h bottomLayer.zHalfSupport = support_length / 2.0; bottomLayer.distanceSensitive = ladder_distance - support_height / 2.0 - sensor_thickness - flex_thickness; bottomLayer.thicknessSensitive = sensor_thickness; - bottomLayer.offsetSensitive = ladder_offset + (support_width/2.0 - sensor_active_width/2.0); - bottomLayer.widthSensitive = sensor_active_width; + bottomLayer.offsetSensitive = ladder_offset + (support_width/2.0 - sensor_active_width/2.0 - sensor_dead_width/2.0); + bottomLayer.widthSensitive = sensor_active_width + sensor_dead_width; bottomLayer.zHalfSensitive = (n_sensors_per_side*(sensor_active_len + dead_gap) - dead_gap) / 2.0; compositeData->layersPlanar.push_back(bottomLayer); diff --git a/Digitization/DigiSimple/src/SmearDigiTool.cpp b/Digitization/DigiSimple/src/SmearDigiTool.cpp index 6362ae3d..15ce3366 100644 --- a/Digitization/DigiSimple/src/SmearDigiTool.cpp +++ b/Digitization/DigiSimple/src/SmearDigiTool.cpp @@ -89,7 +89,7 @@ StatusCode SmearDigiTool::Call(edm4hep::SimTrackerHit simhit, edm4hep::TrackerHi } auto e = simhit.getEDep(); - if (e <= m_eThreshold) return StatusCode::SUCCESS; + if (e < m_eThreshold) return StatusCode::SUCCESS; if (m_randSvc->generator(Rndm::Flat(0, 1))->shoot() > m_efficiency) return StatusCode::SUCCESS; auto t = simhit.getTime(); diff --git a/Reconstruction/RecSiTracking/src/SiliconTrackingAlg.cpp b/Reconstruction/RecSiTracking/src/SiliconTrackingAlg.cpp index 25e5da78..d4f8899c 100644 --- a/Reconstruction/RecSiTracking/src/SiliconTrackingAlg.cpp +++ b/Reconstruction/RecSiTracking/src/SiliconTrackingAlg.cpp @@ -2780,11 +2780,9 @@ void SiliconTrackingAlg::FinalRefit(edm4hep::TrackCollection* trk_col) { int nFit = 0; for (int i=0; i<nHits; ++i) { edm4hep::TrackerHit trkHit = hitVec[i]->getTrackerHit(); - debug() << "TrackerHit " << i << " id = " << trkHit.id().collectionID << "-" << trkHit.id().index << endmsg; + debug() << "TrackerHit " << i << " id = " << trkHit.id().collectionID << "-" << trkHit.id().index << (lh[i] == 1 ? " accept" : " rejected") << endmsg; // check if the hit has been rejected as being on the same layer and further from the helix lh==0 if (lh[i] == 1) { - //edm4hep::TrackerHit trkHit = hitVec[i]->getTrackerHit(); - debug() << " accept" << endmsg; nFit++; if(trkHit.isAvailable()) { trkHits.push_back(trkHit); @@ -2936,7 +2934,7 @@ void SiliconTrackingAlg::FinalRefit(edm4hep::TrackCollection* trk_col) { if( status != IMarlinTrack::success ) { //delete track; - debug() << "FinalRefit: Track fit failed with error code " << status << " track dropped. Number of hits = "<< trkHits.size() << endmsg; + debug() << "FinalRefit: Track fit failed with error code " << MarlinTrk::errorCode(status) << " track dropped. Number of hits = "<< trkHits.size() << endmsg; continue ; } diff --git a/Reconstruction/RecTrkGlobal/src/FitterTool/KalTestTool.cpp b/Reconstruction/RecTrkGlobal/src/FitterTool/KalTestTool.cpp index 6df26678..56074e6e 100644 --- a/Reconstruction/RecTrkGlobal/src/FitterTool/KalTestTool.cpp +++ b/Reconstruction/RecTrkGlobal/src/FitterTool/KalTestTool.cpp @@ -148,7 +148,7 @@ int KalTestTool::createFinalisedTrack(MarlinTrk::IMarlinTrack* marlinTrk, std::v } else { - warning() << "createFinalisedLCIOTrack : Prefit failed error = " << return_error << endmsg; + warning() << "createFinalisedLCIOTrack : Prefit failed error = " << MarlinTrk::errorCode(return_error) << endmsg; } return return_error; } @@ -174,12 +174,12 @@ int KalTestTool::createFinalisedTrack(MarlinTrk::IMarlinTrack* marlinTrk, std::v int fit_status = MarlinTrk::createFit(hit_list, marlinTrk, pre_fit, bfield_z, fit_backwards, maxChi2Increment); if (fit_status != MarlinTrk::IMarlinTrack::success) { - debug() << "createFinalisedTrack fit failed: fit_status = " << fit_status << endmsg; + debug() << "createFinalisedTrack fit failed: fit_status = " << MarlinTrk::errorCode(fit_status) << endmsg; return fit_status; } int error = finaliseTrack(marlinTrk, track, hit_list, fit_backwards); - debug() << "finaliseTrack. status = " << error << endmsg; + debug() << "finaliseTrack. status = " << MarlinTrk::errorCode(error) << endmsg; return error; } @@ -223,7 +223,7 @@ int KalTestTool::finaliseTrack(MarlinTrk::IMarlinTrack* marlintrk, edm4hep::Muta return_error = marlintrk->getNDF(ndf); if (return_error != MarlinTrk::IMarlinTrack::success) { - debug() << "getNDF returns " << return_error << endmsg; + debug() << "getNDF returns " << MarlinTrk::errorCode(return_error) << endmsg; return return_error; } else if (ndf < 0) { @@ -329,7 +329,7 @@ int KalTestTool::finaliseTrack(MarlinTrk::IMarlinTrack* marlintrk, edm4hep::Muta return_error = marlintrk->smooth(lastHit); if (return_error != MarlinTrk::IMarlinTrack::success) { - debug() << "return_code for smoothing to " << lastHit << " = " << return_error << " NDF = " << ndf << endmsg; + debug() << "return_code for smoothing to " << lastHit << " = " << MarlinTrk::errorCode(return_error) << " NDF = " << ndf << endmsg; delete trkStateAtFirstHit; delete trkStateAtLastHit; return return_error ; @@ -366,21 +366,21 @@ int KalTestTool::finaliseTrack(MarlinTrk::IMarlinTrack* marlintrk, edm4hep::Muta double chi2Tmp = 0; int ndfTmp = 0; - //return_error = marlintrk->getTrackState( last_constrained_hit, ts, chi2, ndf); - return_error = marlintrk->getTrackState( lastHit, ts, chi2, ndf); + return_error = marlintrk->getTrackState( last_constrained_hit, ts, chi2, ndf); + //return_error = marlintrk->getTrackState( lastHit, ts, chi2, ndf); debug() << "-- TrackState at last constrained hit : " << ts << endmsg; //need to add a dummy hit to the track - //mTrk->addHit(last_constrained_hit); - mTrk->addHit(lastHit); + mTrk->addHit(last_constrained_hit); + //mTrk->addHit(lastHit); double _bfield = m_magneticField; // fixme: the implementation for DDKalTest does no longer need this value but the IMarlinTrk interface is not yet changed mTrk->initialise(ts, _bfield, fit_backwards); - //while (hI->first.id() != last_constrained_hit.id()) { - while (hI->first.id() != lastHit.id()) { + while (hI->first.id() != last_constrained_hit.id()) { + //while (hI->first.id() != lastHit.id()) { debug() << "-- hit in reverse_iterator : " << hI->first.getCellID() << " " << hI->first.getPosition() << endmsg; ++hI; } @@ -395,8 +395,8 @@ int KalTestTool::finaliseTrack(MarlinTrk::IMarlinTrack* marlintrk, edm4hep::Muta int addHit = mTrk->addAndFit(hit, deltaChi, maxChi2Increment); - debug() << "-- hit " << hit << " added : " << MarlinTrk::errorCode(addHit) - << " deltaChi2: " << deltaChi << endmsg; + debug() << "-- hit id: " << hit.id() << " cellId: " << hit.getCellID() << " pos: " << hit.getPosition() + << " added : " << MarlinTrk::errorCode(addHit) << " deltaChi2: " << deltaChi << endmsg; if (addHit != MarlinTrk::IMarlinTrack::success) { debug() << "-- could not add inner hit to track !!! " << maxChi2Increment << endmsg; @@ -410,7 +410,7 @@ int KalTestTool::finaliseTrack(MarlinTrk::IMarlinTrack* marlintrk, edm4hep::Muta // now propagate the temporary track to the IP return_error = mTrk->propagate(point, firstHit, *trkStateIP, chi2Tmp, ndfTmp); - debug() << "-- propagated temporary track fromfirst hit to IP : " << (*trkStateIP) << endmsg; + debug() << "-- propagated temporary track from first hit to IP : " << (*trkStateIP) << endmsg; //FIXME: if forward, better by add the last inner hits with a Kalman step from the last_constrained hit //return_error = marlintrk->propagate(point, firstHit, *trkStateIP, chi2, ndf ) ; } diff --git a/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.cpp b/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.cpp index a5e8f103..7a256ff7 100755 --- a/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.cpp +++ b/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.cpp @@ -422,13 +422,13 @@ void FullLDCTrackingAlg::AddTrackColToEvt(TrackExtendedVec & trkVec, edm4hep::Tr ts_initial.covMatrix = covMatrix; int fit_count = 0; - bool sort_by_r = false; + bool sort_by_r = _sortByRadius; bool use_ts_initial = false; double maxChi2PerHit = _maxChi2PerHit; fitstart: - // sort hits in R + // sort hits in R or z std::vector< std::pair<float, edm4hep::TrackerHit> > sort_values; sort_values.reserve(trkHits.size()); @@ -1865,12 +1865,12 @@ TrackExtended * FullLDCTrackingAlg::CombineTracks(TrackExtended * tpcTrack, Trac debug() << pre_fit << endmsg; } catch(std::runtime_error& e){ - error() << e.what() << " should be checked (TPC track) " << tpcTrack << endmsg; + warning() << e.what() << " should be checked (silicon track) " << siTrack << endmsg; try{ pre_fit = getTrackStateAt(tpcTrack->getTrack(), edm4hep::TrackState::AtLastHit); } catch(std::runtime_error& e){ - error() << e.what() << " should be checked (Si track)" << endmsg; + error() << e.what() << " should be checked (both silicon " << siTrack << " and TPC track " << tpcTrack << ")" << endmsg; } } diff --git a/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.h b/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.h index 1728f1b2..ef22135d 100755 --- a/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.h +++ b/Reconstruction/RecTrkGlobal/src/FullLDCTracking/FullLDCTrackingAlg.h @@ -400,6 +400,7 @@ protected: Gaudi::Property<int> _lowestTrackerHitNumberSi{this, "LowestSiHitsNumberForInitial", 7}; Gaudi::Property<int> _lowestTrackerHitNumberTPC{this, "LowestTPCHitsNumberForInitial", 200}; Gaudi::Property<bool> _backward{this, "FitBackward", false}; + Gaudi::Property<bool> _sortByRadius{this, "SortByRadius", true}; Gaudi::Property<bool> m_dumpTime{this, "DumpTime", false}; //float _dPCutForForcedMerging; Gaudi::Property<std::string> m_fitToolName{this, "FitterTool", "KalTestTool/KalTest111"}; diff --git a/Service/GearSvc/src/GearSvc.cpp b/Service/GearSvc/src/GearSvc.cpp index 267a6c6c..9d0fab4c 100644 --- a/Service/GearSvc/src/GearSvc.cpp +++ b/Service/GearSvc/src/GearSvc.cpp @@ -226,9 +226,13 @@ StatusCode GearSvc::convertVXD(dd4hep::DetElement& vxd){ const dd4hep::rec::ZPlanarData::LayerLayout& l = vxdData->layers[0] ; double offset = l.offsetSupport; - dd4hep::rec::Vector3D a( l.distanceSensitive + l.thicknessSensitive, offset, 2.*dd4hep::mm); - dd4hep::rec::Vector3D b( l.distanceSupport + l.thicknessSupport, offset, 2.*dd4hep::mm); - gear::SimpleMaterialImpl* VXDSupportMaterial = CreateGearMaterial(a, b, "VXDSupportMaterial"); + double phi = l.phi0 + 0.5*M_PI; + dd4hep::rec::Vector3D shift(offset*cos(phi), offset*sin(phi), 0); + dd4hep::rec::Vector3D a(l.distanceSupport, l.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + dd4hep::rec::Vector3D b(l.distanceSupport + l.thicknessSupport, l.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + //dd4hep::rec::Vector3D a( l.distanceSensitive + l.thicknessSensitive, offset, 2.*dd4hep::mm); + //dd4hep::rec::Vector3D b( l.distanceSupport + l.thicknessSupport, offset, 2.*dd4hep::mm); + gear::SimpleMaterialImpl* VXDSupportMaterial = CreateGearMaterial(a+shift, b+shift, "VXDSupportMaterial"); m_gearMgr->registerSimpleMaterial(VXDSupportMaterial); if (vxdData->rOuterShell>vxdData->rInnerShell) { @@ -335,9 +339,11 @@ StatusCode GearSvc::convertComposite(dd4hep::DetElement& vtx){ debug() << "find out planar support material" << endmsg; const dd4hep::rec::ZPlanarData::LayerLayout& l = vtxData->layersPlanar[0] ; double offset = l.offsetSupport; - dd4hep::rec::Vector3D a( l.distanceSensitive + l.thicknessSensitive, offset, 2.*dd4hep::mm); - dd4hep::rec::Vector3D b( l.distanceSupport + l.thicknessSupport, offset, 2.*dd4hep::mm); - gear::SimpleMaterialImpl* VXDSupportMaterial = CreateGearMaterial(a, b, "VXDSupportMaterial"); + double phi = l.phi0 + 0.5*M_PI; + dd4hep::rec::Vector3D shift(offset*cos(phi), offset*sin(phi), 0); + dd4hep::rec::Vector3D a(l.distanceSupport, l.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + dd4hep::rec::Vector3D b(l.distanceSupport + l.thicknessSupport, l.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + gear::SimpleMaterialImpl* VXDSupportMaterial = CreateGearMaterial(a+shift, b+shift, "VXDSupportMaterial"); m_gearMgr->registerSimpleMaterial(VXDSupportMaterial); } @@ -671,26 +677,31 @@ StatusCode GearSvc::convertSIT(dd4hep::DetElement& sit){ length_sensors.push_back(sensorLength); thickness_flexs.push_back(flexThickness); + double phi = layout.phi0 + 0.5*M_PI; if (layer==0) { // support { - dd4hep::rec::Vector3D a(layout.distanceSupport, layout.offsetSupport, 0); - dd4hep::rec::Vector3D b(layout.distanceSupport + layout.thicknessSupport, layout.offsetSupport, 0); - gear::SimpleMaterialImpl* supportMaterial = CreateGearMaterial(a, b, "ITKBarrelSupportMaterial"); + double offset = layout.offsetSupport; + dd4hep::rec::Vector3D shift(offset*cos(phi), offset*sin(phi), 0); + dd4hep::rec::Vector3D a(layout.distanceSupport, layout.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + dd4hep::rec::Vector3D b(layout.distanceSupport + layout.thicknessSupport, layout.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + gear::SimpleMaterialImpl* supportMaterial = CreateGearMaterial(a+shift, b+shift, "ITKBarrelSupportMaterial"); m_gearMgr->registerSimpleMaterial(supportMaterial); } // sensor { + double offset = layout.offsetSupport; + dd4hep::rec::Vector3D shift(offset*cos(phi), offset*sin(phi), 0); gear::SimpleMaterialImpl* flexMaterial = nullptr; if (senRMin > supRMin) { - dd4hep::rec::Vector3D a(layout.distanceSensitive + layout.thicknessSensitive, layout.offsetSensitive, 2.*dd4hep::mm); - dd4hep::rec::Vector3D b(layout.distanceSensitive + layout.thicknessSensitive + flexThickness*dd4hep::mm, layout.offsetSensitive, 2.*dd4hep::mm); - flexMaterial = CreateGearMaterial(a, b, "ITKBarrelFlexMaterial"); + dd4hep::rec::Vector3D a(layout.distanceSensitive + layout.thicknessSensitive, layout.phi0, 2.*dd4hep::mm, dd4hep::rec::Vector3D::cylindrical); + dd4hep::rec::Vector3D b(layout.distanceSensitive + layout.thicknessSensitive + flexThickness*dd4hep::mm, layout.phi0, 2.*dd4hep::mm, dd4hep::rec::Vector3D::cylindrical); + flexMaterial = CreateGearMaterial(a+shift, b+shift, "ITKBarrelFlexMaterial"); } else { - dd4hep::rec::Vector3D a(layout.distanceSensitive - flexThickness*dd4hep::mm, layout.offsetSensitive, 2.*dd4hep::mm); - dd4hep::rec::Vector3D b(layout.distanceSensitive, layout.offsetSensitive, 2.*dd4hep::mm); - flexMaterial = CreateGearMaterial(a, b, "ITKBarrelFlexMaterial"); + dd4hep::rec::Vector3D a(layout.distanceSensitive - flexThickness*dd4hep::mm, layout.phi0, 2.*dd4hep::mm, dd4hep::rec::Vector3D::cylindrical); + dd4hep::rec::Vector3D b(layout.distanceSensitive, layout.phi0, 2.*dd4hep::mm, dd4hep::rec::Vector3D::cylindrical); + flexMaterial = CreateGearMaterial(a+shift, b+shift, "ITKBarrelFlexMaterial"); } double ratio = 1.0 + flexThickness/flexMaterial->getRadLength()*93.6607/senThickness; debug() << "sensor thickness: " << senThickness << " flex thickness: " << flexThickness << " radL: " << flexMaterial->getRadLength() << " effetive thickness: " << ratio*senThickness << endmsg; @@ -982,9 +993,12 @@ StatusCode GearSvc::convertSET(dd4hep::DetElement& set){ if (layer==0) { // support { - dd4hep::rec::Vector3D a(layout.distanceSupport, layout.offsetSupport, 0); - dd4hep::rec::Vector3D b(layout.distanceSupport + layout.thicknessSupport, layout.offsetSupport, 0); - gear::SimpleMaterialImpl* supportMaterial = CreateGearMaterial(a, b, "OTKBarrelSupportMaterial"); + double offset = layout.offsetSupport; + double phi = layout.phi0 + 0.5*M_PI; + dd4hep::rec::Vector3D shift(offset*cos(phi), offset*sin(phi), 0); + dd4hep::rec::Vector3D a(layout.distanceSupport, layout.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + dd4hep::rec::Vector3D b(layout.distanceSupport + layout.thicknessSupport, layout.phi0, 0., dd4hep::rec::Vector3D::cylindrical); + gear::SimpleMaterialImpl* supportMaterial = CreateGearMaterial(a+shift, b+shift, "OTKBarrelSupportMaterial"); m_gearMgr->registerSimpleMaterial(supportMaterial); } } diff --git a/Utilities/KalDet/src/ild/etd/CEPCOTKEndcapKalDetector.cc b/Utilities/KalDet/src/ild/etd/CEPCOTKEndcapKalDetector.cc index 07515374..d6ca966e 100644 --- a/Utilities/KalDet/src/ild/etd/CEPCOTKEndcapKalDetector.cc +++ b/Utilities/KalDet/src/ild/etd/CEPCOTKEndcapKalDetector.cc @@ -207,7 +207,8 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm double eps3 = 1.0e-06 ; // layer in disk double eps4 = 1.0e-08 ; // forward or backwards - double sort_policy = rInner+height + eps1 * idisk + eps3 * 1; + //double sort_policy = rInner+height + eps1 * idisk + eps3 * 1; + double sort_policy = fabs(z) + eps1 * idisk + eps3 * 1; if (!even_petals) sort_policy += eps2; // if this is the negative z disk add epsilon to the policy @@ -228,7 +229,7 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm // measurement plane z += zsign*0.5*senThickness; //sort_policy = fabs(z) ; - sort_policy = rInner+height + eps1 * idisk + eps3 * 2 ; + sort_policy = fabs(z) + eps1 * idisk + eps3 * 2 ; if (z < 0) sort_policy += eps4 ; if (!even_petals) sort_policy += eps2; @@ -266,7 +267,7 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm // interface between sensitive and support z += zsign*0.5*senThickness; // sort_policy = fabs(z) ; - sort_policy = rInner+height + eps1 * idisk + eps3 * 3; + sort_policy = fabs(z) + eps1 * idisk + eps3 * 3; if (z < 0) sort_policy += eps4; if (!even_petals) sort_policy += eps2; @@ -289,7 +290,7 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm // interface between support and sensitive z += zsign*supThickness; // sort_policy = fabs(z) ; - sort_policy = rInner+height + eps1 * idisk + eps3 * 4; + sort_policy = fabs(z) + eps1 * idisk + eps3 * 4; if (z < 0) sort_policy += eps4; if (!even_petals) sort_policy += eps2; @@ -309,7 +310,7 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm // measurement plane at the back z += zsign*0.5*senThickness; // sort_policy = fabs(z) ; - sort_policy = rInner+height + eps1 * idisk + eps3 * 5; + sort_policy = fabs(z) + eps1 * idisk + eps3 * 5; if (z < 0) sort_policy += eps4; if (!even_petals) { sort_policy += eps2; @@ -349,7 +350,7 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm // rear face of sensitive z += zsign*0.5*senThickness; // sort_policy = fabs(z) ; - sort_policy = rInner+height + eps1 * idisk + eps3 * 6; + sort_policy = fabs(z) + eps1 * idisk + eps3 * 6; if (z < 0) sort_policy += eps4; if (!even_petals) sort_policy += eps2; @@ -371,7 +372,7 @@ void CEPCOTKEndcapKalDetector::create_segmented_disk_layers(int idisk, int nsegm // rear face of support z += zsign*supThickness; // sort_policy = fabs(z) ; - sort_policy = rInner+height + eps1 * idisk + eps3 * 4; + sort_policy = fabs(z) + eps1 * idisk + eps3 * 4; if (z < 0) sort_policy += eps4; if (!even_petals) sort_policy += eps2; diff --git a/Utilities/KalDet/src/ild/ftd/CEPCITKEndcapKalDetector.cc b/Utilities/KalDet/src/ild/ftd/CEPCITKEndcapKalDetector.cc index bb4b4c28..22d54a1f 100644 --- a/Utilities/KalDet/src/ild/ftd/CEPCITKEndcapKalDetector.cc +++ b/Utilities/KalDet/src/ild/ftd/CEPCITKEndcapKalDetector.cc @@ -17,6 +17,7 @@ #include "kaldet/ILDSegmentedDiscMeasLayer.h" #include "kaldet/ILDDiscMeasLayer.h" +#include "kaldet/ILDCylinderMeasLayer.h" #include "streamlog/streamlog.h" #include "CLHEP/Units/SystemOfUnits.h" @@ -43,6 +44,11 @@ void CEPCITKEndcapKalDetector::build() { streamlog_out(DEBUG) << "CEPCITKEndcapKalDetector::build " << std::endl; double eps = 1e-9; + double eps1 = 1.0e-04; // disk + double eps2 = 1.0e-05; // odd or even + double eps3 = 1.0e-06; // layer in disk + //double eps4 = 1.0e-07; // ring + double eps5 = 1.0e-08; // forward or backwards int ndisks = _disksData.layers.size(); for (int idisk = 0; idisk < ndisks; idisk++) { @@ -58,6 +64,7 @@ void CEPCITKEndcapKalDetector::build() { double rmaxSupport = disk.rmaxSupport; double thicknessSupport = disk.thicknessSupport; int nrings = rings.size(); + double thicknessTotal = 0; for (int iring = 0; iring < nrings; iring++) { auto& ring = rings[iring]; @@ -67,6 +74,11 @@ void CEPCITKEndcapKalDetector::build() { double widthInner = ring.widthInner; double widthOuter = ring.widthOuter; double length = ring.length; + double tSensitive = ring.thicknessSensitive; + double tGlue = ring.thicknessGlue; + double tService = ring.thicknessService; + double thickness = tSensitive + tGlue + tService; + if (thickness > thicknessTotal) thicknessTotal = thickness; int nsegments = npetals/2; this->create_segmented_disk_layers(idisk, iring, nsegments, true, phi0, zPosition); @@ -74,7 +86,7 @@ void CEPCITKEndcapKalDetector::build() { // odd segements // update phi0 by the angular distance of one petal - phi0 -= 2.0 * M_PI / npetals; + phi0 += 2.0 * M_PI / npetals; this->create_segmented_disk_layers(idisk, iring, nsegments, false, phi0, zPosition); this->create_segmented_disk_layers(idisk, iring, nsegments, false, phi0, -zPosition); } @@ -84,33 +96,53 @@ void CEPCITKEndcapKalDetector::build() { Bool_t dummy = false; - double z0 = zPosition - 0.5*thicknessSupport + eps; + double z_front = zPosition - 0.5*thicknessSupport + eps; - streamlog_out(DEBUG) << "CEPCITKEndcapKalDetector::create air support disk at " << z0 << " sort_policy = " << fabs(z0) << std::endl; - - TVector3 xc0_fwd(0.0, 0.0, z0); - TVector3 normal0_fwd(xc0_fwd); - normal0_fwd.SetMag(1.0); - Add(new ILDDiscMeasLayer(air, support, xc0_fwd, normal0_fwd, _bZ, fabs(z0), rminSupport, rmaxSupport, dummy, -1, "ITKEAirSupportDiscPositiveZ")); - - TVector3 xc0_bwd(0.0, 0.0, -z0); - TVector3 normal0_bwd(xc0_bwd); - normal0_bwd.SetMag(1.0); - Add(new ILDDiscMeasLayer(support, air, xc0_bwd, normal0_bwd, _bZ, fabs(z0), rminSupport, rmaxSupport, dummy, -1, "ITKEAirSupportDiscNegativeZ")); - - double z1 = zPosition + 0.5*thicknessSupport - eps; - - TVector3 xc1_fwd(0.0, 0.0, z1); - TVector3 normal1_fwd(xc1_fwd); - normal1_fwd.SetMag(1.0); - Add(new ILDDiscMeasLayer(air, support, xc1_fwd, normal1_fwd, _bZ, fabs(z1), rminSupport, rmaxSupport, dummy, -1, "ITKESupportAirDiscPositiveZ")); - - TVector3 xc1_bwd(0.0, 0.0, -z1); - TVector3 normal1_bwd(xc1_bwd); - normal1_bwd.SetMag(1.0); - Add(new ILDDiscMeasLayer(support, air, xc1_bwd, normal1_bwd, _bZ, fabs(z1), rminSupport, rmaxSupport, dummy, -1, "ITKESupportAirDiscNegativeZ")); + double sort_policy = rmaxSupport + idisk * eps1 + 6 * eps3; + streamlog_out(DEBUG) << "CEPCITKEndcapKalDetector::create air support disk at " << z_front << " sort_policy = " << sort_policy << std::endl; + + TVector3 normal_fwd(0, 0, 1); + TVector3 normal_bwd(0, 0,-1); + + TVector3 xc_front_fwd(0.0, 0.0, z_front); + Add(new ILDDiscMeasLayer(air, support, xc_front_fwd, normal_fwd, _bZ, sort_policy, rminSupport, rmaxSupport, dummy, -1, "ITKEAirSupportDiscPositiveZ")); + + TVector3 xc_front_bwd(0.0, 0.0, -z_front); + Add(new ILDDiscMeasLayer(air, support, xc_front_bwd, normal_bwd, _bZ, sort_policy+eps5, rminSupport, rmaxSupport, dummy, -1, "ITKEAirSupportDiscNegativeZ")); + + double z_rear = zPosition + 0.5*thicknessSupport - eps; + + TVector3 xc_rear_fwd(0.0, 0.0, z_rear); + Add(new ILDDiscMeasLayer(support, air, xc_rear_fwd, normal_fwd, _bZ, sort_policy+eps3, rminSupport, rmaxSupport, dummy, -1, "ITKESupportAirDiscPositiveZ")); + + TVector3 xc_rear_bwd(0.0, 0.0, -z_rear); + Add(new ILDDiscMeasLayer(support, air, xc_rear_bwd, normal_bwd, _bZ, sort_policy+eps3+eps5, rminSupport, rmaxSupport, dummy, -1, "ITKESupportAirDiscNegativeZ")); + + double inner_radius = rminSupport - idisk * eps1; + double outer_radius = rmaxSupport + idisk * eps1 + 2 * eps2; + + Add(new ILDCylinderMeasLayer(air, air, inner_radius, 0.5*thicknessSupport+thicknessTotal+eps, 0, 0, zPosition, _bZ, dummy, -1, "ITKEInnerEdgePositiveZ")); + Add(new ILDCylinderMeasLayer(air, air, inner_radius, 0.5*thicknessSupport+thicknessTotal+eps, 0, 0, -zPosition, _bZ, dummy, -1, "ITKEInnerEdgeNegativeZ")); + + sort_policy = rmaxSupport + idisk * eps1; + TVector3 xc_front_edge_fwd(0.0, 0.0, zPosition - 0.5*thicknessSupport - thicknessTotal - eps); + Add(new ILDDiscMeasLayer(air, air, xc_front_edge_fwd, normal_fwd, _bZ, sort_policy, inner_radius, outer_radius, dummy, -1, "ITKEFrontEdgePositiveZ")); + + TVector3 xc_front_edge_bwd(0.0, 0.0, -zPosition + 0.5*thicknessSupport + thicknessTotal + eps); + Add(new ILDDiscMeasLayer(air, air, xc_front_edge_bwd, normal_bwd, _bZ, sort_policy+eps5, inner_radius, outer_radius, dummy, -1, "ITKEFrontEdgeNegativeZ")); + + Add(new ILDCylinderMeasLayer(air, air, outer_radius, 0.5*thicknessSupport+thicknessTotal+eps, 0, 0, zPosition, _bZ, dummy, -1, "ITKEOuterEdgePositiveZ")); + Add(new ILDCylinderMeasLayer(air, air, outer_radius, 0.5*thicknessSupport+thicknessTotal+eps, 0, 0, -zPosition, _bZ, dummy, -1, "ITKEOuterEdgeNegativeZ")); + + sort_policy = rmaxSupport + idisk * eps1 + 3 * eps2; + TVector3 xc_rear_edge_fwd(0.0, 0.0, zPosition + 0.5*thicknessSupport + thicknessTotal + eps); + Add(new ILDDiscMeasLayer(air, air, xc_rear_edge_fwd, normal_fwd, _bZ, sort_policy, inner_radius, outer_radius, dummy, -1, "ITKERearEdgePositiveZ")); + + TVector3 xc_rear_edge_bwd(0.0, 0.0, -zPosition - 0.5*thicknessSupport - thicknessTotal - eps); + Add(new ILDDiscMeasLayer(air, air, xc_rear_edge_bwd, normal_bwd, _bZ, sort_policy+eps5, inner_radius, outer_radius, dummy, -1, "ITKERearEdgeNegativeZ")); } - + + streamlog_out(DEBUG1) << "MultiRingsZDisk based ITKEndcap MeasLayer created" << std::endl; } void CEPCITKEndcapKalDetector::create_segmented_disk_layers(int idisk, int iring, int nsegments, bool even_petals, double phi0, double zpos) { @@ -141,16 +173,19 @@ void CEPCITKEndcapKalDetector::create_segmented_disk_layers(int idisk, int iring } // create segmented disk + double rmaxSupport = _disksData.layers[idisk].rmaxSupport; - double eps1 = 1.0e-04; // ring + double eps1 = 1.0e-04; // disk double eps2 = 1.0e-05; // odd or even double eps3 = 1.0e-06; // layer in disk - double eps4 = 1.0e-08; // forward or backwards + double eps4 = 1.0e-07; // ring + double eps5 = 1.0e-08; // forward or backwards //double sort_policy = fabs(z); //double sort_policy = rInner+height + eps1 * idisk + eps3 * 1 ; - double sort_policy = eps1 * iring; + //double sort_policy = eps1 * iring; + double sort_policy = rmaxSupport + eps1 * idisk + eps3 + eps4 * iring; if (!even_petals) sort_policy += eps2; - if (zpos < 0) sort_policy += eps4; + if (zpos < 0) sort_policy += eps5; double tSupport = _disksData.layers[idisk].thicknessSupport; double tSensitive = _disksData.layers[idisk].rings[iring].thicknessSensitive; @@ -167,26 +202,26 @@ void CEPCITKEndcapKalDetector::create_segmented_disk_layers(int idisk, int iring TMaterial& rear = even_petals ? glue : service; double z = even_petals ? zpos - zsign*(0.5*tSupport + tRear + tSensitive + tFront) : zpos + zsign*(0.5*tSupport); - streamlog_out(DEBUG1) << "CEPCITKEndcapKalDetector::create_segmented_disk add front face of sensitive at " << z << " sort_policy = " << fabs(z)+sort_policy << std::endl; + streamlog_out(DEBUG1) << "CEPCITKEndcapKalDetector::create_segmented_disk add front face of sensitive at " << z << " sort_policy = " << sort_policy << std::endl; - const char *name1 = z > 0 ? "ITKEFrontFacePositiveZ" : "ITKEFrontFaceNegativeZ"; - Add(new ILDSegmentedDiscMeasLayer(air, front, _bZ, fabs(z)+sort_policy, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name1)); + const char *name1 = z > 0 ? (even_petals ? "ITKEFrontFacePositiveZ_even" : "ITKEFrontFacePositiveZ_odd") : (even_petals ? "ITKEFrontFaceNegativeZ_even" : "ITKEFrontFaceNegativeZ_odd"); + Add(new ILDSegmentedDiscMeasLayer(air, front, _bZ, sort_policy, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name1)); z += zsign*tFront; - const char *name2 = z > 0 ? "ITKEFrontPositiveZ" : "ITKEFrontNegativeZ"; - Add(new ILDSegmentedDiscMeasLayer(front, silicon, _bZ, fabs(z)+sort_policy, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name2)); + const char *name2 = z > 0 ? (even_petals ? "ITKEFrontPositiveZ_even" : "ITKEFrontPositiveZ_odd") : (even_petals ? "ITKEFrontNegativeZ_even" : "ITKEFrontNegativeZ_odd"); + Add(new ILDSegmentedDiscMeasLayer(front, silicon, _bZ, sort_policy+eps3, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name2)); z += zsign*0.5*tSensitive; - const char *name3 = z > 0 ? "ITKESenPositiveZ" : "ITKESenNegativeZ"; - Add( new ILDSegmentedDiscMeasLayer(silicon, silicon, _bZ, fabs(z)+sort_policy, nsegments, z, phi0, rInner, height, widthInner, widthOuter, active, module_ids, name3)); + const char *name3 = z > 0 ? (even_petals ? "ITKESenPositiveZ_even" : "ITKESenPositiveZ_odd") : (even_petals ? "ITKESenNegativeZ_even" : "ITKESenNegativeZ_odd"); + Add( new ILDSegmentedDiscMeasLayer(silicon, silicon, _bZ, sort_policy+2*eps3, nsegments, z, phi0, rInner, height, widthInner, widthOuter, active, module_ids, name3)); z += zsign*0.5*tSensitive; - const char *name4 = z > 0 ? "ITKERearPositiveZ" : "ITKERearNegativeZ"; - Add( new ILDSegmentedDiscMeasLayer(silicon, rear, _bZ, fabs(z)+sort_policy, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name4)); + const char *name4 = z > 0 ? (even_petals ? "ITKERearPositiveZ_even" : "ITKERearPositiveZ_odd") : (even_petals ? "ITKERearNegativeZ_even" : "ITKERearNegativeZ_odd"); + Add( new ILDSegmentedDiscMeasLayer(silicon, rear, _bZ, sort_policy+3*eps3, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name4)); z += zsign*tRear; - const char *name5 = z > 0 ? "ITKERearFacePositiveZ" : "ITKERearFaceNegativeZ"; - Add(new ILDSegmentedDiscMeasLayer(rear, air, _bZ, fabs(z)+sort_policy, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name5)); + const char *name5 = z > 0 ? (even_petals ? "ITKERearFacePositiveZ_even" : "ITKERearFacePositiveZ_odd") : (even_petals ? "ITKERearFaceNegativeZ_even" : "ITKERearFaceNegativeZ_odd"); + Add(new ILDSegmentedDiscMeasLayer(rear, air, _bZ, sort_policy+4*eps3, nsegments, z, phi0, rInner, height, widthInner, widthOuter, dummy, name5)); } void CEPCITKEndcapKalDetector::setupGearGeom(const gear::GearMgr& gearMgr) { diff --git a/Utilities/KalDet/src/ild/set/CEPCOTKKalDetector.cc b/Utilities/KalDet/src/ild/set/CEPCOTKKalDetector.cc index 9e56613e..ef71aa00 100644 --- a/Utilities/KalDet/src/ild/set/CEPCOTKKalDetector.cc +++ b/Utilities/KalDet/src/ild/set/CEPCOTKKalDetector.cc @@ -82,7 +82,20 @@ CEPCOTKKalDetector::CEPCOTKKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* const double sensitive_thickness = _OTKgeo[layer].senThickness; const double sensitive_width = _OTKgeo[layer].senWidth; const double sensitive_length = _OTKgeo[layer].senLength; - + + if (ladder_distance+ladder_thickness-sensitive_distance>0) + std::cout << "OTK ladder_distance =" << ladder_distance << " ladder_thickness = " << ladder_thickness << " sensitive_distance = " << sensitive_distance << std::endl; + + double sign = ladder_offset > 0 ? 1 : -1; + double nonoverlap_ladder_width = ladder_width / 2.0; + double nonoverlap_ladder_offset = ladder_offset - sign * (ladder_width/2.0 - nonoverlap_ladder_width/2.0); + double overlap_ladder_width = ladder_width - nonoverlap_ladder_width; + double overlap_ladder_offset = ladder_offset + sign * (ladder_width/2.0 - overlap_ladder_width/2.0); + double nonoverlap_sensitive_width = sensitive_width / 2.0; + double nonoverlap_sensitive_offset = sensitive_offset - sign * (sensitive_width/2.0 - nonoverlap_sensitive_width/2.0); + double overlap_sensitive_width = sensitive_width - nonoverlap_sensitive_width; + double overlap_sensitive_offset = sensitive_offset + sign * (sensitive_width/2.0 - overlap_sensitive_width/2.0); + double currPhi; const double dphi = _OTKgeo[layer].dphi; @@ -103,98 +116,197 @@ CEPCOTKKalDetector::CEPCOTKKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* encoder[lcio::ILDCellID0::module] = ladder; double z_centre_support = 0.0; - + + int nsort = sensitive_offset > 0 ? (nLadders - ladder)%nLadders : ladder; // check if the sensitive is inside or outside for the support if (sensitive_distance < ladder_distance) { - - double sen_front_sorting_policy = sensitive_distance + (4 * ladder+0) * eps_layer ; - double sen_back_sorting_policy = sensitive_distance + (4 * ladder+2) * eps_layer ; - double sup_back_sorting_policy = ladder_distance + (4 * ladder+3) * eps_layer ; - - // air - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, sensitive_width, sensitive_length, - sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront")); - + double gap_distance = sensitive_distance + sensitive_thickness + 1e-6; + + double sen_front_sorting_policy = sensitive_distance + (5 * nsort + 0) * eps_layer; + double sen_back_sorting_policy = sensitive_distance + (5 * nsort + 2) * eps_layer; + double sup_front_sorting_policy = sensitive_distance + (5 * nsort + 3) * eps_layer; + double sup_back_sorting_policy = sensitive_distance + (5 * nsort + 4) * eps_layer; + + double overlap_sen_front_sorting_policy = sensitive_distance + (5 * nLadders + 0) * eps_layer; + double overlap_sen_back_sorting_policy = sensitive_distance + (5 * nLadders + 2) * eps_layer; + double overlap_sup_front_sorting_policy = sensitive_distance + (5 * nLadders + 3) * eps_layer; + double overlap_sup_back_sorting_policy = sensitive_distance + (5 * nLadders + 4) * eps_layer; + + if (ladder == 0) { + // air - sensitive boundary + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, nonoverlap_sensitive_width, sensitive_length, + nonoverlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, overlap_sen_front_sorting_policy, overlap_sensitive_width, sensitive_length, + overlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront_overlap")); + // sensitive - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, nonoverlap_sensitive_width, + sensitive_length, nonoverlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_sen_back_sorting_policy, overlap_sensitive_width, + sensitive_length, overlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear_overlap")); + // air - support boundary, very thin air gap added for different support and sensitive size + Add(new ILDParallelPlanarMeasLayer(air, carbon, gap_distance, currPhi, _bZ, sen_back_sorting_policy+eps_layer*0.1, nonoverlap_ladder_width, ladder_length, + nonoverlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(air, carbon, gap_distance, currPhi, _bZ, overlap_sup_front_sorting_policy, overlap_ladder_width, ladder_length, + overlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront_overlap")); + // support - air boundary + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, nonoverlap_ladder_width, ladder_length, + nonoverlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1 ,"OTKSupRear_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, overlap_sup_back_sorting_policy, overlap_ladder_width, ladder_length, + overlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupRear_overlap")); + } + else { + // air - sensitive boundary + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, sensitive_width, sensitive_length, + sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront")); + // sensitive - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, sensitive_width, sensitive_length, + sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear")); + // air - support boundary, very thin air gap added for different support and sensitive size + Add(new ILDParallelPlanarMeasLayer(air, carbon, gap_distance, currPhi, _bZ, sup_front_sorting_policy, ladder_width, ladder_length, + ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront")); + // support - air boundary + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, ladder_width, ladder_length, + ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupRear")); + } + for (int isensor=0; isensor<nsensors; ++isensor) { encoder[lcio::ILDCellID0::sensor] = isensor; int CellID = encoder.lowWord(); - double measurement_plane_sorting_policy = sensitive_distance + (4 * ladder+1) * eps_layer + eps_sensor * isensor ; + double measurement_plane_sorting_policy = sensitive_distance + (5 * nsort + 1) * eps_layer + eps_sensor * isensor; + double overlap_measurement_plane_sorting_policy = sensitive_distance + (5 * nLadders + 1) * eps_layer + eps_sensor * isensor; double z_centre_sensor = -0.5*sensitive_length + (0.5*sensor_length) + (isensor*sensor_length) ; if (_isStripDetector) { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, - measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, - z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer")); + if (ladder == 0) { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + measurement_plane_sorting_policy, nonoverlap_sensitive_width, sensor_length, nonoverlap_sensitive_offset, + z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + overlap_measurement_plane_sorting_policy, overlap_sensitive_width, sensor_length, overlap_sensitive_offset, + z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, + z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer")); + } } else { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, - measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, - z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer")); + if (ladder == 0) { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + measurement_plane_sorting_policy, nonoverlap_sensitive_width, sensor_length, nonoverlap_sensitive_offset, + z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + overlap_measurement_plane_sorting_policy, overlap_sensitive_width, sensor_length, overlap_sensitive_offset, + z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, + z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer")); + } } - //std::cout << "CEPCOTKKalDetector add surface with CellID = " << CellID // << " layer = " << layer << " ladder = " << ladder << " sensor = " << isensor << std::endl; } - - // sensitive - air boundary - Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, - sen_back_sorting_policy, sensitive_width, sensitive_length, sensitive_offset, - z_centre_support, sensitive_offset, dummy, -1, "OTKSenSupportIntf")); - // air - support boundary, very thin air gap added for different support and sensitive size - Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance+1e6, currPhi, _bZ, sen_back_sorting_policy+eps_layer*0.1, - ladder_width, ladder_length, ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupSenGap")); - // support - air boundary - Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, - sup_back_sorting_policy, ladder_width, ladder_length, ladder_offset, - z_centre_support, ladder_offset, dummy,-1,"OTKSupRear")); } else { - - double sup_front_sorting_policy = ladder_distance + (4 * ladder+0) * eps_layer ; - double sen_front_sorting_policy = sensitive_distance + (4 * ladder+1) * eps_layer ; - double sen_back_sorting_policy = sensitive_distance + (4 * ladder+3) * eps_layer ; - - // air - support boundary - Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_front_sorting_policy, - ladder_width, ladder_length, ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront")); - // support - air boundary, very thin air gap added for different support and sensitive size - Add(new ILDParallelPlanarMeasLayer(carbon, air, sensitive_distance-1e6, currPhi, _bZ, sup_front_sorting_policy+eps_layer*0.1, - ladder_width, ladder_length, ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupSenGap")); - // air boundary - sensitive - Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, - sensitive_width, sensitive_length, sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenSupportIntf")); + double gap_distance = sensitive_distance - 1e-6; + + double sup_front_sorting_policy = sensitive_distance + (5 * nsort + 0) * eps_layer; + double sup_back_sorting_policy = sensitive_distance + (5 * nsort + 1) * eps_layer; + double sen_front_sorting_policy = sensitive_distance + (5 * nsort + 2) * eps_layer; + double sen_back_sorting_policy = sensitive_distance + (5 * nsort + 4) * eps_layer ; + double overlap_sup_front_sorting_policy = sensitive_distance + (5 * nLadders + 0) * eps_layer; + double overlap_sup_back_sorting_policy = sensitive_distance + (5 * nLadders + 1) * eps_layer; + double overlap_sen_front_sorting_policy = sensitive_distance + (5 * nLadders + 2) * eps_layer; + double overlap_sen_back_sorting_policy = sensitive_distance + (5 * nLadders + 4) * eps_layer; + + if (ladder == 0) { + // air - support boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_front_sorting_policy, nonoverlap_ladder_width, ladder_length, + nonoverlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, overlap_sup_front_sorting_policy, overlap_ladder_width, ladder_length, + overlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront_overlap")); + // support - air boundary, very thin air gap added for different support and sensitive size + Add(new ILDParallelPlanarMeasLayer(carbon, air, gap_distance, currPhi, _bZ, sup_back_sorting_policy, nonoverlap_ladder_width, ladder_length, + nonoverlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupRear_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(carbon, air, gap_distance, currPhi, _bZ, overlap_sup_back_sorting_policy, overlap_ladder_width, ladder_length, + overlap_ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupRear_overlap")); + // air boundary - sensitive + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, nonoverlap_sensitive_width, sensitive_length, + nonoverlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, overlap_sen_front_sorting_policy, overlap_sensitive_width, sensitive_length, + overlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront_overlap")); + // sensitive - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, nonoverlap_sensitive_width, + sensitive_length, nonoverlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_sen_back_sorting_policy, overlap_sensitive_width, + sensitive_length, overlap_sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear_overlap")); + } + else { + // air - support boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_front_sorting_policy, ladder_width, ladder_length, + ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupFront")); + // support - air boundary, very thin air gap added for different support and sensitive size + Add(new ILDParallelPlanarMeasLayer(carbon, air, gap_distance, currPhi, _bZ, sup_back_sorting_policy, ladder_width, ladder_length, + ladder_offset, z_centre_support, ladder_offset, dummy, -1, "OTKSupRear")); + // air boundary - sensitive + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, sensitive_width, sensitive_length, + sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenFront")); + // sensitive - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, sensitive_width, sensitive_length, + sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear")); + } for (int isensor=0; isensor<nsensors; ++isensor) { encoder[lcio::ILDCellID0::sensor] = isensor; int CellID = encoder.lowWord() ; - double measurement_plane_sorting_policy = sensitive_distance + (4 * ladder+2) * eps_layer + eps_sensor * isensor ; + double measurement_plane_sorting_policy = sensitive_distance + (5 * nsort + 3) * eps_layer + eps_sensor * isensor; + double overlap_measurement_plane_sorting_policy = sensitive_distance + (5 * nLadders + 3) * eps_layer + eps_sensor * isensor; double z_centre_sensor = -0.5*sensitive_length + (0.5*sensor_length) + (isensor*sensor_length) ; if (_isStripDetector) { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, - measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, - z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer")); + if (ladder == 0) { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + nonoverlap_sensitive_width, sensor_length, nonoverlap_sensitive_offset, + z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, overlap_measurement_plane_sorting_policy, + overlap_sensitive_width, sensor_length, overlap_sensitive_offset, + z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, + z_centre_sensor, sensitive_offset, stripAngle, CellID, "OTKStripMeaslayer")); + } } else { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, - measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, - z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer")); + if (ladder == 0) { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + nonoverlap_sensitive_width, sensor_length, nonoverlap_sensitive_offset, + z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, overlap_measurement_plane_sorting_policy, + overlap_sensitive_width, sensor_length, overlap_sensitive_offset, + z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, + measurement_plane_sorting_policy, sensitive_width, sensor_length, sensitive_offset, + z_centre_sensor, sensitive_offset, true, CellID, "OTKMeaslayer")); + } } - //std::cout << "CEPCOTKKalDetector add surface with CellID = " << CellID // << " layer = " << layer << " ladder = " << ladder << " sensor = " << isensor << std::endl ; } - // sensitive - air boundary - Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, - sensitive_width, sensitive_length, sensitive_offset, z_centre_support, sensitive_offset, dummy, -1, "OTKSenRear")); } } } diff --git a/Utilities/KalDet/src/ild/sit/CEPCITKKalDetector.cc b/Utilities/KalDet/src/ild/sit/CEPCITKKalDetector.cc index e85f3ba1..a7664603 100644 --- a/Utilities/KalDet/src/ild/sit/CEPCITKKalDetector.cc +++ b/Utilities/KalDet/src/ild/sit/CEPCITKKalDetector.cc @@ -2,6 +2,7 @@ #include "kaldet/CEPCITKKalDetector.h" #include "kaldet/MaterialDataBase.h" #include "kaldet/ILDParallelPlanarStripMeasLayer.h" +#include "kaldet/ILDCylinderMeasLayer.h" #include <UTIL/BitField64.h> #include <UTIL/ILDConf.h> @@ -80,6 +81,11 @@ CEPCITKKalDetector::CEPCITKKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* const double width = _ITKgeo[layer].width ; const double length = _ITKgeo[layer].length; + + double nonoverlap_width = width / 2.0; + double nonoverlap_offset = offset - offset/fabs(offset) * (width/2.0 - nonoverlap_width/2.0); + double overlap_width = width - nonoverlap_width; + double overlap_offset = offset + offset/fabs(offset) * (width/2.0 - overlap_width/2.0); double currPhi; const double dphi = _ITKgeo[layer].dphi ; @@ -103,63 +109,142 @@ CEPCITKKalDetector::CEPCITKKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* encoder[lcio::ILDCellID0::side] = 0 ; encoder[lcio::ILDCellID0::layer] = layer ; encoder[lcio::ILDCellID0::module] = ladder ; - + + int nsort = offset > 0 ? (nLadders - ladder)%nLadders : ladder; // check if the sensitive is inside or outside for the support if( sensitive_distance < ladder_distance ) { - - double sen_front_sorting_policy = sensitive_distance + (4 * ladder+0) * eps_layer ; - double sen_back_sorting_policy = sensitive_distance + (4 * ladder+2) * eps_layer ; - double sup_back_sorting_policy = ladder_distance + (4 * ladder+3) * eps_layer ; - - // air - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, width, length, offset, z_centre_support, offset, dummy,-1,"ITKSenFront")) ; + double sen_front_sorting_policy = sensitive_distance + (4 * nsort + 0) * eps_layer; + double sen_back_sorting_policy = sensitive_distance + (4 * nsort + 2) * eps_layer; + double sup_back_sorting_policy = sensitive_distance + (4 * nsort + 3) * eps_layer; + + // overlap sorting policy uses nLadders as the overlapping "ladder" is the order i.e. there will now be nLadders+1 + double overlap_front_sorting_policy = sensitive_distance + (4 * nLadders + 0) * eps_layer; + double overlap_back_sorting_policy = sensitive_distance + (4 * nLadders + 2) * eps_layer; + double overlap_sup_back_sorting_policy = sensitive_distance + (4 * nLadders + 3) * eps_layer; + + // air - sensitive boundary + if (ladder == 0) { + double overlap_front_sorting_policy = sensitive_distance + (4 * nLadders + 0) * eps_layer; + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, + nonoverlap_width, length, nonoverlap_offset, z_centre_support, offset, dummy, -1, "ITKSenFront_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, overlap_front_sorting_policy, + overlap_width, length, overlap_offset, z_centre_support, offset, dummy, -1, "ITKSenFront_nonoverlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, + width, length, offset, z_centre_support, offset, dummy, -1, "ITKSenFront")); + } for (int isensor=0; isensor<nsensors; ++isensor) { encoder[lcio::ILDCellID0::sensor] = isensor ; int CellID = encoder.lowWord() ; - double measurement_plane_sorting_policy = sensitive_distance + (4 * ladder+1) * eps_layer + eps_sensor * isensor ; + double measurement_plane_sorting_policy = sensitive_distance + (4 * nsort + 1) * eps_layer + eps_sensor * isensor; + double overlap_measurement_plane_sorting_policy = sensitive_distance + (4 * nLadders + 1) * eps_layer + eps_sensor * isensor; double z_centre_sensor = -0.5*length + (0.5*sensor_length) + (isensor%(nsensors/nrow))*sensor_length; if (z_centre_sensor>0) z_centre_sensor += gap; if (_isStripDetector) { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, width, sensor_length, offset, z_centre_sensor, offset, stripAngle, CellID, "ITKStripMeaslayer")) ; + if (ladder == 0) { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + nonoverlap_width, sensor_length, nonoverlap_offset, z_centre_sensor, offset, stripAngle, CellID, + "ITKStripMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, overlap_measurement_plane_sorting_policy, + overlap_width, sensor_length, overlap_offset, z_centre_sensor, offset, stripAngle, CellID, + "ITKStripMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + width, sensor_length, offset, z_centre_sensor, offset, stripAngle, CellID, "ITKStripMeaslayer")); + } } else { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, width, sensor_length, offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer")) ; + if (ladder == 0) { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + nonoverlap_width, sensor_length, nonoverlap_offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, overlap_measurement_plane_sorting_policy, + overlap_width, sensor_length, overlap_offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + width, sensor_length, offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer")); + } } - //std::cout << "CEPCITKKalDetector add surface with CellID = " << CellID << std::endl ; } - - // sensitive - support boundary - Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, width, length, offset, z_centre_support, offset, dummy,-1,"ITKSenSupportIntf" )) ; - + + // sensitive - support boundary + if (ladder == 0) { + Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, + nonoverlap_width, length, nonoverlap_offset, z_centre_support, offset, dummy, -1, "ITKSenSupportIntf_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_back_sorting_policy, + overlap_width, length, overlap_offset, z_centre_support, offset, dummy, -1, "ITKSenSupportIntf_overlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, + width, length, offset, z_centre_support, offset, dummy, -1, "ITKSenSupportIntf")); + } // support - air boundary - Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, width, length, offset, z_centre_support, offset, dummy,-1,"ITKSupRear" )) ; + if (ladder == 0) { + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, + nonoverlap_width, length, nonoverlap_offset, z_centre_support, offset, dummy, -1, "ITKSupRear_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, overlap_sup_back_sorting_policy, + overlap_width, length, overlap_offset, z_centre_support, offset, dummy, -1, "ITKSupRear_overlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, + width, length, offset, z_centre_support, offset, dummy, -1, "ITKSupRear")); + } } else { - - double sup_front_sorting_policy = ladder_distance + (4 * ladder+0) * eps_layer ; - double sen_front_sorting_policy = sensitive_distance + (4 * ladder+1) * eps_layer ; - double sen_back_sorting_policy = sensitive_distance + (4 * ladder+3) * eps_layer ; - - // air - support boundary - Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_front_sorting_policy, width, length, offset, z_centre_support, offset, dummy,-1,"ITKSupFront")) ; - - // support boundary - sensitive - Add(new ILDParallelPlanarMeasLayer(carbon, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, width, length, offset, z_centre_support, offset, dummy,-1,"ITKSenSupportIntf" )) ; + double sup_front_sorting_policy = sensitive_distance + (4 * nsort + 0) * eps_layer; + double sen_front_sorting_policy = sensitive_distance + (4 * nsort + 1) * eps_layer; + double sen_back_sorting_policy = sensitive_distance + (4 * nsort + 3) * eps_layer; + // overlap sorting policy uses nLadders as the overlapping "ladder" is the order i.e. there will now be nLadders+1 + double overlap_sup_front_sorting_policy = sensitive_distance + (4 * nLadders + 0) * eps_layer; + double overlap_sen_front_sorting_policy = sensitive_distance + (4 * nLadders + 1) * eps_layer; + double overlap_sen_back_sorting_policy = sensitive_distance + (4 * nLadders + 3) * eps_layer; + + if (ladder == 0) { + // air - support boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_front_sorting_policy, + nonoverlap_width, length, nonoverlap_offset, z_centre_support, offset, dummy, -1, "ITKSupFront_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, overlap_sup_front_sorting_policy, + overlap_width, length, overlap_offset, z_centre_support, offset, dummy, -1, "ITKSupFront_overlap")); + // support boundary - sensitive + Add(new ILDParallelPlanarMeasLayer(carbon, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, + nonoverlap_width, length, nonoverlap_offset, z_centre_support, offset, dummy, -1, "ITKSenSupportIntf_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(carbon, silicon, sensitive_distance, currPhi, _bZ, overlap_sen_front_sorting_policy, + overlap_width, length, overlap_offset, z_centre_support, offset, dummy, -1, "ITKSenSupportIntf_overlap")); + // support - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, + nonoverlap_width, length, nonoverlap_offset, z_centre_support, offset, dummy, -1, "ITKSenRear_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_sen_back_sorting_policy, + overlap_width, length, overlap_offset, z_centre_support, offset, dummy, -1, "ITKSenRear_overlap")); + } + else { + // air - support boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_front_sorting_policy, + width, length, offset, z_centre_support, offset, dummy, -1, "ITKSupFront")); + // support boundary - sensitive + Add(new ILDParallelPlanarMeasLayer(carbon, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, + width, length, offset, z_centre_support, offset, dummy, -1, "ITKSenSupportIntf")); + // support - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, + width, length, offset, z_centre_support, offset, dummy, -1, "ITKSenRear")); + } for (int isensor=0; isensor<nsensors; ++isensor) { encoder[lcio::ILDCellID0::sensor] = isensor ; int CellID = encoder.lowWord() ; - double measurement_plane_sorting_policy = sensitive_distance + (4 * ladder+2) * eps_layer + eps_sensor * isensor ; + double measurement_plane_sorting_policy = sensitive_distance + (4 * nsort + 2) * eps_layer + eps_sensor * isensor; + double overlap_measurement_plane_sorting_policy = sensitive_distance + (4 * nLadders + 2) * eps_layer + eps_sensor * isensor; //double z_centre_sensor = -0.5*length + (0.5*sensor_length) + (isensor*sensor_length) ; double z_centre_sensor = -0.5*length + (0.5*sensor_length) + (isensor%(nsensors/nrow))*sensor_length; @@ -167,19 +252,35 @@ CEPCITKKalDetector::CEPCITKKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* if (_isStripDetector) { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, width, sensor_length, offset, z_centre_sensor, offset, stripAngle, CellID, "ITKStripMeaslayer")) ; + if (ladder == 0) { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + nonoverlap_width, sensor_length, nonoverlap_offset, z_centre_sensor, offset, stripAngle, CellID, "ITKStripMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, overlap_measurement_plane_sorting_policy, + overlap_width, sensor_length, overlap_offset, z_centre_sensor, offset, stripAngle, CellID, "ITKStripMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarStripMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + width, sensor_length, offset, z_centre_sensor, offset, stripAngle, CellID, "ITKStripMeaslayer")); + } } else { // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, width, sensor_length, offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer")) ; + if (ladder == 0) { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + nonoverlap_width, sensor_length, nonoverlap_offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer_nonoverlap")); + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, overlap_measurement_plane_sorting_policy, + overlap_width, sensor_length, overlap_offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer_overlap")); + } + else { + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*0.5, currPhi, _bZ, measurement_plane_sorting_policy, + width, sensor_length, offset, z_centre_sensor, offset, true, CellID, "ITKMeaslayer")); + } } - //std::cout << "CEPCITKKalDetector add surface with CellID = " << CellID << std::endl ; } - - // support - air boundary - Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, width, length, offset, z_centre_support, offset, dummy,-1,"ITKSenRear" )) ; } - } + } + double redge = sqrt((ladder_distance+ladder_thickness)*(ladder_distance+ladder_thickness) + (fabs(offset)+0.5*width) * (fabs(offset)+0.5*width)) + eps_layer; + Add(new ILDCylinderMeasLayer(air, air, redge, 0.5*length, 0, 0, 0, _bZ, dummy, -1, "ITKOuterEdge")); } SetOwner(); diff --git a/Utilities/KalDet/src/ild/support/ILDSupportKalDetector.cc b/Utilities/KalDet/src/ild/support/ILDSupportKalDetector.cc index 48b73b41..a3d2673c 100644 --- a/Utilities/KalDet/src/ild/support/ILDSupportKalDetector.cc +++ b/Utilities/KalDet/src/ild/support/ILDSupportKalDetector.cc @@ -347,7 +347,7 @@ TVKalDetector(10) TVector3 front_face_normal_bwd(front_face_centre_bwd); front_face_normal_bwd.SetMag(1.0); - Add (new ILDDiscMeasLayer(air, air, front_face_centre_bwd,front_face_normal_bwd, bz, -z_min_ecal_ecap, 0., r_max_ecal_ecap/cos(M_PI/8.0), true, encoder.lowWord(),"ECalEndcapFace-Z")); + Add (new ILDDiscMeasLayer(air, air, front_face_centre_bwd,front_face_normal_bwd, bz, z_min_ecal_ecap+1e-8, 0., r_max_ecal_ecap/cos(M_PI/8.0), true, encoder.lowWord(),"ECalEndcapFace-Z")); // streamlog_out( DEBUG0 ) << " *** adding ECalEndcapFace-Z Measurement layer at Zmin = " << front_face_centre_bwd.z() << " and Rmax = " << r_max_ecal_ecap/cos(M_PI/8.0) << std::endl ; diff --git a/Utilities/KalDet/src/ild/tpc/ILDTPCKalDetector.cc b/Utilities/KalDet/src/ild/tpc/ILDTPCKalDetector.cc index 301fb9fd..3166dd9a 100644 --- a/Utilities/KalDet/src/ild/tpc/ILDTPCKalDetector.cc +++ b/Utilities/KalDet/src/ild/tpc/ILDTPCKalDetector.cc @@ -203,13 +203,13 @@ TVKalDetector(250) // SJA:FIXME initial size, 250 looks reasonable for ILD, thou Add(new ILDDiscMeasLayer(tpcgas, tpcreadout, TVector3(0,0,zminReadout), TVector3(0,0,1), bz, zminReadout, rminReadout, rmaxReadout, dummy, -1, "TPCReadoutFace+Z1")); Add(new ILDDiscMeasLayer(tpcreadout, air, TVector3(0,0,zmaxReadout), TVector3(0,0,1), bz, zmaxReadout, rminReadout, rmaxReadout, dummy, -1, "TPCReadoutFace+Z2")); - Add(new ILDDiscMeasLayer(air, tpcendplate, TVector3(0,0,zminEndplate), TVector3(0,0,1), bz, zminEndplate, rminEndplate, rmaxEndplate, dummy, -1,"EPCEndplateFace+Z1")); - Add(new ILDDiscMeasLayer(tpcendplate, air, TVector3(0,0,zmaxEndplate), TVector3(0,0,1), bz, zmaxEndplate, rminEndplate, rmaxEndplate, dummy, -1,"EPCEndplateFace+Z2")); + Add(new ILDDiscMeasLayer(air, tpcendplate, TVector3(0,0,zminEndplate), TVector3(0,0,1), bz, zminEndplate, rtub, outerr, dummy, -1,"TPCEndplateFace+Z1")); + Add(new ILDDiscMeasLayer(tpcendplate, air, TVector3(0,0,zmaxEndplate), TVector3(0,0,1), bz, zmaxEndplate, rtub, outerr, dummy, -1,"TPCEndplateFace+Z2")); - Add(new ILDDiscMeasLayer(tpcgas, tpcreadout, TVector3(0,0,-zminReadout), TVector3(0,0,-1), bz, -zminReadout, rminReadout, rmaxReadout, dummy, -1, "TPCReadoutFace-Z1")); - Add(new ILDDiscMeasLayer(tpcreadout, air, TVector3(0,0,-zmaxReadout), TVector3(0,0,-1), bz, -zmaxReadout, rminReadout, rmaxReadout, dummy, -1, "TPCReadoutFace-Z2")); - Add(new ILDDiscMeasLayer(air, tpcendplate, TVector3(0,0,-zminEndplate), TVector3(0,0,-1), bz, -zminEndplate, rminEndplate, rmaxEndplate, dummy, -1,"EPCEndplateFace-Z1")); - Add(new ILDDiscMeasLayer(tpcendplate, air, TVector3(0,0,-zmaxEndplate), TVector3(0,0,-1), bz, -zmaxEndplate, rminEndplate, rmaxEndplate, dummy, -1,"EPCEndplateFace-Z2")); + Add(new ILDDiscMeasLayer(tpcgas, tpcreadout, TVector3(0,0,-zminReadout), TVector3(0,0,-1), bz, zminReadout+1e-8, rminReadout, rmaxReadout, dummy, -1, "TPCReadoutFace-Z1")); + Add(new ILDDiscMeasLayer(tpcreadout, air, TVector3(0,0,-zmaxReadout), TVector3(0,0,-1), bz, zmaxReadout+1e-8, rminReadout, rmaxReadout, dummy, -1, "TPCReadoutFace-Z2")); + Add(new ILDDiscMeasLayer(air, tpcendplate, TVector3(0,0,-zminEndplate), TVector3(0,0,-1), bz, zminEndplate+1e-8, rtub, outerr, dummy, -1,"TPCEndplateFace-Z1")); + Add(new ILDDiscMeasLayer(tpcendplate, air, TVector3(0,0,-zmaxEndplate), TVector3(0,0,-1), bz, zmaxEndplate+1e-8, rtub, outerr, dummy, -1,"TPCEndplateFace-Z2")); SetOwner(); } diff --git a/Utilities/KalDet/src/ild/vxd/CEPCVTXKalDetector.cc b/Utilities/KalDet/src/ild/vxd/CEPCVTXKalDetector.cc index 847838ec..b49d6c07 100644 --- a/Utilities/KalDet/src/ild/vxd/CEPCVTXKalDetector.cc +++ b/Utilities/KalDet/src/ild/vxd/CEPCVTXKalDetector.cc @@ -3,6 +3,7 @@ #include "kaldet/MaterialDataBase.h" #include "kaldet/ILDParallelPlanarMeasLayer.h" +#include "kaldet/ILDCylinderMeasLayer.h" #include "kaldet/CEPCCylinderMeasLayer.h" #include "kaldet/ILDDiscMeasLayer.h" @@ -41,10 +42,8 @@ CEPCVTXKalDetector::CEPCVTXKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* TMaterial & air = *MaterialDataBase::Instance().getMaterial("air"); TMaterial & silicon = *MaterialDataBase::Instance().getMaterial("silicon"); TMaterial & carbon = *MaterialDataBase::Instance().getMaterial("VXDSupportMaterial"); - TMaterial & beryllium = *MaterialDataBase::Instance().getMaterial("beryllium"); - // needed for cryostat - TMaterial & aluminium = *MaterialDataBase::Instance().getMaterial("aluminium"); + //TMaterial & aluminium = *MaterialDataBase::Instance().getMaterial("aluminium"); if(geoSvc){ this->setupGearGeom(geoSvc) ; @@ -59,27 +58,34 @@ CEPCVTXKalDetector::CEPCVTXKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* Bool_t active = true; Bool_t dummy = false; - static const double eps = 1e-6; + const double eps = 1e-6; + const double edge_eps = 1e-6; UTIL::BitField64 encoder( lcio::ILDCellID0::encoder_string ) ; - + + double front_distance = 0; for (int layer=0; layer<_nLayers[0]; ++layer) { - nLadders = _VXDgeo[layer].nLadders ; double phi0 = _VXDgeo[layer].phi0 ; - double ladder_distance = _VXDgeo[layer].supRMin ; - double ladder_thickness = _VXDgeo[layer].supThickness ; + double ladder_distance = _VXDgeo[layer].supRMin; + double ladder_thickness = _VXDgeo[layer].supThickness; + double ladder_outer_distance = ladder_distance + ladder_thickness; + + if (layer%2 == 0) front_distance = ladder_distance; - double sensitive_distance = _VXDgeo[layer].senRMin ; - double sensitive_thickness = _VXDgeo[layer].senThickness ; + double sensitive_distance = _VXDgeo[layer].senRMin; + double sensitive_thickness = _VXDgeo[layer].senThickness; + double sensitive_outer_distance = sensitive_distance + sensitive_thickness; double width = _VXDgeo[layer].width ; double length = _VXDgeo[layer].length; double offset = _VXDgeo[layer].offset; - - double pos_xi_nonoverlap_width = (2.0 * (( width / 2.0 ) - fabs(offset))); + + // FIXME: generally, more then half nonoverlap + double pos_xi_nonoverlap_width = width / 2.0; //(2.0 * (( width / 2.0 ) - fabs(offset))); + double nonoverlap_region_offset = offset - offset/fabs(offset) * (width/2.0 - pos_xi_nonoverlap_width/2.0); double currPhi; double dphi = _VXDgeo[layer].dphi ; @@ -99,116 +105,152 @@ CEPCVTXKalDetector::CEPCVTXKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* encoder[lcio::ILDCellID0::sensor] = 0 ; int CellID = encoder.lowWord() ; + + int nsort = offset > 0 ? (nLadders - ladder)%nLadders : ladder; // even layers have the senstive side facing the IP if(layer%2 == 0 ){ // overlap section of ladder0 is defined after the last ladder, - - - double sen_front_sorting_policy = sensitive_distance + (4 * ladder+0) * eps ; - double measurement_plane_sorting_policy = sensitive_distance + (4 * ladder+1) * eps ; - double sen_back_sorting_policy = sensitive_distance + (4 * ladder+2) * eps ; - double sup_back_sorting_policy = sensitive_distance + (4 * ladder+3) * eps ; - + + double sen_front_sorting_policy = ladder_distance + (100 * nsort + 0) * eps ; + double measurement_plane_sorting_policy = ladder_distance + (100 * nsort + 1) * eps ; + double sen_back_sorting_policy = ladder_distance + (100 * nsort + 2) * eps ; + double sup_back_sorting_policy = ladder_distance + (100 * nsort + 3) * eps ; if(ladder==0){ // bacause overlap section of ladder0 is further outer than the last ladder. // streamlog_out(DEBUG0) << "CEPCVTXKalDetector add surface with CellID = " // << CellID // << std::endl ; - + // non overlapping region // air - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, pos_xi_nonoverlap_width, length, 0.0, z_offset, offset, dummy,-1,"VXDSenFront_non_overlap_even" )) ; - + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, dummy, -1, "VXDSenFront_non_overlap_even")); // measurement plane defined as the middle of the sensitive volume - unless "relative_position_of_measurement_surface" parameter given in GEAR - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*_relative_position_of_measurement_surface, currPhi, _bZ, measurement_plane_sorting_policy, pos_xi_nonoverlap_width, length, 0.0, z_offset, offset, active, CellID, "VXDMeasLayer_non_overlap_even" )) ; - - // sensitive - support boundary - Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, pos_xi_nonoverlap_width, length, 0.0, z_offset, offset, dummy,-1,"VXDSenSuppportIntf_non_overlap_even" )) ; - + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*_relative_position_of_measurement_surface, + currPhi, _bZ, measurement_plane_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, active, CellID, "VXDMeasLayer_non_overlap_even")); + // sensitive - support boundary + Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, dummy, -1, "VXDSenSuppportIntf_non_overlap_even")); // support - air boundary - Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, pos_xi_nonoverlap_width, length, 0.0, z_offset, offset, dummy,-1,"VXDSupRear_non_overlap_even" )) ; - + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, dummy, -1, "VXDSupRear_non_overlap_even")); // overlapping region double overlap_region_width = width - pos_xi_nonoverlap_width ; - double overlap_region_offset = -(overlap_region_width/2.0) - (pos_xi_nonoverlap_width)/2.0 ; - + double overlap_region_offset = offset + offset/fabs(offset) * (width/2.0 - overlap_region_width/2.0);// -(overlap_region_width/2.0) - (pos_xi_nonoverlap_width)/2.0 ; // overlap sorting policy uses nLadders as the overlapping "ladder" is the order i.e. there will now be nLadders+1 - double overlap_front_sorting_policy = sensitive_distance + (4* nLadders+0) * eps; - double overlap_measurement_plane_sorting_policy = sensitive_distance + (4* nLadders+1) * eps; - double overlap_back_sorting_policy = sensitive_distance + (4* nLadders+2) * eps; - double overlap_sup_back_sorting_policy = sensitive_distance + (4* nLadders+3) * eps; + double overlap_front_sorting_policy = ladder_distance + (100* nLadders+0) * eps; + double overlap_measurement_plane_sorting_policy = ladder_distance + (100* nLadders+1) * eps; + double overlap_back_sorting_policy = ladder_distance + (100* nLadders+2) * eps; + double overlap_sup_back_sorting_policy = ladder_distance + (100* nLadders+3) * eps; // streamlog_out(DEBUG0) << "CEPCVTXKalDetector add surface with CellID = " // << CellID // << std::endl ; // air - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, overlap_front_sorting_policy, overlap_region_width, length, overlap_region_offset, z_offset, offset, dummy,-1,"VXDSenFront_overlap_even")) ; - + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, overlap_front_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, dummy, -1, "VXDSenFront_overlap_even")); // measurement plane defined as the middle of the sensitive volume - unless "relative_position_of_measurement_surface" parameter given in GEAR - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*_relative_position_of_measurement_surface, currPhi, _bZ, overlap_measurement_plane_sorting_policy, overlap_region_width, length, overlap_region_offset, z_offset, offset, active, CellID, "VXDMeasLayer_overlap_even" )) ; - - - // sensitive - support boundary - Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_back_sorting_policy, overlap_region_width, length, overlap_region_offset, z_offset, offset, dummy,-1,"VXDSenSuppportIntf_overlap_even")) ; - + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*_relative_position_of_measurement_surface, + currPhi, _bZ, overlap_measurement_plane_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, active, CellID, "VXDMeasLayer_overlap_even")); + // sensitive - support boundary + Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_back_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, dummy, -1, "VXDSenSuppportIntf_overlap_even")); // support - air boundary - Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, overlap_sup_back_sorting_policy, overlap_region_width, length, overlap_region_offset, z_offset, offset, dummy,-1,"VXDSupRear_overlap_even")) ; - + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, overlap_sup_back_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, dummy, -1, "VXDSupRear_overlap_even")); } else{ - // streamlog_out(DEBUG0) << "CEPCVTXKalDetector (ILDParallelPlanarMeasLayer) add surface with CellID = " // << CellID // << std::endl ; - // air - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, width, length, offset, z_offset, offset, dummy,-1, "VXDSenFront_even")) ; - - + Add(new ILDParallelPlanarMeasLayer(air, silicon, sensitive_distance, currPhi, _bZ, sen_front_sorting_policy, width, length, + offset, z_offset, offset, dummy, -1, "VXDSenFront_even")); // measurement plane defined as the middle of the sensitive volume - unless "relative_position_of_measurement_surface" parameter given in GEAR - even layers face outwards ! - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*( 1.-_relative_position_of_measurement_surface ), currPhi, _bZ, measurement_plane_sorting_policy, width, length, offset, z_offset, offset, active, CellID, "VXDMeaslayer_even" )) ; - + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*(1.-_relative_position_of_measurement_surface), + currPhi, _bZ, measurement_plane_sorting_policy, width, length, offset, z_offset, offset, active, CellID, "VXDMeaslayer_even")); // sensitive - support boundary - Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, width, length, offset, z_offset, offset, dummy,-1,"VXDSenSuppportIntf_even" )) ; - + Add(new ILDParallelPlanarMeasLayer(silicon, carbon, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, width, length, + offset, z_offset, offset, dummy, -1, "VXDSenSuppportIntf_even")); // support - air boundary - Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, width, length, offset, z_offset, offset, dummy,-1,"VXDSupRear_even" )) ; - + Add(new ILDParallelPlanarMeasLayer(carbon, air, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, width, length, + offset, z_offset, offset, dummy, -1, "VXDSupRear_even")); } } else{ // counting from 0, odd numbered layers are placed with the support closer to the IP than the sensitive - - - - double sup_forward_sorting_policy = ladder_distance + (4 * ladder+0) * eps ; - double sup_back_sorting_policy = ladder_distance + (4 * ladder+1) * eps ; - double measurement_plane_sorting_policy = ladder_distance + (4 * ladder+2) * eps ; - double sen_back_sorting_policy = ladder_distance + (4 * ladder+3) * eps ; - - // streamlog_out(DEBUG0) << "CEPCVTXKalDetector (ILDPlanarMeasLayer) add surface with CellID = " - // << CellID - // << std::endl ; - - // air - support boundary - Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_forward_sorting_policy, width, length, offset, z_offset, offset, dummy,-1,"VXDSupFront_odd" )) ; - - // support - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(carbon, silicon, (ladder_distance+ladder_thickness), currPhi, _bZ, sup_back_sorting_policy, width, length, offset, z_offset, offset, dummy,-1,"VXDSenSuppportIntf_odd")) ; - - // measurement plane defined as the middle of the sensitive volume - Add(new ILDParallelPlanarMeasLayer(silicon, silicon, (sensitive_distance+sensitive_thickness*0.5), currPhi, _bZ, measurement_plane_sorting_policy, width, length, offset, z_offset, offset, active, CellID, "VXDMeaslayer_odd")) ; - - // sensitive air - sensitive boundary - Add(new ILDParallelPlanarMeasLayer(silicon, air, (sensitive_distance+sensitive_thickness), currPhi, _bZ, sen_back_sorting_policy, width, length, offset, z_offset, offset, dummy,-1,"VXDSenRear_odd")) ; + double sup_forward_sorting_policy = front_distance + (100 * nsort + 10) * eps; + double sup_back_sorting_policy = front_distance + (100 * nsort + 11) * eps; + double measurement_plane_sorting_policy = front_distance + (100 * nsort + 12) * eps; + double sen_back_sorting_policy = front_distance + (100 * nsort + 13) * eps; + if (ladder==0) { + // non overlapping region + // air - support boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_forward_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, dummy, -1, "VXDSupFront_non_overlap_odd")); + // support - sensitive boundary + Add(new ILDParallelPlanarMeasLayer(carbon, silicon, ladder_distance+ladder_thickness, currPhi, _bZ, sup_back_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, dummy, -1, "VXDSenSuppportIntf_non_overlap_odd")); + // measurement plane defined as the middle of the sensitive volume - unless "relative_position_of_measurement_surface" parameter given in GEAR + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*(1.-_relative_position_of_measurement_surface), + currPhi, _bZ, measurement_plane_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, active, CellID, "VXDMeasLayer_non_overlap_odd")); + // sensitive - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, sen_back_sorting_policy, pos_xi_nonoverlap_width, length, + nonoverlap_region_offset, z_offset, offset, dummy, -1, "VXDSenRear_non_overlap_odd")); + // overlapping region + double overlap_region_width = width - pos_xi_nonoverlap_width ; + double overlap_region_offset = offset + offset/fabs(offset) * (width/2.0 - overlap_region_width/2.0); + + // overlap sorting policy uses nLadders as the overlapping "ladder" is the order i.e. there will now be nLadders+1 + double overlap_sup_front_sorting_policy = front_distance + (100* nLadders+10) * eps; + double overlap_sup_back_sorting_policy = front_distance + (100* nLadders+11) * eps; + double overlap_measurement_plane_sorting_policy = front_distance + (100* nLadders+12) * eps; + double overlap_sen_back_sorting_policy = front_distance + (100* nLadders+13) * eps; + + // air - spport boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, overlap_sup_front_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, dummy, -1, "VXDSupFront_overlap_odd")); + // support - sensitive boundary + Add(new ILDParallelPlanarMeasLayer(carbon, silicon, ladder_distance+ladder_thickness, currPhi, _bZ, overlap_sup_back_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, dummy, -1, "VXDSenSuppportIntf_overlap_odd")); + // measurement plane defined as the middle of the sensitive volume - unless "relative_position_of_measurement_surface" parameter given in GEAR + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, sensitive_distance+sensitive_thickness*(1.-_relative_position_of_measurement_surface), + currPhi, _bZ, overlap_measurement_plane_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, active, CellID, "VXDMeasLayer_overlap_odd")); + // sensitive - air boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, sensitive_distance+sensitive_thickness, currPhi, _bZ, overlap_sen_back_sorting_policy, overlap_region_width, length, + overlap_region_offset, z_offset, offset, dummy, -1, "VXDSenRear_overlap_odd")); + } + else { + // air - support boundary + Add(new ILDParallelPlanarMeasLayer(air, carbon, ladder_distance, currPhi, _bZ, sup_forward_sorting_policy, width, length, + offset, z_offset, offset, dummy, -1, "VXDSupFront_odd")); + // support - sensitive boundary + Add(new ILDParallelPlanarMeasLayer(carbon, silicon, (ladder_distance+ladder_thickness), currPhi, _bZ, sup_back_sorting_policy, width, length, + offset, z_offset, offset, dummy, -1, "VXDSenSuppportIntf_odd")); + // measurement plane defined as the middle of the sensitive volume + Add(new ILDParallelPlanarMeasLayer(silicon, silicon, (sensitive_distance+sensitive_thickness*(1.-_relative_position_of_measurement_surface)), + currPhi, _bZ, measurement_plane_sorting_policy, width, length, + offset, z_offset, offset, active, CellID, "VXDMeaslayer_odd")); + // sensitive air - sensitive boundary + Add(new ILDParallelPlanarMeasLayer(silicon, air, (sensitive_distance+sensitive_thickness), currPhi, _bZ, sen_back_sorting_policy, width, length, + offset, z_offset, offset, dummy, -1, "VXDSenRear_odd")); + } } } + if (layer%2 == 1) { + double redge = sqrt(sensitive_outer_distance*sensitive_outer_distance + (fabs(offset) + 0.5*width) * (fabs(offset) + 0.5*width)) + edge_eps; + Add(new ILDCylinderMeasLayer(air, air, redge, 0.5*length, 0, 0, 0, _bZ, dummy, -1, "VXDOuterEdge")); + } } if (_nLayers[1]>0) { @@ -262,6 +304,7 @@ CEPCVTXKalDetector::CEPCVTXKalDetector( const gear::GearMgr& gearMgr, IGeomSvc* // support - air boundary Add(new CEPCCylinderMeasLayer(bentmat, air, ladder_distance+ladder_thickness, halfz, currPhi, width, x0, y0, z0, _bZ, dummy, -1, "STTSupRear_0" )) ; } + Add(new ILDCylinderMeasLayer(air, air, ladder_distance+ladder_thickness+edge_eps, halfz, x0, y0, z0, _bZ, dummy, -1, "STTOuterEdge")); } } -- GitLab