CMS 3D CMS Logo

Public Member Functions | Private Attributes

CandViewRefTriggerBiasRemover Class Reference

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

List of all members.

Public Member Functions

 CandViewRefTriggerBiasRemover (const edm::ParameterSet &pset)
void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::InputTag src_

Detailed Description

Definition at line 26 of file CandViewRefTriggerBiasRemover.cc.


Constructor & Destructor Documentation

CandViewRefTriggerBiasRemover::CandViewRefTriggerBiasRemover ( const edm::ParameterSet pset)

Definition at line 34 of file CandViewRefTriggerBiasRemover.cc.

References edm::ParameterSet::getParameter(), and src_.

                                 {
  src_ = pset.getParameter<edm::InputTag>("triggered");
  produces<reco::CandidateBaseRefVector>();
}

Member Function Documentation

void CandViewRefTriggerBiasRemover::produce ( edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 40 of file CandViewRefTriggerBiasRemover.cc.

References edm::Event::getByLabel(), convertSQLitetoXML_cfg::output, edm::Event::put(), and src_.

                                                                     {
  edm::Handle<edm::View<reco::Candidate> > cands;
  evt.getByLabel(src_, cands);
  std::auto_ptr<reco::CandidateBaseRefVector> output(
      new reco::CandidateBaseRefVector(cands));
  // Only copy the output if there is more than one item in the input
  size_t nCands = cands->size();
  if (nCands > 1) {
    //output->reserve(nCands);
    for (size_t iCand = 0; iCand < nCands; ++iCand) {
      output->push_back(cands->refVector().at(iCand));
    }
  }
  evt.put(output);
}

Member Data Documentation

Definition at line 31 of file CandViewRefTriggerBiasRemover.cc.

Referenced by CandViewRefTriggerBiasRemover(), and produce().