17 std::vector<RpcCluster> allClusters;
19 std::sort(digis.begin(), digis.end(), [](
const RPCDigi&
a,
const RPCDigi&
b) {
return a.
strip() <
b.strip(); });
21 typedef std::pair<unsigned int, unsigned int> Cluster;
23 for (
auto& digi : digis) {
24 if (allClusters.empty()) {
25 allClusters.emplace_back(digi.strip(), digi.strip());
26 allClusters.back().bx = digi.bx();
28 }
else if (digi.strip() - allClusters.back().lastStrip == 1) {
29 allClusters.back().lastStrip = digi.strip();
31 }
else if (digi.strip() - allClusters.back().lastStrip > 1) {
32 allClusters.emplace_back(digi.strip(), digi.strip());
33 allClusters.back().bx = digi.bx();
38 std::vector<RpcCluster> filteredClusters;
42 return filteredClusters;
46 LogTrace(
"l1tOmtfEventPrint") << __FUNCTION__ <<
":" << __LINE__ <<
" allClusters.size() >= maxClusterCnt "
48 for (
auto& cluster : allClusters)
50 << __FUNCTION__ <<
":" << __LINE__ <<
" roll " << roll <<
" cluster: firstStrip " << cluster.firstStrip
51 <<
" lastStrip " << cluster.lastStrip <<
" halfStrip " << cluster.halfStrip() << std::endl;
57 for (
auto& cluster : allClusters) {
59 filteredClusters.emplace_back(cluster);
65 return filteredClusters;
Log< level::Info, true > LogVerbatim
virtual int convertTiming(double timing) const
virtual ~RpcClusterization()
bool dropAllClustersIfMoreThanMax
virtual std::vector< RpcCluster > getClusters(const RPCDetId &roll, std::vector< RPCDigi > &digis) const
N.B. digis are sorted inside the function.
unsigned int maxClusterCnt
unsigned int maxClusterSize