From fafb9a2c090dc1a220f2accdb1498001f0d035a7 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 27 May 2022 04:39:33 +0000 Subject: [PATCH 1/3] Use ActsDD4hep instead of Acts --- CMakeLists.txt | 13 ++++++++++--- src/BarrelTrackerWithFrame_geo.cpp | 6 +++++- src/CompositeTracker_geo.cpp | 4 ++++ src/CylinderTrackerBarrel_geo.cpp | 10 ++++++++-- src/SimpleDiskDetector_geo.cpp | 6 ++++++ src/TrapEndcapTracker_geo.cpp | 5 +++++ 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bb9136..48adccf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,14 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") find_package(DD4hep REQUIRED COMPONENTS DDCore DDG4) -find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep ) +find_package(ActsDD4hep) +if(ActsDD4hep_FOUND) + add_compile_definitions(USE_ACTSDD4HEP) + set(ActsDD4hep ActsDD4hep::ActsDD4hep) +else() + find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep) + set(ActsDD4hep ActsCore ActsPluginDD4hep) +endif() find_package(fmt REQUIRED) #----------------------------------------------------------------------------------- @@ -44,10 +51,10 @@ dd4hep_add_plugin(${a_lib_name} SOURCES src/SimpleDiskDetector_geo.cpp src/SolenoidCoil_geo.cpp src/TrapEndcapTracker_geo.cpp - USES ActsCore ActsPluginDD4hep + USES ${ActsDD4hep} ) target_link_libraries(${a_lib_name} - PUBLIC DD4hep::DDCore DD4hep::DDRec fmt::fmt + PUBLIC DD4hep::DDCore DD4hep::DDRec fmt::fmt ) #----------------------------------------------------------------------------------- diff --git a/src/BarrelTrackerWithFrame_geo.cpp b/src/BarrelTrackerWithFrame_geo.cpp index 64210bc..ea0420a 100644 --- a/src/BarrelTrackerWithFrame_geo.cpp +++ b/src/BarrelTrackerWithFrame_geo.cpp @@ -14,9 +14,13 @@ #include "XML/Layering.h" #include "XML/Utilities.h" +#if defined(USE_ACTSDD4HEP) +#include "ActsDD4hep/ActsExtension.hpp" +#include "ActsDD4hep/ConvertMaterial.hpp" +#else #include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp" - +#endif using namespace std; using namespace dd4hep; diff --git a/src/CompositeTracker_geo.cpp b/src/CompositeTracker_geo.cpp index 33ee740..22f98b9 100644 --- a/src/CompositeTracker_geo.cpp +++ b/src/CompositeTracker_geo.cpp @@ -11,7 +11,11 @@ #include "DD4hep/Printout.h" #include "XML/Utilities.h" +#if defined(USE_ACTSDD4HEP) +#include "ActsDD4hep/ActsExtension.hpp" +#else #include "Acts/Plugins/DD4hep/ActsExtension.hpp" +#endif using namespace dd4hep; using namespace dd4hep::detail; diff --git a/src/CylinderTrackerBarrel_geo.cpp b/src/CylinderTrackerBarrel_geo.cpp index 071b7ee..b8141eb 100644 --- a/src/CylinderTrackerBarrel_geo.cpp +++ b/src/CylinderTrackerBarrel_geo.cpp @@ -2,11 +2,17 @@ // Specialized generic detector constructor //========================================================================== -#include "Acts/Plugins/DD4hep/ActsExtension.hpp" -#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp" #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" +#if defined(USE_ACTSDD4HEP) +#include "ActsDD4hep/ActsExtension.hpp" +#include "ActsDD4hep/ConvertMaterial.hpp" +#else +#include "Acts/Plugins/DD4hep/ActsExtension.hpp" +#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp" +#endif + using namespace std; using namespace dd4hep; using namespace dd4hep::detail; diff --git a/src/SimpleDiskDetector_geo.cpp b/src/SimpleDiskDetector_geo.cpp index 7381a06..114c58b 100644 --- a/src/SimpleDiskDetector_geo.cpp +++ b/src/SimpleDiskDetector_geo.cpp @@ -15,8 +15,14 @@ // //========================================================================== #include "DD4hep/DetFactoryHelper.h" + +#if defined(USE_ACTSDD4HEP) +#include "ActsDD4hep/ActsExtension.hpp" +#include "ActsDD4hep/ConvertMaterial.hpp" +#else #include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp" +#endif using namespace std; using namespace dd4hep; diff --git a/src/TrapEndcapTracker_geo.cpp b/src/TrapEndcapTracker_geo.cpp index 4930bc9..01ff4ef 100644 --- a/src/TrapEndcapTracker_geo.cpp +++ b/src/TrapEndcapTracker_geo.cpp @@ -15,8 +15,13 @@ #include "XML/Utilities.h" #include "XML/Layering.h" +#if defined(USE_ACTSDD4HEP) +#include "ActsDD4hep/ActsExtension.hpp" +#include "ActsDD4hep/ConvertMaterial.hpp" +#else #include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp" +#endif using namespace std; using namespace dd4hep; -- GitLab From 66fda95894f972112760135d1303e3cc8aa48e7f Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 11 May 2022 22:54:01 -0500 Subject: [PATCH 2/3] Restructuring of ip6 to work with far_backward inclusion --- athena.xml | 90 ++++++----------------------------------- compact/definitions.xml | 58 +++++++++++++++++++++----- 2 files changed, 62 insertions(+), 86 deletions(-) diff --git a/athena.xml b/athena.xml index 3539b47..4abeab6 100644 --- a/athena.xml +++ b/athena.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -84,17 +84,6 @@ - and more... - - Beamline elements - ----------------- - - - - - - - - ## Main magnet @@ -126,70 +115,17 @@ ## Far foward detectors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + ## Far foward detectors + + + + + ## Far backward detectors + + FB elements diff --git a/compact/definitions.xml b/compact/definitions.xml index 449fcab..f87cd72 100644 --- a/compact/definitions.xml +++ b/compact/definitions.xml @@ -231,38 +231,78 @@ The unused IDs below are saved for future use. - #### (150-169) Far Forward Detectors + #### (150-169) Far Forward Detectors - Forward Roman Pot ID: 150 - Forward B0 Tracker ID: 151 - Zero Degree Cal. Ecal ID: 160 - Zero Degree Cal. Hcal ID: 161 - TODO: A lot of the repeated ID's below should be pushed into a single detector + TODO: A lot of the repeated ID's below should be pushed into a single detector - + - + - TODO naming consistency - - + + - #### (170-189) Forward Beamline Magnets + #### (170-189) Far Forward Beamline Magnets + + + + + + + + + + - #### (190-199) Backward Beamline Magnets + #### (190-199) Far Backward Beamline Magnets + + - Low-Q2 Tagger 1 Tracker ID: 195 + - Low-Q2 Tagger 1 Calorimeter ID: 196 + - Low-Q2 Tagger 2 Tracker ID: 198 + - Low-Q2 Tagger 2 Calorimeter ID: 199 + + TODO: A lot of the repeated ID's below should be pushed into a single detector + + + + + + + + + + #### (200-219) Far Backward Beamline Magnets + + + + + + + + + + + + + + ## Detector Definition Parameters -- GitLab From a1a9e9a26fc9fcbec45c8f13103a8c0930e7e801 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 13 May 2022 19:17:50 +0000 Subject: [PATCH 3/3] Resolve "Fix issues introduced by ip6 changes" --- .gitlab-ci.yml | 6 +- bin/generate_prim_file | 2 +- compact/subsystem_views/calorimeters.xml | 14 +- compact/subsystem_views/dirc_only.xml | 4 +- compact/subsystem_views/drich_only.xml | 6 +- compact/subsystem_views/inner_detector.xml | 82 +------- compact/subsystem_views/ip6.xml | 229 ++++++++------------- compact/subsystem_views/pfrich_only.xml | 6 +- compact/subsystem_views/pid_only.xml | 86 +------- compact/subsystem_views/tof_only.xml | 6 +- compact/subsystem_views/tracking_only.xml | 80 +------ compact/subsystem_views/vertex_only.xml | 87 +------- 12 files changed, 120 insertions(+), 488 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0115879..4a5e174 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -158,7 +158,7 @@ detector_documentation: - bash bin/build_documentation | tee doc/detector.md #- | # xmllint --format --xpath '//comment/text()' ${DETECTOR_PATH}/athena.xml | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee doc/detector.md - # xmllint --format --xpath '//comment/text()' ${DETECTOR_PATH}/ip6/ip6_defs.xml | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee -a doc/detector.md || true + # xmllint --format --xpath '//comment/text()' ${DETECTOR_PATH}/ip6/definitions.xml | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee -a doc/detector.md || true # for afile in ${DETECTOR_PATH}/compact/*.xml ; do # xmllint --format --xpath '//comment/text()' ${afile} | sed -re 's/<\/?\w+>//g' | sed 's/^[[:space:]]*#/#/' | tee -a doc/detector.md || true # done @@ -199,7 +199,7 @@ overlap_check_tgeo: script: ## disable fibers in ECAL for normal overlap check - sed -i '/ - - + + @@ -86,7 +86,7 @@ Beamline elements ----------------- - + ## Main magnet @@ -101,14 +101,6 @@ - - FB elements - ----------- - None (TODO) - - What is FB? - - diff --git a/compact/subsystem_views/dirc_only.xml b/compact/subsystem_views/dirc_only.xml index 89ecc4d..109cd11 100644 --- a/compact/subsystem_views/dirc_only.xml +++ b/compact/subsystem_views/dirc_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + diff --git a/compact/subsystem_views/drich_only.xml b/compact/subsystem_views/drich_only.xml index 7193fa5..6136e3d 100644 --- a/compact/subsystem_views/drich_only.xml +++ b/compact/subsystem_views/drich_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -67,7 +67,7 @@ ## dRICh only - + diff --git a/compact/subsystem_views/inner_detector.xml b/compact/subsystem_views/inner_detector.xml index c1d2117..bc3bd67 100644 --- a/compact/subsystem_views/inner_detector.xml +++ b/compact/subsystem_views/inner_detector.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -87,7 +87,7 @@ Beamline elements ----------------- - + ## Main magnet @@ -98,7 +98,6 @@ ## Central tracking detectors - @@ -106,81 +105,6 @@ - - ## Central calorimetry - - - - ## Far foward detectors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FB elements - ----------- - None (TODO) - - What is FB? - - diff --git a/compact/subsystem_views/ip6.xml b/compact/subsystem_views/ip6.xml index 6547712..780b47e 100644 --- a/compact/subsystem_views/ip6.xml +++ b/compact/subsystem_views/ip6.xml @@ -1,153 +1,102 @@ - - + + + + + + + + + + + + + + # Athena Detector + - https://eicweb.phy.anl.gov/EIC/detectors/athena.git + - https://eicweb.phy.anl.gov/EIC/detectors/ip6.git + + + + + Athena + - - - - - - - - - - Change this to 275/100/41 to change the field setup - - - - - ===================================== - (150-169) Far Forward Detectors - ===================================== - - Forward B0 Tracker ID: 150 - 153 - Forward Roman Pot ID: 155 - 158 - - Zero Degree Cal. Ecal ID: 163 - Zero Degree Cal. Hcal ID: 164 - - - - - - - - - - - - - - - - - - - - - - - - - - - ===================================== - (170-189) Forward Beamline Magnets - ===================================== - - - - ===================================== - (190-199) Backward Beamline Magnets - ===================================== - - + + ## Main Constant Definitions + + The ip6 (or other ip) defines should be included first. + These files have only a define tags. + + + + - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + ## Detector Subsystems + + ### IP Subsystems + + The interaction point subsystems are included before the central detector subsystems. + This is becuase the IP subsystems, for exmaple the beampipe, will define paramters + which are subsquently used in the central detector construction -- e.g. the vertex tracker + uses the beampipe OD to help define its placement. + + The IP subsystems include the Far forward and backward regions. The list of subsystem includes: + - Interaction region beampipe + - B0 tracker + - Off-momentum tracker + - Far forward roman pots + - Zero Degree Calorimeter + - Beam line magnets. + - and more... + + + + ## Far foward detectors + + + + + ## Far foward detectors + + + + + ## Far backward detectors + + diff --git a/compact/subsystem_views/pfrich_only.xml b/compact/subsystem_views/pfrich_only.xml index 3fd28f9..0f4c0e2 100644 --- a/compact/subsystem_views/pfrich_only.xml +++ b/compact/subsystem_views/pfrich_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -65,7 +65,7 @@ ## pfRICH only - + diff --git a/compact/subsystem_views/pid_only.xml b/compact/subsystem_views/pid_only.xml index 44207a0..0d5443a 100644 --- a/compact/subsystem_views/pid_only.xml +++ b/compact/subsystem_views/pid_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -86,16 +86,7 @@ Beamline elements ----------------- - - - Main magnet - ----------- - Note: When changing magnet, also select dimensions in definitions.xml. - - - - ## Central tracking detectors - + PID detectors @@ -103,77 +94,6 @@ - - - FF elements - ----------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FB elements - ----------- - None (TODO) - - diff --git a/compact/subsystem_views/tof_only.xml b/compact/subsystem_views/tof_only.xml index 4392434..dcbdba9 100644 --- a/compact/subsystem_views/tof_only.xml +++ b/compact/subsystem_views/tof_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -65,7 +65,7 @@ ## TOF only - + diff --git a/compact/subsystem_views/tracking_only.xml b/compact/subsystem_views/tracking_only.xml index f319523..5bef5df 100644 --- a/compact/subsystem_views/tracking_only.xml +++ b/compact/subsystem_views/tracking_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -86,14 +86,7 @@ Beamline elements ----------------- - - - - Main magnet - ----------- - Note: When changing magnet, also select dimensions in definitions.xml. - - + Central tracking detectors @@ -102,74 +95,11 @@ + PID detectors ------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FB elements - ----------- - None (TODO) + diff --git a/compact/subsystem_views/vertex_only.xml b/compact/subsystem_views/vertex_only.xml index 8c818e8..46f9e46 100644 --- a/compact/subsystem_views/vertex_only.xml +++ b/compact/subsystem_views/vertex_only.xml @@ -33,8 +33,8 @@ The ip6 (or other ip) defines should be included first. These files have only a define tags. - - + + @@ -82,95 +82,12 @@ - and more... - - Beamline elements - ----------------- - - - - Main magnet - ----------- - Note: When changing magnet, also select dimensions in definitions.xml. - - - Central tracking detectors -------------------------- - - PID detectors - ------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FB elements - ----------- - None (TODO) - - -- GitLab