8 int fpga,
int mgtchannelout ,
int dataword)
10 auto genintint = [] (
int col,
int intstr)
12 using searchpairs = std::vector<std::pair<int,std::string>>;
15 auto tab6search = searchpairs();
16 tab6search.push_back(genintint(0,fpga));
17 tab6search.push_back(genintint(3,mgtchannelout));
19 int quad = std::stoi( tab6line->at(1) );
20 int mgtin = std::stoi( tab6line->at(2) );
21 this->
init(crate,efexnumber, fpga,
quad, mgtin, dataword);
25 int fpga,
int eta,
int phi )
27 if ( (crate<0) || (crate>1) || (efexnumber<0) || (efexnumber>11) )
32 int etaIndex = (efexnumber%3)*16 + fpga*4 +
eta - 25;
33 int phiIndex = crate*32 +(efexnumber/3)*8 +
phi + 2;
35 double etaWidth = 0.1;
37 double etaCoord = (etaIndex+0.5)*etaWidth;
48 int fpga,
int eta,
int phi,
int seed )
50 if ( (crate<0) || (crate>1) || (efexnumber<0) || (efexnumber>11) )
54 if ( (seed<0) || (seed>3) )
57 int etaIndex = (efexnumber%3)*64 + fpga*16 +
eta*4 + seed - 100;
58 int phiIndex = crate*32 +(efexnumber/3)*8 +
phi + 2;
60 double etaWidth = 0.025;
62 double etaCoord = (etaIndex+0.5)*etaWidth;
87 int fpga,
int quad,
int mgtchannel ,
int dataword){
102 auto genintstr = [] (
int col, std::string
str )
103 {
return std::make_pair(
col ,
str );};
104 auto genintint = [] (
int col,
int intstr)
106 using searchpairs = std::vector<std::pair<int,std::string>>;
111 auto tab4search = searchpairs();
112 tab4search.push_back(genintstr(0,efexcords));
113 tab4search.push_back(genintint(1,fpga));
114 tab4search.push_back(genintint(2,
quad));
115 tab4search.push_back(genintint(3,mgtchannel));
117 if ( tab4line->size() == 0 )
124 std::string mpod = tab4line->at(4);
125 auto tab3search = searchpairs();
126 tab3search.push_back(genintstr(0,efexcords));
127 tab3search.push_back(genintstr(1,mpod));
129 if ( tab3line->size() == 0 )
141 auto tab2search = searchpairs();
142 tab2search.push_back(genintstr(0,efexcords));
145 tab2search.push_back(genintint(3,dataword ));
147 if ( tab2line->size() == 0 )
150 int globaleta = std::stoi( tab2line->at(4) );
151 int globalphi = std::stoi( tab2line->at(5) );
153 int layer = std::stoi( tab2line->at(6),
nullptr ,16 );
161 double supercelletawidth(0);
162 double supercellphiwidth(0.09817477);
163 int supercelletaoffset(0);
165 supercelletawidth = 0.1;
168 supercelletawidth = 0.025;
169 supercelletaoffset = (
layer - 1 )%4;
172 supercelletawidth = 0.025;
173 supercelletaoffset = (
layer - 1 )%4;
176 supercelletawidth = 0.1;
178 double toweretalowside = (
double)globaleta/10;
179 double towerphilowside = (
double)globalphi*0.09817477;
180 double supercelletacoord = toweretalowside + 0.025*(
double)supercelletaoffset +
181 0.5*supercelletawidth ;
182 double supercellphicoord = towerphilowside + 0.5*supercellphiwidth;
186 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
191 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
196 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
201 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
203 else if(
layer == 10){
206 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
211 int moduleCBA = 2 - ( efexcords.at(0) -
'A' );
212 int octantNum = ( efexcords.at(1) -
'0' ) - 1;
213 int moduleBaseEta = -24 + (moduleCBA * 16);
214 int fpgaBaseEta = moduleBaseEta + (fpga * 4);
215 int fpgaLowerEta = fpgaBaseEta;
216 int fpgaUpperEta = fpgaBaseEta + 4;
217 if (moduleCBA == 0 && fpga == 0) { fpgaLowerEta--; }
218 else if (moduleCBA == 2 && fpga == 3) { fpgaUpperEta++; }
220 int lowerShiftedPhi = octantNum * 8;
221 int upperShiftedPhi = lowerShiftedPhi + 8;
223 if (shiftedPhi >= upperShiftedPhi || shiftedPhi < lowerShiftedPhi) {
226 if (octantNum == 0 || octantNum == 7) {
227 fpgaOverlap |= (shiftedPhi > 32) ? 1 : 2;
230 fpgaOverlap |= (shiftedPhi < lowerShiftedPhi) ? 1 : 2;
233 if (globalEta >= fpgaUpperEta || globalEta < fpgaLowerEta) {
234 fpgaOverlap |= (globalEta < fpgaLowerEta) ? 4 : 8;
242 if ( (crate<0 || crate>1) ){
243 throw "Invalid Crate # created within eFEX mapping";
246 if ( efexnumber<0 || efexnumber>11 ){
247 throw "Invalid Module # created within eFEX mapping";
255 int octant = 4*crate + efexnumber/3 + 1;
257 int etaslicenum = 3 - efexnumber%3;
258 std::string etaslice;