114 int bx = (*m_digiItr).getBx();
117 if (
m_debug )
std::cout <<
"RBCProcessRPCSimDigis> found a bx bigger than max allowed: "
124 const RPCRoll * roll =
dynamic_cast<const RPCRoll*
>( (*m_ptr_rpcGeom)->roll(
id));
127 if(
m_debug )
std::cout <<
"RBCProcessRPCSimDigis: roll is forward" << std::endl;
131 int wheel = roll->
id().
ring();
133 int layer = roll->
id().
layer();
136 int rollid =
id.roll();
138 int digipos = (station * 100) + (layer * 10) + rollid;
140 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 1 )
141 digipos = 30000 + digipos;
142 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 2 )
143 digipos = 30000 + digipos;
145 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 2 )
146 digipos = 20000 + digipos;
147 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 1 )
148 digipos = 20000 + digipos;
151 <<
"Wheel: " << wheel <<
'\t'
152 <<
"Sector: " << sector <<
'\t'
153 <<
"Station: " << station <<
'\t'
154 <<
"Layer: " << layer <<
'\t'
155 <<
"B-Layer: " << blayer <<
'\t'
156 <<
"Roll id: " << rollid <<
'\t'
157 <<
"Digi at: " << digipos <<
'\n';
160 std::map<int,std::vector<RPCData*> >::iterator itr;
165 std::vector<RPCData*> wheelData;
168 this->
m_block = wheelData[ (wheel + 2) ];
172 this->
m_block = (*itr).second[ (wheel + 2) ];
194 <<
" ndigis " << ndigis << std::endl;
196 if (
m_data.size() <= 0 )
return 0;
205 std::map<int,std::vector<RPCData*> >::iterator itr1;
207 std::vector<RPCData*>::iterator itr2;
208 for(itr2 = (*itr1).second.begin(); itr2 != (*itr1).second.end();++itr2 )
209 if ( (*itr2) )
delete *itr2;
210 (*itr1).second.clear();
225 for(
int i=0;
i < maxWheels; ++
i) {
231 for(
int j=0;
j < maxRbcBrds; ++
j) {
254 std::vector<RPCData*>::iterator itr;
255 std::map<int, std::vector<RPCData*> >::iterator itr2;
264 if ( bx != 0 ) bxsign = ( bx /
abs(bx) );
267 for(itr = (*itr2).second.begin(); itr != (*itr2).second.end(); ++itr) {
269 for(
int k=0;
k < 6; ++
k) {
271 code = bxsign * ( 1000000*
abs(bx)
272 + 10000*(*itr)->wheelIdx()
273 + 100 *(*itr)->m_sec1[
k]
274 + 1 *(*itr)->m_sec2[
k] );
277 RBCInput * signal = & (*itr)->m_orsignals[
k];
280 if ( signal->hasData )
281 m_data.insert( std::make_pair( code , signal) );
300 if ( _station < 3 ) {
301 blayer = ( (_station-1) * 2 ) + _layer;
304 blayer = _station + 2;
320 std::vector<int>::const_iterator itr;
328 for ( pos = 0; pos < 6; ++
pos ) {
329 if (this->
m_block->
m_sec1[pos] == sector || this->m_block->m_sec2[pos] == sector )
350 signals.set( bitpos , 1 );
357 std::cout <<
"RBCProcessRPCSimDigis> Output starts" << std::endl;
359 std::map<int,RBCInput*>::const_iterator itr;
360 for( itr =
m_data.begin(); itr !=
m_data.end(); ++itr) {
361 std::cout << (*itr).first <<
'\t' << (* (*itr).second ) <<
'\n';
364 std::cout <<
"RBCProcessRPCSimDigis> Output ends" << std::endl;
std::vector< int > m_sec2id
virtual ~RBCProcessRPCSimDigis()
Destructor.
std::map< int, int > m_layermap
std::map< int, RBCInput * > m_data
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const edm::Handle< edm::DetSetVector< RPCDigiSimLink > > * m_ptr_digiSimLink
RBCProcessRPCSimDigis()
Standard constructor.
std::vector< int > m_wheelid
int getBarrelLayer(const int &, const int &)
void initialize(std::vector< RPCData * > &)
iterator end()
Return the off-the-end iterator.
void setInputBit(std::bitset< 15 > &, int)
const edm::ESHandle< RPCGeometry > * m_ptr_rpcGeom
edm::DetSet< RPCDigiSimLink >::const_iterator m_digiItr
std::map< int, std::vector< RPCData * > > m_vecDataperBx
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
iterator begin()
Return an iterator to the first DetSet.
edm::DetSetVector< RPCDigiSimLink >::const_iterator m_linkItr
std::vector< int > m_sec1id