Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-22 02:23:58

0001 #ifndef RecoHGCal_TICL_PatternRecognitionAlgoBase_H__
0002 #define RecoHGCal_TICL_PatternRecognitionAlgoBase_H__
0003 
0004 #include <memory>
0005 #include <vector>
0006 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
0007 #include "DataFormats/HGCalReco/interface/MtdHostCollection.h"
0008 #include "DataFormats/HGCalReco/interface/Trackster.h"
0009 #include "DataFormats/HGCalReco/interface/TICLCandidate.h"
0010 #include "DataFormats/HGCalReco/interface/TICLLayerTile.h"
0011 #include "DataFormats/HGCalReco/interface/TICLSeedingRegion.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0014 #include "FWCore/Framework/interface/Event.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "DataFormats/Common/interface/ValueMap.h"
0017 #include "MagneticField/Engine/interface/MagneticField.h"
0018 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0019 #include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
0020 #include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h"
0021 #include "RecoHGCal/TICL/interface/GlobalCache.h"
0022 #include "DataFormats/HGCalReco/interface/Common.h"
0023 #include "FWCore/Framework/interface/ConsumesCollector.h"
0024 #include "PhysicsTools/TensorFlow/interface/TensorFlow.h"
0025 #include "CommonTools/RecoAlgos/interface/MultiVectorManager.h"
0026 
0027 namespace edm {
0028   class Event;
0029   class EventSetup;
0030 }  // namespace edm
0031 namespace ticl {
0032   template <typename T>
0033   class TICLInterpretationAlgoBase {
0034   public:
0035     TICLInterpretationAlgoBase(const edm::ParameterSet& conf, edm::ConsumesCollector)
0036         : algo_verbosity_(conf.getParameter<int>("algo_verbosity")) {}
0037     virtual ~TICLInterpretationAlgoBase(){};
0038     struct Inputs {
0039       const edm::Event& ev;
0040       const edm::EventSetup& es;
0041       const std::vector<reco::CaloCluster>& layerClusters;
0042       const edm::ValueMap<std::pair<float, float>>& layerClustersTime;
0043       const MultiVectorManager<Trackster>& tracksters;
0044       const std::vector<std::vector<unsigned int>>& linkedResultTracksters;
0045       const edm::Handle<std::vector<T>> tracksHandle;
0046       const std::vector<bool>& maskedTracks;
0047 
0048       Inputs(const edm::Event& eV,
0049              const edm::EventSetup& eS,
0050              const std::vector<reco::CaloCluster>& lC,
0051              const edm::ValueMap<std::pair<float, float>>& lcT,
0052              const MultiVectorManager<Trackster>& tS,
0053              const std::vector<std::vector<unsigned int>>& links,
0054              const edm::Handle<std::vector<T>> trks,
0055              const std::vector<bool>& mT)
0056           : ev(eV),
0057             es(eS),
0058             layerClusters(lC),
0059             layerClustersTime(lcT),
0060             tracksters(tS),
0061             linkedResultTracksters(links),
0062             tracksHandle(trks),
0063             maskedTracks(mT) {}
0064     };
0065 
0066     struct TrackTimingInformation {
0067       const edm::Handle<edm::ValueMap<float>> tkTime_h;
0068       const edm::Handle<edm::ValueMap<float>> tkTimeErr_h;
0069       const edm::Handle<edm::ValueMap<float>> tkQuality_h;
0070       const edm::Handle<edm::ValueMap<float>> tkBeta_h;
0071       const edm::Handle<edm::ValueMap<float>> tkPath_h;
0072       const edm::Handle<edm::ValueMap<GlobalPoint>> tkMtdPos_h;
0073 
0074       TrackTimingInformation(const edm::Handle<edm::ValueMap<float>> tkT,
0075                              const edm::Handle<edm::ValueMap<float>> tkTE,
0076                              const edm::Handle<edm::ValueMap<float>> tkQ,
0077                              const edm::Handle<edm::ValueMap<float>> tkB,
0078                              const edm::Handle<edm::ValueMap<float>> tkP,
0079                              const edm::Handle<edm::ValueMap<GlobalPoint>> mtdPos)
0080           : tkTime_h(tkT), tkTimeErr_h(tkTE), tkQuality_h(tkQ), tkBeta_h(tkB), tkPath_h(tkP), tkMtdPos_h(mtdPos) {}
0081     };
0082 
0083     virtual void makeCandidates(const Inputs& input,
0084                                 edm::Handle<MtdHostCollection> inputTiming_h,
0085                                 std::vector<Trackster>& resultTracksters,
0086                                 std::vector<int>& resultCandidate) = 0;
0087 
0088     virtual void initialize(const HGCalDDDConstants* hgcons,
0089                             const hgcal::RecHitTools rhtools,
0090                             const edm::ESHandle<MagneticField> bfieldH,
0091                             const edm::ESHandle<Propagator> propH) = 0;
0092 
0093     static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add<int>("algo_verbosity", 0); };
0094 
0095   protected:
0096     int algo_verbosity_;
0097   };
0098 }  // namespace ticl
0099 
0100 #endif