Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-10 10:03:05

0001 #ifndef PhotonEnergyCorrector_H
0002 #define PhotonEnergyCorrector_H
0003 /** \class PhotonEnergyCorrector
0004  **  
0005  **
0006  **  \author Nancy Marinelli, U. of Notre Dame, US
0007  **
0008  ***/
0009 #include "FWCore/Framework/interface/Event.h"
0010 #include "DataFormats/Common/interface/Handle.h"
0011 #include "FWCore/Framework/interface/ESHandle.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0015 #include "RecoEgamma/EgammaTools/interface/EGEnergyCorrector.h"
0016 #include "RecoEgamma/EgammaTools/interface/EGEnergyCorrectorFactoryFromEventSetup.h"
0017 #include "CommonTools/CandAlgos/interface/ModifyObjectValueBase.h"
0018 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
0019 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
0020 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0021 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0022 
0023 #include "RecoEgamma/EgammaPhotonAlgos/interface/EnergyUncertaintyPhotonSpecific.h"
0024 #include <iostream>
0025 
0026 class PhotonEnergyCorrector {
0027 public:
0028   PhotonEnergyCorrector(const edm::ParameterSet& config, edm::ConsumesCollector&& iC);
0029 
0030   std::unique_ptr<ModifyObjectValueBase>& gedRegression() { return gedRegression_; }
0031 
0032   void init(const edm::EventSetup& theEventSetup);
0033   void calculate(
0034       edm::Event& evt, reco::Photon&, int subdet, const reco::VertexCollection& vtxcol, const edm::EventSetup& iSetup);
0035   double applyCrackCorrection(const reco::SuperCluster& cl, EcalClusterFunctionBaseClass* crackCorrectionFunction);
0036 
0037 private:
0038   bool weightsfromDB_;
0039   std::string w_file_;
0040   std::string w_db_;
0041   std::string candidateP4type_;
0042   std::unique_ptr<EGEnergyCorrectorFactoryFromEventSetup> regressionCorrectorFactory_;
0043   std::unique_ptr<EGEnergyCorrector> regressionCorrector_;
0044   std::unique_ptr<EcalClusterFunctionBaseClass> scEnergyFunction_;
0045   std::unique_ptr<EcalClusterFunctionBaseClass> scCrackEnergyFunction_;
0046   std::unique_ptr<EcalClusterFunctionBaseClass> scEnergyErrorFunction_;
0047   std::unique_ptr<EcalClusterFunctionBaseClass> photonEcalEnergyCorrFunction_;
0048   std::unique_ptr<ModifyObjectValueBase> gedRegression_;
0049   double minR9Barrel_;
0050   double minR9Endcap_;
0051   edm::ESHandle<CaloGeometry> theCaloGeom_;
0052   edm::InputTag barrelEcalHits_;
0053   edm::InputTag endcapEcalHits_;
0054   edm::EDGetTokenT<EcalRecHitCollection> barrelEcalHitsToken_;
0055   edm::EDGetTokenT<EcalRecHitCollection> endcapEcalHitsToken_;
0056   const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_;
0057   const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeomToken_;
0058 
0059   std::unique_ptr<EnergyUncertaintyPhotonSpecific> photonUncertaintyCalculator_;
0060 };
0061 
0062 #endif