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::MuonIDPFCandidateSelectorDefinition Class Reference

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

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

Inheritance diagram for pf2pat::MuonIDPFCandidateSelectorDefinition:
pf2pat::PFCandidateSelectorDefinition

Public Member Functions

 MuonIDPFCandidateSelectorDefinition (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
< pat::Muon
muonCut_
 

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:
MuonIDPFCandidateSelectorDefinition.h,v 1.2 2011/04/06 12:12:38 rwolf Exp

Definition at line 21 of file MuonIDPFCandidateSelectorDefinition.h.

Constructor & Destructor Documentation

pf2pat::MuonIDPFCandidateSelectorDefinition::MuonIDPFCandidateSelectorDefinition ( const edm::ParameterSet cfg)
inline

Definition at line 23 of file MuonIDPFCandidateSelectorDefinition.h.

23  :
24  muonCut_( cfg.getParameter< std::string >( "cut" ) )
25  {
26  }
T getParameter(std::string const &) const

Member Function Documentation

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

Definition at line 28 of file MuonIDPFCandidateSelectorDefinition.h.

References edm::Ref< C, T, F >::isNull(), combine::key, muonCut_, 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().

30  {
31  selected_.clear();
32 
33  unsigned key=0;
34  for( collection::const_iterator pfc = hc->begin();
35  pfc != hc->end(); ++pfc, ++key) {
36 
37  reco::MuonRef muR = pfc->muonRef();
38 
39  // skip ones without a ref to a reco::Muon: they won't be matched anyway
40  if (muR.isNull()) continue;
41 
42  // convert into a pat::Muon, so that the 'muonID' method is available
43  pat::Muon patMu(*muR);
44 
45  // apply muon id
46  if (muonCut_(patMu)) {
47  selected_.push_back( reco::PFCandidate(*pfc) );
48  reco::PFCandidatePtr ptrToMother( hc, key );
49  selected_.back().setSourceCandidatePtr( ptrToMother );
50  }
51  }
52  }
bool isNull() const
Checks for null.
Definition: Ref.h:247
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:33
list key
Definition: combine.py:13
Analysis-level muon class.
Definition: Muon.h:51

Member Data Documentation

StringCutObjectSelector<pat::Muon> pf2pat::MuonIDPFCandidateSelectorDefinition::muonCut_
private

Definition at line 55 of file MuonIDPFCandidateSelectorDefinition.h.

Referenced by select().