CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pf2pat::PtMinPFCandidateSelectorDefinition Class Reference

#include <PtMinPFCandidateSelectorDefinition.h>

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

Public Member Functions

 PtMinPFCandidateSelectorDefinition (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
void select (const HandleToCollection &hc, const edm::EventBase &e, const edm::EventSetup &s)
 
- Public Member Functions inherited from pf2pat::PFCandidateSelectorDefinition
const_iterator begin () const
 
const_iterator end () const
 
 PFCandidateSelectorDefinition ()
 
const containerselected () const
 
size_t size () const
 

Private Attributes

double ptMin_
 

Additional Inherited Members

- Public Types inherited from pf2pat::PFCandidateSelectorDefinition
typedef reco::PFCandidateCollection collection
 
typedef boost::transform_iterator< Pointer, container::const_iterator > const_iterator
 
typedef std::vector< reco::PFCandidatecontainer
 
typedef edm::Handle< collectionHandleToCollection
 
- Protected Attributes inherited from pf2pat::PFCandidateSelectorDefinition
container selected_
 

Detailed Description

Definition at line 13 of file PtMinPFCandidateSelectorDefinition.h.

Constructor & Destructor Documentation

◆ PtMinPFCandidateSelectorDefinition()

pf2pat::PtMinPFCandidateSelectorDefinition::PtMinPFCandidateSelectorDefinition ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 15 of file PtMinPFCandidateSelectorDefinition.h.

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

Member Function Documentation

◆ select()

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

Definition at line 18 of file PtMinPFCandidateSelectorDefinition.h.

18  {
19  selected_.clear();
20 
21  assert(hc.isValid());
22 
23  unsigned key = 0;
24  for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) {
25  if (pfc->pt() > ptMin_) {
26  selected_.push_back(reco::PFCandidate(*pfc));
27  reco::PFCandidatePtr ptrToMother(hc, key);
28  selected_.back().setSourceCandidatePtr(ptrToMother);
29  }
30  }
31  }

References cms::cuda::assert(), edm::HandleBase::isValid(), crabWrapper::key, ptMin_, and pf2pat::PFCandidateSelectorDefinition::selected_.

Member Data Documentation

◆ ptMin_

double pf2pat::PtMinPFCandidateSelectorDefinition::ptMin_
private

Definition at line 36 of file PtMinPFCandidateSelectorDefinition.h.

Referenced by select().

pf2pat::PtMinPFCandidateSelectorDefinition::ptMin_
double ptMin_
Definition: PtMinPFCandidateSelectorDefinition.h:36
cms::cuda::assert
assert(be >=bs)
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition: PFCandidateSelectorDefinition.h:33
edm::Ptr< PFCandidate >
looper.cfg
cfg
Definition: looper.py:297
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
crabWrapper.key
key
Definition: crabWrapper.py:19