Skip to content

Commit 4a0fd50

Browse files
committed
Concatenate the lists of types
1 parent 7701dd2 commit 4a0fd50

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

k4FWCore/components/EfficiencyFilter.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
#include <random>
2727
#include <string>
2828

29+
template <typename List1, typename List2>
30+
struct ConcatTypeLists;
31+
32+
template <template <typename...> class List, typename... Ts, typename... Us>
33+
struct ConcatTypeLists<List<Ts...>, List<Us...>> {
34+
using type = List<Ts..., Us...>;
35+
};
36+
2937
struct EfficiencyFilter final : k4FWCore::Transformer<podio::CollectionBase*(const podio::CollectionBase&,
3038
const edm4hep::EventHeaderCollection&)> {
3139
EfficiencyFilter(const std::string& name, ISvcLocator* svcLoc)
@@ -60,12 +68,8 @@ struct EfficiencyFilter final : k4FWCore::Transformer<podio::CollectionBase*(con
6068

6169
const auto uid = m_uniqueIDSvc->getUniqueID(evtHeader, name());
6270

63-
auto ptr = dispatchByType(
64-
coll, uid,
65-
edm4hep::edm4hepDataTypes{}); // Dispatch to the correct createSubsetCollection template function based on type
66-
if (!ptr) {
67-
ptr = dispatchByType(coll, uid, edm4hep::edm4hepLinkTypes{}); // Try link types if not found in data types
68-
}
71+
using AllTypes = typename ConcatTypeLists<edm4hep::edm4hepDataTypes, edm4hep::edm4hepLinkTypes>::type;
72+
auto ptr = dispatchByType(coll, uid, AllTypes{});
6973
if (!ptr) {
7074
throw std::runtime_error(fmt::format(
7175
"EfficiencyFilter: No createSubsetCollection function found for collection type '{}'", coll.getTypeName()));

0 commit comments

Comments
 (0)