Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:55

0001 #ifndef RecoEgamma_PhotonIdentification_PhotonDNNEstimator_h
0002 #define RecoEgamma_PhotonIdentification_PhotonDNNEstimator_h
0003 
0004 #include "RecoEgamma/EgammaTools/interface/EgammaDNNHelper.h"
0005 #include "PhysicsTools/TensorFlow/interface/TensorFlow.h"
0006 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0007 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0008 
0009 #include <vector>
0010 #include <memory>
0011 #include <string>
0012 
0013 class PhotonDNNEstimator {
0014 public:
0015   PhotonDNNEstimator(const egammaTools::DNNConfiguration&, const bool useEBModelInGap);
0016 
0017   // Function returning a map with all the possible variables and their name
0018   std::map<std::string, float> getInputsVars(const reco::Photon& ele) const;
0019 
0020   // Evaluate the DNN on all the electrons with the correct model
0021   std::vector<std::pair<uint, std::vector<float>>> evaluate(const reco::PhotonCollection& ele) const;
0022 
0023   // List of input variables names used to check the variables request as
0024   // inputs in a dynamic way from configuration file.
0025   // If an input variables is not found at construction time an expection is thrown.
0026   static const std::vector<std::string> dnnAvaibleInputs;
0027 
0028   static constexpr float ecalBarrelMaxEtaWithGap = 1.566;
0029   static constexpr float ecalBarrelMaxEtaNoGap = 1.485;
0030 
0031 private:
0032   const egammaTools::EgammaDNNHelper dnnHelper_;
0033 
0034   const bool useEBModelInGap_;
0035 };
0036 
0037 #endif