CMS 3D CMS Logo

TracksterLinkingAlgoBase.h
Go to the documentation of this file.
1 // Author: Felice Pantaleo - felice.pantaleo@cern.ch
2 // Date: 09/2018
3 
4 #ifndef RecoHGCal_TICL_PatternRecognitionAlgoBase_H__
5 #define RecoHGCal_TICL_PatternRecognitionAlgoBase_H__
6 
7 #include <memory>
8 #include <vector>
27 
28 namespace edm {
29  class Event;
30  class EventSetup;
31 } // namespace edm
32 
33 namespace cms {
34  namespace Ort {
35  class ONNXRuntime;
36  }
37 } // namespace cms
38 
39 namespace ticl {
41  public:
47  cms::Ort::ONNXRuntime const* onnxRuntime = nullptr)
48  : algo_verbosity_(conf.getParameter<int>("algo_verbosity")), onnxRuntime_(onnxRuntime) {}
50 
51  struct Inputs {
52  const edm::Event& ev;
54  const std::vector<reco::CaloCluster>& layerClusters;
57 
58  Inputs(const edm::Event& eV,
59  const edm::EventSetup& eS,
60  const std::vector<reco::CaloCluster>& lC,
61  const edm::ValueMap<std::pair<float, float>>& lT,
63  : ev(eV), es(eS), layerClusters(lC), layerClustersTime(lT), tracksters(tS) {}
64  };
65 
66  virtual void linkTracksters(const Inputs& input,
67  std::vector<Trackster>& resultTracksters,
68  std::vector<std::vector<unsigned int>>& linkedResultTracksters,
69  std::vector<std::vector<unsigned int>>& linkedTracksterIdToInputTracksterId) = 0;
70 
71  virtual void initialize(const HGCalDDDConstants* hgcons,
72  const hgcal::RecHitTools rhtools,
73  const edm::ESHandle<MagneticField> bfieldH,
74  const edm::ESHandle<Propagator> propH) = 0;
75 
76  // To be called by TracksterLinksProducer at the start of TracksterLinksProducer::produce. Subclasses can use this to store Event and EventSetup
77  virtual void setEvent(edm::Event& iEvent, edm::EventSetup const& iEventSetup){};
78 
79  static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add<int>("algo_verbosity", 0); };
80 
81  protected:
82  int algo_verbosity_;
84  };
85 } // namespace ticl
86 
87 #endif
const std::vector< reco::CaloCluster > & layerClusters
Inputs(const edm::Event &eV, const edm::EventSetup &eS, const std::vector< reco::CaloCluster > &lC, const edm::ValueMap< std::pair< float, float >> &lT, const MultiVectorManager< Trackster > &tS)
static std::string const input
Definition: EdmProvDump.cc:50
virtual void linkTracksters(const Inputs &input, std::vector< Trackster > &resultTracksters, std::vector< std::vector< unsigned int >> &linkedResultTracksters, std::vector< std::vector< unsigned int >> &linkedTracksterIdToInputTracksterId)=0
int iEvent
Definition: GenABIO.cc:224
cms::Ort::ONNXRuntime const * onnxRuntime_
virtual void setEvent(edm::Event &iEvent, edm::EventSetup const &iEventSetup)
Namespace of DDCMS conversion namespace.
static void fillPSetDescription(edm::ParameterSetDescription &desc)
HLT enums.
Definition: Common.h:10
const MultiVectorManager< Trackster > & tracksters
TracksterLinkingAlgoBase(const edm::ParameterSet &conf, edm::ConsumesCollector, cms::Ort::ONNXRuntime const *onnxRuntime=nullptr)
virtual void initialize(const HGCalDDDConstants *hgcons, const hgcal::RecHitTools rhtools, const edm::ESHandle< MagneticField > bfieldH, const edm::ESHandle< Propagator > propH)=0
const edm::ValueMap< std::pair< float, float > > & layerClustersTime