CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& es) const override {
27  auto output = std::make_unique<reco::PFClusterCollection>();
28  for (const auto& input : _inputs) {
30  e.getByToken(input, handle);
31  output->insert(output->end(), handle->begin(), handle->end());
32  }
33  e.put(std::move(output));
34  }
35 
36 private:
37  std::vector<edm::EDGetTokenT<reco::PFClusterCollection> > _inputs;
38 };
39 
41 
42 #endif
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static std::string const input
Definition: EdmProvDump.cc:47
def move
Definition: eostools.py:511
tuple handle
Definition: patZpeak.py:25
void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &es) const override
PFClusterCollectionMerger(const edm::ParameterSet &conf)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< edm::EDGetTokenT< reco::PFClusterCollection > > _inputs