Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates FieldMapB magnetic field-map sampling/interpolation to use the covfie field infrastructure, with the goal of enabling covfie pass-through to downstream consumers while keeping the DD4hep field interface.
Changes:
- Added covfie-based field types and loading for
BrBzandBxByBzmap formats. - Replaced manual (bi/tri)-linear interpolation with covfie
field_view::at(...)sampling. - Added covfie as a CMake dependency.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/FieldMapB.cpp |
Switches field-map storage/sampling to covfie-backed fields and removes the custom interpolation/indexing logic. |
CMakeLists.txt |
Adds covfie discovery via find_package(covfie REQUIRED). |
Comments suppressed due to low confidence (1)
CMakeLists.txt:67
find_package(covfie REQUIRED)is added, but the plugin target is not linked against any covfie imported target (nor are covfie include dirs applied). Unless covfie headers are in a global include path, this will break builds; please attach covfie to the${a_lib_name}target (e.g., viatarget_link_librarieswith the package’s exported target) so include paths/compile options propagate correctly.
# Dependencies
find_package(DD4hep 1.27 REQUIRED COMPONENTS DDCore DDRec)
find_package(fmt REQUIRED)
find_package(covfie REQUIRED)
find_package(IRT2 2.1.1)
#-----------------------------------------------------------------------------------
set(a_lib_name ${PROJECT_NAME})
set(DD4HEP_SET_RPATH TRUE)
dd4hep_configure_output(INSTALL ${CMAKE_INSTALL_PREFIX})
dd4hep_set_compiler_flags()
file(GLOB sources CONFIGURE_DEPENDS src/*.cpp)
dd4hep_add_plugin(${a_lib_name}
SOURCES ${sources}
USES ROOT::Core ROOT::Gdml
)
target_link_libraries(${a_lib_name}
PUBLIC DD4hep::DDCore DD4hep::DDRec fmt::fmt
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Briefly, what does this PR introduce?
Needs:
This PR converts the FieldMapB handling to using covfie for all interpolation etc. This will allow us to pass-through covfie to ACTS and others(*), while continuing to use the DD4hep field accessors where necessary.
(*) No demo of this. Not sure all necessary parts are there. You'd need to access the bare cvf file.
After profiling with this change, the cost of fieldComponent calls went from 12% to 7% (and due to the way covfie works with templated code, all calls could be inlined so there is no remaining branching).
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No.
Does this PR change default behavior?
No.