CMS 3D CMS Logo

CutApplicatorBase.cc
Go to the documentation of this file.
2 
4 
6  if (arg.isNull()) {
7  throw cms::Exception("BadProductPtr") << _name << "received a bad product ref to process!" << std::endl;
8  }
9 
10  switch (candidateType()) {
11  case ELECTRON: {
12  const reco::GsfElectronPtr ele(arg);
13  return this->operator()(ele);
14  } break;
15  case MUON: {
16  const reco::MuonPtr mu(arg);
17  return this->operator()(mu);
18  } break;
19  case PHOTON: {
20  const reco::PhotonPtr pho(arg);
21  return this->operator()(pho);
22  } break;
23  case TAU: {
24  const reco::PFTauPtr tau(arg);
25  return this->operator()(tau);
26  } break;
27  case PATELECTRON: {
28  const pat::ElectronPtr ele(arg);
29  return this->operator()(ele);
30  } break;
31  case PATMUON: {
32  const pat::MuonPtr mu(arg);
33  return this->operator()(mu);
34  } break;
35  case PATPHOTON: {
36  const pat::PhotonPtr pho(arg);
37  return this->operator()(pho);
38  } break;
39  case PATTAU: {
40  const pat::TauPtr tau(arg);
41  return this->operator()(tau);
42  } break;
43  case NONE: {
44  return asCandidate(arg);
45  break;
46  }
47  default:
48  throw cms::Exception("BadCandidateType") << "Unknown candidate type";
49  }
50 }
CutApplicatorBase::PATTAU
Definition: CutApplicatorBase.h:47
CutApplicatorBase::PHOTON
Definition: CutApplicatorBase.h:47
metsig::tau
Definition: SignAlgoResolutions.h:49
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
CutApplicatorBase::candidateType
virtual CandidateType candidateType() const
Definition: CutApplicatorBase.h:78
CutApplicatorBase::operator()
result_type operator()(const argument_type &) const final
Definition: CutApplicatorBase.cc:5
CutApplicatorBase::PATMUON
Definition: CutApplicatorBase.h:47
CutApplicatorBase::asCandidate
virtual result_type asCandidate(const argument_type &) const
Definition: CutApplicatorBase.h:76
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
EDM_REGISTER_PLUGINFACTORY
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
CutApplicatorBase::MUON
Definition: CutApplicatorBase.h:47
CutApplicatorBase::PATELECTRON
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
CutApplicatorBase::NONE
Definition: CutApplicatorBase.h:47
CutApplicatorBase::PATPHOTON
Definition: CutApplicatorBase.h:47
CutApplicatorBase::_name
const std::string _name
Definition: CutApplicatorBase.h:83
edm::Ptr< Candidate >
Exception
Definition: hltDiff.cc:246
funct::arg
A arg
Definition: Factorize.h:36
CutApplicatorBase.h
CutApplicatorBase::TAU
Definition: CutApplicatorBase.h:47
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47