File indexing completed on 2024-04-06 12:22:50
0001
0002
0003
0004
0005
0006
0007
0008 #include <OnlineDB/CSCCondDB/interface/CSCToAFEB.h>
0009 #include <iostream>
0010
0011 using namespace std;
0012
0013
0014 int CSCToAFEB::getAfebCh(int layer, int wiregroup) const {
0015 int wire = wiregroup - 8 * ((wiregroup - 1) / 8);
0016 int channel = layer_wire_to_channel_[layer - 1][wire - 1];
0017 return channel;
0018 }
0019
0020 int CSCToAFEB::getAfebPos(int layer, int wiregroup) const {
0021 int col = (wiregroup - 1) / 8 + 1;
0022 int wire = wiregroup - 8 * ((wiregroup - 1) / 8);
0023 int afeb = (col - 1) * 3 + layer_wire_to_board_[layer - 1][wire - 1];
0024 return afeb;
0025 }
0026
0027 int CSCToAFEB::getLayer(int afeb, int channel) const {
0028 int col = (afeb - 1) / 3 + 1;
0029 int pos_in_col = afeb - (col - 1) * 3;
0030 int layer = pos_in_col * 2 - 1;
0031 if (channel < 5 || (channel > 8 && channel < 13))
0032 layer++;
0033 return layer;
0034 }
0035
0036 int CSCToAFEB::getWireGroup(int afeb, int channel) const {
0037 int col = (afeb - 1) / 3 + 1;
0038 int wire = (col - 1) * 8 + 1;
0039 if (channel < 5)
0040 wire = wire + (channel - 1);
0041 if (channel > 4 && channel < 9)
0042 wire = wire + (channel - 5);
0043 if (channel > 8 && channel < 13)
0044 wire = wire + (channel - 5);
0045 if (channel > 12)
0046 wire = wire + (channel - 9);
0047 return wire;
0048 }
0049
0050 int CSCToAFEB::getMaxAfeb(int station, int ring) const { return station_ring_to_nmxafeb_[station - 1][ring - 1]; }
0051
0052
0053 int CSCToAFEB::getMaxWire(int station, int ring) const { return station_ring_to_nmxwire_[station - 1][ring - 1]; }