CMS 3D CMS Logo

List of all members | Public Member Functions
reco::PFCandidateWithSrcPtrFactory Class Reference

Creates a PFCandidate from an input FwdPtr, and sets the "source" Ptr to the FwdPtr.backPtr. More...

#include "CommonTools/ParticleFlow/interface/PFCandidateWithSrcPtrFactory.h"

Public Member Functions

reco::PFCandidate operator() (edm::FwdPtr< reco::PFCandidate > const &input) const
 

Detailed Description

Creates a PFCandidate from an input FwdPtr, and sets the "source" Ptr to the FwdPtr.backPtr.

Author
Salvatore Rappoccio

Definition at line 16 of file PFCandidateWithSrcPtrFactory.h.

Member Function Documentation

reco::PFCandidate reco::PFCandidateWithSrcPtrFactory::operator() ( edm::FwdPtr< reco::PFCandidate > const &  input) const
inline

Definition at line 18 of file PFCandidateWithSrcPtrFactory.h.

References edm::FwdPtr< T >::backPtr(), edm::Ptr< T >::isAvailable(), convertSQLitetoXML_cfg::output, edm::FwdPtr< T >::ptr(), and reco::PFCandidate::setSourceCandidatePtr().

18  {
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  }
Ptr< value_type > const & ptr() const
Definition: FwdPtr.h:116
bool isAvailable() const
Definition: Ptr.h:229
Ptr< value_type > const & backPtr() const
Definition: FwdPtr.h:117
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40