Skip to content

Commit

Permalink
Make EDM4hep to LCIO conversion a template library
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 13, 2023
1 parent 212d55d commit d5ae846
Show file tree
Hide file tree
Showing 4 changed files with 854 additions and 841 deletions.
9 changes: 8 additions & 1 deletion k4EDM4hep2LcioConv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ target_link_libraries(k4EDM4hep2LcioConv PUBLIC
${LCIO_LIBRARIES}
EDM4HEP::edm4hep)

set(public_headers
include/${PROJECT_NAME}/k4EDM4hep2LcioConv.h
include/${PROJECT_NAME}/k4EDM4hep2LcioConv.ipp
include/${PROJECT_NAME}/k4Lcio2EDM4hepConv.h
include/${PROJECT_NAME}/MappingUtils.h
)

set_target_properties(${PROJECT_NAME}
PROPERTIES
PUBLIC_HEADER "include/${PROJECT_NAME}/k4EDM4hep2LcioConv.h;include/${PROJECT_NAME}/k4Lcio2EDM4hepConv.h;include/${PROJECT_NAME}/MappingUtils.h"
PUBLIC_HEADER "${public_headers}"
)

install(TARGETS k4EDM4hep2LcioConv
Expand Down
16 changes: 16 additions & 0 deletions k4EDM4hep2LcioConv/include/k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ namespace edm4hep {
#include <edm4hep/TrackerHitPlaneCollection.h>
#include <edm4hep/VertexCollection.h>

#if __has_include("edm4hep/EDM4hepVersion.h")
#include "edm4hep/EDM4hepVersion.h"
#else
// Copy the necessary parts from the header above to make whatever we need to work here
#define EDM4HEP_VERSION(major, minor, patch) ((UINT64_C(major) << 32) | (UINT64_C(minor) << 16) | (UINT64_C(patch)))
// v00-07-02 is the last version without that still has TPCHits
#if __has_include("edm4hep/TPCHitCollection.h")
#define EDM4HEP_BUILD_VERSION EDM4HEP_VERSION(0, 7, 2)
#else
// v00-09 is the last version without the capitalization change of the track vector members
#define EDM4HEP_BUILD_VERSION EDM4HEP_VERSION(0, 9, 0)
#endif
#endif

// LCIO
#include <IMPL/CalorimeterHitImpl.h>
#include <IMPL/ClusterImpl.h>
Expand Down Expand Up @@ -168,4 +182,6 @@ namespace EDM4hep2LCIOConv {

} // namespace EDM4hep2LCIOConv

#include "k4EDM4hep2LcioConv/k4EDM4hep2LcioConv.ipp"

#endif
Loading

0 comments on commit d5ae846

Please sign in to comment.