#include <PhysicsTools/CandUtils/interface/CompositeCandSelector.h>
Public Member Functions | |
CompositeCandSelector (const Selector &select) | |
bool | operator() (const reco::Candidate &cmp) const |
Private Attributes | |
Selector | select_ |
Definition at line 7 of file CompositeCandSelector.h.
CompositeCandSelector< Selector, T1, T2, nDau >::CompositeCandSelector | ( | const Selector & | select | ) | [inline, explicit] |
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 }
Selector CompositeCandSelector< Selector, T1, T2, nDau >::select_ [private] |
Definition at line 29 of file CompositeCandSelector.h.
Referenced by CompositeCandSelector< Selector, T1, T2, nDau >::operator()().