Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:01

0001 //--------------------------------------------------------------------------------------------------
0002 //
0003 // EGEnergyCorrector
0004 //
0005 // Helper Class for applying regression-based energy corrections with optimized BDT implementation
0006 //
0007 // Authors: J.Bendavid
0008 //--------------------------------------------------------------------------------------------------
0009 
0010 #ifndef EGAMMATOOLS_EGEnergyCorrector_H
0011 #define EGAMMATOOLS_EGEnergyCorrector_H
0012 
0013 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0014 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0015 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
0016 
0017 #include <array>
0018 #include <memory>
0019 
0020 class GBRForest;
0021 
0022 class EGEnergyCorrector {
0023 public:
0024   struct Initializer {
0025     std::shared_ptr<const GBRForest> readereb_;
0026     std::shared_ptr<const GBRForest> readerebvariance_;
0027     std::shared_ptr<const GBRForest> readeree_;
0028     std::shared_ptr<const GBRForest> readereevariance_;
0029   };
0030 
0031   ~EGEnergyCorrector() = default;
0032   EGEnergyCorrector() = default;
0033   explicit EGEnergyCorrector(Initializer) noexcept;
0034 
0035   std::pair<double, double> CorrectedEnergyWithError(const reco::Photon &p,
0036                                                      const reco::VertexCollection &vtxcol,
0037                                                      EcalClusterLazyTools &clustertools,
0038                                                      CaloGeometry const &caloGeometry);
0039 
0040   std::pair<double, double> CorrectedEnergyWithErrorV3(const reco::Photon &p,
0041                                                        const reco::VertexCollection &vtxcol,
0042                                                        double rho,
0043                                                        EcalClusterLazyTools &clustertools,
0044                                                        CaloGeometry const &caloGeometry,
0045                                                        bool applyRescale = false);
0046 
0047 protected:
0048   std::shared_ptr<const GBRForest> fReadereb;
0049   std::shared_ptr<const GBRForest> fReaderebvariance;
0050   std::shared_ptr<const GBRForest> fReaderee;
0051   std::shared_ptr<const GBRForest> fReadereevariance;
0052 
0053   std::array<float, 73> fVals;
0054 };
0055 
0056 #endif