Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:11

0001 #ifndef Workspace_EventSelector_h_
0002 #define Workspace_EventSelector_h_
0003 /** Base class for event selection modules for SUSY analysis.
0004  */
0005 // Original author: W. Adam, 10/4/08
0006 
0007 // system include files
0008 #include <string>
0009 
0010 // user include files
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/ConsumesCollector.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 
0016 class EventSelector {
0017 public:
0018   EventSelector() {}
0019   EventSelector(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC) : EventSelector(iConfig, iC) {}
0020   EventSelector(const edm::ParameterSet& iConfig, edm::ConsumesCollector& iC) {
0021     std::string selector = iConfig.getParameter<std::string>("selector");
0022     name_ = iConfig.getUntrackedParameter<std::string>("name", selector);
0023   }
0024   virtual ~EventSelector() {}
0025   /// name of the module (from configuration)
0026   const std::string& name() const { return name_; }
0027   const std::vector<std::string>& description() { return description_; }
0028   /// decision of the selector module
0029   virtual bool select(const edm::Event&) const = 0;
0030 
0031 protected:
0032   std::string name_;
0033   std::vector<std::string> description_;
0034 };
0035 
0036 #include "FWCore/PluginManager/interface/PluginFactory.h"
0037 
0038 typedef edmplugin::PluginFactory<EventSelector*(const edm::ParameterSet&, edm::ConsumesCollector&&)>
0039     EventSelectorFactory;
0040 typedef edmplugin::PluginFactory<EventSelector*(const edm::ParameterSet&, edm::ConsumesCollector&)>
0041     EventSelectorFactoryFromHelper;
0042 
0043 #endif