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:
20  ModifyObjectValueBase(const edm::ParameterSet& conf) : name_(conf.getParameter<std::string>("modifierName")) {}
21 
23 
24  virtual void setEvent(const edm::Event&) {}
25  virtual void setEventContent(const edm::EventSetup&) {}
26 
27  virtual void modifyObject(reco::GsfElectron&) const {
28  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle reco::GsfElectrons!";
29  }
30  virtual void modifyObject(reco::Photon&) const {
31  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle reco::Photons!";
32  }
33  virtual void modifyObject(reco::Muon&) const {
34  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle reco::Muons!";
35  }
36  virtual void modifyObject(reco::BaseTau&) const {
37  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle reco::Taus!";
38  }
39  virtual void modifyObject(reco::Jet&) const {
40  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle reco::Jets!";
41  }
42  // pat modifiers
43  virtual void modifyObject(pat::Electron&) const {
44  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle pat::Electrons!";
45  }
46  virtual void modifyObject(pat::Photon&) const {
47  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle pat::Photons!";
48  }
49  virtual void modifyObject(pat::Muon&) const {
50  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle pat::Muons!";
51  }
52  virtual void modifyObject(pat::Tau&) const {
53  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle pat::Taus!";
54  }
55  virtual void modifyObject(pat::Jet&) const {
56  throw cms::Exception("InvalidConfiguration") << name_ << " is not configured to handle pat::Jets!";
57  }
58 
59  const std::string& name() const { return name_; }
60 
61 private:
63 };
64 
65 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
69 #endif
70 
71 #endif
Analysis-level Photon class.
Definition: Photon.h:46
virtual void modifyObject(reco::Jet &) const
virtual void modifyObject(reco::BaseTau &) const
Base class for all types of Jets.
Definition: Jet.h:20
virtual void modifyObject(pat::Muon &) const
virtual void modifyObject(pat::Tau &) const
virtual void modifyObject(pat::Jet &) const
virtual void modifyObject(reco::GsfElectron &) const
virtual void setEventContent(const edm::EventSetup &)
ModifyObjectValueBase(const edm::ParameterSet &conf)
Analysis-level tau class.
Definition: Tau.h:53
Analysis-level electron class.
Definition: Electron.h:51
Analysis-level calorimeter jet class.
Definition: Jet.h:77
const std::string & name() const
virtual void modifyObject(pat::Photon &) const
virtual void setEvent(const edm::Event &)
edmplugin::PluginFactory< ModifyObjectValueBase *(const edm::ParameterSet &, edm::ConsumesCollector &)> ModifyObjectValueFactory
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:51