Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:21

0001 #ifndef __PFClusterEnergyCorrectorBase_H__
0002 #define __PFClusterEnergyCorrectorBase_H__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
0006 #include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
0007 
0008 #include <string>
0009 
0010 namespace edm {
0011   class Event;
0012   class EventSetup;
0013 }  // namespace edm
0014 
0015 class PFClusterEnergyCorrectorBase {
0016   typedef PFClusterEnergyCorrectorBase Corrector;
0017 
0018 public:
0019   PFClusterEnergyCorrectorBase(const edm::ParameterSet& conf) : _algoName(conf.getParameter<std::string>("algoName")) {}
0020   virtual ~PFClusterEnergyCorrectorBase() = default;
0021   //get rid of things we should never use
0022   PFClusterEnergyCorrectorBase(const Corrector&) = delete;
0023   Corrector& operator=(const Corrector&) = delete;
0024 
0025   virtual void update(const edm::EventSetup&) {}
0026 
0027   // here we transform one PFCluster to use the new position calculation
0028   virtual void correctEnergy(reco::PFCluster&) = 0;
0029   // here you call a loop inside to transform the whole vector
0030   virtual void correctEnergies(reco::PFClusterCollection&) = 0;
0031 
0032   const std::string& name() const { return _algoName; }
0033 
0034 private:
0035   const std::string _algoName;
0036 };
0037 
0038 #include "FWCore/PluginManager/interface/PluginFactory.h"
0039 typedef edmplugin::PluginFactory<PFClusterEnergyCorrectorBase*(const edm::ParameterSet&)>
0040     PFClusterEnergyCorrectorFactory;
0041 
0042 #endif