CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CutApplicatorBase.cc
Go to the documentation of this file.
2 
4 
5 CutApplicatorBase::result_type
7 operator()(const CutApplicatorBase::argument_type& arg) const {
8  if( arg.isNull() ) {
9  throw cms::Exception("BadProductPtr")
10  << _name << "received a bad product ref to process!" << std::endl;
11  }
12 
13  switch(candidateType()) {
14  case ELECTRON:
15  {
16  const reco::GsfElectronPtr ele(arg);
17  return this->operator()(ele);
18  }
19  break;
20  case MUON:
21  {
22  const reco::MuonPtr mu(arg);
23  return this->operator()(mu);
24  }
25  break;
26  case PHOTON:
27  {
28  const reco::PhotonPtr pho(arg);
29  return this->operator()(pho);
30  }
31  break;
32  case TAU:
33  {
34  const reco::PFTauPtr tau(arg);
35  return this->operator()(tau);
36  }
37  break;
38  case PATELECTRON:
39  {
40  const pat::ElectronPtr ele(arg);
41  return this->operator()(ele);
42  }
43  break;
44  case PATMUON:
45  {
46  const pat::MuonPtr mu(arg);
47  return this->operator()(mu);
48  }
49  break;
50  case PATPHOTON:
51  {
52  const pat::PhotonPtr pho(arg);
53  return this->operator()(pho);
54  }
55  break;
56  case PATTAU:
57  {
58  const pat::TauPtr tau(arg);
59  return this->operator()(tau);
60  }
61  break;
62  case NONE:
63  {
64  return asCandidate(arg);
65  break;
66  }
67  default:
68  throw cms::Exception("BadCandidateType")
69  << "Unknown candidate type";
70  }
71 }
virtual result_type asCandidate(const argument_type &) const
A arg
Definition: Factorize.h:36
virtual result_type operator()(const argument_type &) const final
const std::string _name
const int mu
Definition: Constants.h:22
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:90
virtual CandidateType candidateType() const