Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:38

0001 #ifndef RecoECAL_ECALClusters_EgammaSCEnergyCorrectionAlgo_h_
0002 #define RecoECAL_ECALClusters_EgammaSCEnergyCorrectionAlgo_h_
0003 
0004 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0005 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
0006 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
0007 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0008 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0009 #include "DataFormats/DetId/interface/DetId.h"
0010 
0011 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0012 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
0013 
0014 #include <functional>
0015 #include <map>
0016 #include <string>
0017 
0018 class EgammaSCEnergyCorrectionAlgo {
0019 public:
0020   using BasicClusterFunction = std::function<float(reco::BasicCluster const&, EcalRecHitCollection const&)>;
0021 
0022   // public member functions
0023   EgammaSCEnergyCorrectionAlgo(float noise);
0024 
0025   // take a SuperCluster and return a corrected SuperCluster
0026   reco::SuperCluster applyCorrection(const reco::SuperCluster& cl,
0027                                      const EcalRecHitCollection& rhc,
0028                                      reco::CaloCluster::AlgoId theAlgo,
0029                                      const CaloSubdetectorGeometry* geometry,
0030                                      EcalClusterFunctionBaseClass* energyCorrectionFunction,
0031                                      std::string energyCorrectorName_,
0032                                      int modeEB_,
0033                                      int modeEE_);
0034 
0035   // take a SuperCluster and return a crack-corrected SuperCluster
0036   static reco::SuperCluster applyCrackCorrection(const reco::SuperCluster& cl,
0037                                                  EcalClusterFunctionBaseClass* crackCorrectionFunction);
0038 
0039   // take a SuperCluster and return a local containment corrected SuperCluster
0040 
0041   static reco::SuperCluster applyLocalContCorrection(const reco::SuperCluster& cl,
0042                                                      BasicClusterFunction localContCorrectionFunction);
0043 
0044 private:
0045   // correction factor as a function of number of crystals,
0046   // BasicCluster algo and location in the detector
0047   float fNCrystals(int nCry, reco::CaloCluster::AlgoId theAlgo, EcalSubdetector theBase) const;
0048 
0049   // Return the number of crystals in a BasicCluster above
0050   // 2sigma noise level
0051   int nCrystalsGT2Sigma(reco::BasicCluster const& seed, EcalRecHitCollection const& rhc) const;
0052 
0053   float sigmaElectronicNoise_;
0054 };
0055 
0056 #endif /*RecoECAL_ECALClusters_EgammaSCEnergyCorrectionAlgo_h_*/