7 const std::vector<l1thgcfirmware::HGCalCluster>&
clusters,
8 const std::vector<l1thgcfirmware::HGCalSeed>&
seeds,
9 std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters,
11 std::map<int, l1thgcfirmware::HGCalMulticluster> mapSeedMulticluster;
12 std::vector<l1thgcfirmware::HGCalMulticluster> multiclustersOut;
15 int z_side = clu.zside();
17 double radiusCoefficientA =
configuration.dr_byLayer_coefficientA().empty()
20 double radiusCoefficientB =
23 double minDistSqrd = radiusCoefficientA + radiusCoefficientB * (
configuration.midRadius() -
std::abs(clu.eta()));
24 minDistSqrd *= minDistSqrd;
26 std::vector<std::pair<int, double>> targetSeedsEnergy;
28 unsigned int iseed = 0;
30 if (z_side *
seed.z() < 0) {
35 double seedEnergy =
seed.energy();
37 double d = (clu.x() -
seed.x()) * (clu.x() -
seed.x()) + (clu.y() -
seed.y()) * (clu.y() -
seed.y());
39 if (
d < minDistSqrd) {
43 if (targetSeedsEnergy.empty()) {
44 targetSeedsEnergy.emplace_back(
iseed, seedEnergy);
46 targetSeedsEnergy.at(0).first =
iseed;
47 targetSeedsEnergy.at(0).second = seedEnergy;
53 if (targetSeedsEnergy.empty()) {
54 rejected_clusters.emplace_back(clu);
63 for (
const auto&
energy : targetSeedsEnergy) {
64 double seedWeight = 1;
65 if (mapSeedMulticluster[
energy.first].size() == 0) {
68 mapSeedMulticluster[
energy.first].addConstituent(clu,
true, seedWeight);
73 multiclustersOut.reserve(mapSeedMulticluster.size());
74 for (
const auto& mclu : mapSeedMulticluster)
75 multiclustersOut.emplace_back(mclu.second);
77 return multiclustersOut;
81 const std::vector<l1thgcfirmware::HGCalMulticluster>& multiclusters_in,
82 const std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters_in,
83 std::vector<l1thgcfirmware::HGCalMulticluster>& multiclusters_out,
84 std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters_out,
86 for (
const auto& tc : rejected_clusters_in) {
87 rejected_clusters_out.push_back(tc);
90 for (
const auto& multicluster : multiclusters_in) {
92 multiclusters_out.push_back(multicluster);
94 for (
const auto& tc : multicluster.constituents()) {
95 rejected_clusters_out.push_back(tc);
void finalizeClusters_SA(const std::vector< l1thgcfirmware::HGCalMulticluster > &, const std::vector< l1thgcfirmware::HGCalCluster > &, std::vector< l1thgcfirmware::HGCalMulticluster > &, std::vector< l1thgcfirmware::HGCalCluster > &, const l1thgcfirmware::ClusterAlgoConfig &configuration) const
Abs< T >::type abs(const T &t)
std::vector< l1thgcfirmware::HGCalMulticluster > clusterSeedMulticluster_SA(const std::vector< l1thgcfirmware::HGCalCluster > &clusters, const std::vector< l1thgcfirmware::HGCalSeed > &seeds, std::vector< l1thgcfirmware::HGCalCluster > &rejected_clusters, const l1thgcfirmware::ClusterAlgoConfig &configuration) const