CMS 3D CMS Logo

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

#include <PdgIdPFCandidateSelectorDefinition.h>

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

Public Member Functions

 PdgIdPFCandidateSelectorDefinition (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

std::vector< int > pdgIds_
 

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 14 of file PdgIdPFCandidateSelectorDefinition.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file PdgIdPFCandidateSelectorDefinition.h.

17  :
18  pdgIds_( cfg.getParameter< std::vector<int> >( "pdgId" ) ) { }
T getParameter(std::string const &) const

Member Function Documentation

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

Definition at line 20 of file PdgIdPFCandidateSelectorDefinition.h.

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

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().

22  {
23  selected_.clear();
24 
25  unsigned key=0;
26  for( collection::const_iterator pfc = hc->begin();
27  pfc != hc->end(); ++pfc, ++key) {
28 
29  for(unsigned iId=0; iId<pdgIds_.size(); iId++) {
30  if ( pfc->pdgId() == pdgIds_[iId] ) {
31  selected_.push_back( reco::PFCandidate(*pfc) );
32  reco::PFCandidatePtr ptrToMother( hc, key );
33  selected_.back().setSourceCandidatePtr( ptrToMother );
34  break;
35  }
36  }
37  }
38  }
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
susybsm::HSCParticleCollection hc
Definition: classes.h:25

Member Data Documentation

std::vector<int> pf2pat::PdgIdPFCandidateSelectorDefinition::pdgIds_
private

Definition at line 41 of file PdgIdPFCandidateSelectorDefinition.h.

Referenced by select().