CMS 3D CMS Logo

CompositeCandSelector< Selector, T1, T2, nDau > Class Template Reference

#include <PhysicsTools/CandUtils/interface/CompositeCandSelector.h>

List of all members.

Public Member Functions

 CompositeCandSelector (const Selector &select)
bool operator() (const reco::Candidate &cmp) const

Private Attributes

Selector select_


Detailed Description

template<typename Selector, typename T1 = reco::Candidate, typename T2 = T1, unsigned int nDau = 2>
class CompositeCandSelector< Selector, T1, T2, nDau >

Definition at line 7 of file CompositeCandSelector.h.


Constructor & Destructor Documentation

template<typename Selector, typename T1 = reco::Candidate, typename T2 = T1, unsigned int nDau = 2>
CompositeCandSelector< Selector, T1, T2, nDau >::CompositeCandSelector ( const Selector &  select  )  [inline, explicit]

Definition at line 9 of file CompositeCandSelector.h.

00009 : select_(select) { }


Member Function Documentation

template<typename Selector, typename T1 = reco::Candidate, typename T2 = T1, unsigned int nDau = 2>
bool CompositeCandSelector< Selector, T1, T2, nDau >::operator() ( const reco::Candidate cmp  )  const [inline]

Definition at line 10 of file CompositeCandSelector.h.

References reco::Candidate::daughter(), edm::errors::InvalidReference, reco::Candidate::numberOfDaughters(), and CompositeCandSelector< Selector, T1, T2, nDau >::select_.

00010                                                    {
00011     if(cmp.numberOfDaughters() != nDau)
00012       throw edm::Exception(edm::errors::InvalidReference)
00013         << "candidate has " << cmp.numberOfDaughters() 
00014         << ", while CompositeCandSelector "
00015         << "requires " << nDau << " daughters.\n";
00016     const T1 * dau1 = dynamic_cast<const T1 *>(cmp.daughter(0));
00017     if(dau1 == 0)  
00018       throw edm::Exception(edm::errors::InvalidReference)
00019         << "candidate's first daughter is not of the type required "
00020         << "by CompositeCandSelector.\n";
00021     const T2 * dau2 = dynamic_cast<const T2 *>(cmp.daughter(1));
00022     if(dau2 == 0)  
00023       throw edm::Exception(edm::errors::InvalidReference)
00024         << "candidate's second daughter is not of the type required "
00025         << "by CompositeCandSelector.\n";
00026     return select_(*dau1, *dau2);
00027   }


Member Data Documentation

template<typename Selector, typename T1 = reco::Candidate, typename T2 = T1, unsigned int nDau = 2>
Selector CompositeCandSelector< Selector, T1, T2, nDau >::select_ [private]

Definition at line 29 of file CompositeCandSelector.h.

Referenced by CompositeCandSelector< Selector, T1, T2, nDau >::operator()().


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