CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauPluginsCommon.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_RecoTau_RecoTauPluginsCommon_h
2 #define RecoTauTag_RecoTau_RecoTauPluginsCommon_h
3 
4 /*
5  * RecoTauPluginsCommon
6  *
7  * Common base classes for the plugins used in the
8  * the PFTau production classes. The named plugin simply
9  * assigns a name to each plugin, that is retrieved by the
10  * ParameterSet passed to the constructor. The EventHolder
11  * plugin manages plugins that might need access to event data.
12  *
13  * The setup(...) method should be called for each event to cache
14  * pointers to the edm::Event and edm::EventSetup. Derived classes
15  * can access this information through the evt() and evtSetup() methods.
16  * The virtual function beginEvent() is provided as a hook for derived
17  * classes to do setup tasks and is called by RecoTauEventHolderPlugin
18  * after setup is called.
19  *
20  * Author: Evan K. Friis, UC Davis
21  *
22  * $Id $
23  */
24 
27 
28 namespace reco { namespace tau {
29 
31  /* Base class for all named RecoTau plugins */
32  public:
33  explicit RecoTauNamedPlugin(const edm::ParameterSet& pset);
34  virtual ~RecoTauNamedPlugin() {}
35  const std::string& name() const;
36  private:
37  std::string name_;
38 };
39 
41  /* Base class for all plugins that cache the edm::Event and edm::EventSetup
42  * as internal data members */
43  public:
44  explicit RecoTauEventHolderPlugin(const edm::ParameterSet& pset);
46  // Get the internal cached copy of the event
47  const edm::Event* evt() const;
48  const edm::EventSetup* evtSetup() const;
49  // Cache a local pointer to the event and event setup
50  void setup(const edm::Event&, const edm::EventSetup&);
51  // Called after setup(...)
52  virtual void beginEvent() {}
53  private:
54  const edm::Event* evt_;
56 };
57 }} // end namespace reco::tau
58 #endif
RecoTauEventHolderPlugin(const edm::ParameterSet &pset)
RecoTauNamedPlugin(const edm::ParameterSet &pset)
const edm::EventSetup * evtSetup() const
void setup(const edm::Event &, const edm::EventSetup &)
const std::string & name() const