82 std::vector<int>::iterator wheel;
96 std::vector<int>::iterator wheel;
124 m_digiItr = (*m_detUnitItr ).second.first;
125 int bx = (*m_digiItr).bx();
128 if (
m_debug )
std::cout <<
"RBCProcessRPCDigis> found a bx bigger than max allowed: "
133 const RPCDetId &
id = (*m_detUnitItr).first;
134 const RPCRoll * roll =
dynamic_cast<const RPCRoll*
>( (*m_ptr_rpcGeom)->roll(
id));
137 if(
m_debug )
std::cout <<
"RBCProcessRPCDigis: roll is forward" << std::endl;
141 int wheel = roll->
id().
ring();
143 int layer = roll->
id().
layer();
146 int rollid =
id.roll();
148 int digipos = (station * 100) + (layer * 10) + rollid;
150 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 1 )
151 digipos = 30000 + digipos;
152 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 2 )
153 digipos = 30000 + digipos;
155 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 2 )
156 digipos = 20000 + digipos;
157 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 1 )
158 digipos = 20000 + digipos;
161 <<
"Wheel: " << wheel <<
'\t'
162 <<
"Sector: " << sector <<
'\t'
163 <<
"Station: " << station <<
'\t'
164 <<
"Layer: " << layer <<
'\t'
165 <<
"B-Layer: " << blayer <<
'\t'
166 <<
"Roll id: " << rollid <<
'\t'
167 <<
"Digi at: " << digipos <<
'\n';
170 std::map<int,std::vector<RPCData*> >::iterator itr;
175 std::vector<RPCData*> wheelData;
178 this->
m_block = wheelData[ (wheel + 2) ];
182 this->
m_block = (*itr).second[ (wheel + 2) ];
186 std::map<int, l1trigger::Counters* >::iterator wheelCounter;
190 (*wheelCounter).second->incrementSector( sector );
208 <<
" ndigis " << ndigis << std::endl;
210 std::map<int, l1trigger::Counters* >::iterator wheelCounter;
212 (*wheelCounter).second->evalCounters();
213 if (
m_debug ) (*wheelCounter).second->printSummary();
216 if (
m_data.size() <= 0 )
return 0;
225 std::map<int,std::vector<RPCData*> >::iterator itr1;
227 std::vector<RPCData*>::iterator itr2;
228 for(itr2 = (*itr1).second.begin(); itr2 != (*itr1).second.end();++itr2 )
229 if ( (*itr2) )
delete *itr2;
230 (*itr1).second.clear();
245 for(
int i=0;
i < maxWheels; ++
i) {
251 for(
int j=0;
j < maxRbcBrds; ++
j) {
274 std::vector<RPCData*>::iterator itr;
275 std::map<int, std::vector<RPCData*> >::iterator itr2;
284 if ( bx != 0 ) bxsign = ( bx /
abs(bx) );
287 for(itr = (*itr2).second.begin(); itr != (*itr2).second.end(); ++itr) {
289 for(
int k=0;
k < 6; ++
k) {
291 code = bxsign * ( 1000000*
abs(bx)
292 + 10000*(*itr)->wheelIdx()
293 + 100 *(*itr)->m_sec1[
k]
294 + 1 *(*itr)->m_sec2[
k] );
296 RBCInput * signal = & (*itr)->m_orsignals[
k];
299 if ( signal->hasData )
300 m_data.insert( std::make_pair( code , signal) );
319 if ( _station < 3 ) {
320 blayer = ( (_station-1) * 2 ) + _layer;
323 blayer = _station + 2;
339 std::vector<int>::const_iterator itr;
347 for ( pos = 0; pos < 6; ++
pos ) {
348 if (this->
m_block->
m_sec1[pos] == sector || this->m_block->m_sec2[pos] == sector )
369 signals.set( bitpos , 1 );
376 std::cout <<
"RBCProcessRPCDigis> Output starts" << std::endl;
378 std::map<int,RBCInput*>::const_iterator itr;
379 for( itr =
m_data.begin(); itr !=
m_data.end(); ++itr) {
380 std::cout << (*itr).first <<
'\t' << (* (*itr).second ) <<
'\n';
383 std::cout <<
"RBCProcessRPCDigis> Output ends" << std::endl;
void setInputBit(std::bitset< 15 > &, int)
RPCDigiCollection::DigiRangeIterator m_detUnitItr
void initialize(std::vector< RPCData * > &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< int > m_wheelid
std::map< int, l1trigger::Counters * > m_digiCounters
virtual ~RBCProcessRPCDigis()
Destructor.
std::vector< int > m_sec1id
const edm::ESHandle< RPCGeometry > * m_ptr_rpcGeom
std::vector< int > m_sec2id
RBCProcessRPCDigis()
Standard constructor.
const edm::Handle< RPCDigiCollection > * m_ptr_digiColl
RPCDigiCollection::const_iterator m_digiItr
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
std::map< int, int > m_layermap
int getBarrelLayer(const int &, const int &)
std::map< int, std::vector< RPCData * > > m_vecDataperBx
std::map< int, RBCInput * > m_data