CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CandReducer Class Reference

Inheritance diagram for CandReducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CandReducer (const edm::ParameterSet &)
 constructor from parameter set
 ~CandReducer ()
 destructor

Private Member Functions

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

Private Attributes

edm::InputTag src_
 label of source candidate collection

Detailed Description

Definition at line 22 of file CandReducer.cc.


Constructor & Destructor Documentation

CandReducer::CandReducer ( const edm::ParameterSet cfg) [explicit]

constructor from parameter set

Definition at line 44 of file CandReducer.cc.

                                                     :
  src_( cfg.getParameter<edm::InputTag>("src") ) {
  produces<CandidateCollection>();
}
CandReducer::~CandReducer ( )

destructor

Definition at line 49 of file CandReducer.cc.

                          {
}

Member Function Documentation

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

process one evevnt

Implements edm::EDProducer.

Definition at line 52 of file CandReducer.cc.

References trackerHits::c, AlCaHLTBitMon_QueryRunRegistry::comp, edm::Event::getByLabel(), edm::Event::put(), and src_.

                                                         {
  Handle<reco::CandidateView> cands;
  evt.getByLabel( src_, cands );
  std::auto_ptr<CandidateCollection> comp( new CandidateCollection );
  for( reco::CandidateView::const_iterator c = cands->begin(); c != cands->end(); ++c ) {
    std::auto_ptr<Candidate> cand( new LeafCandidate( * c ) );
    comp->push_back( cand.release() );
  }
  evt.put( comp );
}

Member Data Documentation

label of source candidate collection

Definition at line 32 of file CandReducer.cc.

Referenced by produce().