Skip to content

Commit

Permalink
fix: forward compatibility with Acts-v31 (#1188)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?
~~Thanks to C++20 we can now do templated lambdas which don't require
syntactic validity of all code paths. That makes forward/backward
compatibility across Acts versions easier with constexpr lambdas.~~

Ifdefs on defined Acts major versions allow us to bypass code blocks
that are not compilable or parsable under different versions of Acts.

Ref: acts-project/acts#2649

### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [x] New feature (issue: Acts v31 compatibility)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
No.

---------

Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
  • Loading branch information
wdconinc and veprbl authored Dec 22, 2023
1 parent 4023c3f commit 03b1049
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmake/jana_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ macro(plugin_add_acts _name)
ActsPluginDD4hep
${ActsCore_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}ActsExamplesFramework${CMAKE_SHARED_LIBRARY_SUFFIX}
)
if(${_name}_WITH_LIBRARY)
target_compile_definitions(${PLUGIN_NAME}_library PRIVATE "Acts_VERSION_MAJOR=${Acts_VERSION_MAJOR}")
endif()
if(${_name}_WITH_PLUGIN)
target_compile_definitions(${PLUGIN_NAME}_plugin PRIVATE "Acts_VERSION_MAJOR=${Acts_VERSION_MAJOR}")
endif()

endmacro()

Expand Down
8 changes: 6 additions & 2 deletions src/algorithms/tracking/IterativeVertexFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ std::unique_ptr<edm4eic::VertexCollection> eicrecon::IterativeVertexFinder::prod
VertexSeeder::Config seederCfg(ipEst);
VertexSeeder seeder(seederCfg);
// Set up the actual vertex finder
VertexFinder::Config finderCfg(vertexFitter, std::move(linearizer),
std::move(seeder), ipEst);
VertexFinder::Config finderCfg(std::move(vertexFitter), std::move(linearizer),
std::move(seeder), std::move(ipEst));
finderCfg.maxVertices = m_cfg.m_maxVertices;
finderCfg.reassignTracksAfterFirstFit = m_cfg.m_reassignTracksAfterFirstFit;
#if Acts_VERSION_MAJOR >= 31
VertexFinder finder(std::move(finderCfg));
#else
VertexFinder finder(finderCfg);
#endif
VertexFinder::State state(*m_BField, m_fieldctx);
VertexFinderOptions finderOpts(m_geoctx, m_fieldctx);

Expand Down

0 comments on commit 03b1049

Please sign in to comment.