CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFConcretePFCandidateProducer.cc
Go to the documentation of this file.
3 
4 
6  inputColl_ = iConfig.getParameter<edm::InputTag>("src");
7  // register products
8  produces<reco::PFCandidateCollection>();
9 }
10 
12 
14  const edm::EventSetup& iSetup) {
16  bool inputOk = iEvent.getByLabel(inputColl_,inputColl);
17 
18  if (!inputOk){
19  // nothing ... I guess we prefer to send an exception in the next lines
20  }
21 
22  std::auto_ptr< reco::PFCandidateCollection > outputColl(new reco::PFCandidateCollection());
23  outputColl->resize(inputColl->size());
24 
25  for (unsigned int iCopy=0;iCopy!=inputColl->size();++iCopy){
26  const reco::PFCandidate & pf=(*inputColl)[iCopy];
27  (*outputColl)[iCopy]=pf;
28  //dereferenced internally the ref and hardcopy the value
29  (*outputColl)[iCopy].setVertex(pf.vertex());
30  //math::XYZPoint(pf.vx(),pf.vy(),pf.vz()));
31  }
32 
33  iEvent.put(outputColl);
34 }
T getParameter(std::string const &) const
PFConcretePFCandidateProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
virtual const Point & vertex() const
vertex position
Definition: PFCandidate.cc:546
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
virtual void setVertex(math::XYZPoint p)
Definition: PFCandidate.h:370
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:33
virtual void produce(edm::Event &, const edm::EventSetup &)