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;
14 for (
const auto& clu : clusters) {
15 int z_side = clu.zside();
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;
29 for (
const auto&
seed : seeds) {
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);
64 double totalTargetSeedEnergy = 0;
65 for (
const auto&
energy : targetSeedsEnergy) {
66 totalTargetSeedEnergy +=
energy.second;
69 for (
const auto&
energy : targetSeedsEnergy) {
70 double seedWeight = 1;
71 if (mapSeedMulticluster[
energy.first].size() == 0) {
74 mapSeedMulticluster[
energy.first].addConstituent(clu,
true, seedWeight);
79 multiclustersOut.reserve(mapSeedMulticluster.size());
80 for (
const auto& mclu : mapSeedMulticluster)
81 multiclustersOut.emplace_back(mclu.second);
83 return multiclustersOut;
87 const std::vector<l1thgcfirmware::HGCalMulticluster>& multiclusters_in,
88 const std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters_in,
89 std::vector<l1thgcfirmware::HGCalMulticluster>& multiclusters_out,
90 std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters_out,
92 for (
const auto& tc : rejected_clusters_in) {
93 rejected_clusters_out.push_back(tc);
96 for (
const auto& multicluster : multiclusters_in) {
98 multiclusters_out.push_back(multicluster);
100 for (
const auto& tc : multicluster.constituents()) {
101 rejected_clusters_out.push_back(tc);
float ptC3dThreshold() const
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
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
const std::vector< double > & dr_byLayer_coefficientA() const
Abs< T >::type abs(const T &t)
const std::vector< double > & dr_byLayer_coefficientB() const