Go to the documentation of this file.00001
00008 #include <OnlineDB/CSCCondDB/interface/CSCToAFEB.h>
00009 #include <iostream>
00010
00011 using namespace std;
00012
00014 int CSCToAFEB::getAfebCh(int layer, int wiregroup) const {
00015 int wire=wiregroup-8*((wiregroup-1)/8);
00016 int channel=layer_wire_to_channel_[layer - 1][wire - 1];
00017 return channel;
00018 }
00020 int CSCToAFEB::getAfebPos(int layer, int wiregroup) const {
00021 int col=(wiregroup-1)/8+1;
00022 int wire=wiregroup-8*((wiregroup-1)/8);
00023 int afeb=(col-1)*3+layer_wire_to_board_[layer - 1][wire - 1];
00024 return afeb;
00025 }
00027 int CSCToAFEB::getLayer(int afeb, int channel) const {
00028 int col=(afeb-1)/3+1;
00029 int pos_in_col=afeb-(col-1)*3;
00030 int layer=pos_in_col*2-1;
00031 if(channel < 5 || (channel >8 && channel < 13)) layer++;
00032 return layer;
00033 }
00035 int CSCToAFEB::getWireGroup(int afeb, int channel) const {
00036 int col=(afeb-1)/3+1;
00037 int wire=(col-1)*8+1;
00038 if(channel<5) wire=wire+(channel-1);
00039 if(channel>4 && channel<9) wire=wire+(channel-5);
00040 if(channel>8 && channel<13) wire=wire+(channel-5);
00041 if(channel>12) wire=wire+(channel-9);
00042 return wire;
00043 }
00045 int CSCToAFEB::getMaxAfeb(int station, int ring) const {
00046 return station_ring_to_nmxafeb_[station-1][ring-1];
00047 }
00048
00050 int CSCToAFEB::getMaxWire(int station, int ring) const {
00051 return station_ring_to_nmxwire_[station-1][ring-1];
00052 }