CMS 3D CMS Logo

CSCToAFEB.h
Go to the documentation of this file.
1 #ifndef CSCToAFEB_h
2 #define CSCToAFEB_h
3 
11 class CSCToAFEB {
12 private:
17 
18 public:
20 
22  for (int i = 1; i <= 6; i++)
23  for (int j = 1; j <= 8; j++) {
24  if (i == 1 || i == 3 || i == 5) {
25  if (j < 5)
26  layer_wire_to_channel_[i - 1][j - 1] = j + 4;
27  if (j > 4)
28  layer_wire_to_channel_[i - 1][j - 1] = j + 8;
29  }
30  if (i == 2 || i == 4 || i == 6) {
31  if (j < 5)
32  layer_wire_to_channel_[i - 1][j - 1] = j;
33  if (j > 4)
34  layer_wire_to_channel_[i - 1][j - 1] = j + 4;
35  }
36  }
37 
38  for (int i = 1; i <= 6; i++)
39  for (int j = 1; j <= 8; j++)
40  layer_wire_to_board_[i - 1][j - 1] = (i - 1) / 2 + 1;
41 
42  for (int i = 1; i <= 4; i++)
43  for (int j = 1; j <= 3; j++) {
44  if (i == 1) {
45  if (j == 1)
46  station_ring_to_nmxafeb_[i - 1][j - 1] = 18;
47  if (j == 2)
48  station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
49  if (j == 3)
50  station_ring_to_nmxafeb_[i - 1][j - 1] = 12;
51  }
52  if (i == 2) {
53  if (j == 1)
54  station_ring_to_nmxafeb_[i - 1][j - 1] = 42;
55  if (j == 2)
56  station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
57  if (j == 3)
58  station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
59  }
60  if (i == 3) {
61  if (j == 1)
62  station_ring_to_nmxafeb_[i - 1][j - 1] = 36;
63  if (j == 2)
64  station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
65  if (j == 3)
66  station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
67  }
68  if (i == 4) {
69  if (j == 1)
70  station_ring_to_nmxafeb_[i - 1][j - 1] = 36;
71  if (j == 2)
72  station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
73  if (j == 3)
74  station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
75  }
76  }
77 
78  for (int i = 1; i <= 4; i++)
79  for (int j = 1; j <= 3; j++) {
80  if (i == 1) {
81  if (j == 1)
82  station_ring_to_nmxwire_[i - 1][j - 1] = 48;
83  if (j == 2)
84  station_ring_to_nmxwire_[i - 1][j - 1] = 64;
85  if (j == 3)
86  station_ring_to_nmxwire_[i - 1][j - 1] = 32;
87  }
88  if (i == 2) {
89  if (j == 1)
90  station_ring_to_nmxwire_[i - 1][j - 1] = 112;
91  if (j == 2)
92  station_ring_to_nmxwire_[i - 1][j - 1] = 64;
93  if (j == 3)
94  station_ring_to_nmxwire_[i - 1][j - 1] = 0;
95  }
96  if (i == 3) {
97  if (j == 1)
98  station_ring_to_nmxwire_[i - 1][j - 1] = 96;
99  if (j == 2)
100  station_ring_to_nmxwire_[i - 1][j - 1] = 64;
101  if (j == 3)
102  station_ring_to_nmxwire_[i - 1][j - 1] = 0;
103  }
104  if (i == 4) {
105  if (j == 1)
106  station_ring_to_nmxwire_[i - 1][j - 1] = 96;
107  if (j == 2)
108  station_ring_to_nmxwire_[i - 1][j - 1] = 64;
109  if (j == 3)
110  station_ring_to_nmxwire_[i - 1][j - 1] = 0;
111  }
112  }
113 
114  /*
115  layer_wire_to_channel_[6][8] = {{ 5,6,7,8,13,14,15,16 },
116  { 1,2,3,4, 9,10,11,12 },
117  { 5,6,7,8,13,14,15,16 },
118  { 1,2,3,4, 9,10,11,12 },
119  { 5,6,7,8,13,14,15,16 },
120  { 1,2,3,4, 9,10,11,12 }};
121  gives AFEB channel number for given layer and wire numbers.
122 
123  layer_wire_to_board_[6][8] = {{ 1,1,1,1,1,1,1,1 },
124  { 1,1,1,1,1,1,1,1 },
125  { 2,2,2,2,2,2,2,2 },
126  { 2,2,2,2,2,2,2,2 },
127  { 3,3,3,3,3,3,3,3 },
128  { 3,3,3,3,3,3,3,3 }};
129  gives position of AFEB in column for given layer and wire numbers.
130 
131  station_ring_to_nmxafeb_[4][3]= {{18?,24,12},
132  {42, 24,0 },
133  {36, 24,0 ],
134  {36, 24,0 }};
135  gives max. # of AFEBs in CSC of different types for given station and ring.
136 
137  station_ring_to_nmxwire_[4][3]= {{48?,64,32},
138  {112,64,0 },
139  {96, 64,0 ],
140  {96, 64,0 }};
141  gives max. # of wiregroups in one layer of CSC of different types
142  for given station and ring.
143  */
144  }
145 
147  int getAfebCh(int layer, int wiregroup) const;
149  int getAfebPos(int layer, int wiregroup) const;
151  int getLayer(int afeb, int channel) const;
153  int getWireGroup(int afeb, int channel) const;
155  int getMaxAfeb(int station, int ring) const;
157  int getMaxWire(int station, int ring) const;
158 
160  void print() const;
161 };
162 
163 #endif
int getAfebCh(int layer, int wiregroup) const
return AFEB channel number
Definition: CSCToAFEB.cc:14
int station_ring_to_nmxafeb_[4][3]
Definition: CSCToAFEB.h:15
constexpr std::array< uint8_t, layerIndexSize > layer
int getMaxAfeb(int station, int ring) const
return max. number of AFEBs
Definition: CSCToAFEB.cc:50
int getMaxWire(int station, int ring) const
return max. number of wiregroups per layer
Definition: CSCToAFEB.cc:53
int getWireGroup(int afeb, int channel) const
return wiregroup number
Definition: CSCToAFEB.cc:36
int station_ring_to_nmxwire_[4][3]
Definition: CSCToAFEB.h:16
CSCToAFEB()
Constructor.
Definition: CSCToAFEB.h:21
int layer_wire_to_channel_[6][8]
Definition: CSCToAFEB.h:13
void print() const
Print content.
int getLayer(int afeb, int channel) const
return layer number
Definition: CSCToAFEB.cc:27
int layer_wire_to_board_[6][8]
Definition: CSCToAFEB.h:14
int getAfebPos(int layer, int wiregroup) const
return AFEB position number
Definition: CSCToAFEB.cc:20