File indexing completed on 2024-04-06 12:22:49
0001 #ifndef CSCToAFEB_h
0002 #define CSCToAFEB_h
0003
0004
0005
0006
0007
0008
0009
0010
0011 class CSCToAFEB {
0012 private:
0013 int layer_wire_to_channel_[6][8];
0014 int layer_wire_to_board_[6][8];
0015 int station_ring_to_nmxafeb_[4][3];
0016 int station_ring_to_nmxwire_[4][3];
0017
0018 public:
0019
0020
0021 CSCToAFEB() {
0022 for (int i = 1; i <= 6; i++)
0023 for (int j = 1; j <= 8; j++) {
0024 if (i == 1 || i == 3 || i == 5) {
0025 if (j < 5)
0026 layer_wire_to_channel_[i - 1][j - 1] = j + 4;
0027 if (j > 4)
0028 layer_wire_to_channel_[i - 1][j - 1] = j + 8;
0029 }
0030 if (i == 2 || i == 4 || i == 6) {
0031 if (j < 5)
0032 layer_wire_to_channel_[i - 1][j - 1] = j;
0033 if (j > 4)
0034 layer_wire_to_channel_[i - 1][j - 1] = j + 4;
0035 }
0036 }
0037
0038 for (int i = 1; i <= 6; i++)
0039 for (int j = 1; j <= 8; j++)
0040 layer_wire_to_board_[i - 1][j - 1] = (i - 1) / 2 + 1;
0041
0042 for (int i = 1; i <= 4; i++)
0043 for (int j = 1; j <= 3; j++) {
0044 if (i == 1) {
0045 if (j == 1)
0046 station_ring_to_nmxafeb_[i - 1][j - 1] = 18;
0047 if (j == 2)
0048 station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0049 if (j == 3)
0050 station_ring_to_nmxafeb_[i - 1][j - 1] = 12;
0051 }
0052 if (i == 2) {
0053 if (j == 1)
0054 station_ring_to_nmxafeb_[i - 1][j - 1] = 42;
0055 if (j == 2)
0056 station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0057 if (j == 3)
0058 station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
0059 }
0060 if (i == 3) {
0061 if (j == 1)
0062 station_ring_to_nmxafeb_[i - 1][j - 1] = 36;
0063 if (j == 2)
0064 station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0065 if (j == 3)
0066 station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
0067 }
0068 if (i == 4) {
0069 if (j == 1)
0070 station_ring_to_nmxafeb_[i - 1][j - 1] = 36;
0071 if (j == 2)
0072 station_ring_to_nmxafeb_[i - 1][j - 1] = 24;
0073 if (j == 3)
0074 station_ring_to_nmxafeb_[i - 1][j - 1] = 0;
0075 }
0076 }
0077
0078 for (int i = 1; i <= 4; i++)
0079 for (int j = 1; j <= 3; j++) {
0080 if (i == 1) {
0081 if (j == 1)
0082 station_ring_to_nmxwire_[i - 1][j - 1] = 48;
0083 if (j == 2)
0084 station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0085 if (j == 3)
0086 station_ring_to_nmxwire_[i - 1][j - 1] = 32;
0087 }
0088 if (i == 2) {
0089 if (j == 1)
0090 station_ring_to_nmxwire_[i - 1][j - 1] = 112;
0091 if (j == 2)
0092 station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0093 if (j == 3)
0094 station_ring_to_nmxwire_[i - 1][j - 1] = 0;
0095 }
0096 if (i == 3) {
0097 if (j == 1)
0098 station_ring_to_nmxwire_[i - 1][j - 1] = 96;
0099 if (j == 2)
0100 station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0101 if (j == 3)
0102 station_ring_to_nmxwire_[i - 1][j - 1] = 0;
0103 }
0104 if (i == 4) {
0105 if (j == 1)
0106 station_ring_to_nmxwire_[i - 1][j - 1] = 96;
0107 if (j == 2)
0108 station_ring_to_nmxwire_[i - 1][j - 1] = 64;
0109 if (j == 3)
0110 station_ring_to_nmxwire_[i - 1][j - 1] = 0;
0111 }
0112 }
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 }
0145
0146
0147 int getAfebCh(int layer, int wiregroup) const;
0148
0149 int getAfebPos(int layer, int wiregroup) const;
0150
0151 int getLayer(int afeb, int channel) const;
0152
0153 int getWireGroup(int afeb, int channel) const;
0154
0155 int getMaxAfeb(int station, int ring) const;
0156
0157 int getMaxWire(int station, int ring) const;
0158
0159
0160 void print() const;
0161 };
0162
0163 #endif