From edf41bf342012c8d55df7f0d9b6bd49f648bee6a Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 7 Jan 2025 08:29:44 +0100 Subject: [PATCH 01/11] Restore compatibility with EDM4hep 0.10.5 --- DDDigi/io/DigiIO.cpp | 8 ++++---- DDG4/edm4hep/Geant4Output2EDM4hep.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/DDDigi/io/DigiIO.cpp b/DDDigi/io/DigiIO.cpp index 4866929c6..1d8ccf374 100644 --- a/DDDigi/io/DigiIO.cpp +++ b/DDDigi/io/DigiIO.cpp @@ -171,8 +171,8 @@ namespace dd4hep { mcp.setCharge(3.0*p.charge); mcp.setVertex( _toVectorD(p.start_position) ); mcp.setEndpoint( _toVectorD(p.end_position) ); - mcp.setMomentum( _toVectorD(p.momentum) ); - mcp.setMomentumAtEndpoint( _toVectorD(p.momentum) ); + mcp.setMomentum( _toVectorF(p.momentum) ); + mcp.setMomentumAtEndpoint( _toVectorF(p.momentum) ); } template <> template <> @@ -552,8 +552,8 @@ namespace dd4hep { const PropertyMask mask(status); mcp.setPDG(p.pdgID); - mcp.setMomentum( _toVectorD( { p.psx, p.psy, p.psz } ) ); - mcp.setMomentumAtEndpoint( _toVectorD( {p.pex, p.pey, p.pez} ) ); + mcp.setMomentum( _toVectorF( { p.psx, p.psy, p.psz } ) ); + mcp.setMomentumAtEndpoint( _toVectorF( {p.pex, p.pey, p.pez} ) ); mcp.setVertex( _toVectorD( { p.vsx, p.vsy, p.vsz } ) ); mcp.setEndpoint( _toVectorD( { p.vex, p.vey, p.vez } ) ); diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp index 1ceb1e00c..38be43743 100644 --- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp +++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp @@ -26,6 +26,11 @@ #include #include #include +#if EDM4HEP_VERSION_MAJOR == 0 && EDM4HEP_VERSION_MINOR < 99 + using edm4hep::CellIDEncoding; +#else + using edm4hep::labels::CellIDEncoding; +#endif /// podio include files #include #include @@ -269,7 +274,7 @@ void Geant4Output2EDM4hep::endRun(const G4Run* run) { void Geant4Output2EDM4hep::saveFileMetaData() { podio::Frame metaFrame{}; for (const auto& [name, encodingStr] : m_cellIDEncodingStrings) { - metaFrame.putParameter(podio::collMetadataParamName(name, edm4hep::labels::CellIDEncoding), encodingStr); + metaFrame.putParameter(podio::collMetadataParamName(name, CellIDEncoding), encodingStr); } m_file->writeFrame(metaFrame, "metadata"); From 798a1dbfdbd1940911386f320378b4da1e805ff9 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Wed, 8 Jan 2025 09:13:21 +0100 Subject: [PATCH 02/11] Add compatibility with EDM4hep 0.10.0 and bump the required version --- CMakeLists.txt | 2 +- DDG4/edm4hep/Geant4Output2EDM4hep.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7095e914..b87655048 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ if(DD4HEP_USE_LCIO) endif() if(DD4HEP_USE_EDM4HEP) - find_package(EDM4HEP REQUIRED) + find_package(EDM4HEP 0.10.0 REQUIRED) # we need podio with Frame support (>=0.16.3) # podio is "SameMajorVersion" compatible find_package(podio 0.16.3) # this will not find 1.0 and newer diff --git a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp index 38be43743..99f27bfab 100644 --- a/DDG4/edm4hep/Geant4Output2EDM4hep.cpp +++ b/DDG4/edm4hep/Geant4Output2EDM4hep.cpp @@ -25,10 +25,13 @@ #include #include #include -#include -#if EDM4HEP_VERSION_MAJOR == 0 && EDM4HEP_VERSION_MINOR < 99 +#if EDM4HEP_BUILD_VERSION <= EDM4HEP_VERSION(0, 10, 2) + constexpr const char* CellIDEncoding = "CellIDEncoding"; +#elif EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0) + #include using edm4hep::CellIDEncoding; #else + #include using edm4hep::labels::CellIDEncoding; #endif /// podio include files From 7b56bfbefa9e17340dd9cf27a50fcb59b582911f Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Tue, 7 Jan 2025 16:34:32 +0100 Subject: [PATCH 03/11] CI: add LCG_106 and enable EDM4hep for it. This is EDM4hep v 0.10.05 --- .github/workflows/linux.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index aa0bdaa5d..be0a78535 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -13,6 +13,7 @@ jobs: "LCG_102/x86_64-centos9-gcc11-opt", # g4 11 "LCG_104/x86_64-el9-gcc13-opt", # g4 11 "LCG_105/x86_64-ubuntu2204-gcc11-opt", # g4 11 + "LCG_106/x86_64-el9-gcc13-opt", # g4 11 "dev3/x86_64-el9-gcc13-opt", "dev3/x86_64-el9-clang16-opt", # g4 11 "dev4/x86_64-el9-gcc13-opt"] @@ -67,6 +68,10 @@ jobs: echo "::group::CMakeConfig 2" cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON .. fi + if [[ ${{ matrix.LCG }} =~ 106 ]]; then + echo "::group::CMakeConfig Enable EDM4hep" + cmake -DDD4HEP_USE_EDM4HEP=ON .. + fi echo "::group::Compile" ninja install . ../bin/thisdd4hep.sh From 9948664c0c232834d416f455885462a2f4790728 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 9 Jan 2025 15:51:47 +0100 Subject: [PATCH 04/11] Add a comment in the workflow and preprocessor checks for the vector constructor --- .github/workflows/linux.yml | 1 + DDDigi/io/DigiIO.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index be0a78535..c579d6dee 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -68,6 +68,7 @@ jobs: echo "::group::CMakeConfig 2" cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON .. fi + # Make sure DD4hep can be built with an older version of EDM4hep (0.10.5 for LCG_106) if [[ ${{ matrix.LCG }} =~ 106 ]]; then echo "::group::CMakeConfig Enable EDM4hep" cmake -DDD4HEP_USE_EDM4HEP=ON .. diff --git a/DDDigi/io/DigiIO.cpp b/DDDigi/io/DigiIO.cpp index 1d8ccf374..b4052921c 100644 --- a/DDDigi/io/DigiIO.cpp +++ b/DDDigi/io/DigiIO.cpp @@ -16,6 +16,8 @@ #include #include "DigiIO.h" +#include + /// C/C++ include files #include @@ -171,8 +173,13 @@ namespace dd4hep { mcp.setCharge(3.0*p.charge); mcp.setVertex( _toVectorD(p.start_position) ); mcp.setEndpoint( _toVectorD(p.end_position) ); +#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0) mcp.setMomentum( _toVectorF(p.momentum) ); mcp.setMomentumAtEndpoint( _toVectorF(p.momentum) ); +#else + mcp.setMomentum( _toVectorD(p.momentum) ); + mcp.setMomentumAtEndpoint( _toVectorD(p.momentum) ); +#endif } template <> template <> @@ -552,8 +559,13 @@ namespace dd4hep { const PropertyMask mask(status); mcp.setPDG(p.pdgID); +#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0) mcp.setMomentum( _toVectorF( { p.psx, p.psy, p.psz } ) ); mcp.setMomentumAtEndpoint( _toVectorF( {p.pex, p.pey, p.pez} ) ); +#else + mcp.setMomentum( _toVectorD( { p.psx, p.psy, p.psz } ) ); + mcp.setMomentumAtEndpoint( _toVectorD( {p.pex, p.pey, p.pez} ) ); +#endif mcp.setVertex( _toVectorD( { p.vsx, p.vsy, p.vsz } ) ); mcp.setEndpoint( _toVectorD( { p.vex, p.vey, p.vez } ) ); From 00cec4b6dc078fedf1f9b9c1f6be40f66d04ce11 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 9 Jan 2025 16:04:29 +0100 Subject: [PATCH 05/11] Add LCG_104 to the CI with EDM4hep --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c579d6dee..31ec61965 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -69,7 +69,7 @@ jobs: cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON .. fi # Make sure DD4hep can be built with an older version of EDM4hep (0.10.5 for LCG_106) - if [[ ${{ matrix.LCG }} =~ 106 ]]; then + if [[ ${{ matrix.LCG }} =~ 106 ||${{ matrix.LCG }} =~ 104 ]]; then echo "::group::CMakeConfig Enable EDM4hep" cmake -DDD4HEP_USE_EDM4HEP=ON .. fi From e1c41cc0403a327580b9ac787372e365edd01a67 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 9 Jan 2025 16:04:51 +0100 Subject: [PATCH 06/11] Fix space --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 31ec61965..d8367f77f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -69,7 +69,7 @@ jobs: cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON .. fi # Make sure DD4hep can be built with an older version of EDM4hep (0.10.5 for LCG_106) - if [[ ${{ matrix.LCG }} =~ 106 ||${{ matrix.LCG }} =~ 104 ]]; then + if [[ ${{ matrix.LCG }} =~ 106 || ${{ matrix.LCG }} =~ 104 ]]; then echo "::group::CMakeConfig Enable EDM4hep" cmake -DDD4HEP_USE_EDM4HEP=ON .. fi From 7473eacb1b9b42d35f03f53442e5227c06cc1bbd Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 9 Jan 2025 16:08:24 +0100 Subject: [PATCH 07/11] Add LCG_104 in the comment --- .github/workflows/linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d8367f77f..086351e51 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -68,7 +68,8 @@ jobs: echo "::group::CMakeConfig 2" cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON .. fi - # Make sure DD4hep can be built with an older version of EDM4hep (0.10.5 for LCG_106) + # Make sure DD4hep can be built with an older version of EDM4hep, + # 0.10.5 for LCG_106 and 0.10.0 for LCG_104 if [[ ${{ matrix.LCG }} =~ 106 || ${{ matrix.LCG }} =~ 104 ]]; then echo "::group::CMakeConfig Enable EDM4hep" cmake -DDD4HEP_USE_EDM4HEP=ON .. From 3cbd9b6c0e83b43905ef16c3099ab634ae7d63f6 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 9 Jan 2025 16:31:45 +0100 Subject: [PATCH 08/11] Move the version include down --- DDDigi/io/DigiIO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DDDigi/io/DigiIO.cpp b/DDDigi/io/DigiIO.cpp index b4052921c..10cf81158 100644 --- a/DDDigi/io/DigiIO.cpp +++ b/DDDigi/io/DigiIO.cpp @@ -16,7 +16,6 @@ #include #include "DigiIO.h" -#include /// C/C++ include files #include @@ -42,6 +41,7 @@ namespace edm4hep { #include #include #include +#include #include /// Namespace for the AIDA detector description toolkit From d29b1aa0e7478db25fc4208c50f161259882127a Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 9 Jan 2025 18:05:42 +0100 Subject: [PATCH 09/11] Do not build with EDM4hep on LCG_104 --- .github/workflows/linux.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 086351e51..58633590a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -68,9 +68,8 @@ jobs: echo "::group::CMakeConfig 2" cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON .. fi - # Make sure DD4hep can be built with an older version of EDM4hep, - # 0.10.5 for LCG_106 and 0.10.0 for LCG_104 - if [[ ${{ matrix.LCG }} =~ 106 || ${{ matrix.LCG }} =~ 104 ]]; then + # Make sure DD4hep can be built with an older version of EDM4hep, 0.10.5 for LCG_106 + if [[ ${{ matrix.LCG }} =~ 106 ]]; then echo "::group::CMakeConfig Enable EDM4hep" cmake -DDD4HEP_USE_EDM4HEP=ON .. fi From dc5751db2c6cc4526a39aa5e287f58c7957e9c7a Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 10 Jan 2025 10:29:23 +0100 Subject: [PATCH 10/11] Bump the required version of podio --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b87655048..a71791c7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,7 @@ if(DD4HEP_USE_EDM4HEP) find_package(EDM4HEP 0.10.0 REQUIRED) # we need podio with Frame support (>=0.16.3) # podio is "SameMajorVersion" compatible - find_package(podio 0.16.3) # this will not find 1.0 and newer + find_package(podio 0.16.7) # this will not find 1.0 and newer if(NOT podio_FOUND) # we try to find a newer version now find_package(podio 1.0 REQUIRED) From 1ef0a0b774a20d9cd236d41079b4af0ce52fee4c Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 16 Jan 2025 15:56:19 +0100 Subject: [PATCH 11/11] Require EDM4hep 0.10.5 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a71791c7a..4d8fffe9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ if(DD4HEP_USE_LCIO) endif() if(DD4HEP_USE_EDM4HEP) - find_package(EDM4HEP 0.10.0 REQUIRED) + find_package(EDM4HEP 0.10.5 REQUIRED) # we need podio with Frame support (>=0.16.3) # podio is "SameMajorVersion" compatible find_package(podio 0.16.7) # this will not find 1.0 and newer