CMS 3D CMS Logo

ModifyObjectValueBase.h
Go to the documentation of this file.
1 #ifndef __CommonTools_CandAlgos_ModifyObjectValueBase_h__
2 #define __CommonTools_CandAlgos_ModifyObjectValueBase_h__
3 
9 
15 
16 #include <string>
17 
19  public:
21  name_( conf.getParameter<std::string>("modifierName") ) {}
22 
24 
25  virtual void setEvent(const edm::Event&) {}
26  virtual void setEventContent(const edm::EventSetup&) {}
27 
28  virtual void modifyObject(reco::GsfElectron&) const {
29  throw cms::Exception("InvalidConfiguration")
30  << name_ << " is not configured to handle reco::GsfElectrons!";
31  }
32  virtual void modifyObject(reco::Photon&) const {
33  throw cms::Exception("InvalidConfiguration")
34  << name_ << " is not configured to handle reco::Photons!";
35  }
36  virtual void modifyObject(reco::Muon&) const {
37  throw cms::Exception("InvalidConfiguration")
38  << name_ << " is not configured to handle reco::Muons!";
39  }
40  virtual void modifyObject(reco::BaseTau&) const {
41  throw cms::Exception("InvalidConfiguration")
42  << name_ << " is not configured to handle reco::Taus!";
43  }
44  virtual void modifyObject(reco::Jet&) const {
45  throw cms::Exception("InvalidConfiguration")
46  << name_ << " is not configured to handle reco::Jets!";
47  }
48  // pat modifiers
49  virtual void modifyObject(pat::Electron&) const {
50  throw cms::Exception("InvalidConfiguration")
51  << name_ << " is not configured to handle pat::Electrons!";
52  }
53  virtual void modifyObject(pat::Photon&) const {
54  throw cms::Exception("InvalidConfiguration")
55  << name_ << " is not configured to handle pat::Photons!";
56  }
57  virtual void modifyObject(pat::Muon&) const {
58  throw cms::Exception("InvalidConfiguration")
59  << name_ << " is not configured to handle pat::Muons!";
60  }
61  virtual void modifyObject(pat::Tau&) const {
62  throw cms::Exception("InvalidConfiguration")
63  << name_ << " is not configured to handle pat::Taus!";
64  }
65  virtual void modifyObject(pat::Jet&) const {
66  throw cms::Exception("InvalidConfiguration")
67  << name_ << " is not configured to handle pat::Jets!";
68  }
69 
70  const std::string& name() const { return name_; }
71 
72  private:
74 };
75 
76 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
79 #endif
80 
81 #endif
Analysis-level Photon class.
Definition: Photon.h:47
virtual void modifyObject(reco::Jet &) const
Base class for all types of Jets.
Definition: Jet.h:20
virtual void modifyObject(pat::Jet &) const
virtual void modifyObject(reco::BaseTau &) const
virtual void modifyObject(pat::Tau &) const
const std::string & name() const
virtual void setEventContent(const edm::EventSetup &)
virtual void modifyObject(pat::Photon &) const
ModifyObjectValueBase(const edm::ParameterSet &conf)
virtual void modifyObject(reco::GsfElectron &) const
Analysis-level tau class.
Definition: Tau.h:56
Analysis-level electron class.
Definition: Electron.h:52
Analysis-level calorimeter jet class.
Definition: Jet.h:80
virtual void modifyObject(pat::Muon &) const
virtual void setEvent(const edm::Event &)
virtual void modifyObject(reco::Photon &) const
virtual void modifyObject(pat::Electron &) const
virtual void modifyObject(reco::Muon &) const
Analysis-level muon class.
Definition: Muon.h:50
edmplugin::PluginFactory< ModifyObjectValueBase *(const edm::ParameterSet &, edm::ConsumesCollector &) > ModifyObjectValueFactory