Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef __BlockElementLinkerBase_H__
0002 #define __BlockElementLinkerBase_H__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/Common/interface/Handle.h"
0006 #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"
0007 
0008 #include <string>
0009 
0010 class BlockElementLinkerBase {
0011 public:
0012   BlockElementLinkerBase(const edm::ParameterSet& conf) : _linkerName(conf.getParameter<std::string>("linkerName")) {}
0013   BlockElementLinkerBase(const BlockElementLinkerBase&) = delete;
0014   virtual ~BlockElementLinkerBase() = default;
0015   BlockElementLinkerBase& operator=(const BlockElementLinkerBase&) = delete;
0016 
0017   virtual bool linkPrefilter(const reco::PFBlockElement*, const reco::PFBlockElement*) const { return true; }
0018 
0019   virtual double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const = 0;
0020 
0021   const std::string& name() const { return _linkerName; }
0022 
0023 private:
0024   const std::string _linkerName;
0025 };
0026 
0027 #include "FWCore/PluginManager/interface/PluginFactory.h"
0028 typedef edmplugin::PluginFactory<BlockElementLinkerBase*(const edm::ParameterSet&)> BlockElementLinkerFactory;
0029 
0030 #endif