diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d868e192eae5fd1a32e5a9c75476f314b913f5c..5d97ae91e55f6d0654a093c8ee3d5e0faae5f441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,7 @@ dd4hep_add_plugin(${a_lib_name} SOURCES src/MRich_geo.cpp src/PolyhedraEndcapCalorimeter2_geo.cpp src/ShashlikCalorimeter_geo.cpp - src/SimpleDiskTracker_geo.cpp - src/SimpleRectangularTracker_geo.cpp + src/SimpleDiskDetector_geo.cpp src/SolenoidCoil_geo.cpp src/TrapEndcapTracker_geo.cpp USES ActsCore ActsPluginDD4hep diff --git a/compact/central_tracker.xml b/compact/central_tracker.xml index 5dee338c36035cecd49794f359106282ab64c9ff..a1aed4d51c5b367bdc6686e22d7dcf0c78c34c6e 100644 --- a/compact/central_tracker.xml +++ b/compact/central_tracker.xml @@ -532,11 +532,11 @@ total X0 0.24% per disk layer (4 sectors per disk): <readouts> <readout name="TrackerBarrelHits"> <segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-14,y:-18</id> + <id>system:8,layer:4,module:12,sensor:2,x:32:-14,y:-18</id> </readout> <readout name="TrackerEndcapHits"> <segmentation type="CartesianGridXZ" grid_size_x="0.010*mm" grid_size_z="0.010*mm" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> + <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> </readout> diff --git a/compact/fake_dirc.xml b/compact/fake_dirc.xml index 9af533ee957acfee076b6c43a94b40f8413ac4d2..7dfce9ab006eea9c498d0de8af7dccc0df5fe5dc 100644 --- a/compact/fake_dirc.xml +++ b/compact/fake_dirc.xml @@ -97,7 +97,7 @@ <readouts> <readout name="DIRCBarHits"> <segmentation type="CartesianGridXY" grid_size_x="3.0*mm" grid_size_y="3.0*mm" /> - <id>system:8,barrel:2,layer:4,module:8,section:4,x:32:-16,y:-16</id> + <id>system:8,layer:4,module:8,section:4,x:32:-16,y:-16</id> </readout> </readouts> diff --git a/compact/gem_tracker_endcap.xml b/compact/gem_tracker_endcap.xml index f88e530af0e42389a42e569f0b0706a46a83b0b7..6ae6f6c54442c1357b61b6ca57188ac36a95b584 100644 --- a/compact/gem_tracker_endcap.xml +++ b/compact/gem_tracker_endcap.xml @@ -216,7 +216,7 @@ <readouts> <readout name="GEMTrackerEndcapHits"> <segmentation type="CartesianGridXZ" grid_size_x="50*um" grid_size_z="250*um" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> + <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> </readout> </readouts> diff --git a/compact/tof_barrel.xml b/compact/tof_barrel.xml index 7ba847259e566f5441818c7a49faeafc217cdba7..510654825097750a2bd4b1402d61e542bf70047b 100644 --- a/compact/tof_barrel.xml +++ b/compact/tof_barrel.xml @@ -71,7 +71,7 @@ <readouts> <readout name="BarrelTOFHits"> <segmentation type="CartesianGridXY" grid_size_x="0.150*mm" grid_size_y="0.150*mm" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> + <id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> </readout> </readouts> diff --git a/compact/tof_endcap.xml b/compact/tof_endcap.xml index c79fe5e00bff8a8c43d6dc3587531dc699549d6d..a9b22dc0295a75aefd4dbcfa8feb2c0873703c47 100644 --- a/compact/tof_endcap.xml +++ b/compact/tof_endcap.xml @@ -130,8 +130,8 @@ <readouts> <readout name="TOFEndcapHits"> - <segmentation type="CartesianGridXY" grid_size_x="0.20*mm" grid_size_y="0.20*mm" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> + <segmentation type="CartesianGridXZ" grid_size_x="0.20*mm" grid_size_z="0.20*mm" /> + <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> </readout> </readouts> diff --git a/compact/vertex_tracker.xml b/compact/vertex_tracker.xml index 0e0d7e65ada2b52aa3446e55b0786f479715bf2c..ce9abfc04eff5c5c40bdb23ac484246532a4abf2 100644 --- a/compact/vertex_tracker.xml +++ b/compact/vertex_tracker.xml @@ -311,11 +311,11 @@ Simple carbon fiber support shell. <readouts> <readout name="VertexBarrelHits"> <segmentation type="CartesianGridXY" grid_size_x="0.010*mm" grid_size_y="0.010*mm" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> + <id>system:8,layer:4,module:12,sensor:2,x:32:-16,y:-16</id> </readout> <readout name="VertexEndcapHits"> <segmentation type="CartesianGridXZ" grid_size_x="0.20*mm" grid_size_z="0.20*mm" /> - <id>system:8,barrel:2,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> + <id>system:8,layer:4,module:12,sensor:2,x:32:-16,z:-16</id> </readout> </readouts> diff --git a/src/BarrelBarDetectorWithSideFrame_geo.cpp b/src/BarrelBarDetectorWithSideFrame_geo.cpp index eda8daae25f3b60b4aa28515d382a5aad42635c4..d7911bde8a54ec3cc8fde728a7146c22fe61e32a 100644 --- a/src/BarrelBarDetectorWithSideFrame_geo.cpp +++ b/src/BarrelBarDetectorWithSideFrame_geo.cpp @@ -241,7 +241,6 @@ static Ref_t create_BarrelBarDetectorWithSideFrame(Detector& description, xml_h assembly.setVisAttributes(description.invisible()); pv = description.pickMotherVolume(sdet).placeVolume(assembly, Position(0, 0, dirc_pos.z())); pv.addPhysVolID("system", det_id); // Set the subdetector system ID. - pv.addPhysVolID("barrel", 1); // Flag this as a barrel subdetector. sdet.setPlacement(pv); return sdet; } diff --git a/src/BarrelTrackerWithFrame_geo.cpp b/src/BarrelTrackerWithFrame_geo.cpp index 6233a2a4eff431d6075c1c1acd791e85238aebd6..bc82b124ffb75442981a5687d4975829fce54941 100644 --- a/src/BarrelTrackerWithFrame_geo.cpp +++ b/src/BarrelTrackerWithFrame_geo.cpp @@ -319,7 +319,6 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi assembly.setVisAttributes(description.invisible()); pv = description.pickMotherVolume(sdet).placeVolume(assembly); pv.addPhysVolID("system", det_id); // Set the subdetector system ID. - pv.addPhysVolID("barrel", 1); // Flag this as a barrel subdetector. sdet.setPlacement(pv); return sdet; } diff --git a/src/SimpleDiskTracker_geo.cpp b/src/SimpleDiskDetector_geo.cpp similarity index 95% rename from src/SimpleDiskTracker_geo.cpp rename to src/SimpleDiskDetector_geo.cpp index 484276e33548da44b242246d878b412e44571d15..7381a06474c49e24b235f8ad5185291afbc093cd 100644 --- a/src/SimpleDiskTracker_geo.cpp +++ b/src/SimpleDiskDetector_geo.cpp @@ -22,7 +22,7 @@ using namespace std; using namespace dd4hep; using namespace dd4hep::detail; -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) +static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, SensitiveDetector sens) { xml_det_t x_det = e; Material air = description.air(); @@ -126,6 +126,5 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s return sdet; } -DECLARE_DETELEMENT(athena_SimpleDiskTracker, create_detector) -DECLARE_DETELEMENT(ref_DiskTracker, create_detector) -DECLARE_DETELEMENT(ref_SolenoidEndcap, create_detector) +DECLARE_DETELEMENT(ref_SolenoidEndcap, SimpleDiskDetector_create_detector) +DECLARE_DETELEMENT(athena_SolenoidEndcap, SimpleDiskDetector_create_detector) diff --git a/src/SimpleRectangularTracker_geo.cpp b/src/SimpleRectangularTracker_geo.cpp deleted file mode 100644 index 1b8ae7436203c77c221a2ff8d44600109a890084..0000000000000000000000000000000000000000 --- a/src/SimpleRectangularTracker_geo.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//========================================================================== -// AIDA Detector description implementation -//-------------------------------------------------------------------------- -// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) -// All rights reserved. -// -// For the licensing terms see $DD4hepINSTALL/LICENSE. -// For the list of contributors see $DD4hepINSTALL/doc/CREDITS. -// -// Author : M.Frank -// Modified : W.Armstrong -// -//========================================================================== -// -// Specialized generic detector constructor -// -//========================================================================== -#include "DD4hep/DetFactoryHelper.h" - -using namespace std; -using namespace dd4hep; -using namespace dd4hep::detail; - -static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { - xml_det_t x_det = e; - Material air = description.air(); - string det_name = x_det.nameStr(); - bool reflect = x_det.reflect(); - DetElement sdet(det_name,x_det.id()); - Assembly assembly(det_name); - PlacedVolume pv; - int l_num = 0; - xml::Component pos = x_det.position(); - - for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++l_num) { - xml_comp_t x_layer = i; - string l_nam = det_name + _toString(l_num, "_layer%d"); - double x_lay = x_layer.x(); - double y_lay = x_layer.y(); - double z = 0; - double zmin = 0; - double layerWidth = 0.; - int s_num = 0; - for(xml_coll_t j(x_layer,_U(slice)); j; ++j) { - double thickness = xml_comp_t(j).thickness(); - layerWidth += thickness; - } - Box l_box(x_lay/2.0, y_lay/2.0, layerWidth/2.0 ); - Volume l_vol(l_nam, l_box, air); - l_vol.setVisAttributes(description, x_layer.visStr()); - for (xml_coll_t j(x_layer, _U(slice)); j; ++j, ++s_num) { - xml_comp_t x_slice = j; - double thick = x_slice.thickness(); - Material mat = description.material(x_slice.materialStr()); - string s_nam = l_nam + _toString(s_num, "_slice%d"); - Volume s_vol(s_nam, Box(x_lay/2.0, y_lay/2.0, thick/2.0), mat); - if (x_slice.isSensitive()) { - sens.setType("tracker"); - s_vol.setSensitiveDetector(sens); - } - s_vol.setAttributes(description, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr()); - pv = l_vol.placeVolume(s_vol, Position(0, 0, z - zmin - layerWidth / 2 + thick / 2)); - pv.addPhysVolID("slice", s_num); - } - - DetElement layer(sdet,l_nam+"_pos",l_num); - pv = assembly.placeVolume(l_vol,Position(0,0,zmin+layerWidth/2.)); - pv.addPhysVolID("layer",l_num); - pv.addPhysVolID("barrel",1); - layer.setPlacement(pv); - if ( reflect ) { - pv = assembly.placeVolume(l_vol,Transform3D(RotationY(M_PI),Position(0,0,-zmin-layerWidth/2))); - pv.addPhysVolID("layer",l_num); - pv.addPhysVolID("barrel",2); - DetElement layerR = layer.clone(l_nam+"_neg"); - sdet.add(layerR.setPlacement(pv)); - } - } - if ( x_det.hasAttr(_U(combineHits)) ) { - sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens); - } - pv = description.pickMotherVolume(sdet).placeVolume(assembly,Position(pos.x(),pos.y(),pos.z())); - pv.addPhysVolID("system", x_det.id()); // Set the subdetector system ID. - sdet.setPlacement(pv); - return sdet; -} - -DECLARE_DETELEMENT(ref_RectangularTracker,create_detector) diff --git a/src/TrapEndcapTracker_geo.cpp b/src/TrapEndcapTracker_geo.cpp index b20e6d161b7209bfe8313e949bfde636e2740be5..f12bf94b2223b30d9ced14ea6caf6698aa4504fa 100644 --- a/src/TrapEndcapTracker_geo.cpp +++ b/src/TrapEndcapTracker_geo.cpp @@ -224,11 +224,11 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s if (reflect) { layer_pv = assembly.placeVolume(layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z))); - layer_pv.addPhysVolID("barrel", 3).addPhysVolID("layer", l_id); + layer_pv.addPhysVolID("layer", l_id); layer_name += "_N"; } else { layer_pv = assembly.placeVolume(layer_vol, Position(0, 0, layer_center_z)); - layer_pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id); + layer_pv.addPhysVolID("layer", l_id); layer_name += "_P"; } DetElement layer_element(sdet, layer_name, l_id); @@ -262,7 +262,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s DetElement module(layer_element, m_base + "_pos", det_id); pv = layer_vol.placeVolume( m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz))); - pv.addPhysVolID("barrel", 1).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); + pv.addPhysVolID("module", mod_num); module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; @@ -276,7 +276,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s } else { pv = layer_vol.placeVolume( m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, -zstart - dz))); - pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num); + pv.addPhysVolID("module", mod_num); DetElement r_module(layer_element, m_base + "_neg", det_id); r_module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) {