Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:18

0001 #ifndef IsolationAlgos_CITKIsolationConeDefinitionBase_H
0002 #define IsolationAlgos_CITKIsolationConeDefinitionBase_H
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 
0009 #include "DataFormats/Candidate/interface/Candidate.h"
0010 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0011 
0012 #include "FWCore/Framework/interface/ConsumesCollector.h"
0013 
0014 #include <unordered_map>
0015 
0016 namespace citk {
0017   class IsolationConeDefinitionBase {
0018   public:
0019     IsolationConeDefinitionBase(const edm::ParameterSet& c)
0020         : _coneSize2(std::pow(c.getParameter<double>("coneSize"), 2.0)),
0021           _name(c.getParameter<std::string>("isolationAlgo")) {}
0022     IsolationConeDefinitionBase(const IsolationConeDefinitionBase&) = delete;
0023     IsolationConeDefinitionBase& operator=(const IsolationConeDefinitionBase&) = delete;
0024 
0025     virtual void getEventSetupInfo(const edm::EventSetup&) {}
0026     virtual void getEventInfo(const edm::Event&) {}
0027     virtual void setConsumes(edm::ConsumesCollector) = 0;
0028 
0029     virtual bool isInIsolationCone(const reco::CandidatePtr& physob, const reco::CandidatePtr& other) const = 0;
0030 
0031     const std::string& name() const { return _name; }
0032 
0033     const std::string& additionalCode() const { return _additionalCode; }
0034 
0035     //! Destructor
0036     virtual ~IsolationConeDefinitionBase() {}
0037 
0038   protected:
0039     const float _coneSize2;
0040     std::string _additionalCode;
0041 
0042   private:
0043     const std::string _name;
0044   };
0045 }  // namespace citk
0046 
0047 #include "FWCore/PluginManager/interface/PluginFactory.h"
0048 typedef edmplugin::PluginFactory<citk::IsolationConeDefinitionBase*(const edm::ParameterSet&)>
0049     CITKIsolationConeDefinitionFactory;
0050 
0051 #endif