CMS 3D CMS Logo

Public Member Functions | Private Attributes

pf2pat::PdgIdPFCandidateSelectorDefinition Class Reference

#include <PdgIdPFCandidateSelectorDefinition.h>

Inheritance diagram for pf2pat::PdgIdPFCandidateSelectorDefinition:
pf2pat::PFCandidateSelectorDefinition

List of all members.

Public Member Functions

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

Private Attributes

std::vector< int > pdgIds_

Detailed Description

Definition at line 10 of file PdgIdPFCandidateSelectorDefinition.h.


Constructor & Destructor Documentation

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

Definition at line 13 of file PdgIdPFCandidateSelectorDefinition.h.

                                                                       :
      pdgIds_( cfg.getParameter< std::vector<int> >( "pdgId" ) ) { }

Member Function Documentation

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

Definition at line 16 of file PdgIdPFCandidateSelectorDefinition.h.

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

                                         {
      selected_.clear();
      
      unsigned key=0;
      for( collection::const_iterator pfc = hc->begin(); 
           pfc != hc->end(); ++pfc, ++key) {
        
        for(unsigned iId=0; iId<pdgIds_.size(); iId++) {
          if ( pfc->pdgId() == pdgIds_[iId] ) {
            selected_.push_back( reco::PFCandidate(*pfc) );
            reco::PFCandidatePtr ptrToMother( hc, key );
            selected_.back().setSourceCandidatePtr( ptrToMother );
            break;
          }
        }
      }
    }

Member Data Documentation

Definition at line 37 of file PdgIdPFCandidateSelectorDefinition.h.

Referenced by select().