CMS 3D CMS Logo

PFClusterCollectionMerger.cc
Go to the documentation of this file.
1 #ifndef __PFClusterCollectionMerger__
2 #define __PFClusterCollectionMerger__
3 
4 // user include files
7 
10 
12 
15 
17 public:
19  const std::vector<edm::InputTag>& inputs = conf.getParameter<std::vector<edm::InputTag>>("inputs");
20  for (const auto& input : inputs) {
21  _inputs.push_back(consumes<reco::PFClusterCollection>(input));
22  }
23  produces<reco::PFClusterCollection>();
24  }
25 
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
28  desc.add<std::vector<edm::InputTag>>("inputs", {});
29  descriptions.addWithDefaultLabel(desc);
30  }
31 
32  void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& es) const override {
33  auto output = std::make_unique<reco::PFClusterCollection>();
34  for (const auto& input : _inputs) {
36  e.getByToken(input, handle);
37  output->insert(output->end(), handle->begin(), handle->end());
38  }
39  e.put(std::move(output));
40  }
41 
42 private:
43  std::vector<edm::EDGetTokenT<reco::PFClusterCollection>> _inputs;
44 };
45 
47 
48 #endif
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
static std::string const input
Definition: EdmProvDump.cc:50
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &es) const override
PFClusterCollectionMerger(const edm::ParameterSet &conf)
std::vector< edm::EDGetTokenT< reco::PFClusterCollection > > _inputs
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511