CMS 3D CMS Logo

CSCToAFEB.cc
Go to the documentation of this file.
1 
9 #include <iostream>
10 
11 using namespace std;
12 
14  int CSCToAFEB::getAfebCh(int layer, int wiregroup) const {
15  int wire=wiregroup-8*((wiregroup-1)/8);
16  int channel=layer_wire_to_channel_[layer - 1][wire - 1];
17  return channel;
18  }
20  int CSCToAFEB::getAfebPos(int layer, int wiregroup) const {
21  int col=(wiregroup-1)/8+1;
22  int wire=wiregroup-8*((wiregroup-1)/8);
23  int afeb=(col-1)*3+layer_wire_to_board_[layer - 1][wire - 1];
24  return afeb;
25  }
27  int CSCToAFEB::getLayer(int afeb, int channel) const {
28  int col=(afeb-1)/3+1;
29  int pos_in_col=afeb-(col-1)*3;
30  int layer=pos_in_col*2-1;
31  if(channel < 5 || (channel >8 && channel < 13)) layer++;
32  return layer;
33  }
35  int CSCToAFEB::getWireGroup(int afeb, int channel) const {
36  int col=(afeb-1)/3+1;
37  int wire=(col-1)*8+1;
38  if(channel<5) wire=wire+(channel-1);
39  if(channel>4 && channel<9) wire=wire+(channel-5);
40  if(channel>8 && channel<13) wire=wire+(channel-5);
41  if(channel>12) wire=wire+(channel-9);
42  return wire;
43  }
45  int CSCToAFEB::getMaxAfeb(int station, int ring) const {
46  return station_ring_to_nmxafeb_[station-1][ring-1];
47  }
48 
50  int CSCToAFEB::getMaxWire(int station, int ring) const {
51  return station_ring_to_nmxwire_[station-1][ring-1];
52  }
int getAfebCh(int layer, int wiregroup) const
return AFEB channel number
Definition: CSCToAFEB.cc:14
int getMaxAfeb(int station, int ring) const
return max. number of AFEBs
Definition: CSCToAFEB.cc:45
int getLayer(int afeb, int channel) const
return layer number
Definition: CSCToAFEB.cc:27
int getMaxWire(int station, int ring) const
return max. number of wiregroups per layer
Definition: CSCToAFEB.cc:50
int getWireGroup(int afeb, int channel) const
return wiregroup number
Definition: CSCToAFEB.cc:35
int getAfebPos(int layer, int wiregroup) const
return AFEB position number
Definition: CSCToAFEB.cc:20
col
Definition: cuy.py:1010