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 getRPCCollection ()
 Return Output RPCCollection. More...
 
 RPCHitCleaner (RPCDigiCollection inrpcDigis)
 
void run (const edm::EventSetup &c)
 
 ~RPCHitCleaner ()
 

Private Attributes

RPCDigiCollection 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  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 }
RPCDigiCollection m_inrpcDigis
Input.
Definition: RPCHitCleaner.h:52
RPCHitCleaner::~RPCHitCleaner ( )
inline

Definition at line 33 of file RPCHitCleaner.h.

References EnergyCorrector::c, and run().

33 {};

Member Function Documentation

RPCDigiCollection RPCHitCleaner::getRPCCollection ( )
inline

Return Output RPCCollection.

Definition at line 38 of file RPCHitCleaner.h.

References m_outrpcDigis.

38 { return m_outrpcDigis;}
RPCDigiCollection m_outrpcDigis
Output.
Definition: RPCHitCleaner.h:54
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 57 of file RPCHitCleaner.cc.

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

Referenced by ~RPCHitCleaner().

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

Member Data Documentation

RPCDigiCollection RPCHitCleaner::m_inrpcDigis
private

Input.

Definition at line 52 of file RPCHitCleaner.h.

RPCDigiCollection RPCHitCleaner::m_outrpcDigis
private

Output.

Definition at line 54 of file RPCHitCleaner.h.

Referenced by getRPCCollection().