CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CandViewRefMerger Class Reference

Inheritance diagram for CandViewRefMerger:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CandViewRefMerger (const edm::ParameterSet &cfg)

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &)

Private Attributes

std::vector< edm::InputTagsrc_

Detailed Description

Definition at line 16 of file CandViewRefMerger.cc.


Constructor & Destructor Documentation

CandViewRefMerger::CandViewRefMerger ( const edm::ParameterSet cfg) [inline, explicit]

Definition at line 18 of file CandViewRefMerger.cc.

                                                         :
    src_(cfg.getParameter<std::vector<edm::InputTag> >("src")) {
    produces<std::vector<reco::CandidateBaseRef> >();
  }

Member Function Documentation

void CandViewRefMerger::produce ( edm::Event evt,
const edm::EventSetup  
) [inline, private, virtual]

Implements edm::EDProducer.

Definition at line 23 of file CandViewRefMerger.cc.

References edm::RefToBaseVector< T >::begin(), edm::RefToBaseVector< T >::end(), edm::Event::getByLabel(), i, j, dbtoconf::out, edm::Event::put(), align_tpl::src, and src_.

                                                      {
    std::auto_ptr<std::vector<reco::CandidateBaseRef> > out(new std::vector<reco::CandidateBaseRef>);
    for(std::vector<edm::InputTag>::const_iterator i = src_.begin(); i != src_.end(); ++i) {
      edm::Handle<reco::CandidateView> src;
      evt.getByLabel(*i, src);
      reco::CandidateBaseRefVector refs = src->refVector();
      for(reco::CandidateBaseRefVector::const_iterator j = refs.begin(); j != refs.end(); ++j)
        out->push_back(*j);
    }
    evt.put(out);
  }

Member Data Documentation

std::vector<edm::InputTag> CandViewRefMerger::src_ [private]

Definition at line 34 of file CandViewRefMerger.cc.

Referenced by produce().