Skip to content

Commit

Permalink
Use new links category to define links
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Oct 1, 2024
1 parent aa795e8 commit 4b9728a
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 122 deletions.
43 changes: 43 additions & 0 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -685,3 +685,46 @@ interfaces:
Types:
- edm4hep::TrackerHit3D
- edm4hep::TrackerHitPlane

links:
edm4hep::RecoMCParticleLink:
Description: "Link between a ReconstructedParticle and an MCParticle"
Author: "EDM4hep authors"
From: edm4hep::ReconstructedParticle
To: edm4hep::MCParticle

edm4hep::CaloHitMCParticleLink:
Description: "Link between a CalorimeterHit and an MCParticle"
Author: "EDM4hep authors"
From: edm4hep::CalorimeterHit
To: edm4hep::MCParticle

edm4hep::ClusterMCParticleLink:
Description: "Link between a Cluster and an MCParticle"
Author: "EDM4hep authors"
From: edm4hep::Cluster
To: edm4hep::MCParticle

edm4hep::TrackMCParticleLink:
Description: "Link between a Track and an MCParticle"
Author: "EDM4hep authors"
From: edm4hep::Track
To: edm4hep::MCParticle

edm4hep::CaloHitSimCaloHitLink:
Description: "Link between a CalorimeterHit and a SimCalorimeterHit"
Author: "EDM4hep authors"
From: edm4hep::CalorimeterHit
To: edm4hep::SimCalorimeterHit

edm4hep::TrackerHitSimTrackerHitLink:
Description: "Link between a TrackerHit and a SimTrackerHit"
Author: "EDM4hep authors"
From: edm4hep::TrackerHit
To: edm4hep::SimTrackerHit

edm4hep::VertexRecoParticleLink:
Description: "Link between a Vertex and a ReconstructedParticle"
Author: "EDM4hep authors"
From: edm4hep::Vertex
To: edm4hep::ReconstructedParticle
2 changes: 0 additions & 2 deletions edm4hep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ add_library(EDM4HEP::edm4hep ALIAS edm4hep)

file(GLOB_RECURSE top_headers ${PROJECT_SOURCE_DIR}/include/*.h)
target_sources(edm4hep PUBLIC FILE_SET headers TYPE HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/include FILES ${top_headers})
target_sources(edm4hep PRIVATE src/LinkCollectionDeclarations.cc)

if (nlohmann_json_FOUND)
target_compile_definitions(edm4hep PUBLIC PODIO_JSON_OUTPUT)
target_link_libraries(edm4hep PUBLIC nlohmann_json::nlohmann_json)
Expand Down
15 changes: 0 additions & 15 deletions edm4hep/src/LinkCollectionDeclarations.cc

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/CaloHitMCParticleLinkCollection.h

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/CaloHitSimCaloHitLinkCollection.h

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/ClusterMCParticleLinkCollection.h

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/RecoMCParticleLinkCollection.h

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/TrackMCParticleLinkCollection.h

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/TrackerHitSimTrackerHitLinkCollection.h

This file was deleted.

13 changes: 0 additions & 13 deletions include/edm4hep/VertexRecoParticleLinkCollection.h

This file was deleted.

14 changes: 0 additions & 14 deletions python/edm4hep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@
if res != 0:
raise RuntimeError("Failed to load edm4hep v2 legacy library")

_LINK_COLLS = [
"RecoMCParticle",
"CaloHitMCParticle",
"CaloHitSimCaloHit",
"ClusterMCParticle",
"TrackMCParticle",
"TrackerHitSimTrackerHit",
"VertexRecoParticle",
]

for lc in _LINK_COLLS:
if ROOT.gInterpreter.LoadFile(f"edm4hep/{lc}LinkCollection.h") != 0:
raise RuntimeError(f"Failed to load {lc}LinkCollection.h")

from ROOT import edm4hep # noqa: E402

from podio.pythonizations import load_pythonizations # noqa: E402
Expand Down

0 comments on commit 4b9728a

Please sign in to comment.