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
PluginFactory.h
reco::Jet
Base class for all types of Jets.
Definition: Jet.h:20
ModifyObjectValueBase::modifyObject
virtual void modifyObject(reco::Photon &) const
Definition: ModifyObjectValueBase.h:30
Muon.h
pat::Tau
Analysis-level tau class.
Definition: Tau.h:53
Photon.h
pat::Photon
Analysis-level Photon class.
Definition: Photon.h:46
ModifyObjectValueBase::setEvent
virtual void setEvent(const edm::Event &)
Definition: ModifyObjectValueBase.h:24
pat::Muon
Analysis-level muon class.
Definition: Muon.h:51
ModifyObjectValueBase::setEventContent
virtual void setEventContent(const edm::EventSetup &)
Definition: ModifyObjectValueBase.h:25
Tau.h
ModifyObjectValueBase::ModifyObjectValueBase
ModifyObjectValueBase(const edm::ParameterSet &conf)
Definition: ModifyObjectValueBase.h:20
reco::Muon
Definition: Muon.h:27
ModifyObjectValueBase::name
const std::string & name() const
Definition: ModifyObjectValueBase.h:59
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
reco::BaseTau
Definition: BaseTau.h:18
ModifyObjectValueBase::modifyObject
virtual void modifyObject(pat::Tau &) const
Definition: ModifyObjectValueBase.h:52
reco::GsfElectron
Definition: GsfElectron.h:35
ModifyObjectValueBase::name_
const std::string name_
Definition: ModifyObjectValueBase.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ModifyObjectValueBase::modifyObject
virtual void modifyObject(reco::GsfElectron &) const
Definition: ModifyObjectValueBase.h:27
ModifyObjectValueBase::modifyObject
virtual void modifyObject(pat::Jet &) const
Definition: ModifyObjectValueBase.h:55
edm::ParameterSet
Definition: ParameterSet.h:47
ModifyObjectValueBase
Definition: ModifyObjectValueBase.h:18
Event.h
ModifyObjectValueBase::modifyObject
virtual void modifyObject(pat::Muon &) const
Definition: ModifyObjectValueBase.h:49
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::EventSetup
Definition: EventSetup.h:57
Jet.h
ModifyObjectValueBase::modifyObject
virtual void modifyObject(pat::Photon &) const
Definition: ModifyObjectValueBase.h:46
ModifyObjectValueBase::modifyObject
virtual void modifyObject(reco::BaseTau &) const
Definition: ModifyObjectValueBase.h:36
reco::Photon
Definition: Photon.h:21
ModifyObjectValueBase::modifyObject
virtual void modifyObject(reco::Muon &) const
Definition: ModifyObjectValueBase.h:33
std
Definition: JetResolutionObject.h:76
Exception
Definition: hltDiff.cc:246
ModifyObjectValueBase::modifyObject
virtual void modifyObject(reco::Jet &) const
Definition: ModifyObjectValueBase.h:39
EventSetup.h
Exception.h
Electron.h
ConsumesCollector.h
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
ParameterSet.h
ModifyObjectValueBase::modifyObject
virtual void modifyObject(pat::Electron &) const
Definition: ModifyObjectValueBase.h:43
edm::Event
Definition: Event.h:73
ModifyObjectValueBase::~ModifyObjectValueBase
virtual ~ModifyObjectValueBase()
Definition: ModifyObjectValueBase.h:22
edm::ConsumesCollector
Definition: ConsumesCollector.h:45