CMS 3D CMS Logo

GEMClusterizer.cc
Go to the documentation of this file.
2 
4  GEMClusterContainer initialCluster, finalCluster;
5  // Return empty container for null input
6  if (std::distance(digiRange.second, digiRange.first) == 0)
7  return finalCluster;
8 
9  // Start from single digi recHits
10  for (auto digi = digiRange.first; digi != digiRange.second; ++digi) {
11  if (mask.test(digi->strip()))
12  continue;
13  GEMCluster cl(digi->strip(), digi->strip(), digi->bx());
14  initialCluster.insert(cl);
15  }
16  if (initialCluster.empty())
17  return finalCluster; // Confirm the collection is valid
18 
19  // Start from the first initial cluster
20  GEMCluster prev = *initialCluster.begin();
21 
22  // Loop over the remaining digis
23  // Note that the last one remains as open in this loop
24  for (auto cl = std::next(initialCluster.begin()); cl != initialCluster.end(); ++cl) {
25  if (prev.isAdjacent(*cl)) {
26  // Merged digi to the previous one
27  prev.merge(*cl);
28  } else {
29  // Close the previous cluster and start new cluster
30  finalCluster.insert(prev);
31  prev = *cl;
32  }
33  }
34 
35  // Finalize by adding the last cluster
36  finalCluster.insert(prev);
37 
38  return finalCluster;
39 }
std::set< GEMCluster > GEMClusterContainer
constexpr uint32_t mask
Definition: gpuClustering.h:26
bool isAdjacent(const GEMCluster &cl) const
Definition: GEMCluster.cc:21
void merge(const GEMCluster &cl)
Definition: GEMCluster.cc:25
std::bitset< maskSIZE > EtaPartitionMask
std::pair< const_iterator, const_iterator > Range
GEMClusterContainer doAction(const GEMDigiCollection::Range &digiRange, const EtaPartitionMask &mask)