Skip to content

Commit 2362560

Browse files
authored
Make edm4dr an "extended datamodel" (#29)
* Make edm4dr an "extended datamodel" This profits from the recently added functionality in podio (AIDASoft/podio#317) and takes edm4hep::ObjectID from edm4hep proper. This avoids some warning and a possible deadlock in ROOT. * adapt warning
1 parent 31c01d2 commit 2362560

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

edm4dr.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ options:
44
exposePODMembers: False
55
includeSubfolder: True
66

7-
components:
8-
#------ ObjectID helper struct for references/relations
9-
edm4hep::ObjectID: # FIXME already lives in edm4hep, error handling in podio should be improved
10-
Members:
11-
- int index
12-
- int collectionID
13-
ExtraCode :
14-
includes: "#include <podio/ObjectID.h>\n"
15-
declaration: "
16-
ObjectID() = default;\n
17-
ObjectID(const podio::ObjectID& id ): index(id.index), collectionID(id.collectionID) {}\n
18-
"
197

208
datatypes :
219
edm4hep::SparseVector:

edm4dr/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
# installed podio
33
find_package(EDM4HEP REQUIRED)
44

5-
PODIO_GENERATE_DATAMODEL(edm4hep ../edm4dr.yaml headers sources IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS})
5+
# Use the EDM4HEP_DATA_DIR to derive extended data model
6+
if ("${EDM4HEP_DATA_DIR}" STREQUAL "")
7+
message(FATAL_ERROR "Unable to extend data model since no installed yaml file found.")
8+
else()
9+
message(STATUS "Current EDM4HEP data model is available at ${EDM4HEP_DATA_DIR}.")
10+
PODIO_GENERATE_DATAMODEL(edm4hep ../edm4dr.yaml headers sources
11+
UPSTREAM_EDM edm4hep:${EDM4HEP_DATA_DIR}/edm4hep.yaml
12+
IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS})
13+
endif()
614

715
# use customized library linking instead of PODIO_ADD_DATAMODEL_CORE_LIB(edm4dr "${headers}" "${sources}")
816

0 commit comments

Comments
 (0)