Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-30 22:39:05

0001 // Author: Felice Pantaleo - felice.pantaleo@cern.ch
0002 // Date: 09/2018
0003 
0004 #ifndef RecoHGCal_TICL_PatternRecognitionAlgoBase_H__
0005 #define RecoHGCal_TICL_PatternRecognitionAlgoBase_H__
0006 
0007 #include <memory>
0008 #include <vector>
0009 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
0010 #include "DataFormats/HGCalReco/interface/Trackster.h"
0011 #include "DataFormats/HGCalReco/interface/TICLLayerTile.h"
0012 #include "DataFormats/HGCalReco/interface/TICLSeedingRegion.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "DataFormats/Common/interface/ValueMap.h"
0015 #include "RecoHGCal/TICL/interface/GlobalCache.h"
0016 #include "RecoHGCal/TICL/interface/commons.h"
0017 #include "FWCore/Framework/interface/ConsumesCollector.h"
0018 #include "PhysicsTools/TensorFlow/interface/TensorFlow.h"
0019 
0020 namespace edm {
0021   class Event;
0022   class EventSetup;
0023 }  // namespace edm
0024 
0025 namespace ticl {
0026   template <typename TILES>
0027   class PatternRecognitionAlgoBaseT {
0028   public:
0029     PatternRecognitionAlgoBaseT(const edm::ParameterSet& conf, edm::ConsumesCollector)
0030         : algo_verbosity_(conf.getParameter<int>("algo_verbosity")) {}
0031     virtual ~PatternRecognitionAlgoBaseT(){};
0032 
0033     struct Inputs {
0034       const edm::Event& ev;
0035       const edm::EventSetup& es;
0036       const std::vector<reco::CaloCluster>& layerClusters;
0037       const std::vector<float>& mask;
0038       const edm::ValueMap<std::pair<float, float>>& layerClustersTime;
0039       const TILES& tiles;
0040       const std::vector<TICLSeedingRegion>& regions;
0041       const tensorflow::Session* tfSession;
0042 
0043       Inputs(const edm::Event& eV,
0044              const edm::EventSetup& eS,
0045              const std::vector<reco::CaloCluster>& lC,
0046              const std::vector<float>& mS,
0047              const edm::ValueMap<std::pair<float, float>>& lT,
0048              const TILES& tL,
0049              const std::vector<TICLSeedingRegion>& rG,
0050              const tensorflow::Session* tS)
0051           : ev(eV), es(eS), layerClusters(lC), mask(mS), layerClustersTime(lT), tiles(tL), regions(rG), tfSession(tS) {}
0052     };
0053 
0054     virtual void makeTracksters(const Inputs& input,
0055                                 std::vector<Trackster>& result,
0056                                 std::unordered_map<int, std::vector<int>>& seedToTracksterAssociation) = 0;
0057 
0058   protected:
0059     int algo_verbosity_;
0060   };
0061 }  // namespace ticl
0062 
0063 #endif