CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PatternRecognitionbyCLUE3D.h
Go to the documentation of this file.
1 // Author: Marco Rovere - marco.rovere@cern.ch
2 // Date: 04/2021
3 
4 #ifndef __RecoHGCal_TICL_PRbyCLUE3D_H__
5 #define __RecoHGCal_TICL_PRbyCLUE3D_H__
6 #include <memory> // unique_ptr
9 
10 namespace ticl {
11  template <typename TILES>
13  public:
15  ~PatternRecognitionbyCLUE3D() override = default;
16 
18  std::vector<Trackster>& result,
19  std::unordered_map<int, std::vector<int>>& seedToTracksterAssociation) override;
20 
21  void energyRegressionAndID(const std::vector<reco::CaloCluster>& layerClusters, std::vector<Trackster>& result);
22 
24 
25  private:
26  struct ClustersOnLayer {
27  std::vector<float> x;
28  std::vector<float> y;
29  std::vector<float> radius;
30  std::vector<float> eta;
31  std::vector<float> phi;
32  std::vector<int> cells;
33 
34  std::vector<float> energy;
35  std::vector<float> rho;
36 
37  std::vector<float> delta;
38  std::vector<std::pair<int, int>> nearestHigher;
39  std::vector<int> clusterIndex;
40  std::vector<unsigned int> layerClusterOriginalIdx;
41  std::vector<std::vector<std::pair<int, int>>> followers;
42  std::vector<bool> isSeed;
43 
44  void clear() {
45  x.clear();
46  y.clear();
47  radius.clear();
48  eta.clear();
49  phi.clear();
50  cells.clear();
51  energy.clear();
52  rho.clear();
53  delta.clear();
54  nearestHigher.clear();
55  clusterIndex.clear();
57  followers.clear();
58  isSeed.clear();
59  }
60 
61  void shrink_to_fit() {
62  x.shrink_to_fit();
63  y.shrink_to_fit();
64  radius.shrink_to_fit();
65  eta.shrink_to_fit();
66  phi.shrink_to_fit();
67  cells.shrink_to_fit();
68  energy.shrink_to_fit();
69  rho.shrink_to_fit();
70  delta.shrink_to_fit();
71  nearestHigher.shrink_to_fit();
72  clusterIndex.shrink_to_fit();
73  layerClusterOriginalIdx.shrink_to_fit();
74  followers.shrink_to_fit();
75  isSeed.shrink_to_fit();
76  }
77  };
78 
79  void reset() {
80  for (auto& c : clusters_) {
81  c.clear();
82  c.shrink_to_fit();
83  }
84  }
85  void calculateLocalDensity(const TILES&, const unsigned int layerId, const std::vector<std::pair<int, int>>&);
86  void calculateDistanceToHigher(const TILES&, const unsigned int layerId, const std::vector<std::pair<int, int>>&);
87  int findAndAssignTracksters(const TILES&, const std::vector<std::pair<int, int>>&);
88  void dumpClusters(const std::vector<std::pair<int, int>>& layerIdx2layerandSoa, const int) const;
89  void dumpTracksters(const std::vector<std::pair<int, int>>& layerIdx2layerandSoa,
90  const int,
91  const std::vector<Trackster>&) const;
92  void dumpTiles(const TILES&) const;
93 
94  std::vector<ClustersOnLayer> clusters_;
95 
97  const double criticalDensity_;
100  const double densityOnSameLayer_;
102  const double outlierMultiplier_;
104  const std::vector<int> filter_on_categories_;
108  const float eidMinClusterEnergy_;
109  const int eidNLayers_;
110  const int eidNClusters_;
111 
113  tensorflow::Session* eidSession_;
114 
115  static const int eidNFeatures_ = 3;
116  };
117 
118 } // namespace ticl
119 #endif
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
const edm::EventSetup & c
void dumpTracksters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int, const std::vector< Trackster > &) const
void calculateDistanceToHigher(const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
std::vector< ClustersOnLayer > clusters_
~PatternRecognitionbyCLUE3D() override=default
static std::string const input
Definition: EdmProvDump.cc:47
tuple result
Definition: mps_fire.py:311
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
void makeTracksters(const typename PatternRecognitionAlgoBaseT< TILES >::Inputs &input, std::vector< Trackster > &result, std::unordered_map< int, std::vector< int >> &seedToTracksterAssociation) override
int findAndAssignTracksters(const TILES &, const std::vector< std::pair< int, int >> &)
void calculateLocalDensity(const TILES &, const unsigned int layerId, const std::vector< std::pair< int, int >> &)
PatternRecognitionbyCLUE3D(const edm::ParameterSet &conf, const CacheBase *cache, edm::ConsumesCollector)
std::vector< std::vector< std::pair< int, int > > > followers
void dumpClusters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int) const
const std::vector< int > filter_on_categories_
def cache
Definition: utilities.py:3
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, std::vector< Trackster > &result)