7 : seedingAlgoType_(conf.getParameter<
string>(
"type_multicluster")),
8 nBinsRHisto_(conf.getParameter<unsigned>(
"nBins_R_histo_multicluster")),
9 nBinsPhiHisto_(conf.getParameter<unsigned>(
"nBins_Phi_histo_multicluster")),
10 binsSumsHisto_(conf.getParameter<
std::vector<unsigned>>(
"binSumsHisto")),
11 histoThreshold_(conf.getParameter<double>(
"threshold_histo_multicluster")),
12 neighbour_weights_(conf.getParameter<
std::vector<double>>(
"neighbour_weights")) {
26 <<
"\nMulticluster number of R-bins for the histo algorithm: " <<
nBinsRHisto_ 27 <<
"\nMulticluster number of Phi-bins for the histo algorithm: " <<
nBinsPhiHisto_ 28 <<
"\nMulticluster MIPT threshold for histo threshold algorithm: " <<
histoThreshold_ 33 <<
"Inconsistent nBins_R_histo_multicluster ( " <<
nBinsRHisto_ <<
" ) and binSumsHisto ( " 39 <<
"Inconsistent size of neighbour weights vector in HGCalMulticlustering ( " <<
neighbour_weights_.size()
48 for (
int z_side : {-1, 1}) {
51 histoClusters[{{z_side, bin_R, bin_phi}}] = 0;
56 for (
auto& clu : clustersPtrs) {
57 float ROverZ =
sqrt(
pow(clu->centreProj().x(), 2) +
pow(clu->centreProj().y(), 2));
68 const vector<unsigned>& binSums) {
71 for (
int z_side : {-1, 1}) {
73 int nBinsSide = (binSums[bin_R] - 1) / 2;
77 0.5 * (
pow(R2, 2) -
pow(R1, 2)) *
85 float content = histoClusters.at({{z_side, bin_R, bin_phi}});
87 for (
int bin_phi2 = 1; bin_phi2 <= nBinsSide; bin_phi2++) {
88 int binToSumLeft = bin_phi - bin_phi2;
91 int binToSumRight = bin_phi + bin_phi2;
95 content += histoClusters.at({{z_side, bin_R, binToSumLeft}}) /
pow(2, bin_phi2);
96 content += histoClusters.at({{z_side, bin_R, binToSumRight}}) /
pow(2, bin_phi2);
99 histoSumPhiClusters[{{z_side, bin_R, bin_phi}}] = content /
area;
104 return histoSumPhiClusters;
110 for (
int z_side : {-1, 1}) {
117 float content = histoClusters.at({{z_side, bin_R, bin_phi}});
118 float contentDown = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, bin_phi}}) : 0;
119 float contentUp = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, bin_phi}}) : 0;
121 histoSumRPhiClusters[{{z_side, bin_R, bin_phi}}] = (
content + 0.5 * contentDown + 0.5 * contentUp) / weight;
126 return histoSumRPhiClusters;
130 std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
132 for (
int z_side : {-1, 1}) {
135 float MIPT_seed = histoClusters.at({{z_side, bin_R, bin_phi}});
140 float MIPT_S = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, bin_phi}}) : 0;
141 float MIPT_N = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, bin_phi}}) : 0;
143 int binLeft = bin_phi - 1;
146 int binRight = bin_phi + 1;
150 float MIPT_W = histoClusters.at({{z_side, bin_R, binLeft}});
151 float MIPT_E = histoClusters.at({{z_side, bin_R, binRight}});
152 float MIPT_NW = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binLeft}}) : 0;
153 float MIPT_NE = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binRight}}) : 0;
154 float MIPT_SW = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binLeft}}) : 0;
155 float MIPT_SE = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binRight}}) : 0;
157 isMax &= MIPT_seed >= MIPT_S && MIPT_seed > MIPT_N && MIPT_seed >= MIPT_E && MIPT_seed >= MIPT_SE &&
158 MIPT_seed >= MIPT_NE && MIPT_seed > MIPT_W && MIPT_seed > MIPT_SW && MIPT_seed > MIPT_NW;
163 float x_seed = ROverZ_seed *
cos(phi_seed);
164 float y_seed = ROverZ_seed *
sin(phi_seed);
165 seedPositionsEnergy.emplace_back(
GlobalPoint(x_seed, y_seed, z_side), MIPT_seed);
171 return seedPositionsEnergy;
176 std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
178 for (
int z_side : {-1, 1}) {
181 float MIPT_seed = histoClusters.at({{z_side, bin_R, bin_phi}});
182 float MIPT_S = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, bin_phi}}) : 0;
183 float MIPT_N = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, bin_phi}}) : 0;
185 int binLeft = bin_phi - 1;
188 int binRight = bin_phi + 1;
192 float MIPT_W = histoClusters.at({{z_side, bin_R, binLeft}});
193 float MIPT_E = histoClusters.at({{z_side, bin_R, binRight}});
195 float MIPT_NW = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binLeft}}) : 0;
196 float MIPT_NE = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binRight}}) : 0;
197 float MIPT_SW = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binLeft}}) : 0;
198 float MIPT_SE = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binRight}}) : 0;
210 float x_seed = ROverZ_seed *
cos(phi_seed);
211 float y_seed = ROverZ_seed *
sin(phi_seed);
212 seedPositionsEnergy.emplace_back(
GlobalPoint(x_seed, y_seed, z_side), MIPT_seed);
218 return seedPositionsEnergy;
223 std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
225 for (
int z_side : {-1, 1}) {
228 float MIPT_seed = histoClusters.at({{z_side, bin_R, bin_phi}});
234 float x_seed = ROverZ_seed *
cos(phi_seed);
235 float y_seed = ROverZ_seed *
sin(phi_seed);
236 seedPositionsEnergy.emplace_back(
GlobalPoint(x_seed, y_seed, z_side), MIPT_seed);
242 return seedPositionsEnergy;
247 std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
249 std::map<std::tuple<int, int, int>,
bool> primarySeedPositions;
250 std::map<std::tuple<int, int, int>,
bool> secondarySeedPositions;
251 std::map<std::tuple<int, int, int>,
bool> vetoPositions;
254 for (
int z_side : {-1, 1}) {
257 float MIPT_seed = histoClusters.at({{z_side, bin_R, bin_phi}});
263 float MIPT_S = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, bin_phi}}) : 0;
264 float MIPT_N = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, bin_phi}}) : 0;
266 int binLeft = bin_phi - 1;
269 int binRight = bin_phi + 1;
273 float MIPT_W = histoClusters.at({{z_side, bin_R, binLeft}});
274 float MIPT_E = histoClusters.at({{z_side, bin_R, binRight}});
275 float MIPT_NW = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binLeft}}) : 0;
276 float MIPT_NE = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binRight}}) : 0;
277 float MIPT_SW = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binLeft}}) : 0;
278 float MIPT_SE = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binRight}}) : 0;
280 isMax &= MIPT_seed >= MIPT_S && MIPT_seed > MIPT_N && MIPT_seed >= MIPT_E && MIPT_seed >= MIPT_SE &&
281 MIPT_seed >= MIPT_NE && MIPT_seed > MIPT_W && MIPT_seed > MIPT_SW && MIPT_seed > MIPT_NW;
286 float x_seed = ROverZ_seed *
cos(phi_seed);
287 float y_seed = ROverZ_seed *
sin(phi_seed);
289 seedPositionsEnergy.emplace_back(
GlobalPoint(x_seed, y_seed, z_side), MIPT_seed);
290 primarySeedPositions[std::make_tuple(bin_R, bin_phi, z_side)] =
true;
292 vetoPositions[std::make_tuple(bin_R, binLeft, z_side)] =
true;
293 vetoPositions[std::make_tuple(bin_R, binRight, z_side)] =
true;
295 vetoPositions[std::make_tuple(bin_R - 1, bin_phi, z_side)] =
true;
296 vetoPositions[std::make_tuple(bin_R - 1, binRight, z_side)] =
true;
297 vetoPositions[std::make_tuple(bin_R - 1, binLeft, z_side)] =
true;
300 vetoPositions[std::make_tuple(bin_R + 1, bin_phi, z_side)] =
true;
301 vetoPositions[std::make_tuple(bin_R + 1, binRight, z_side)] =
true;
302 vetoPositions[std::make_tuple(bin_R + 1, binLeft, z_side)] =
true;
311 for (
int z_side : {-1, 1}) {
315 if (primarySeedPositions[std::make_tuple(bin_R, bin_phi, z_side)] ||
316 vetoPositions[std::make_tuple(bin_R, bin_phi, z_side)])
319 float MIPT_seed = histoClusters.at({{z_side, bin_R, bin_phi}});
322 float MIPT_S = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, bin_phi}}) : 0;
323 float MIPT_N = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, bin_phi}}) : 0;
325 int binLeft = bin_phi - 1;
328 int binRight = bin_phi + 1;
332 float MIPT_W = histoClusters.at({{z_side, bin_R, binLeft}});
333 float MIPT_E = histoClusters.at({{z_side, bin_R, binRight}});
334 float MIPT_NW = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binLeft}}) : 0;
335 float MIPT_NE = bin_R > 0 ? histoClusters.at({{z_side, bin_R - 1, binRight}}) : 0;
336 float MIPT_SW = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binLeft}}) : 0;
337 float MIPT_SE = bin_R < (
int(
nBinsRHisto_) - 1) ? histoClusters.at({{z_side, bin_R + 1, binRight}}) : 0;
339 isMax &= (vetoPositions[std::make_tuple(bin_R + 1, bin_phi, z_side)]
or MIPT_seed >= MIPT_S) &&
340 (vetoPositions[std::make_tuple(bin_R - 1, bin_phi, z_side)]
or MIPT_seed > MIPT_N) &&
341 (vetoPositions[std::make_tuple(bin_R, binRight, z_side)]
or MIPT_seed >= MIPT_E) &&
342 (vetoPositions[std::make_tuple(bin_R + 1, binRight, z_side)]
or MIPT_seed >= MIPT_SE) &&
343 (vetoPositions[std::make_tuple(bin_R - 1, binRight, z_side)]
or MIPT_seed >= MIPT_NE) &&
344 (vetoPositions[std::make_tuple(bin_R, binLeft, z_side)]
or MIPT_seed > MIPT_W) &&
345 (vetoPositions[std::make_tuple(bin_R + 1, binLeft, z_side)]
or MIPT_seed > MIPT_SW) &&
346 (vetoPositions[std::make_tuple(bin_R - 1, binLeft, z_side)]
or MIPT_seed > MIPT_NW);
351 float x_seed = ROverZ_seed *
cos(phi_seed);
352 float y_seed = ROverZ_seed *
sin(phi_seed);
353 seedPositionsEnergy.emplace_back(
GlobalPoint(x_seed, y_seed, z_side), MIPT_seed);
354 secondarySeedPositions[std::make_tuple(bin_R, bin_phi, z_side)] =
true;
360 return seedPositionsEnergy;
364 std::vector<std::pair<GlobalPoint, double>>& seedPositionsEnergy) {
std::vector< std::pair< GlobalPoint, double > > computeInterpolatedMaxSeeds(const Histogram &histoClusters)
std::vector< unsigned > binsSumsHisto_
constexpr T reduceRange(T x)
Histogram fillSmoothPhiHistoClusters(const Histogram &histoClusters, const vector< unsigned > &binSums)
static unsigned neighbour_weights_size_
Histogram fillSmoothRPhiHistoClusters(const Histogram &histoClusters)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
std::map< std::array< int, 3 >, float > Histogram
static double kROverZMax_
std::vector< std::pair< GlobalPoint, double > > computeMaxSeeds(const Histogram &histoClusters)
HGCalTriggerTools triggerTools_
std::vector< std::pair< GlobalPoint, double > > computeSecondaryMaxSeeds(const Histogram &histoClusters)
void findHistoSeeds(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtr, std::vector< std::pair< GlobalPoint, double >> &seedPositionsEnergy)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Cos< T >::type cos(const T &t)
std::vector< std::pair< GlobalPoint, double > > computeThresholdSeeds(const Histogram &histoClusters)
static double kROverZMin_
std::vector< double > neighbour_weights_
Histogram fillHistoClusters(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtrs)
std::string seedingAlgoType_
Power< A, B >::type pow(const A &a, const B &b)
HGCalHistoSeedingImpl(const edm::ParameterSet &conf)