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,
22  const tensorflow::Session*,
23  std::vector<Trackster>& result);
24 
26 
27  private:
28  struct ClustersOnLayer {
29  std::vector<float> x;
30  std::vector<float> y;
31  std::vector<float> radius;
32  std::vector<float> eta;
33  std::vector<float> phi;
34  std::vector<int> cells;
35 
36  std::vector<float> energy;
37  std::vector<float> rho;
38 
39  std::vector<float> delta;
40  std::vector<std::pair<int, int>> nearestHigher;
41  std::vector<int> clusterIndex;
42  std::vector<unsigned int> layerClusterOriginalIdx;
43  std::vector<std::vector<std::pair<int, int>>> followers;
44  std::vector<bool> isSeed;
45 
46  void clear() {
47  x.clear();
48  y.clear();
49  radius.clear();
50  eta.clear();
51  phi.clear();
52  cells.clear();
53  energy.clear();
54  rho.clear();
55  delta.clear();
56  nearestHigher.clear();
57  clusterIndex.clear();
59  followers.clear();
60  isSeed.clear();
61  }
62 
63  void shrink_to_fit() {
64  x.shrink_to_fit();
65  y.shrink_to_fit();
66  radius.shrink_to_fit();
67  eta.shrink_to_fit();
68  phi.shrink_to_fit();
69  cells.shrink_to_fit();
70  energy.shrink_to_fit();
71  rho.shrink_to_fit();
72  delta.shrink_to_fit();
73  nearestHigher.shrink_to_fit();
74  clusterIndex.shrink_to_fit();
75  layerClusterOriginalIdx.shrink_to_fit();
76  followers.shrink_to_fit();
77  isSeed.shrink_to_fit();
78  }
79  };
80 
81  void reset() {
82  for (auto& c : clusters_) {
83  c.clear();
84  c.shrink_to_fit();
85  }
86  }
87  void calculateLocalDensity(const TILES&, const int layerId, const std::vector<std::pair<int, int>>&);
88  void calculateDistanceToHigher(const TILES&, const int layerId, const std::vector<std::pair<int, int>>&);
89  int findAndAssignTracksters(const TILES&, const std::vector<std::pair<int, int>>&);
90  void dumpClusters(const std::vector<std::pair<int, int>>& layerIdx2layerandSoa, const int) const;
91  void dumpTracksters(const std::vector<std::pair<int, int>>& layerIdx2layerandSoa,
92  const int,
93  const std::vector<Trackster>&) const;
94  void dumpTiles(const TILES&) const;
95 
96  std::vector<ClustersOnLayer> clusters_;
97 
99  const double criticalDensity_;
102  const double densityOnSameLayer_;
104  const double outlierMultiplier_;
106  const std::vector<int> filter_on_categories_;
110  const float eidMinClusterEnergy_;
111  const int eidNLayers_;
112  const int eidNClusters_;
113 
115  tensorflow::Session* eidSession_;
116 
117  static const int eidNFeatures_ = 3;
118  };
119 
120 } // namespace ticl
121 #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 energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, const tensorflow::Session *, std::vector< Trackster > &result)
PatternRecognitionbyCLUE3D(const edm::ParameterSet &conf, edm::ConsumesCollector)
std::vector< ClustersOnLayer > clusters_
~PatternRecognitionbyCLUE3D() override=default
void calculateDistanceToHigher(const TILES &, const int layerId, const std::vector< std::pair< int, int >> &)
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 >> &)
std::vector< std::vector< std::pair< int, int > > > followers
void dumpClusters(const std::vector< std::pair< int, int >> &layerIdx2layerandSoa, const int) const
void calculateLocalDensity(const TILES &, const int layerId, const std::vector< std::pair< int, int >> &)
const std::vector< int > filter_on_categories_