CMS 3D CMS Logo

PFCandidateWithSrcPtrFactory.h
Go to the documentation of this file.
1 #ifndef CommonTools_ParticleFlow_PFCandidateWithSrcPtrFactor_h
2 #define CommonTools_ParticleFlow_PFCandidateWithSrcPtrFactor_h
3 
14 
15 namespace reco {
16  class PFCandidateWithSrcPtrFactory : public std::unary_function<reco::PFCandidate, edm::FwdPtr<reco::PFCandidate> > {
17  public :
19  reco::PFCandidate output( *input );
20  /* really, what's the point in this ? The one below should be enough
21  //and the one loop here is a torture of converting Ptr<PFCandidate> to Ptr<Candidate> and back
22  for ( unsigned int isource = 0; isource < input->numberOfSourceCandidatePtrs(); ++isource ) {
23  edm::Ptr<reco::PFCandidate> ptr (input->sourceCandidatePtr(isource) );
24  output.setSourceCandidatePtr( ptr );
25  }
26  */
27  output.setSourceCandidatePtr( input.backPtr() );
28  return output;
29  }
30  };
31 }
32 
33 #endif
Creates a PFCandidate from an input FwdPtr, and sets the "source" Ptr to the FwdPtr.backPtr.
void setSourceCandidatePtr(const PFCandidatePtr &ptr)
Definition: PFCandidate.h:125
static std::string const input
Definition: EdmProvDump.cc:44
Ptr< value_type > const & backPtr() const
Definition: FwdPtr.h:121
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
fixed size matrix
reco::PFCandidate operator()(edm::FwdPtr< reco::PFCandidate > const &input) const