CMS 3D CMS Logo

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>

Inheritance diagram for reco::PFCandidateWithSrcPtrFactory:
unary_function

List of all members.

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(), convertSQLitetoXML_cfg::output, and reco::PFCandidate::setSourceCandidatePtr().

                                                                                 {
      reco::PFCandidate output( *input );
      /* really, what's the point in this ? The one below should be enough
      //and the one loop here is a torture of converting Ptr<PFCandidate> to Ptr<Candidate> and back
      for ( unsigned int isource = 0; isource < input->numberOfSourceCandidatePtrs(); ++isource ) {
        edm::Ptr<reco::PFCandidate> ptr (input->sourceCandidatePtr(isource) );
        output.setSourceCandidatePtr( ptr );
      }
      */
      output.setSourceCandidatePtr( input.backPtr() );
      return output; 
    }