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 }
virtual CandidateType candidateType() const
A arg
Definition: Factorize.h:31
virtual result_type asCandidate(const argument_type &) const
result_type operator()(const argument_type &) const final
const std::string _name
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:88