CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CPPFMaskReClusterizer.cc
Go to the documentation of this file.
1 
5 #include "CPPFCluster.h"
6 #include "CPPFClusterizer.h"
8 
10  CPPFClusterContainer& initClusters,
11  const CPPFRollMask& mask) const {
12  CPPFClusterContainer finClusters;
13  if (initClusters.empty())
14  return finClusters;
15 
16  CPPFCluster prev = *initClusters.begin();
17  for (auto cl = std::next(initClusters.begin()); cl != initClusters.end(); ++cl) {
18  // Merge this cluster if it is adjacent by 1 masked strip
19  // Note that the CPPFClusterContainer collection is sorted in DECREASING ORDER of strip #
20  // So the prev. cluster is placed after the current cluster (check the < operator of CPPFCluster carefully)
21  if ((prev.firstStrip() - cl->lastStrip()) == 2 and this->get(mask, cl->lastStrip() + 1) and prev.bx() == cl->bx()) {
22  CPPFCluster merged(cl->firstStrip(), prev.lastStrip(), cl->bx());
23  prev = merged;
24  } else {
25  finClusters.insert(prev);
26  prev = *cl;
27  }
28  }
29 
30  // Finalize by putting the last cluster to the collection
31  finClusters.insert(prev);
32 
33  return finClusters;
34 }
35 
36 bool CPPFMaskReClusterizer::get(const CPPFRollMask& mask, int strip) const { return mask.test(strip - 1); }
bool get(const CPPFRollMask &mask, int strip) const
tuple cl
Definition: haddnano.py:49
std::set< CPPFCluster > CPPFClusterContainer
std::bitset< maskCPPFSIZE > CPPFRollMask
int bx() const
Definition: CPPFCluster.cc:19
int firstStrip() const
Definition: CPPFCluster.cc:16
int lastStrip() const
Definition: CPPFCluster.cc:17
CPPFClusterContainer doAction(const RPCDetId &id, CPPFClusterContainer &initClusters, const CPPFRollMask &mask) const