Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:59:24

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