Skip to content

Commit

Permalink
move actual conversion to k4EDM4hep2LcioConv
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Apr 18, 2023
1 parent 0a03a3c commit 9a73716
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,7 @@ void EDM4hep2LcioTool::convertEventHeader(const std::string& e4h_coll_name, lcio
DataHandle<edm4hep::EventHeaderCollection> header_handle{e4h_coll_name, Gaudi::DataHandle::Reader, this};
const auto header_coll = header_handle.get();

const auto& event_n = header_coll->eventNumber();
const auto& run_n = header_coll->runNumber();
const auto& timestamp = header_coll->timeStamp();
const auto& event_weight = header_coll->weight();

// the collection returns vectors but they should be of length 1
if (event_n.size() != 1 || run_n.size() != 1 || timestamp.size() != 1 || event_weight.size() != 1) {
// TODO: fail harder?
error() << "Malformed EventHeader, multiple entries for event number, run number, timestamp or weight!" << endmsg;
return;
}

lcio_event->setEventNumber(event_n[0]);
lcio_event->setRunNumber(run_n[0]);
lcio_event->setTimeStamp(timestamp[0]);
lcio_event->setWeight(event_weight[0]);
convEventHeader(header_coll, lcio_event);
}

// Select the appropiate method to convert a collection given its type
Expand Down

0 comments on commit 9a73716

Please sign in to comment.