Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef __PFCPositionCalculatorBase_H__
0002 #define __PFCPositionCalculatorBase_H__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/Framework/interface/ConsumesCollector.h"
0006 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
0007 #include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
0008 #include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
0009 #include "CondTools/Hcal/interface/HcalPFCutsHandler.h"
0010 
0011 #include <string>
0012 
0013 namespace edm {
0014   class EventSetup;
0015 }
0016 
0017 class PFCPositionCalculatorBase {
0018   typedef PFCPositionCalculatorBase PosCalc;
0019 
0020 public:
0021   PFCPositionCalculatorBase(const edm::ParameterSet& conf, edm::ConsumesCollector& cc)
0022       : _minFractionInCalc(conf.getParameter<double>("minFractionInCalc")),
0023         _algoName(conf.getParameter<std::string>("algoName")) {}
0024   virtual ~PFCPositionCalculatorBase() = default;
0025   //get rid of things we should never use
0026   PFCPositionCalculatorBase(const PosCalc&) = delete;
0027   PosCalc& operator=(const PosCalc&) = delete;
0028 
0029   virtual void update(const edm::EventSetup&) {}
0030 
0031   // here we transform one PFCluster to use the new position calculation
0032   virtual void calculateAndSetPosition(reco::PFCluster&, const HcalPFCuts*) = 0;
0033   // here you call a loop inside to transform the whole vector
0034   virtual void calculateAndSetPositions(reco::PFClusterCollection&, const HcalPFCuts*) = 0;
0035 
0036   const std::string& name() const { return _algoName; }
0037 
0038 protected:
0039   const float _minFractionInCalc;
0040 
0041 private:
0042   const std::string _algoName;
0043 };
0044 
0045 // define the factory for this base class
0046 #include "FWCore/PluginManager/interface/PluginFactory.h"
0047 typedef edmplugin::PluginFactory<PFCPositionCalculatorBase*(const edm::ParameterSet&, edm::ConsumesCollector&)>
0048     PFCPositionCalculatorFactory;
0049 
0050 #endif