Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RVecs to root dictionaries #750

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmake/podioMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,17 @@ function(PODIO_ADD_ROOT_IO_DICT dict_name CORE_LIB HEADERS SELECTION_XML)
${CORE_LIB}
podio::podio
ROOT::Core
ROOT::ROOTVecOps
)
target_include_directories(${dict_name} PUBLIC
$<BUILD_INTERFACE:${ARG_OUTPUT_FOLDER}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
PODIO_GENERATE_DICTIONARY(${dict_name} ${HEADERS} SELECTION ${selectionfile}
PODIO_GENERATE_DICTIONARY(${dict_name} ${HEADERS} "${ROOT_INCLUDE_DIRS}/ROOT/RVec.hxx" SELECTION ${selectionfile}
OPTIONS --library ${CMAKE_SHARED_LIBRARY_PREFIX}${dict_name}${CMAKE_SHARED_LIBRARY_SUFFIX}
)
set_target_properties(${dict_name}-dictgen PROPERTIES EXCLUDE_FROM_ALL TRUE)
target_compile_options(${dict_name} PRIVATE "-Wno-effc++")
add_dependencies(${dict_name} ${CORE_LIB})
endfunction()

Expand Down
1 change: 1 addition & 0 deletions python/templates/selection.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<class name="{{ namespace }}{{ full_name }}" ClassVersion="{{ version }}"/>
{% if vector %}
<class name="std::vector<{{ namespace }}{{ full_name }}>" ClassVersion="{{ version }}"/>
<class name="ROOT::VecOps::RVec<{{ namespace }}{{ full_name }}>" ClassVersion="{{ version }}"/>
{%- endif -%}
{%- endmacro -%}

Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ FUNCTION(PODIO_ADD_LIB_AND_DICT libname headers sources selection )
target_include_directories(${dictname} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(${dictname} PUBLIC podio::${libname} podio::podio ROOT::Core ROOT::Tree)
target_link_libraries(${dictname} PUBLIC podio::${libname} podio::podio ROOT::Core ROOT::Tree ROOT::ROOTVecOps)
if(ENABLE_RNTUPLE)
target_link_libraries(${dictname} PUBLIC ROOT::ROOTNTuple)
endif()
PODIO_GENERATE_DICTIONARY(${dictname} ${headers} SELECTION ${selection}
PODIO_GENERATE_DICTIONARY(${dictname} ${headers} "${ROOT_INCLUDE_DIRS}/ROOT/RVec.hxx" SELECTION ${selection}
OPTIONS --library ${CMAKE_SHARED_LIBRARY_PREFIX}${dictname}${CMAKE_SHARED_LIBRARY_SUFFIX}
)
# prevent generating dictionary twice
set_target_properties(${dictname}-dictgen PROPERTIES EXCLUDE_FROM_ALL TRUE)
target_compile_options(${dictname} PRIVATE "-Wno-effc++")
target_sources(${dictname} PRIVATE ${dictname}.cxx)
ENDFUNCTION()

Expand Down
2 changes: 2 additions & 0 deletions src/selection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<class name="podio::version::Version"/>
<class name="podio::ObjectID"/>
<class name="vector<podio::ObjectID>"/>
<class name="ROOT::VecOps::RVec<podio::ObjectID>"/>

<class name="podio::UserDataCollection<float>"/>
<class name="podio::UserDataCollection<double>"/>
Expand All @@ -45,6 +46,7 @@

<class name="podio::LinkData"/>
<class name="std::vector<podio::LinkData>"/>
<class name="ROOT::VecOps::RVec<podio::LinkData>"/>

<function name="podio::utils::is_glob_pattern"/>
<function name="podio::utils::expand_glob"/>
Expand Down