CMS 3D CMS Logo

RPCMaskReClusterizer.cc
Go to the documentation of this file.
1 
5 #include "RPCCluster.h"
6 #include "RPCClusterizer.h"
7 #include "RPCMaskReClusterizer.h"
8 
10  RPCClusterContainer& initClusters,
11  const RollMask& mask) const {
12  RPCClusterContainer finClusters;
13  if (initClusters.empty())
14  return finClusters;
15 
16  RPCCluster 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 RPCClusterContainer collection is sorted in DECREASING ORDER of strip #
20  // So the prev. cluster is placed after the current cluster (check the < operator of RPCCluster carefully)
21  if ((prev.firstStrip() - cl->lastStrip()) == 2 and this->get(mask, cl->lastStrip() + 1) and prev.bx() == cl->bx()) {
22  RPCCluster 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 RPCMaskReClusterizer::get(const RollMask& mask, int strip) const { return mask.test(strip - 1); }
RPCCluster::firstStrip
int firstStrip() const
Definition: RPCCluster.cc:16
RPCClusterContainer
std::set< RPCCluster > RPCClusterContainer
Definition: RPCClusterContainer.h:4
RollMask
std::bitset< maskSIZE > RollMask
Definition: RPCRollMask.h:7
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
RPCDetId
Definition: RPCDetId.h:16
RPCMaskReClusterizer.h
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
RPCCluster::bx
int bx() const
Definition: RPCCluster.cc:19
RPCClusterizer.h
RPCCluster::lastStrip
int lastStrip() const
Definition: RPCCluster.cc:17
RPCCluster
Definition: RPCCluster.h:4
RPCMaskReClusterizer::get
bool get(const RollMask &mask, int strip) const
Definition: RPCMaskReClusterizer.cc:36
RPCCluster.h
RPCMaskReClusterizer::doAction
RPCClusterContainer doAction(const RPCDetId &id, RPCClusterContainer &initClusters, const RollMask &mask) const
Definition: RPCMaskReClusterizer.cc:9
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31