CMS 3D CMS Logo

Public Member Functions | Private Attributes

pf2pat::PtMinPFCandidateSelectorDefinition Class Reference

#include <PtMinPFCandidateSelectorDefinition.h>

Inheritance diagram for pf2pat::PtMinPFCandidateSelectorDefinition:
pf2pat::PFCandidateSelectorDefinition

List of all members.

Public Member Functions

 PtMinPFCandidateSelectorDefinition (const edm::ParameterSet &cfg)
void select (const HandleToCollection &hc, const edm::EventBase &e, const edm::EventSetup &s)

Private Attributes

double ptMin_

Detailed Description

Definition at line 10 of file PtMinPFCandidateSelectorDefinition.h.


Constructor & Destructor Documentation

pf2pat::PtMinPFCandidateSelectorDefinition::PtMinPFCandidateSelectorDefinition ( const edm::ParameterSet cfg) [inline]

Definition at line 13 of file PtMinPFCandidateSelectorDefinition.h.

                                                                       :
      ptMin_( cfg.getParameter< double >( "ptMin" ) ) { }

Member Function Documentation

void pf2pat::PtMinPFCandidateSelectorDefinition::select ( const HandleToCollection hc,
const edm::EventBase e,
const edm::EventSetup s 
) [inline]

Definition at line 17 of file PtMinPFCandidateSelectorDefinition.h.

References edm::HandleBase::isValid(), combine::key, ptMin_, and pf2pat::PFCandidateSelectorDefinition::selected_.

                   {
      selected_.clear();
    
      assert( hc.isValid() );
    
    
      unsigned key=0;
      for( collection::const_iterator pfc = hc->begin(); 
           pfc != hc->end(); ++pfc, ++key) {

        if( pfc->pt() > ptMin_ ) {
          selected_.push_back( reco::PFCandidate(*pfc) );
          reco::PFCandidatePtr ptrToMother( hc, key );
          selected_.back().setSourceCandidatePtr( ptrToMother );

        }
      }
    }

Member Data Documentation

Definition at line 42 of file PtMinPFCandidateSelectorDefinition.h.

Referenced by select().