22 rctLookupTables_(rctLookupTables),
31 std::vector<unsigned short>
input(64);
32 for (
int i = 0;
i < 64;
i++)
33 input.at(
i) = rand() & 511;
38 std::vector<unsigned short>
input(64);
42 for (
int i = 0;
i < 64;
i++) {
72 std::vector<unsigned short> ecalInput(32);
73 std::vector<unsigned short> ecalFG(32);
74 std::vector<unsigned short> hcalInput(32);
75 std::vector<unsigned short> hcalMuon(32);
77 for (
int i = 0;
i < 32;
i++) {
78 ecalInput.at(
i) =
input.at(
i) / 2;
80 hcalInput.at(
i) =
input.at(
i + 32) / 2;
81 hcalMuon.at(
i) =
input.at(
i + 32) & 1;
84 unsigned short etIn7Bits = lookup & 127;
85 unsigned short etIn9Bits = (lookup >> 8) & 511;
86 unsigned short HE_FGBit = (lookup >> 7) & 1;
87 unsigned short activityBit = (lookup >> 17) & 1;
90 unsigned short row =
indices.at(1);
96 regions.at(
r).setActivityBit(row,
col, activityBit);
101 std::vector<unsigned short> returnVec(3);
103 unsigned short towerrow;
104 unsigned short towercol;
109 towerrow = towernum % 4;
110 towercol = 3 - (towernum / 4);
113 towerrow = towernum % 4;
114 towercol = 7 - (towernum / 4);
119 towerrow = towernum % 4;
120 towercol = 3 - (towernum / 4);
123 towerrow = towernum % 4;
124 towercol = (towernum / 4) - 4;
131 towerrow = towernum % 4;
132 towercol = towernum / 4;
135 towerrow = towernum % 4;
136 towercol = (towernum / 4) - 4;
141 towerrow = towernum % 4;
142 towercol = towernum / 4;
145 towerrow = towernum % 4;
146 towercol = 7 - (towernum / 4);
151 returnVec.at(1) = towerrow;
152 returnVec.at(2) = towercol;
157 for (
int i = 0;
i < 2;
i++)
162 bitset<4> etaPattern;
163 bitset<4> phiPattern;
165 bitset<4> badPattern5(
string(
"0101"));
166 bitset<4> badPattern7(
string(
"0111"));
167 bitset<4> badPattern9(
string(
"1001"));
168 bitset<4> badPattern10(
string(
"1010"));
169 bitset<4> badPattern11(
string(
"1011"));
170 bitset<4> badPattern13(
string(
"1101"));
171 bitset<4> badPattern14(
string(
"1110"));
172 bitset<4> badPattern15(
string(
"1111"));
174 for (
int i = 0;
i < 4;
i++) {
175 phiPattern[
i] =
region.getActivityBit(
i, 0) ||
region.getActivityBit(
i, 1) ||
region.getActivityBit(
i, 2) ||
177 etaPattern[
i] =
region.getActivityBit(0,
i) ||
region.getActivityBit(1,
i) ||
region.getActivityBit(2,
i) ||
183 if (etaPattern != badPattern5 && etaPattern != badPattern7 && etaPattern != badPattern10 &&
184 etaPattern != badPattern11 && etaPattern != badPattern13 && etaPattern != badPattern14 &&
185 etaPattern != badPattern15 && phiPattern != badPattern5 && phiPattern != badPattern7 &&
186 phiPattern != badPattern10 && phiPattern != badPattern11 && phiPattern != badPattern13 &&
187 phiPattern != badPattern14 && phiPattern != badPattern15 && etaPattern != badPattern9 &&
188 phiPattern != badPattern9) {
201 for (
int i = 0;
i < 2;
i++) {
208 unsigned short sum = 0;
209 unsigned short overflow = 0;
210 for (
int i = 0;
i < 4;
i++) {
211 for (
int j = 0;
j < 4;
j++) {
212 unsigned short towerEt =
region.getEtIn9Bits(
i,
j);
223 unsigned short sumFullInfo = sum * 2 + overflow;
228 for (
int i = 0;
i < 2;
i++)
234 for (
int i = 0;
i < 4;
i++) {
235 for (
int j = 0;
j < 4;
j++) {
245 for (
int i = 0;
i < 2;
i++) {
246 std::cout <<
"Region " <<
i <<
" information" << std::endl;
L1RCTReceiverCard()=delete
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const
void fillInput(const std::vector< unsigned short > &input)
static std::string const input
const L1RCTLookupTables * rctLookupTables_
std::vector< unsigned short > overFlowBits
unsigned short calcTauBit(L1RCTRegion region)
std::vector< unsigned short > etIn10Bits
void fileInput(char *filename)
unsigned short calcMuonBit(L1RCTRegion region)
std::vector< unsigned short > muonBits
std::vector< unsigned short > tauBits
unsigned short calcRegionSum(L1RCTRegion region)
std::vector< unsigned short > towerToRegionMap(int towernum)
std::vector< L1RCTRegion > regions