CMS 3D CMS Logo

TracksterLinkingbySuperClusteringDNN.h
Go to the documentation of this file.
1 /*
2 TICL plugin for electron superclustering in HGCAL using a DNN.
3 DNN designed and trained by Alessandro Tarabini.
4 
5 Inputs are CLUE3D EM tracksters. Outputs are superclusters (as vectors of IDs of trackster)
6 "Seed trackster" : seed of supercluster, always highest pT trackster of supercluster, normally should be an electron
7 "Candidate trackster" : trackster that is considered for superclustering with a seed
8 
9 Authors : Theo Cuisset <theo.cuisset@cern.ch>, Shamik Ghosh <shamik.ghosh@cern.ch>
10 Date : 11/2023
11 */
12 
13 #ifndef RecoHGCal_TICL_TracksterLinkingSuperClustering_H
14 #define RecoHGCal_TICL_TracksterLinkingSuperClustering_H
15 
16 #include <vector>
17 
18 namespace cms {
19  namespace Ort {
20  class ONNXRuntime;
21  }
22 } // namespace cms
23 
26 
27 namespace ticl {
28  class Trackster;
29 
31  public:
34  cms::Ort::ONNXRuntime const* onnxRuntime = nullptr);
35  /* virtual */ ~TracksterLinkingbySuperClusteringDNN() override {}
37 
38  void linkTracksters(const Inputs& input,
39  std::vector<Trackster>& resultTracksters,
40  std::vector<std::vector<unsigned int>>& linkedResultTracksters,
41  std::vector<std::vector<unsigned int>>& linkedTracksterIdToInputTracksterId) override;
42  void initialize(const HGCalDDDConstants* hgcons,
43  const hgcal::RecHitTools rhtools,
44  const edm::ESHandle<MagneticField> bfieldH,
45  const edm::ESHandle<Propagator> propH) override;
46 
47  private:
48  bool checkExplainedVarianceRatioCut(ticl::Trackster const& ts) const;
49  bool trackstersPassesPIDCut(const Trackster& ts) const;
50 
51  std::unique_ptr<AbstractSuperclusteringDNNInput> dnnInputs_; // Helper class for DNN input features computation
52  unsigned int inferenceBatchSize_; // Size of inference batches fed to DNN
53  double
54  nnWorkingPoint_; // Working point for neural network (above this score, consider the trackster candidate for superclustering)
55  float deltaEtaWindow_; // Delta eta window to consider trackster seed-candidate pairs for inference
56  float deltaPhiWindow_; // Delta phi window
57  float seedPtThreshold_; // Min pT for a trackster to be considered as supercluster seed
58  float candidateEnergyThreshold_; // Min energy for a trackster to be superclustered as candidate
59  float explVarRatioCut_energyBoundary_; // Boundary energy between low and high energy explVarRatio cut threshold
60  float explVarRatioMinimum_lowEnergy_; // Cut on explained variance ratio of tracksters to be considered as candidate, for trackster raw_energy < explVarRatioCut_energyBoundary
61  float explVarRatioMinimum_highEnergy_; // Cut on explained variance ratio of tracksters to be considered as candidate, for trackster raw_energy > explVarRatioCut_energyBoundary
65  };
66 
67 } // namespace ticl
68 
69 #endif
void initialize(const HGCalDDDConstants *hgcons, const hgcal::RecHitTools rhtools, const edm::ESHandle< MagneticField > bfieldH, const edm::ESHandle< Propagator > propH) override
std::unique_ptr< AbstractSuperclusteringDNNInput > dnnInputs_
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
TracksterLinkingbySuperClusteringDNN(const edm::ParameterSet &ps, edm::ConsumesCollector iC, cms::Ort::ONNXRuntime const *onnxRuntime=nullptr)
static std::string const input
Definition: EdmProvDump.cc:50
void linkTracksters(const Inputs &input, std::vector< Trackster > &resultTracksters, std::vector< std::vector< unsigned int >> &linkedResultTracksters, std::vector< std::vector< unsigned int >> &linkedTracksterIdToInputTracksterId) override
bool checkExplainedVarianceRatioCut(ticl::Trackster const &ts) const
Namespace of DDCMS conversion namespace.
Definition: Common.h:10