Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-16 01:50:16

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   std::vector<tensorflow::Session*> getSessions() const;
0018   ;
0019 
0020   // Function returning a map with all the possible variables and their name
0021   std::map<std::string, float> getInputsVars(const reco::Photon& ele) const;
0022 
0023   // Evaluate the DNN on all the electrons with the correct model
0024   std::vector<std::pair<uint, std::vector<float>>> evaluate(const reco::PhotonCollection& ele,
0025                                                             const std::vector<tensorflow::Session*>& sessions) const;
0026 
0027   // List of input variables names used to check the variables request as
0028   // inputs in a dynamic way from configuration file.
0029   // If an input variables is not found at construction time an expection is thrown.
0030   static const std::vector<std::string> dnnAvaibleInputs;
0031 
0032   static constexpr float ecalBarrelMaxEtaWithGap = 1.566;
0033   static constexpr float ecalBarrelMaxEtaNoGap = 1.485;
0034 
0035 private:
0036   const egammaTools::EgammaDNNHelper dnnHelper_;
0037 
0038   const bool useEBModelInGap_;
0039 };
0040 
0041 #endif