00001 #ifndef RecoTauTag_RecoTau_RecoTauPluginsCommon_h 00002 #define RecoTauTag_RecoTau_RecoTauPluginsCommon_h 00003 00004 /* 00005 * RecoTauPluginsCommon 00006 * 00007 * Common base classes for the plugins used in the 00008 * the PFTau production classes. The named plugin simply 00009 * assigns a name to each plugin, that is retrieved by the 00010 * ParameterSet passed to the constructor. The EventHolder 00011 * plugin manages plugins that might need access to event data. 00012 * 00013 * The setup(...) method should be called for each event to cache 00014 * pointers to the edm::Event and edm::EventSetup. Derived classes 00015 * can access this information through the evt() and evtSetup() methods. 00016 * The virtual function beginEvent() is provided as a hook for derived 00017 * classes to do setup tasks and is called by RecoTauEventHolderPlugin 00018 * after setup is called. 00019 * 00020 * Author: Evan K. Friis, UC Davis 00021 * 00022 * $Id $ 00023 */ 00024 00025 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00026 #include "FWCore/Framework/interface/Event.h" 00027 00028 namespace reco { namespace tau { 00029 00030 class RecoTauNamedPlugin { 00031 /* Base class for all named RecoTau plugins */ 00032 public: 00033 explicit RecoTauNamedPlugin(const edm::ParameterSet& pset); 00034 virtual ~RecoTauNamedPlugin() {} 00035 const std::string& name() const; 00036 private: 00037 std::string name_; 00038 }; 00039 00040 class RecoTauEventHolderPlugin : public RecoTauNamedPlugin { 00041 /* Base class for all plugins that cache the edm::Event and edm::EventSetup 00042 * as internal data members */ 00043 public: 00044 explicit RecoTauEventHolderPlugin(const edm::ParameterSet& pset); 00045 virtual ~RecoTauEventHolderPlugin() {} 00046 // Get the internal cached copy of the event 00047 const edm::Event* evt() const; 00048 const edm::EventSetup* evtSetup() const; 00049 // Cache a local pointer to the event and event setup 00050 void setup(const edm::Event&, const edm::EventSetup&); 00051 // Called after setup(...) 00052 virtual void beginEvent() {} 00053 private: 00054 const edm::Event* evt_; 00055 const edm::EventSetup* es_; 00056 }; 00057 }} // end namespace reco::tau 00058 #endif