CMS 3D CMS Logo

EcalClustersGraph.h
Go to the documentation of this file.
1 #ifndef RecoEcal_EgammaCoreTools_EcalClustersGraph_h
2 #define RecoEcal_EgammaCoreTools_EcalClustersGraph_h
3 
11 #include <vector>
12 #include <array>
13 #include <cmath>
14 
17 
24 
28 
37 
41 
42 /*
43  * class: EcalClustersGraph
44  * Authors: D.Valsecchi, B.Marzocchi
45  * Date: January 2022
46  *
47  * Utility class to handle all the PFClusters in ECAL as a graph.
48  * The DeepSC algorithm is applied on sub-graphs of clusters to form SuperCluster.
49  */
50 
51 namespace reco {
52 
54  public:
55  typedef std::vector<CalibratedPFCluster> CalibratedPFClusterVector;
56  typedef std::vector<std::pair<CalibratedPFCluster, CalibratedPFClusterVector>> EcalGraphOutput;
57 
59  int nSeeds,
60  const CaloTopology* topology,
61  const CaloSubdetectorGeometry* ebGeom,
62  const CaloSubdetectorGeometry* eeGeom,
66 
67  void fillVariables();
68 
69  double scoreThreshold(const CaloCluster* cluster);
70  void initWindows();
71 
72  void setThresholds();
73  void evaluateScores();
74  void selectClusters();
75 
77 
78  private:
79  std::array<int, 3> clusterPosition(const CaloCluster* cluster) const;
80 
81  // Sign flip deltaEta as in the Mustache
82  double deltaEta(double seed_eta, double cluster_eta) const {
83  return (1 - 2 * (seed_eta < 0)) * (cluster_eta - seed_eta);
84  }
85 
86  // The dEta-dPhi detector window dimension is chosen to that the algorithm is always larger than
87  // the Mustache dimension
88  std::array<double, 3> dynamicWindow(double seedEta) const;
89 
91  std::vector<std::vector<float>> fillHits(const CaloCluster* cluster) const;
92  DeepSCInputs::FeaturesMap computeWindowVariables(const std::vector<DeepSCInputs::FeaturesMap>& clusters) const;
93 
94  std::pair<double, double> computeCovariances(const CaloCluster* cluster);
95  std::vector<double> computeShowerShapes(const CaloCluster* cluster, bool full5x5);
96 
100 
101  std::array<float, 3> locCov_;
102  std::pair<double, double> widths_;
103 
104  //To compute the input variables
111 
112  // GraphMap for handling all the windows and scores
115 
116  // Raw input for the tensorflow DeepSCGraphEvaluation object
118  float threshold_;
119  };
120 
121 } // namespace reco
122 #endif
std::array< double, 3 > dynamicWindow(double seedEta) const
const CaloTopology * topology_
CalibratedPFClusterVector clusters_
const EcalRecHitCollection * recHitsEB_
const EcalRecHitCollection * recHitsEE_
reco::DeepSCInputs::Inputs inputs_
EcalGraphOutput getGraphOutput()
DeepSCInputs::FeaturesMap computeWindowVariables(const std::vector< DeepSCInputs::FeaturesMap > &clusters) const
const reco::SCProducerCache * scProducerCache_
std::pair< double, double > widths_
const CaloSubdetectorGeometry * eeGeom_
reco::GraphMap::CollectionStrategy strategy_
std::vector< double > computeShowerShapes(const CaloCluster *cluster, bool full5x5)
std::array< float, 3 > locCov_
double deltaEta(double seed_eta, double cluster_eta) const
std::map< std::string, double > FeaturesMap
DeepSCInputs::FeaturesMap computeVariables(const CaloCluster *seed, const CaloCluster *cluster) const
double scoreThreshold(const CaloCluster *cluster)
std::array< int, 3 > clusterPosition(const CaloCluster *cluster) const
const CaloSubdetectorGeometry * ebGeom_
EcalClustersGraph(CalibratedPFClusterVector clusters, int nSeeds, const CaloTopology *topology, const CaloSubdetectorGeometry *ebGeom, const CaloSubdetectorGeometry *eeGeom, const EcalRecHitCollection *recHitsEB, const EcalRecHitCollection *recHitsEE, const reco::SCProducerCache *cache)
std::vector< std::vector< float > > fillHits(const CaloCluster *cluster) const
fixed size matrix
def cache(function)
Definition: utilities.py:3
std::vector< CalibratedPFCluster > CalibratedPFClusterVector
std::vector< std::pair< CalibratedPFCluster, CalibratedPFClusterVector > > EcalGraphOutput
std::pair< double, double > computeCovariances(const CaloCluster *cluster)