Skip to content

Commit

Permalink
adressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Mar 31, 2023
1 parent 787beee commit 0a03a3c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,16 @@ void EDM4hep2LcioTool::convertReconstructedParticles(

// Transfer info from EDM4hep EventHeader to LCIO event
void EDM4hep2LcioTool::convertEventHeader(const std::string& e4h_coll_name, lcio::LCEventImpl* lcio_event) {
// ReconstructedParticles handle
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();
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) {
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;
Expand Down Expand Up @@ -319,7 +318,7 @@ StatusCode EDM4hep2LcioTool::convertCollections(lcio::LCEventImpl* lcio_event) {
}

// TODO: warn here if EventHeader not there
info() << "Event: " << lcio_event->getEventNumber() << " Run: " << lcio_event->getRunNumber() << endmsg;
debug() << "Event: " << lcio_event->getEventNumber() << " Run: " << lcio_event->getRunNumber() << endmsg;

FillMissingCollections(collection_pairs);

Expand Down

0 comments on commit 0a03a3c

Please sign in to comment.