Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-18 09:15:23

0001 #ifndef __BlockElementImporterBase_H__
0002 #define __BlockElementImporterBase_H__
0003 
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/ConsumesCollector.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "DataFormats/Common/interface/Handle.h"
0009 #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"
0010 
0011 #include <string>
0012 #include <memory>
0013 
0014 class BlockElementImporterBase {
0015 public:
0016   typedef std::vector<std::unique_ptr<reco::PFBlockElement> > ElementList;
0017   BlockElementImporterBase(const edm::ParameterSet& conf, edm::ConsumesCollector& cc)
0018       : _importerName(conf.getParameter<std::string>("importerName")) {}
0019   BlockElementImporterBase(const BlockElementImporterBase&) = delete;
0020   virtual ~BlockElementImporterBase() = default;
0021   BlockElementImporterBase& operator=(const BlockElementImporterBase&) = delete;
0022 
0023   virtual void updateEventSetup(const edm::EventSetup&) {}
0024 
0025   virtual void importToBlock(const edm::Event&, ElementList&) const = 0;
0026 
0027   const std::string& name() const { return _importerName; }
0028 
0029   enum VetoMode { pfRecTrackCollection = 0, ticlSeedingRegion = 1, pfCandidateCollection = 2 };
0030 
0031 private:
0032   const std::string _importerName;
0033 };
0034 
0035 #include "FWCore/PluginManager/interface/PluginFactory.h"
0036 typedef edmplugin::PluginFactory<BlockElementImporterBase*(const edm::ParameterSet&, edm::ConsumesCollector&)>
0037     BlockElementImporterFactory;
0038 
0039 #endif