CMS 3D CMS Logo

TracksterLinkingbyFastJet.h
Go to the documentation of this file.
1 #ifndef RecoHGCal_TICL_TracksterLinkingAlgoByFastJet_H
2 #define RecoHGCal_TICL_TracksterLinkingAlgoByFastJet_H
3 
9 #include "fastjet/ClusterSequence.hh"
11 
12 namespace ticl {
13 
15  public:
18  cms::Ort::ONNXRuntime const* onnxRuntime = nullptr)
19  : TracksterLinkingAlgoBase(conf, iC), radius_(conf.getParameter<double>("radius")) {
20  // Cluster tracksters into jets using FastJet with configurable algorithm
21  auto algo = conf.getParameter<int>("jet_algorithm");
22 
23  switch (algo) {
24  case 0:
25  algorithm_ = fastjet::kt_algorithm;
26  break;
27  case 1:
28  algorithm_ = fastjet::cambridge_algorithm;
29  break;
30  case 2:
31  algorithm_ = fastjet::antikt_algorithm;
32  break;
33  default:
34  throw cms::Exception("BadConfig") << "FastJet jet clustering algorithm not set correctly.";
35  }
36  }
37 
39 
40  void linkTracksters(const Inputs& input,
41  std::vector<Trackster>& resultTracksters,
42  std::vector<std::vector<unsigned int>>& linkedResultTracksters,
43  std::vector<std::vector<unsigned int>>& linkedTracksterIdToInputTracksterId) override;
44 
45  void initialize(const HGCalDDDConstants* hgcons,
46  const hgcal::RecHitTools rhtools,
47  const edm::ESHandle<MagneticField> bfieldH,
48  const edm::ESHandle<Propagator> propH) override {};
49 
51  iDesc.add<int>("algo_verbosity", 0);
52  iDesc.add<int>("jet_algorithm", 2)
53  ->setComment("FastJet jet clustering algorithm: 0 = kt, 1 = Cambridge/Aachen, 2 = anti-kt");
54  iDesc.add<double>("radius", 0.1);
55  }
56 
57  private:
58  fastjet::JetAlgorithm algorithm_; // FastJet jet clustering algorithm
59  const float radius_;
60  };
61 
62 } // namespace ticl
63 
64 #endif
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void initialize(const HGCalDDDConstants *hgcons, const hgcal::RecHitTools rhtools, const edm::ESHandle< MagneticField > bfieldH, const edm::ESHandle< Propagator > propH) override
TracksterLinkingbyFastJet(const edm::ParameterSet &conf, edm::ConsumesCollector iC, cms::Ort::ONNXRuntime const *onnxRuntime=nullptr)
static std::string const input
Definition: EdmProvDump.cc:50
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
void linkTracksters(const Inputs &input, std::vector< Trackster > &resultTracksters, std::vector< std::vector< unsigned int >> &linkedResultTracksters, std::vector< std::vector< unsigned int >> &linkedTracksterIdToInputTracksterId) override
Definition: Common.h:10