7 : dr_(conf.getParameter<double>(
"dR_multicluster")),
8 dr_byLayer_coefficientA_(conf.existsAs<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientA")
9 ? conf.getParameter<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientA")
11 dr_byLayer_coefficientB_(conf.existsAs<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientB")
12 ? conf.getParameter<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientB")
14 ptC3dThreshold_(conf.getParameter<double>(
"minPt_multicluster")),
15 cluster_association_input_(conf.getParameter<
string>(
"cluster_association")),
27 <<
"Multicluster dR: " <<
dr_ <<
"\nMulticluster minimum transverse-momentum: " <<
ptC3dThreshold_;
29 id_ = std::unique_ptr<HGCalTriggerClusterIdentificationBase>{
41 std::vector<l1t::HGCalCluster>& rejected_clusters)
const {
42 std::map<int, l1t::HGCalMulticluster> mapSeedMulticluster;
43 std::vector<l1t::HGCalMulticluster> multiclustersOut;
45 for (
const auto& clu : clustersPtrs) {
48 double radiusCoefficientA =
50 double radiusCoefficientB =
53 double minDist = radiusCoefficientA + radiusCoefficientB * (
kMidRadius_ -
std::abs(clu->eta()));
55 std::vector<pair<int, double>> targetSeedsEnergy;
61 if (z_side * seedPosition.
z() < 0)
67 targetSeedsEnergy.emplace_back(
iseed, seedEnergy);
71 if (targetSeedsEnergy.empty()) {
72 targetSeedsEnergy.emplace_back(
iseed, seedEnergy);
74 targetSeedsEnergy.at(0).first =
iseed;
75 targetSeedsEnergy.at(0).second = seedEnergy;
81 if (targetSeedsEnergy.empty()) {
82 rejected_clusters.emplace_back(*clu);
86 double totalTargetSeedEnergy = 0;
87 for (
const auto&
energy : targetSeedsEnergy) {
88 totalTargetSeedEnergy +=
energy.second;
91 for (
const auto&
energy : targetSeedsEnergy) {
92 double seedWeight = 1;
94 seedWeight =
energy.second / totalTargetSeedEnergy;
95 if (mapSeedMulticluster[
energy.first].size() == 0) {
98 mapSeedMulticluster[
energy.first].addConstituent(clu,
true, seedWeight);
103 multiclustersOut.reserve(mapSeedMulticluster.size());
104 for (
const auto& mclu : mapSeedMulticluster)
105 multiclustersOut.emplace_back(mclu.second);
107 return multiclustersOut;
111 const std::vector<std::pair<GlobalPoint, double>>& seedPositionsEnergy,
116 std::vector<l1t::HGCalCluster> rejected_clusters_vec;
117 std::vector<l1t::HGCalMulticluster> multiclusters_vec =
120 finalizeClusters(multiclusters_vec, rejected_clusters_vec, multiclusters, rejected_clusters, triggerGeometry);
124 const std::vector<l1t::HGCalCluster>& rejected_clusters_in,
128 for (
const auto& tc : rejected_clusters_in) {
132 for (
auto& multicluster : multiclusters_in) {
135 double sumPt = multicluster.sumPt();
138 multicluster.setP4(multiclusterP4);
144 multicluster.setHwQual(
id_->decision(multicluster));
146 multicluster.saveHOverE();
148 multiclusters_out.
push_back(0, multicluster);
150 for (
const auto& tc : multicluster.constituents()) {
151 rejected_clusters_out.
push_back(0, *(tc.second));