Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,14 @@ StatusCode EDM4hep2LcioTool::convertCollections(lcio::LCEventImpl* lcio_event) {
std::vector<std::tuple<std::string, const podio::CollectionBase*>> linkCollections{};

for (const auto& [edm4hepName, lcioName] : m_collsToConvert) {
const auto coll = getEDM4hepCollection(edm4hepName);
if (coll->getTypeName().find("LinkCollection") != std::string_view::npos) {
debug() << edm4hepName << " is a link collection, converting it later" << endmsg;
linkCollections.emplace_back(lcioName, coll);
continue;
}
debug() << "Converting collection " << edm4hepName << " (storing it as " << lcioName << ")" << endmsg;
if (!EDM4hep2LCIOConv::collectionExist(lcioName, lcio_event)) {
const auto coll = getEDM4hepCollection(edm4hepName);
if (coll->getTypeName().find("LinkCollection") != std::string_view::npos) {
debug() << edm4hepName << " is a link collection, converting it later" << endmsg;
linkCollections.emplace_back(lcioName, coll);
continue;
}
convertAdd(edm4hepName, lcioName, lcio_event, collection_pairs, pidCollections, dQdxCollections);
} else {
debug() << " Collection " << lcioName << " already in place, skipping conversion. " << endmsg;
Expand Down
25 changes: 24 additions & 1 deletion test/gaudi_opts/test_link_conversion_edm4hep.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,30 @@
mcLinkConverter.OutputLevel = DEBUG
MarlinMCLinkChecker.EDM4hep2LcioTool = mcLinkConverter

algList = [PseudoRecoAlg, MCRecoLinker, MarlinMCLinkChecker]
# Another link checker and converter
# We use this to avoid regressions for the fix in #237
AnotherLinkChecker = MarlinProcessorWrapper(
"AnotherLinkChecker",
ProcessorType="MarlinMCRecoLinkChecker",
Parameters={
"MCRecoLinks": ["TrivialMCRecoLinks"],
"InputMCs": ["MCParticles"],
"InputRecos": ["PseudoRecoParticles"],
},
)

anotherLinkConverter = EDM4hep2LcioTool("AnotherLinkConverter")
anotherLinkConverter.convertAll = True
anotherLinkConverter.collNameMapping = {
"TrivialMCRecoLinks": "TrivialMCRecoLinks",
"MCParticles": "MCParticles",
"PseudoRecoParticles": "PseudoRecoParticles",
}
anotherLinkConverter.OutputLevel = DEBUG
AnotherLinkChecker.EDM4hep2LcioTool = anotherLinkConverter


algList = [PseudoRecoAlg, MCRecoLinker, MarlinMCLinkChecker, AnotherLinkChecker]

if args.no_iosvc:
algList = [podioInput] + algList
Expand Down