CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CompositeCandSelector< Selector, T1, T2, nDau > Class Template Reference

#include <CompositeCandSelector.h>

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

◆ CompositeCandSelector()

template<typename Selector , typename T1 = reco::Candidate, typename T2 = T1, unsigned int nDau = 2>
CompositeCandSelector< Selector, T1, T2, nDau >::CompositeCandSelector ( const Selector select)
inlineexplicit

Definition at line 9 of file CompositeCandSelector.h.

9 : select_(select) {}

Member Function Documentation

◆ operator()()

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.

10  {
11  if (cmp.numberOfDaughters() != nDau)
13  << "candidate has " << cmp.numberOfDaughters() << ", while CompositeCandSelector "
14  << "requires " << nDau << " daughters.\n";
15  const T1 *dau1 = dynamic_cast<const T1 *>(cmp.daughter(0));
16  if (dau1 == nullptr)
17  throw edm::Exception(edm::errors::InvalidReference) << "candidate's first daughter is not of the type required "
18  << "by CompositeCandSelector.\n";
19  const T2 *dau2 = dynamic_cast<const T2 *>(cmp.daughter(1));
20  if (dau2 == nullptr)
21  throw edm::Exception(edm::errors::InvalidReference) << "candidate's second daughter is not of the type required "
22  << "by CompositeCandSelector.\n";
23  return select_(*dau1, *dau2);
24  }

References fileCollector::cmp, Exception, edm::errors::InvalidReference, and CompositeCandSelector< Selector, T1, T2, nDau >::select_.

Member Data Documentation

◆ select_

template<typename Selector , typename T1 = reco::Candidate, typename T2 = T1, unsigned int nDau = 2>
Selector CompositeCandSelector< Selector, T1, T2, nDau >::select_
private
edm::errors::InvalidReference
Definition: EDMException.h:39
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
edm::Exception
Definition: EDMException.h:77
fileCollector.cmp
cmp
Definition: fileCollector.py:125
Exception
Definition: hltDiff.cc:245
CompositeCandSelector::select_
Selector select_
Definition: CompositeCandSelector.h:27