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&) {}
28 
29  virtual void modifyObject(reco::GsfElectron&) const {
30  throw cms::Exception("InvalidConfiguration")
31  << name_ << " is not configured to handle reco::GsfElectrons!";
32  }
33  virtual void modifyObject(reco::Photon&) const {
34  throw cms::Exception("InvalidConfiguration")
35  << name_ << " is not configured to handle reco::Photons!";
36  }
37  virtual void modifyObject(reco::Muon&) const {
38  throw cms::Exception("InvalidConfiguration")
39  << name_ << " is not configured to handle reco::Muons!";
40  }
41  virtual void modifyObject(reco::BaseTau&) const {
42  throw cms::Exception("InvalidConfiguration")
43  << name_ << " is not configured to handle reco::Taus!";
44  }
45  virtual void modifyObject(reco::Jet&) const {
46  throw cms::Exception("InvalidConfiguration")
47  << name_ << " is not configured to handle reco::Jets!";
48  }
49  // pat modifiers
50  virtual void modifyObject(pat::Electron&) const {
51  throw cms::Exception("InvalidConfiguration")
52  << name_ << " is not configured to handle pat::Electrons!";
53  }
54  virtual void modifyObject(pat::Photon&) const {
55  throw cms::Exception("InvalidConfiguration")
56  << name_ << " is not configured to handle pat::Photons!";
57  }
58  virtual void modifyObject(pat::Muon&) const {
59  throw cms::Exception("InvalidConfiguration")
60  << name_ << " is not configured to handle pat::Muons!";
61  }
62  virtual void modifyObject(pat::Tau&) const {
63  throw cms::Exception("InvalidConfiguration")
64  << name_ << " is not configured to handle pat::Taus!";
65  }
66  virtual void modifyObject(pat::Jet&) const {
67  throw cms::Exception("InvalidConfiguration")
68  << name_ << " is not configured to handle pat::Jets!";
69  }
70 
71  const std::string& name() const { return name_; }
72 
73  private:
75 };
76 
77 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
80 #endif
81 
82 #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 setConsumes(edm::ConsumesCollector &)
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:55
edmplugin::PluginFactory< ModifyObjectValueBase *(const edm::ParameterSet &) > ModifyObjectValueFactory
Analysis-level electron class.
Definition: Electron.h:52
Analysis-level calorimeter jet class.
Definition: Jet.h:78
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:49