From 0311c9ff12dac68220e627455e8566a259bd911b Mon Sep 17 00:00:00 2001 From: Whitney Armstrong <warmstrong@anl.gov> Date: Fri, 16 Jul 2021 20:41:28 +0000 Subject: [PATCH] Fix for the tracking geometry. --- CMakeLists.txt | 2 +- athena.xml | 11 +++++++++-- src/TrapEndcapTracker_geo.cpp | 35 +++++++++++++++-------------------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e909a0b..4c2733fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ dd4hep_add_plugin(${a_lib_name} SOURCES src/*.cpp USES ActsCore ActsPluginDD4hep ) target_link_libraries(${a_lib_name} - PUBLIC DD4hep::DDCore DD4hep::DDRec + PUBLIC DD4hep::DDCore ) #----------------------------------------------------------------------------------- diff --git a/athena.xml b/athena.xml index f8a75669..9387ad3c 100644 --- a/athena.xml +++ b/athena.xml @@ -199,14 +199,20 @@ <composite name="VertexEndcapP" /> </detector> + <detector id="TrackerBarrelSubAssembly_Inner_ID" + name="TrackerBarrelSubAssembly_Inner" + type="DD4hep_SubdetectorAssembly" + vis="TrackerSubAssemblyVis"> + <composite name="TrackerBarrel_Inner"/> + </detector> <detector id="TrackerEndcapSubAssembly_Inner_ID" - name="TrackerSubAssembly_Inner" + name="TrackerEndcapSubAssembly_Inner" type="DD4hep_SubdetectorAssembly" vis="TrackerSubAssemblyVis"> <composite name="TrackerEndcapN_Inner"/> - <composite name="TrackerBarrel_Inner"/> <composite name="TrackerEndcapP_Inner"/> </detector> + <detector id="TrackerBarrelSubAssembly_Outer_ID" name="TrackerSubAssembly_Outer" type="DD4hep_SubdetectorAssembly" @@ -279,6 +285,7 @@ <include ref="compact/ecal_barrel_interlayers.xml"/> <include ref="compact/hcal.xml"/> + <!--include ref="compact/ce_GEM.xml"/--> <!--include ref="compact/gem_tracker_endcap.xml"/--> <include ref="compact/mrich.xml"/> diff --git a/src/TrapEndcapTracker_geo.cpp b/src/TrapEndcapTracker_geo.cpp index 9e829d7e..69dc101e 100644 --- a/src/TrapEndcapTracker_geo.cpp +++ b/src/TrapEndcapTracker_geo.cpp @@ -1,19 +1,3 @@ -//========================================================================== -// 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 -// -//========================================================================== -// -// Specialized generic detector constructor -// -//========================================================================== #include <map> #include "DD4hep/DetFactoryHelper.h" #include "Acts/Plugins/DD4hep/ActsExtension.hpp" @@ -23,6 +7,11 @@ using namespace std; using namespace dd4hep; using namespace dd4hep::detail; +/*! Endcap Trapezoidal Tracker. + * + * @author Whitney Armstrong + * + */ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) { typedef vector<PlacedVolume> Placements; @@ -114,8 +103,10 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s c_vol.setVisAttributes(description.visAttributes(c.visStr())); pv = m_volume.placeVolume(c_vol, Position(0, posY + c_thick / 2, 0)); if (c.isSensitive()) { + std::cout << " adding sensitive volume" << c_name << "\n"; sdet.check(n_sensor > 2, "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!"); pv.addPhysVolID("sensor", n_sensor); + sens.setType("tracker"); c_vol.setSensitiveDetector(sens); sensitives[m_nam].push_back(pv); ++n_sensor; @@ -164,6 +155,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s Acts::ActsExtension* layerExtension = new Acts::ActsExtension(); layerExtension->addType("layer", "layer"); //layerExtension->addType("axes", "definitions", "XZY"); + //layerExtension->addType("sensitive disk", "layer"); + //layerExtension->addType("axes", "definitions", "XZY"); layer_element.addExtension<Acts::ActsExtension>(layerExtension); for (xml_coll_t ri(x_layer, _U(ring)); ri; ++ri) { @@ -185,7 +178,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s double y = -r * std::sin(phi); if (!reflect) { - DetElement module(sdet, m_base + "_pos", det_id); + 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); @@ -194,20 +187,22 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s PlacedVolume sens_pv = sensVols[ic]; DetElement comp_elt(module, sens_pv.volume().name(), mod_num); comp_elt.setPlacement(sens_pv); - Acts::ActsExtension* moduleExtension = new Acts::ActsExtension(); + //std::cout << " adding ACTS extension" << "\n"; + Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("XZY"); comp_elt.addExtension<Acts::ActsExtension>(moduleExtension); } } 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); - DetElement r_module(sdet, m_base + "_neg", det_id); + DetElement r_module(layer_element, m_base + "_neg", det_id); r_module.setPlacement(pv); for (size_t ic = 0; ic < sensVols.size(); ++ic) { PlacedVolume sens_pv = sensVols[ic]; DetElement comp_elt(r_module, sens_pv.volume().name(), mod_num); comp_elt.setPlacement(sens_pv); - Acts::ActsExtension* moduleExtension = new Acts::ActsExtension(); + //std::cout << " adding ACTS extension" << "\n"; + Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("XZY"); comp_elt.addExtension<Acts::ActsExtension>(moduleExtension); } } -- GitLab