Skip to content

Commit

Permalink
Use edm4hep::labels (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Jun 18, 2024
1 parent 70c9c11 commit a6a1fd0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions k4FWCore/components/PodioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ StatusCode PodioInput::initialize() {
}

void PodioInput::operator()() const {
if (m_podioDataSvc->getEventFrame().get(edm4hep::EventHeaderName)) {
m_readers[edm4hep::EventHeaderCollection::typeName](edm4hep::EventHeaderName);
if (m_podioDataSvc->getEventFrame().get(edm4hep::labels::EventHeader)) {
m_readers[edm4hep::EventHeaderCollection::typeName](edm4hep::labels::EventHeader);
} else {
info() << "No EventHeader collection found in the event. Not reading it" << endmsg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

struct ExampleEventHeaderConsumer final : k4FWCore::Consumer<void(const edm4hep::EventHeaderCollection&)> {
ExampleEventHeaderConsumer(const std::string& name, ISvcLocator* svcLoc)
: Consumer(name, svcLoc, {KeyValues("EventHeaderName", {edm4hep::EventHeaderName})}) {}
: Consumer(name, svcLoc, {KeyValues("EventHeaderName", {edm4hep::labels::EventHeader})}) {}

void operator()(const edm4hep::EventHeaderCollection& evtHeaderColl) const {
if (evtHeaderColl.empty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ struct ExampleFunctionalProducerRuntimeCollections final

// This is the function that will be called to produce the data
std::map<std::string, edm4hep::MCParticleCollection> operator()() const override {
std::map<std::string, edm4hep::MCParticleCollection> m_outputCollections;
std::map<std::string, edm4hep::MCParticleCollection> outputCollections;
for (int i = 0; i < m_numberOfCollections; ++i) {
std::string name = "MCParticles" + std::to_string(i);
auto coll = edm4hep::MCParticleCollection();
coll->create(1, 2, 3, 4.f, 5.f, 6.f);
coll->create(2, 3, 4, 5.f, 6.f, 7.f);
m_outputCollections[name] = std::move(coll);
outputCollections[name] = std::move(coll);
}
return m_outputCollections;
return outputCollections;
}

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class k4FWCoreTest_cellID_reader : public Gaudi::Algorithm {
/// Handle for the SimTrackerHits to be read
mutable DataHandle<edm4hep::SimTrackerHitCollection> m_simTrackerHitReaderHandle{"SimTrackerHits",
Gaudi::DataHandle::Reader, this};
mutable MetaDataHandle<std::string> m_cellIDHandle{m_simTrackerHitReaderHandle, edm4hep::CellIDEncoding,
mutable MetaDataHandle<std::string> m_cellIDHandle{m_simTrackerHitReaderHandle, edm4hep::labels::CellIDEncoding,
Gaudi::DataHandle::Reader};
};
#endif /* K4FWCORE_K4FWCORETEST_CELLID */
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class k4FWCoreTest_cellID_writer : public Gaudi::Algorithm {
/// Handle for the SimTrackerHits to be written
mutable DataHandle<edm4hep::SimTrackerHitCollection> m_simTrackerHitWriterHandle{"SimTrackerHits",
Gaudi::DataHandle::Writer, this};
MetaDataHandle<std::string> m_cellIDHandle{m_simTrackerHitWriterHandle, edm4hep::CellIDEncoding,
MetaDataHandle<std::string> m_cellIDHandle{m_simTrackerHitWriterHandle, edm4hep::labels::CellIDEncoding,
Gaudi::DataHandle::Writer};
};
#endif /* K4FWCORE_K4FWCORETEST_CELLID_WRITER */

0 comments on commit a6a1fd0

Please sign in to comment.