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))
32  layer++;
33  return layer;
34 }
36 int CSCToAFEB::getWireGroup(int afeb, int channel) const {
37  int col = (afeb - 1) / 3 + 1;
38  int wire = (col - 1) * 8 + 1;
39  if (channel < 5)
40  wire = wire + (channel - 1);
41  if (channel > 4 && channel < 9)
42  wire = wire + (channel - 5);
43  if (channel > 8 && channel < 13)
44  wire = wire + (channel - 5);
45  if (channel > 12)
46  wire = wire + (channel - 9);
47  return wire;
48 }
50 int CSCToAFEB::getMaxAfeb(int station, int ring) const { return station_ring_to_nmxafeb_[station - 1][ring - 1]; }
51 
53 int CSCToAFEB::getMaxWire(int station, int ring) const { return station_ring_to_nmxwire_[station - 1][ring - 1]; }
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCToAFEB.h
cuy.col
col
Definition: cuy.py:1010
CSCToAFEB::getWireGroup
int getWireGroup(int afeb, int channel) const
return wiregroup number
Definition: CSCToAFEB.cc:36
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCToAFEB::getAfebPos
int getAfebPos(int layer, int wiregroup) const
return AFEB position number
Definition: CSCToAFEB.cc:20
CSCToAFEB::getMaxWire
int getMaxWire(int station, int ring) const
return max. number of wiregroups per layer
Definition: CSCToAFEB.cc:53
CSCToAFEB::getLayer
int getLayer(int afeb, int channel) const
return layer number
Definition: CSCToAFEB.cc:27
std
Definition: JetResolutionObject.h:76
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCToAFEB::getAfebCh
int getAfebCh(int layer, int wiregroup) const
return AFEB channel number
Definition: CSCToAFEB.cc:14
CSCToAFEB::getMaxAfeb
int getMaxAfeb(int station, int ring) const
return max. number of AFEBs
Definition: CSCToAFEB.cc:50