2 #include "fastjet/ClusterSequence.hh" 10 std::vector<Trackster>& resultTracksters,
11 std::vector<std::vector<unsigned int>>& linkedResultTracksters,
12 std::vector<std::vector<unsigned int>>& linkedTracksterIdToInputTracksterId) {
14 std::vector<fastjet::PseudoJet> fjInputs;
15 for (
size_t i = 0;
i <
input.tracksters.size(); ++
i) {
17 fastjet::PseudoJet pj(
input.tracksters[
i].barycenter().x(),
18 input.tracksters[
i].barycenter().y(),
19 input.tracksters[
i].barycenter().z(),
20 input.tracksters[
i].raw_energy());
22 fjInputs.push_back(pj);
26 fastjet::ClusterSequence sequence(fjInputs, fastjet::JetDefinition(
algorithm_,
radius_));
27 auto jets = fastjet::sorted_by_pt(sequence.inclusive_jets(0));
28 linkedTracksterIdToInputTracksterId.resize(
jets.size());
30 for (
unsigned int i = 0;
i <
jets.size(); ++
i) {
33 std::vector<unsigned int> linkedTracksters;
35 if (!
jet.constituents().empty()) {
37 for (
const auto& constituent :
jet.constituents()) {
38 auto tracksterIndex = constituent.user_index();
39 linkedTracksterIdToInputTracksterId[
i].push_back(tracksterIndex);
42 linkedTracksters.push_back(resultTracksters.size());
43 resultTracksters.push_back(outTrackster);
45 linkedResultTracksters.push_back(linkedTracksters);
static std::string const input
void mergeTracksters(const Trackster &other)
void linkTracksters(const Inputs &input, std::vector< Trackster > &resultTracksters, std::vector< std::vector< unsigned int >> &linkedResultTracksters, std::vector< std::vector< unsigned int >> &linkedTracksterIdToInputTracksterId) override
fastjet::JetAlgorithm algorithm_