CMS 3D CMS Logo

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

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

#include "CommonTools/ParticleFlow/interface/GenericPFCandidateSelectorDefinition.h"

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

Public Member Functions

 GenericPFCandidateSelectorDefinition (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
void select (const HandleToCollection &hc, const edm::Event &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

StringCutObjectSelector< reco::PFCandidateselector_
 

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

Selects PFCandidates basing on cuts provided with string cut parser.

Author
Giovanni Petrucciani
Version
Id
GenericPFCandidateSelectorDefinition.h,v 1.1 2011/01/28 20:56:44 srappocc Exp

Definition at line 22 of file GenericPFCandidateSelectorDefinition.h.

Constructor & Destructor Documentation

◆ GenericPFCandidateSelectorDefinition()

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

Definition at line 23 of file GenericPFCandidateSelectorDefinition.h.

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

Member Function Documentation

◆ select()

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

Definition at line 26 of file GenericPFCandidateSelectorDefinition.h.

26  {
27  selected_.clear();
28 
29  unsigned key = 0;
30  for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) {
31  if (selector_(*pfc)) {
32  selected_.push_back(reco::PFCandidate(*pfc));
33  reco::PFCandidatePtr ptrToMother(hc, key);
34  selected_.back().setSourceCandidatePtr(ptrToMother);
35  }
36  }
37  }

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

Member Data Documentation

◆ selector_

StringCutObjectSelector<reco::PFCandidate> pf2pat::GenericPFCandidateSelectorDefinition::selector_
private

Definition at line 40 of file GenericPFCandidateSelectorDefinition.h.

Referenced by select().

pf2pat::GenericPFCandidateSelectorDefinition::selector_
StringCutObjectSelector< reco::PFCandidate > selector_
Definition: GenericPFCandidateSelectorDefinition.h:40
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition: PFCandidateSelectorDefinition.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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