#include <PFConcretePFCandidateProducer.h>
Public Member Functions | |
PFConcretePFCandidateProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~PFConcretePFCandidateProducer () | |
Private Attributes | |
edm::InputTag | inputColl_ |
Definition at line 17 of file PFConcretePFCandidateProducer.h.
PFConcretePFCandidateProducer::PFConcretePFCandidateProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 5 of file PFConcretePFCandidateProducer.cc.
References edm::ParameterSet::getParameter(), and inputColl_.
{ inputColl_ = iConfig.getParameter<edm::InputTag>("src"); // register products produces<reco::PFCandidateCollection>(); }
PFConcretePFCandidateProducer::~PFConcretePFCandidateProducer | ( | ) |
Definition at line 11 of file PFConcretePFCandidateProducer.cc.
{}
void PFConcretePFCandidateProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 13 of file PFConcretePFCandidateProducer.cc.
References edm::Event::getByLabel(), PFEmbeddingSource_cff::inputColl, inputColl_, edm::Event::put(), reco::PFCandidate::setVertex(), and reco::PFCandidate::vertex().
{ edm::Handle<reco::PFCandidateCollection> inputColl; bool inputOk = iEvent.getByLabel(inputColl_,inputColl); if (!inputOk){ // nothing ... I guess we prefer to send an exception in the next lines } std::auto_ptr< reco::PFCandidateCollection > outputColl(new reco::PFCandidateCollection()); outputColl->resize(inputColl->size()); for (unsigned int iCopy=0;iCopy!=inputColl->size();++iCopy){ const reco::PFCandidate & pf=(*inputColl)[iCopy]; (*outputColl)[iCopy]=pf; //dereferenced internally the ref and hardcopy the value (*outputColl)[iCopy].setVertex(pf.vertex()); //math::XYZPoint(pf.vx(),pf.vy(),pf.vz())); } iEvent.put(outputColl); }
Definition at line 26 of file PFConcretePFCandidateProducer.h.
Referenced by PFConcretePFCandidateProducer(), and produce().