96 std::vector<GEMInternalCluster>
output;
100 if (
cl.bx() ==
bx and
cl.isValid()) {
109 std::vector<GEMInternalCluster>
output;
122 std::vector<GEMInternalCluster>
output;
126 if (
cl.bx() ==
bx and
cl.isCoincidence()) {
136 for (
auto det_range = in_clusters->begin(); det_range != in_clusters->end(); ++det_range) {
137 const GEMDetId&
id = (*det_range).first;
155 auto co_clusters_range = in_clusters->get(co_id);
158 if (co_clusters_range.first == co_clusters_range.second)
162 const auto& pads_range = (*det_range).second;
163 for (
auto p = pads_range.first;
p != pads_range.second; ++
p) {
174 for (
auto co_p = co_clusters_range.first; co_p != co_clusters_range.second; ++co_p) {
176 if (!co_p->isValid())
188 int cl2_min = co_p->pads().front();
189 int cl2_max = co_p->pads().back();
192 const bool condition1(cl1_min <= cl2_min and cl1_max >= cl2_min);
193 const bool condition2(cl1_min <= cl2_max and cl1_max >= cl2_max);
194 const bool match(condition1
or condition2);
209 const std::vector<GEMInternalCluster>& coincidences =
clusters_;
212 for (
auto det_range = in_clusters->begin(); det_range != in_clusters->end(); ++det_range) {
213 const GEMDetId&
id = (*det_range).first;
223 const auto& clusters_range = (*det_range).second;
224 for (
auto p = clusters_range.first;
p != clusters_range.second; ++
p) {
237 return q.has_cluster(*
p);
253 if (cluster.cl1().isValid()) {
255 const int layer1_first_pad = cluster.layer1_pad();
256 const int layer1_last_pad = layer1_first_pad + cluster.layer1_size() - 1;
259 int layer1_pad_to_first_hs = -1;
260 int layer1_pad_to_last_hs = -1;
261 int layer1_pad_to_first_hs_me1a = -1;
262 int layer1_pad_to_last_hs_me1a = -1;
293 int layer1_middle_hs = 0.5 * (layer1_pad_to_first_hs + layer1_pad_to_last_hs);
294 int layer1_middle_hs_me1a = 0.5 * (layer1_pad_to_first_hs_me1a + layer1_pad_to_last_hs_me1a);
297 cluster.set_layer1_first_hs(layer1_pad_to_first_hs);
298 cluster.set_layer1_last_hs(layer1_pad_to_last_hs);
299 cluster.set_layer1_middle_hs(layer1_middle_hs);
302 cluster.set_layer1_first_hs_me1a(layer1_pad_to_first_hs_me1a);
303 cluster.set_layer1_last_hs_me1a(layer1_pad_to_last_hs_me1a);
304 cluster.set_layer1_middle_hs_me1a(layer1_middle_hs_me1a);
307 int layer1_pad_to_first_es = -1;
308 int layer1_pad_to_last_es = -1;
310 int layer1_pad_to_first_es_me1a = -1;
311 int layer1_pad_to_last_es_me1a = -1;
342 int layer1_middle_es = 0.5 * (layer1_pad_to_first_es + layer1_pad_to_last_es);
343 int layer1_middle_es_me1a = 0.5 * (layer1_pad_to_first_es_me1a + layer1_pad_to_last_es_me1a);
345 cluster.set_layer1_first_es(layer1_pad_to_first_es);
346 cluster.set_layer1_last_es(layer1_pad_to_last_es);
347 cluster.set_layer1_middle_es(layer1_middle_es);
350 cluster.set_layer1_first_es_me1a(layer1_pad_to_first_es_me1a);
351 cluster.set_layer1_last_es_me1a(layer1_pad_to_last_es_me1a);
352 cluster.set_layer1_middle_es_me1a(layer1_middle_es_me1a);
357 const int roll = cluster.roll() - 1;
359 int roll_l1_to_min_wg = -1;
360 int roll_l1_to_max_wg = -1;
385 cluster.set_layer1_min_wg(roll_l1_to_min_wg);
386 cluster.set_layer1_max_wg(roll_l1_to_max_wg);
389 if (cluster.cl2().isValid()) {
391 const int layer2_first_pad = cluster.layer2_pad();
392 const int layer2_last_pad = layer2_first_pad + cluster.layer2_size() - 1;
395 int layer2_pad_to_first_hs = -1;
396 int layer2_pad_to_last_hs = -1;
397 int layer2_pad_to_first_hs_me1a = -1;
398 int layer2_pad_to_last_hs_me1a = -1;
428 int layer2_middle_hs = 0.5 * (layer2_pad_to_first_hs + layer2_pad_to_last_hs);
429 int layer2_middle_hs_me1a = 0.5 * (layer2_pad_to_first_hs_me1a + layer2_pad_to_last_hs_me1a);
432 cluster.set_layer2_first_hs(layer2_pad_to_first_hs);
433 cluster.set_layer2_last_hs(layer2_pad_to_last_hs);
434 cluster.set_layer2_middle_hs(layer2_middle_hs);
437 cluster.set_layer2_first_hs_me1a(layer2_pad_to_first_hs_me1a);
438 cluster.set_layer2_last_hs_me1a(layer2_pad_to_last_hs_me1a);
439 cluster.set_layer2_middle_hs_me1a(layer2_middle_hs_me1a);
442 int layer2_pad_to_first_es = -1;
443 int layer2_pad_to_last_es = -1;
445 int layer2_pad_to_first_es_me1a = -1;
446 int layer2_pad_to_last_es_me1a = -1;
477 int layer2_middle_es = 0.5 * (layer2_pad_to_first_es + layer2_pad_to_last_es);
478 int layer2_middle_es_me1a = 0.5 * (layer2_pad_to_first_es_me1a + layer2_pad_to_last_es_me1a);
480 cluster.set_layer2_first_es(layer2_pad_to_first_es);
481 cluster.set_layer2_last_es(layer2_pad_to_last_es);
482 cluster.set_layer2_middle_es(layer2_middle_es);
485 cluster.set_layer2_first_es_me1a(layer2_pad_to_first_es_me1a);
486 cluster.set_layer2_last_es_me1a(layer2_pad_to_last_es_me1a);
487 cluster.set_layer2_middle_es_me1a(layer2_middle_es_me1a);
493 const int roll = cluster.roll() - 1;
495 int roll_l2_to_min_wg = -1;
496 int roll_l2_to_max_wg = -1;
521 cluster.set_layer2_min_wg(roll_l2_to_min_wg);
522 cluster.set_layer2_max_wg(roll_l2_to_max_wg);
527 std::vector<GEMCoPadDigi>
output;
532 if (!cluster.isCoincidence())
536 output.emplace_back(cluster.roll(), cluster.mid1(), cluster.mid2());