CMS 3D CMS Logo

reco::MCMatchSelector< T1, T2 > Class Template Reference

#include <PhysicsTools/UtilAlgos/interface/MCMatchSelector.h>

List of all members.

Public Member Functions

 MCMatchSelector (const edm::ParameterSet &cfg)
bool operator() (const T1 &c, const T2 &mc) const
 true if match is possible

Private Attributes

bool checkCharge_
std::set< intids_
std::set< intstatus_


Detailed Description

template<typename T1, typename T2>
class reco::MCMatchSelector< T1, T2 >

Definition at line 14 of file MCMatchSelector.h.


Constructor & Destructor Documentation

template<typename T1, typename T2>
reco::MCMatchSelector< T1, T2 >::MCMatchSelector ( const edm::ParameterSet cfg  )  [inline]

Definition at line 16 of file MCMatchSelector.h.

References edm::ParameterSet::getParameter(), i, reco::MCMatchSelector< T1, T2 >::ids_, StDecayID::status, and reco::MCMatchSelector< T1, T2 >::status_.

00016                                                 : 
00017       checkCharge_(cfg.getParameter<bool>("checkCharge")) { 
00018       std::vector<int> ids = 
00019         cfg.getParameter< std::vector<int> >("mcPdgId");
00020       for ( std::vector<int>::const_iterator i=ids.begin();
00021             i!=ids.end(); ++i )  ids_.insert(*i);
00022       std::vector<int> status = 
00023         cfg.getParameter< std::vector<int> >("mcStatus");
00024       for ( std::vector<int>::const_iterator i=status.begin();
00025             i!=status.end(); ++i )  status_.insert(*i);
00026     }


Member Function Documentation

template<typename T1, typename T2>
bool reco::MCMatchSelector< T1, T2 >::operator() ( const T1 &  c,
const T2 &  mc 
) const [inline]

true if match is possible

Definition at line 28 of file MCMatchSelector.h.

References funct::abs(), reco::MCMatchSelector< T1, T2 >::checkCharge_, reco::MCMatchSelector< T1, T2 >::ids_, and reco::MCMatchSelector< T1, T2 >::status_.

00028                                                          {
00029       if ( checkCharge_ && c.charge() != mc.charge() ) return false;
00030       if ( !ids_.empty() ) {
00031         if ( ids_.find(abs(mc.pdgId()))==ids_.end() )  return false;
00032       }
00033       if ( status_.empty() )  return true;
00034       return status_.find(mc.status())!=status_.end();
00035     }


Member Data Documentation

template<typename T1, typename T2>
bool reco::MCMatchSelector< T1, T2 >::checkCharge_ [private]

Definition at line 37 of file MCMatchSelector.h.

Referenced by reco::MCMatchSelector< T1, T2 >::operator()().

template<typename T1, typename T2>
std::set<int> reco::MCMatchSelector< T1, T2 >::ids_ [private]

Definition at line 38 of file MCMatchSelector.h.

Referenced by reco::MCMatchSelector< T1, T2 >::MCMatchSelector(), and reco::MCMatchSelector< T1, T2 >::operator()().

template<typename T1, typename T2>
std::set<int> reco::MCMatchSelector< T1, T2 >::status_ [private]

Definition at line 39 of file MCMatchSelector.h.

Referenced by reco::MCMatchSelector< T1, T2 >::MCMatchSelector(), and reco::MCMatchSelector< T1, T2 >::operator()().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:51:16 2009 for CMSSW by  doxygen 1.5.4