CMS 3D CMS Logo

Public Member Functions | Private Attributes

pf2pat::GenericPFCandidateSelectorDefinition Class Reference

Selects PFCandidates basing on cuts provided with string cut parser. More...

#include <PhysicsTools/PFCandProducer/interface/GenericPFCandidateSelectorDefinition.h>

Inheritance diagram for pf2pat::GenericPFCandidateSelectorDefinition:
pf2pat::PFCandidateSelectorDefinition

List of all members.

Public Member Functions

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

Private Attributes

StringCutObjectSelector
< reco::PFCandidate
selector_

Detailed Description

Selects PFCandidates basing on cuts provided with string cut parser.

Author:
Giovanni Petrucciani
Version:
Id:
GenericPFCandidateSelectorDefinition.h,v 1.1 2010/08/09 10:47:20 mbluj Exp

Definition at line 19 of file GenericPFCandidateSelectorDefinition.h.


Constructor & Destructor Documentation

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

Definition at line 21 of file GenericPFCandidateSelectorDefinition.h.

                                                                         :
      selector_( cfg.getParameter< std::string >( "cut" ) ) { }

Member Function Documentation

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

Definition at line 24 of file GenericPFCandidateSelectorDefinition.h.

References combine::key, pf2pat::PFCandidateSelectorDefinition::selected_, and selector_.

                                         {
      selected_.clear();
      
      unsigned key=0;
      for( collection::const_iterator pfc = hc->begin(); 
           pfc != hc->end(); ++pfc, ++key) {
        
        if( selector_(*pfc) ) {
          selected_.push_back( reco::PFCandidate(*pfc) );
          reco::PFCandidatePtr ptrToMother( hc, key );
          selected_.back().setSourceCandidatePtr( ptrToMother );
          
        }
      }
    }

Member Data Documentation

Definition at line 43 of file GenericPFCandidateSelectorDefinition.h.

Referenced by select().