1 #ifndef CollectionCombiner_H
2 #define CollectionCombiner_H
26 template <
typename Collection>
40 template <
typename Collection>
43 produces<Collection>();
44 for (
unsigned int i = 0;
i <
labels.size(); ++
i)
45 collectionTokens.push_back(consumes<Collection>(
labels.at(
i)));
47 template <
typename Collection>
50 template <
typename Collection>
52 unsigned int i = 0, i_max =
labels.size();
54 auto merged = std::make_unique<Collection>();
55 for (; i != i_max; ++
i) {
56 iEvent.
getByToken(collectionTokens[i], handle);
57 merged->insert(
merged->end(), handle->begin(), handle->end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< edm::EDGetTokenT< Collection > > collectionTokens
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
~CollectionCombiner() override
T getParameter(std::string const &) const
CollectionCombiner(const edm::ParameterSet &)
std::vector< edm::InputTag > labels