81 std::vector<int>::iterator
wheel;
95 std::vector<int>::iterator
wheel;
123 m_digiItr = (*m_detUnitItr ).second.first;
124 int bx = (*m_digiItr).bx();
127 if (
m_debug )
std::cout <<
"RBCProcessRPCDigis> found a bx bigger than max allowed: " 132 const RPCDetId &
id = (*m_detUnitItr).first;
133 const RPCRoll * roll =
dynamic_cast<const RPCRoll*
>( (*m_ptr_rpcGeom)->roll(
id));
136 if(
m_debug )
std::cout <<
"RBCProcessRPCDigis: roll is forward" << std::endl;
142 int layer = roll->
id().
layer();
145 int rollid =
id.roll();
147 int digipos = (station * 100) + (layer * 10) + rollid;
149 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 1 )
150 digipos = 30000 + digipos;
151 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 2 )
152 digipos = 30000 + digipos;
154 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 2 )
155 digipos = 20000 + digipos;
156 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 1 )
157 digipos = 20000 + digipos;
160 <<
"Wheel: " << wheel <<
'\t' 161 <<
"Sector: " << sector <<
'\t' 162 <<
"Station: " << station <<
'\t' 163 <<
"Layer: " << layer <<
'\t' 164 <<
"B-Layer: " << blayer <<
'\t' 165 <<
"Roll id: " << rollid <<
'\t' 166 <<
"Digi at: " << digipos <<
'\n';
169 std::map<int,std::vector<RPCData*> >::iterator itr;
174 std::vector<RPCData*> wheelData;
177 this->
m_block = wheelData[ (wheel + 2) ];
181 this->
m_block = (*itr).second[ (wheel + 2) ];
185 std::map<int, l1trigger::Counters* >::iterator wheelCounter;
189 (*wheelCounter).second->incrementSector( sector );
207 <<
" ndigis " << ndigis << std::endl;
209 std::map<int, l1trigger::Counters* >::iterator wheelCounter;
211 (*wheelCounter).second->evalCounters();
212 if (
m_debug ) (*wheelCounter).second->printSummary();
215 if (
m_data.size() <= 0 )
return 0;
224 std::map<int,std::vector<RPCData*> >::iterator itr1;
226 std::vector<RPCData*>::iterator itr2;
227 for(itr2 = (*itr1).second.begin(); itr2 != (*itr1).second.end();++itr2 )
228 if ( (*itr2) )
delete *itr2;
229 (*itr1).second.clear();
244 for(
int i=0;
i < maxWheels; ++
i) {
250 for(
int j=0; j < maxRbcBrds; ++j) {
273 std::vector<RPCData*>::iterator itr;
274 std::map<int, std::vector<RPCData*> >::iterator itr2;
283 if ( bx != 0 ) bxsign = ( bx /
abs(bx) );
286 for(itr = (*itr2).second.begin(); itr != (*itr2).second.end(); ++itr) {
288 for(
int k=0;
k < 6; ++
k) {
290 code = bxsign * ( 1000000*
abs(bx)
291 + 10000*(*itr)->wheelIdx()
292 + 100 *(*itr)->m_sec1[
k]
293 + 1 *(*itr)->m_sec2[
k] );
295 RBCInput * signal = & (*itr)->m_orsignals[
k];
298 if ( signal->hasData )
299 m_data.insert( std::make_pair( code , signal) );
318 if ( _station < 3 ) {
319 blayer = ( (_station-1) * 2 ) + _layer;
322 blayer = _station + 2;
338 std::vector<int>::const_iterator itr;
346 for ( pos = 0; pos < 6; ++pos ) {
347 if (this->
m_block->
m_sec1[pos] == sector || this->m_block->m_sec2[pos] == sector )
368 signals.set( bitpos , 1 );
375 std::cout <<
"RBCProcessRPCDigis> Output starts" << std::endl;
377 std::map<int,RBCInput*>::const_iterator itr;
378 for( itr =
m_data.begin(); itr !=
m_data.end(); ++itr) {
379 std::cout << (*itr).first <<
'\t' << (* (*itr).second ) <<
'\n';
382 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
Abs< T >::type abs(const T &t)
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 &)
TriggerPrimitive::RPCData RPCData
std::map< int, std::vector< RPCData * > > m_vecDataperBx
std::map< int, RBCInput * > m_data