24 const std::pair<const HGCalTriggerGeometryBase* const, const edm::ParameterSet&>&
configuration)
override;
27 const std::vector<std::pair<GlobalPoint, double>>>& inputClustersAndSeeds,
28 std::pair<l1t::HGCalMulticlusterBxCollection&, l1t::HGCalClusterBxCollection&>&
29 outputMulticlustersAndRejectedClusters)
const override;
61 theConfiguration_(kMidRadius_,
62 conf.getParameter<double>(
"dR_multicluster"),
63 conf.existsAs<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientA")
64 ? conf.getParameter<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientA")
66 conf.existsAs<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientB")
67 ? conf.getParameter<
std::
vector<double>>(
"dR_multicluster_byLayer_coefficientB")
69 conf.getParameter<double>(
"minPt_multicluster")) {}
72 std::vector<l1thgcfirmware::HGCalCluster>& clusters_SA,
74 std::vector<l1thgcfirmware::HGCalSeed>& seeds_SA)
const {
76 clusters_SA.reserve(clustersPtrs.size());
77 unsigned int clusterIndex = 0;
78 for (
const auto& cluster : clustersPtrs) {
79 clusters_SA.emplace_back(cluster->centreProj().x(),
80 cluster->centreProj().y(),
81 cluster->centre().z(),
93 seeds_SA.reserve(
seeds.size());
95 seeds_SA.emplace_back(
seed.first.x(),
seed.first.y(),
seed.first.z(),
seed.second);
100 const std::vector<l1thgcfirmware::HGCalMulticluster>& multiclusters_out,
101 const std::vector<l1thgcfirmware::HGCalCluster>& rejected_clusters_out,
112 for (
const auto& rejected_cluster : rejected_clusters_out) {
113 rejected_clusters.
push_back(0, *clustersPtrs.at(rejected_cluster.index_cmssw()));
116 std::vector<l1t::HGCalMulticluster> multiclusters;
117 multiclusters.reserve(multiclusters_out.size());
118 for (
unsigned int imulticluster = 0; imulticluster < multiclusters_out.size(); ++imulticluster) {
119 bool firstConstituent =
true;
120 for (
const auto& constituent : multiclusters_out[imulticluster].constituents()) {
121 if (firstConstituent) {
122 multiclusters.emplace_back(clustersPtrs.at(constituent.index_cmssw()), 1.);
124 multiclusters.at(imulticluster).addConstituent(clustersPtrs.at(constituent.index_cmssw()), 1.);
126 firstConstituent =
false;
130 for (
const auto& multicluster : multiclusters) {
131 multiclustersBXCollection.
push_back(0, multicluster);
137 inputClustersAndSeeds,
138 std::pair<l1t::HGCalMulticlusterBxCollection&, l1t::HGCalClusterBxCollection&>&
139 outputMulticlustersAndRejectedClusters)
const {
142 convertCMSSWInputs(inputClustersAndSeeds.first, clusters_SA, inputClustersAndSeeds.second, seeds_SA);
146 clusterizeHisto(clusters_SA, seeds_SA, multiclusters_finalized_SA, rejected_clusters_finalized_SA);
149 rejected_clusters_finalized_SA,
150 inputClustersAndSeeds.first,
151 outputMulticlustersAndRejectedClusters.first,
152 outputMulticlustersAndRejectedClusters.second);
161 std::vector<l1thgcfirmware::HGCalCluster> rejected_clusters_vec_SA;
162 std::vector<l1thgcfirmware::HGCalMulticluster> multiclusters_vec_SA =
166 multiclusters_vec_SA, rejected_clusters_vec_SA, outputMulticlusters, outputRejectedClusters,
theConfiguration_);
170 const std::pair<const HGCalTriggerGeometryBase* const, const edm::ParameterSet&>&
configuration) {
std::vector< HGCalCluster > HGCalClusterSACollection
HGCalHistoClusteringImplSA theAlgo_
void convertAlgorithmOutputs(const l1thgcfirmware::HGCalMulticlusterSACollection &multiclusters_out, const l1thgcfirmware::HGCalClusterSACollection &rejected_clusters_out, const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtrs, l1t::HGCalMulticlusterBxCollection &multiclusters, l1t::HGCalClusterBxCollection &rejected_clusters) const
void setGeometry(const HGCalTriggerGeometryBase *const geom)
void process(const std::pair< const std::vector< edm::Ptr< l1t::HGCalCluster >>, const std::vector< std::pair< GlobalPoint, double >>> &inputClustersAndSeeds, std::pair< l1t::HGCalMulticlusterBxCollection &, l1t::HGCalClusterBxCollection &> &outputMulticlustersAndRejectedClusters) const override
void convertCMSSWInputs(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtrs, l1thgcfirmware::HGCalClusterSACollection &clusters_SA, const std::vector< std::pair< GlobalPoint, double >> &seeds, l1thgcfirmware::HGCalSeedSACollection &seeds_SA) const
~HGCalHistoClusteringWrapper() override
const std::vector< double > & dr_byLayer_coefficientA() const
HGCalTriggerTools triggerTools_
std::vector< HGCalSeed > HGCalSeedSACollection
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
const std::vector< double > & dr_byLayer_coefficientB() const
static constexpr double kMidRadius_
void configure(const std::pair< const HGCalTriggerGeometryBase *const, const edm::ParameterSet &> &configuration) override
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
l1thgcfirmware::ClusterAlgoConfig theConfiguration_
#define DEFINE_EDM_PLUGIN(factory, type, name)
HGCalHistoClusteringWrapper(const edm::ParameterSet &conf)
void clusterizeHisto(const l1thgcfirmware::HGCalClusterSACollection &inputClusters, const l1thgcfirmware::HGCalSeedSACollection &inputSeeds, l1thgcfirmware::HGCalMulticlusterSACollection &outputMulticlusters, l1thgcfirmware::HGCalClusterSACollection &outputRejectedClusters) const
std::vector< HGCalMulticluster > HGCalMulticlusterSACollection
void push_back(int bx, T object)