CMS 3D CMS Logo

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 (const edm::EventSetup &c)
 

Private Attributes

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

Detailed Description

Definition at line 30 of file RPCHitCleaner.h.

Constructor & Destructor Documentation

RPCHitCleaner::RPCHitCleaner ( RPCDigiCollection const &  inrpcDigis)

Definition at line 29 of file RPCHitCleaner.cc.

References mps_check::array, constexpr, createfilelist::int, operator[](), or, and findQualityFiles::size.

29  :
30  m_inrpcDigis {inrpcDigis}
31 {
32 }
RPCDigiCollection const & m_inrpcDigis
Input.
Definition: RPCHitCleaner.h:51

Member Function Documentation

RPCDigiCollection const& RPCHitCleaner::getRPCCollection ( )
inline

Return Output RPCCollection.

Definition at line 37 of file RPCHitCleaner.h.

References m_outrpcDigis.

37 { return m_outrpcDigis;}
RPCDigiCollection m_outrpcDigis
Output.
Definition: RPCHitCleaner.h:53
void RPCHitCleaner::run ( const edm::EventSetup c)

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 58 of file RPCHitCleaner.cc.

References funct::abs(), relativeConstraints::chamber, hfClusterShapes_cfi::hits, m_inrpcDigis, m_outrpcDigis, RPCDetId::region(), RecoTauPiZeroBuilderPlugins_cfi::strips, and tmp.

58  {
59 
60  std::map<detId_Ext, int> hits;
61  vector<int> vcluster_size;
62  std::map<RPCDetId, int> bx_hits;
63 
64  int cluster_size = 0;
65  int cluster_id = -1;
66  int itr=0;
67 
68  for( auto chamber = m_inrpcDigis.begin(); chamber != m_inrpcDigis.end(); ++chamber ){
69  RPCDetId detid = (*chamber).first;
70  int strip_n1 = -10000;
71  int bx_n1 = -10000;
72  if(detid.region()!=0 ) continue; //Region = 0 Barrel
73  for( auto digi = (*chamber).second.first ; digi != (*chamber).second.second; ++digi ) {
74  if(fabs(digi->bx())>3 ) continue;
76  //if((digi->strip()-1!=strip_n1) || digi->bx()!=bx_n1){
77  if( abs(digi->strip()-strip_n1)!=1 || digi->bx()!=bx_n1){
78  if(itr!=0)vcluster_size.push_back(cluster_size);
79  cluster_size = 0;
80  cluster_id++;
81  }
82  itr++;
83  cluster_size++;
85  detId_Ext tmp{detid,digi->bx(),digi->strip()};
86  hits[tmp] = cluster_id;
88  strip_n1 = digi->strip();
89  bx_n1 = digi->bx();
90  }
91  }
92  vcluster_size.push_back(cluster_size);
93 
94  for( auto chamber = m_inrpcDigis.begin(); chamber != m_inrpcDigis.end(); ++chamber ){
95  RPCDetId detid = (*chamber).first;
96  if(detid.region()!=0 ) continue; //Region = 0 Barrel
97  BxToStrips strips;
98  int cluster_n1 = -10;
99  bx_hits[detid] = 10;
100  //Keep cluster with min bx in a roll
101  for( auto digi = (*chamber).second.first ; digi != (*chamber).second.second; ++digi ) {
102  if(BxToStrips::outOfRange(digi->bx()) ) continue;
103  //int cluster_id = hits[(detid.ring()+2)][(detid.station()-1)][(detid.sector()-1)][(detid.layer()-1)][(digi->bx()+2)][detid.roll()-1][digi->strip()];
104  detId_Ext tmp{detid,digi->bx(),digi->strip()};
105  int cluster_id = hits[tmp];
107  if( vcluster_size[cluster_id] >=4 ) continue;
108  if(bx_hits[detid]>digi->bx())
109  bx_hits[detid] = digi->bx();
110  }
111 
112  for( auto digi = (*chamber).second.first ; digi != (*chamber).second.second; ++digi ) {
113  if(fabs(digi->bx())>3 ) continue;
114  detId_Ext tmp{detid,digi->bx(),digi->strip()};
115  int cluster_id = hits[tmp];
117  if( vcluster_size[cluster_id] >=4 ) continue;
119  if(digi->bx()!=bx_hits[detid] ) continue;
121  if(cluster_n1 != cluster_id) {strips[digi->bx()] = {0}; }
122  strips[digi->bx()] ++ ;
123  cluster_n1 = cluster_id;
124 
125  if( vcluster_size[cluster_id] ==3 && strips[digi->bx()]!=2) continue;
127  RPCDigi digi_out(digi->strip(), digi->bx());
128  m_outrpcDigis.insertDigi(detid, digi_out);
129  }
130  }
131 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
RPCDigiCollection m_outrpcDigis
Output.
Definition: RPCHitCleaner.h:53
RPCDigiCollection const & m_inrpcDigis
Input.
Definition: RPCHitCleaner.h:51
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63

Member Data Documentation

RPCDigiCollection const& RPCHitCleaner::m_inrpcDigis
private

Input.

Definition at line 51 of file RPCHitCleaner.h.

Referenced by run().

RPCDigiCollection RPCHitCleaner::m_outrpcDigis
private

Output.

Definition at line 53 of file RPCHitCleaner.h.

Referenced by getRPCCollection(), and run().