CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Private Attributes
RPCHitCleaner Class Reference

#include <RPCHitCleaner.h>

Classes

struct  detId_Ext
 

Public Member Functions

RPCDigiCollection const & getRPCCollection ()
 Return Output RPCCollection. More...
 
 RPCHitCleaner (RPCDigiCollection const &inrpcDigis)
 
void run ()
 

Private Attributes

RPCDigiCollection const & m_inrpcDigis
 Input. More...
 
RPCDigiCollection m_outrpcDigis
 Output. More...
 

Detailed Description

Definition at line 17 of file RPCHitCleaner.h.

Constructor & Destructor Documentation

RPCHitCleaner::RPCHitCleaner ( RPCDigiCollection const &  inrpcDigis)

Definition at line 28 of file RPCHitCleaner.cc.

28 : m_inrpcDigis{inrpcDigis} {}
RPCDigiCollection const & m_inrpcDigis
Input.
Definition: RPCHitCleaner.h:38

Member Function Documentation

RPCDigiCollection const& RPCHitCleaner::getRPCCollection ( )
inline

Return Output RPCCollection.

Definition at line 24 of file RPCHitCleaner.h.

References m_outrpcDigis.

24 { return m_outrpcDigis; }
RPCDigiCollection m_outrpcDigis
Output.
Definition: RPCHitCleaner.h:40
void RPCHitCleaner::run ( )

Create cluster ids and store their size

hit belongs to cluster with clusterid

strip of i-1

for digicout

for chamber

Remove clusters with size>=4

Remove clusters with size>=4

keep only one bx per st/sec/wheel/layer

Count strips in a cluster

Keep clusters with size=2. Calculate and store the mean phi in RPCtoDTTranslator

for digicout

for chamber

Definition at line 51 of file RPCHitCleaner.cc.

References funct::abs(), m_inrpcDigis, m_outrpcDigis, RPCDetId::region(), DigiDM_cff::strips, and createJobs::tmp.

51  {
52  std::map<detId_Ext, int> hits;
53  vector<int> vcluster_size;
54  std::map<RPCDetId, int> bx_hits;
55 
56  int cluster_size = 0;
57  int cluster_id = -1;
58  int itr = 0;
59 
60  for (auto chamber = m_inrpcDigis.begin(); chamber != m_inrpcDigis.end(); ++chamber) {
61  RPCDetId detid = (*chamber).first;
62  int strip_n1 = -10000;
63  int bx_n1 = -10000;
64  if (detid.region() != 0)
65  continue; //Region = 0 Barrel
66  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
67  if (fabs(digi->bx()) > 3)
68  continue;
70  //if((digi->strip()-1!=strip_n1) || digi->bx()!=bx_n1){
71  if (abs(digi->strip() - strip_n1) != 1 || digi->bx() != bx_n1) {
72  if (itr != 0)
73  vcluster_size.push_back(cluster_size);
74  cluster_size = 0;
75  cluster_id++;
76  }
77  itr++;
78  cluster_size++;
80  detId_Ext tmp{detid, digi->bx(), digi->strip()};
81  hits[tmp] = cluster_id;
83  strip_n1 = digi->strip();
84  bx_n1 = digi->bx();
85  }
86  }
87  vcluster_size.push_back(cluster_size);
88 
89  for (auto chamber = m_inrpcDigis.begin(); chamber != m_inrpcDigis.end(); ++chamber) {
90  RPCDetId detid = (*chamber).first;
91  if (detid.region() != 0)
92  continue; //Region = 0 Barrel
93  BxToStrips strips;
94  int cluster_n1 = -10;
95  bx_hits[detid] = 10;
96  //Keep cluster with min bx in a roll
97  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
98  if (BxToStrips::outOfRange(digi->bx()))
99  continue;
100  //int cluster_id = hits[(detid.ring()+2)][(detid.station()-1)][(detid.sector()-1)][(detid.layer()-1)][(digi->bx()+2)][detid.roll()-1][digi->strip()];
101  detId_Ext tmp{detid, digi->bx(), digi->strip()};
102  int cluster_id = hits[tmp];
104  if (vcluster_size[cluster_id] >= 4)
105  continue;
106  if (bx_hits[detid] > digi->bx())
107  bx_hits[detid] = digi->bx();
108  }
109 
110  for (auto digi = (*chamber).second.first; digi != (*chamber).second.second; ++digi) {
111  if (fabs(digi->bx()) > 3)
112  continue;
113  detId_Ext tmp{detid, digi->bx(), digi->strip()};
114  int cluster_id = hits[tmp];
116  if (vcluster_size[cluster_id] >= 4)
117  continue;
119  if (digi->bx() != bx_hits[detid])
120  continue;
122  if (cluster_n1 != cluster_id) {
123  strips[digi->bx()] = {0};
124  }
125  strips[digi->bx()]++;
126  cluster_n1 = cluster_id;
127 
128  if (vcluster_size[cluster_id] == 3 && strips[digi->bx()] != 2)
129  continue;
131  RPCDigi digi_out(digi->strip(), digi->bx());
132  m_outrpcDigis.insertDigi(detid, digi_out);
133  }
134  }
135 }
tuple strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RPCDigiCollection m_outrpcDigis
Output.
Definition: RPCHitCleaner.h:40
tmp
align.sh
Definition: createJobs.py:716
RPCDigiCollection const & m_inrpcDigis
Input.
Definition: RPCHitCleaner.h:38
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

Member Data Documentation

RPCDigiCollection const& RPCHitCleaner::m_inrpcDigis
private

Input.

Definition at line 38 of file RPCHitCleaner.h.

Referenced by run().

RPCDigiCollection RPCHitCleaner::m_outrpcDigis
private

Output.

Definition at line 40 of file RPCHitCleaner.h.

Referenced by getRPCCollection(), and run().