Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:46

0001 #ifndef RecoTauTag_RecoTau_RecoTauPluginsCommon_h
0002 #define RecoTauTag_RecoTau_RecoTauPluginsCommon_h
0003 
0004 /*
0005  * RecoTauPluginsCommon
0006  *
0007  * Common base classes for the plugins used in the
0008  * the PFTau production classes.  The named plugin simply
0009  * assigns a name to each plugin, that is retrieved by the
0010  * ParameterSet passed to the constructor.  The EventHolder
0011  * plugin manages plugins that might need access to event data.
0012  *
0013  * The setup(...) method should be called for each event to cache
0014  * pointers to the edm::Event and edm::EventSetup.  Derived classes
0015  * can access this information through the evt() and evtSetup() methods.
0016  * The virtual function beginEvent() is provided as a hook for derived
0017  * classes to do setup tasks and is called by RecoTauEventHolderPlugin
0018  * after setup is called.
0019  *
0020  * Author: Evan K. Friis, UC Davis
0021  *
0022  */
0023 
0024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0025 #include "FWCore/Framework/interface/Event.h"
0026 
0027 namespace reco {
0028   namespace tau {
0029 
0030     class RecoTauNamedPlugin {
0031       /* Base class for all named RecoTau plugins */
0032     public:
0033       explicit RecoTauNamedPlugin(const edm::ParameterSet& pset);
0034       virtual ~RecoTauNamedPlugin() {}
0035       const std::string& name() const;
0036 
0037     private:
0038       std::string name_;
0039     };
0040 
0041     class RecoTauEventHolderPlugin : public RecoTauNamedPlugin {
0042       /* Base class for all plugins that cache the edm::Event and edm::EventSetup
0043     * as internal data members */
0044     public:
0045       explicit RecoTauEventHolderPlugin(const edm::ParameterSet& pset);
0046       ~RecoTauEventHolderPlugin() override {}
0047       // Get the internal cached copy of the event
0048       const edm::Event* evt() const;
0049       edm::Event* evt();
0050       const edm::EventSetup* evtSetup() const;
0051       // Cache a local pointer to the event and event setup
0052       void setup(edm::Event&, const edm::EventSetup&);
0053       // Called after setup(...)
0054       virtual void beginEvent() {}
0055 
0056     private:
0057       edm::Event* evt_;
0058       const edm::EventSetup* es_;
0059     };
0060   }  // namespace tau
0061 }  // namespace reco
0062 #endif