test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 =
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  virtual void produce(edm::StreamID, edm::Event& e, const edm::EventSetup& es) const {
28  std::auto_ptr<reco::PFClusterCollection> output;
29  output.reset(new reco::PFClusterCollection);
30  for( const auto& input : _inputs ) {
32  e.getByToken(input,handle);
33  output->insert(output->end(),handle->begin(),handle->end());
34  }
35  e.put(output);
36  }
37 private:
38  std::vector<edm::EDGetTokenT<reco::PFClusterCollection> > _inputs;
39 };
40 
42 
43 #endif
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static std::string const input
Definition: EdmProvDump.cc:43
virtual void produce(edm::StreamID, edm::Event &e, const edm::EventSetup &es) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
tuple handle
Definition: patZpeak.py:22
PFClusterCollectionMerger(const edm::ParameterSet &conf)
tuple conf
Definition: dbtoconf.py:185
std::vector< edm::EDGetTokenT< reco::PFClusterCollection > > _inputs
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9