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 =
20  conf.getParameter<std::vector<edm::InputTag> >("inputs");
21  for( const auto& input : inputs ) {
22  _inputs.push_back(consumes<reco::PFClusterCollection>( input ));
23  }
24  produces<reco::PFClusterCollection>();
25  }
26 
27  void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& es) const override {
28  auto output = std::make_unique<reco::PFClusterCollection>();
29  for( const auto& input : _inputs ) {
31  e.getByToken(input,handle);
32  output->insert(output->end(),handle->begin(),handle->end());
33  }
34  e.put(std::move(output));
35  }
36 private:
37  std::vector<edm::EDGetTokenT<reco::PFClusterCollection> > _inputs;
38 };
39 
41 
42 #endif
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &es) const override
static std::string const input
Definition: EdmProvDump.cc:44
PFClusterCollectionMerger(const edm::ParameterSet &conf)
std::vector< edm::EDGetTokenT< reco::PFClusterCollection > > _inputs
def move(src, dest)
Definition: eostools.py:510