CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CandViewRefMerger.cc
Go to the documentation of this file.
1 /* \class CandViewRefMerger
2  *
3  * Producer of merged references to Candidates
4  *
5  * \author: Luca Lista, INFN
6  *
7  */
8 
15 
17 public:
18  explicit CandViewRefMerger(const edm::ParameterSet& cfg) :
19  src_(cfg.getParameter<std::vector<edm::InputTag> >("src")) {
20  produces<std::vector<reco::CandidateBaseRef> >();
21  }
22 private:
23  void produce(edm::Event & evt, const edm::EventSetup &) {
24  std::auto_ptr<std::vector<reco::CandidateBaseRef> > out(new std::vector<reco::CandidateBaseRef>);
25  for(std::vector<edm::InputTag>::const_iterator i = src_.begin(); i != src_.end(); ++i) {
27  evt.getByLabel(*i, src);
28  reco::CandidateBaseRefVector refs = src->refVector();
29  for(reco::CandidateBaseRefVector::const_iterator j = refs.begin(); j != refs.end(); ++j)
30  out->push_back(*j);
31  }
32  evt.put(out);
33  }
34  std::vector<edm::InputTag> src_;
35 };
36 
int i
Definition: DBlmapReader.cc:9
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void produce(edm::Event &evt, const edm::EventSetup &)
CandViewRefMerger(const edm::ParameterSet &cfg)
const_iterator end() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::vector< edm::InputTag > src_
int j
Definition: DBlmapReader.cc:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple out
Definition: dbtoconf.py:99
const_iterator begin() const