CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
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::PFCandidate
selector_
 

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::PFCandidate
container
 
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.2 2011/04/06 12:12:38 rwolf 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.

21  :
22  selector_( cfg.getParameter< std::string >( "cut" ) ) { }
T getParameter(std::string const &) const
StringCutObjectSelector< reco::PFCandidate > selector_

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_.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

26  {
27  selected_.clear();
28 
29  unsigned key=0;
30  for( collection::const_iterator pfc = hc->begin();
31  pfc != hc->end(); ++pfc, ++key) {
32 
33  if( selector_(*pfc) ) {
34  selected_.push_back( reco::PFCandidate(*pfc) );
35  reco::PFCandidatePtr ptrToMother( hc, key );
36  selected_.back().setSourceCandidatePtr( ptrToMother );
37 
38  }
39  }
40  }
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:33
list key
Definition: combine.py:13
StringCutObjectSelector< reco::PFCandidate > selector_

Member Data Documentation

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

Definition at line 43 of file GenericPFCandidateSelectorDefinition.h.

Referenced by select().