CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 {
17  public:
19  reco::PFCandidate output(*input);
20 
21  if (input.backPtr().isAvailable())
22  output.setSourceCandidatePtr(input.backPtr());
23  else //we are in a job where the original collection is gone
24  output.setSourceCandidatePtr(input.ptr());
25  return output;
26  }
27  };
28 } // namespace reco
29 
30 #endif
Ptr< value_type > const & ptr() const
Definition: FwdPtr.h:116
bool isAvailable() const
Definition: Ptr.h:230
Creates a PFCandidate from an input FwdPtr, and sets the &quot;source&quot; Ptr to the FwdPtr.backPtr.
void setSourceCandidatePtr(const PFCandidatePtr &ptr)
Definition: PFCandidate.h:120
static std::string const input
Definition: EdmProvDump.cc:47
Ptr< value_type > const & backPtr() const
Definition: FwdPtr.h:117
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
reco::PFCandidate operator()(edm::FwdPtr< reco::PFCandidate > const &input) const