diff --git a/k4FWCore/components/PodioInput.cpp b/k4FWCore/components/PodioInput.cpp index 1af6a0b2..dd0c6d18 100644 --- a/k4FWCore/components/PodioInput.cpp +++ b/k4FWCore/components/PodioInput.cpp @@ -45,7 +45,14 @@ #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TimeSeriesCollection.h" #include "edm4hep/TrackCollection.h" +#if __has_include("edm4hep/TrackerHit3DCollection.h") +#include "edm4hep/TrackerHit3DCollection.h" +#else #include "edm4hep/TrackerHitCollection.h" +namespace edm4hep { + using TrackerHit3DCollection = edm4hep::TrackerHitCollection; +} // namespace edm4hep +#endif #include "edm4hep/TrackerHitPlaneCollection.h" #include "edm4hep/TrackerPulseCollection.h" #include "edm4hep/VertexCollection.h" @@ -85,8 +92,11 @@ void PodioInput::fillReaders() { m_readers["edm4hep::ClusterCollection"] = [&](std::string_view collName) { maybeRead(collName); }; + m_readers["edm4hep::TrackerHit3DCollection"] = [&](std::string_view collName) { + maybeRead(collName); + }; m_readers["edm4hep::TrackerHitCollection"] = [&](std::string_view collName) { - maybeRead(collName); + maybeRead(collName); }; m_readers["edm4hep::TrackerHitPlaneCollection"] = [&](std::string_view collName) { maybeRead(collName); diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp index 1f4e6447..440d8f85 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalConsumerMultiple.cpp @@ -23,7 +23,14 @@ #include "edm4hep/MCParticleCollection.h" #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TrackCollection.h" +#if __has_include("edm4hep/TrackerHit3DCollection.h") +#include "edm4hep/TrackerHit3DCollection.h" +#else #include "edm4hep/TrackerHitCollection.h" +namespace edm4hep { + using TrackerHit3DCollection = edm4hep::TrackerHitCollection; +} // namespace edm4hep +#endif #include "podio/UserDataCollection.h" // Define BaseClass_t @@ -37,7 +44,7 @@ using FloatColl = podio::UserDataCollection; using ParticleColl = edm4hep::MCParticleCollection; using SimTrackerHitColl = edm4hep::SimTrackerHitCollection; -using TrackerHitColl = edm4hep::TrackerHitCollection; +using TrackerHitColl = edm4hep::TrackerHit3DCollection; using TrackColl = edm4hep::TrackCollection; struct ExampleFunctionalConsumerMultiple final diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp index 7f892560..fab16140 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalProducerMultiple.cpp @@ -24,7 +24,14 @@ #include "edm4hep/MCParticleCollection.h" #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TrackCollection.h" +#if __has_include("edm4hep/TrackerHit3DCollection.h") +#include "edm4hep/TrackerHit3DCollection.h" +#else #include "edm4hep/TrackerHitCollection.h" +namespace edm4hep { + using TrackerHit3DCollection = edm4hep::TrackerHitCollection; +} // namespace edm4hep +#endif #include "podio/UserDataCollection.h" #include @@ -33,7 +40,7 @@ using Float = podio::UserDataCollection; using Particle = edm4hep::MCParticleCollection; using SimTrackerHit = edm4hep::SimTrackerHitCollection; -using TrackerHit = edm4hep::TrackerHitCollection; +using TrackerHit = edm4hep::TrackerHit3DCollection; using Track = edm4hep::TrackCollection; struct ExampleFunctionalProducerMultiple final @@ -71,7 +78,7 @@ struct ExampleFunctionalProducerMultiple final auto hit = simTrackerHits.create(); hit.setPosition({3, 4, 5}); - auto trackerHits = edm4hep::TrackerHitCollection(); + auto trackerHits = edm4hep::TrackerHit3DCollection(); auto trackerHit = trackerHits.create(); trackerHit.setPosition({3, 4, 5}); diff --git a/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerMultiple.cpp b/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerMultiple.cpp index 3a5876b5..e84587fa 100644 --- a/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerMultiple.cpp +++ b/test/k4FWCoreTest/src/components/ExampleFunctionalTransformerMultiple.cpp @@ -23,7 +23,15 @@ #include "edm4hep/MCParticleCollection.h" #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TrackCollection.h" +#if __has_include("edm4hep/TrackerHit3DCollection.h") +#include "edm4hep/TrackerHit3DCollection.h" +#else #include "edm4hep/TrackerHitCollection.h" +namespace edm4hep { + using TrackerHit3DCollection = edm4hep::TrackerHitCollection; +} // namespace edm4hep +#endif +#include "edm4hep/TrackerHit3DCollection.h" #include "podio/UserDataCollection.h" // Define BaseClass_t @@ -35,7 +43,7 @@ using FloatColl = podio::UserDataCollection; using ParticleColl = edm4hep::MCParticleCollection; using SimTrackerHitColl = edm4hep::SimTrackerHitCollection; -using TrackerHitColl = edm4hep::TrackerHitCollection; +using TrackerHitColl = edm4hep::TrackerHit3DCollection; using TrackColl = edm4hep::TrackCollection; // As a simple example, we'll write an integer and a collection of MCParticles diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp b/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp index 9d918329..38be7565 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.cpp @@ -23,7 +23,15 @@ #include "edm4hep/MCParticleCollection.h" #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TrackCollection.h" +#if __has_include("edm4hep/TrackerHit3DCollection.h") +#include "edm4hep/TrackerHit3DCollection.h" +#else #include "edm4hep/TrackerHitCollection.h" +namespace edm4hep { + using TrackerHit3DCollection = edm4hep::TrackerHitCollection; +} // namespace edm4hep +#endif +#include "edm4hep/TrackerHitPlaneCollection.h" DECLARE_COMPONENT(k4FWCoreTest_CheckExampleEventData) diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.h b/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.h index 7c507d4b..92fe7ba0 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.h +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_CheckExampleEventData.h @@ -29,10 +29,6 @@ // datamodel namespace edm4hep { class MCParticleCollection; - class SimTrackerHitCollection; - class TrackerHitCollection; - class SimCaloHitCollection; - class TrackCollection; } // namespace edm4hep class k4FWCoreTest_CheckExampleEventData : public GaudiAlgorithm { diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp b/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp index 402fffb1..aac738e9 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.cpp @@ -24,7 +24,6 @@ #include "edm4hep/MCParticleCollection.h" #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TrackCollection.h" -#include "edm4hep/TrackerHitCollection.h" #if __has_include("edm4hep/EDM4hepVersion.h") #include "edm4hep/EDM4hepVersion.h" #else @@ -74,8 +73,8 @@ StatusCode k4FWCoreTest_CreateExampleEventData::execute() { auto hit = simTrackerHits->create(); hit.setPosition({3, 4, 5}); - edm4hep::TrackerHitCollection* trackerHits = m_TrackerHitHandle.createAndPut(); - auto trackerHit = trackerHits->create(); + edm4hep::TrackerHit3DCollection* trackerHits = m_TrackerHitHandle.createAndPut(); + auto trackerHit = trackerHits->create(); trackerHit.setPosition({3, 4, 5}); edm4hep::TrackCollection* tracks = m_trackHandle.createAndPut(); diff --git a/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.h b/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.h index ed1b8ee9..2aa3d3bd 100644 --- a/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.h +++ b/test/k4FWCoreTest/src/components/k4FWCoreTest_CreateExampleEventData.h @@ -25,6 +25,16 @@ // key4hep #include "k4FWCore/DataHandle.h" +// edm4hep +#if __has_include("edm4hep/TrackerHit3DCollection.h") +#include "edm4hep/TrackerHit3DCollection.h" +#else +#include "edm4hep/TrackerHitCollection.h" +namespace edm4hep { + using TrackerHit3DCollection = edm4hep::TrackerHitCollection; +} // namespace edm4hep +#endif + // podio #include "podio/UserDataCollection.h" @@ -32,7 +42,6 @@ namespace edm4hep { class MCParticleCollection; class SimTrackerHitCollection; - class TrackerHitCollection; class SimCaloHitCollection; class TrackCollection; } // namespace edm4hep @@ -69,7 +78,7 @@ class k4FWCoreTest_CreateExampleEventData : public GaudiAlgorithm { DataHandle m_mcParticleHandle{"MCParticles", Gaudi::DataHandle::Writer, this}; /// Handle for the SimTrackerHits to be written DataHandle m_simTrackerHitHandle{"SimTrackerHits", Gaudi::DataHandle::Writer, this}; - DataHandle m_TrackerHitHandle{"TrackerHits", Gaudi::DataHandle::Writer, this}; + DataHandle m_TrackerHitHandle{"TrackerHits", Gaudi::DataHandle::Writer, this}; /// Handle for the Tracks to be written DataHandle m_trackHandle{"Tracks", Gaudi::DataHandle::Writer, this};