12 #ifndef TauAnalysis_MCEmbeddingTools_CollectionMerger_H
13 #define TauAnalysis_MCEmbeddingTools_CollectionMerger_H
38 template <
typename T1,
typename T2>
49 std::map<std::string, std::vector<edm::EDGetTokenT<MergeCollection> > >
inputs_;
55 bool print_pixel =
false);
62 template <
typename T1,
typename T2>
64 std::vector<edm::InputTag> inCollections = iConfig.
getParameter<std::vector<edm::InputTag> >(
"mergCollections");
65 for (
auto const &inCollection : inCollections) {
66 inputs_[inCollection.instance()].push_back(consumes<MergeCollection>(inCollection));
68 for (
auto toproduce : inputs_) {
70 produces<MergeCollection>(toproduce.first);
74 template <
typename T1,
typename T2>
79 template <
typename T1,
typename T2>
81 for (
auto input_ : inputs_) {
83 std::vector<edm::Handle<MergeCollection> > inputCollections;
84 inputCollections.resize(input_.second.size());
85 for (
unsigned id = 0;
id < input_.second.size();
id++) {
86 iEvent.getByToken(input_.second[
id], inputCollections[
id]);
88 fill_output_obj(
output, inputCollections);