19 regions(2),crtNo(crateNumber),cardNo(cardNumber),
20 rctLookupTables_(rctLookupTables),
21 etIn10Bits(2), overFlowBits(2),muonBits(2),tauBits(2)
28 std::vector<unsigned short>
input(64);
29 for(
int i = 0;
i<64;
i++)
30 input.at(
i) =
rand()&511;
35 std::vector<unsigned short>
input(64);
37 std::ifstream instream(filename);
39 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;
79 ecalFG.at(
i) = input.at(
i) & 1;
80 hcalInput.at(
i) = input.at(
i+32)/2;
81 hcalMuon.at(
i) = input.at(
i+32) & 1;
83 unsigned short etIn7Bits = lookup&127;
84 unsigned short etIn9Bits = (lookup >> 8)&511;
85 unsigned short HE_FGBit = (lookup>>7)&1;
86 unsigned short activityBit = (lookup>>17)&1;
88 unsigned short r = indices.at(0);
89 unsigned short row = indices.at(1);
90 unsigned short col = indices.at(2);
91 regions.at(r).setEtIn7Bits(row,col,etIn7Bits);
92 regions.at(r).setEtIn9Bits(row,col,etIn9Bits);
93 regions.at(r).setHE_FGBit(row,col,HE_FGBit);
94 regions.at(r).setMuonBit(row,col,hcalMuon.at(
i));
95 regions.at(r).setActivityBit(row,col,activityBit);
102 std::vector<unsigned short> returnVec(3);
103 unsigned short region;
104 unsigned short towerrow;
105 unsigned short towercol;
110 towerrow = towernum%4;
111 towercol = 3-(towernum/4);
115 towerrow = towernum%4;
116 towercol = 7-(towernum/4);
122 towerrow = towernum%4;
123 towercol = 3-(towernum/4);
127 towerrow = towernum%4;
128 towercol = (towernum/4)-4;
136 towerrow = towernum%4;
137 towercol = towernum/4;
141 towerrow = towernum%4;
142 towercol = (towernum/4)-4;
148 towerrow = towernum%4;
149 towercol = towernum/4;
153 towerrow = towernum%4;
154 towercol = 7-(towernum/4);
158 returnVec.at(0)=region;
159 returnVec.at(1)=towerrow;
160 returnVec.at(2)=towercol;
167 for(
int i = 0;
i<2;
i++)
172 bitset<4> etaPattern;
173 bitset<4> phiPattern;
175 bitset<4> badPattern5(
string(
"0101"));
176 bitset<4> badPattern7(
string(
"0111"));
177 bitset<4> badPattern9(
string(
"1001"));
178 bitset<4> badPattern10(
string(
"1010"));
179 bitset<4> badPattern11(
string(
"1011"));
180 bitset<4> badPattern13(
string(
"1101"));
181 bitset<4> badPattern14(
string(
"1110"));
182 bitset<4> badPattern15(
string(
"1111"));
184 for(
int i = 0;
i<4;
i++){
193 if(etaPattern != badPattern5 && etaPattern != badPattern7 &&
194 etaPattern != badPattern10 && etaPattern != badPattern11 &&
195 etaPattern != badPattern13 && etaPattern != badPattern14 &&
196 etaPattern != badPattern15 && phiPattern != badPattern5 &&
197 phiPattern != badPattern7 && phiPattern != badPattern10 &&
198 phiPattern != badPattern11 && phiPattern != badPattern13 &&
199 phiPattern != badPattern14 && phiPattern != badPattern15 &&
200 etaPattern != badPattern9 && phiPattern != badPattern9){
213 for(
int i = 0;
i<2;
i++){
220 unsigned short sum = 0;
221 unsigned short overflow = 0;
222 for(
int i = 0;
i<4;
i++){
223 for(
int j = 0; j<4; j++){
235 unsigned short sumFullInfo = sum*2 + overflow;
240 for(
int i = 0;
i<2;
i++)
245 unsigned short muonBit = 0;
246 for(
int i = 0;
i<4;
i++){
247 for(
int j = 0; j<4; j++){
258 for(
int i=0;
i<2;
i++){
259 std::cout <<
"Region " <<
i <<
" information" << std::endl;
L1RCTReceiverCard()=delete
unsigned short getEtIn9Bits(int i, int j) const
unsigned short getMuonBit(int i, int j) const
void fillInput(const std::vector< unsigned short > &input)
static std::string const input
const L1RCTLookupTables * rctLookupTables_
std::vector< unsigned short > overFlowBits
unsigned short getActivityBit(int i, int j) const
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
unsigned int lookup(unsigned short ecalInput, unsigned short hcalInput, unsigned short fgbit, unsigned short crtNo, unsigned short crdNo, unsigned short twrNo) const