Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoEcal_EgammaCoreTools_SCProducerCache_h
0002 #define RecoEcal_EgammaCoreTools_SCProducerCache_h
0003 
0004 #include "RecoEcal/EgammaCoreTools/interface/DeepSCGraphEvaluation.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 
0007 namespace reco {
0008 
0009   class SCProducerCache {
0010   public:
0011     // Cache for SuperCluster Producer containing Tensorflow objects
0012     SCProducerCache(const edm::ParameterSet& conf) {
0013       // Here we will have to load the DNN PFID if present in the config
0014       auto clustering_type = conf.getParameter<std::string>("ClusteringType");
0015 
0016       if (clustering_type == "DeepSC") {
0017         const auto& pset_dnn = conf.getParameter<edm::ParameterSet>("deepSuperClusterConfig");
0018         config.modelFile = pset_dnn.getParameter<std::string>("modelFile");
0019         config.configFileClusterFeatures = pset_dnn.getParameter<std::string>("configFileClusterFeatures");
0020         config.configFileWindowFeatures = pset_dnn.getParameter<std::string>("configFileWindowFeatures");
0021         config.configFileHitsFeatures = pset_dnn.getParameter<std::string>("configFileHitsFeatures");
0022         config.nClusterFeatures = pset_dnn.getParameter<uint>("nClusterFeatures");
0023         config.nWindowFeatures = pset_dnn.getParameter<uint>("nWindowFeatures");
0024         config.nHitsFeatures = pset_dnn.getParameter<uint>("nHitsFeatures");
0025         config.maxNClusters = pset_dnn.getParameter<uint>("maxNClusters");
0026         config.maxNRechits = pset_dnn.getParameter<uint>("maxNRechits");
0027         config.batchSize = pset_dnn.getParameter<uint>("batchSize");
0028         config.collectionStrategy = pset_dnn.getParameter<std::string>("collectionStrategy");
0029         deepSCEvaluator = std::make_unique<DeepSCGraphEvaluation>(config);
0030       }
0031     };
0032 
0033     std::unique_ptr<const DeepSCGraphEvaluation> deepSCEvaluator;
0034     reco::DeepSCConfiguration config;
0035   };
0036 }  // namespace reco
0037 
0038 #endif