11 int fpga,
int mgtchannelout ,
int dataword)
13 auto genintint = [] (
int col,
int intstr)
14 {
return std::make_pair(col , std::to_string(intstr) );};
15 using searchpairs = std::vector<std::pair<int,std::string>>;
18 auto tab6search = searchpairs();
19 tab6search.push_back(genintint(0,fpga));
20 tab6search.push_back(genintint(3,mgtchannelout));
21 auto tab6line =
m_tables.GetTable(6)->FindLine(tab6search);
22 int quad = std::stoi( tab6line->at(1) );
23 int mgtin = std::stoi( tab6line->at(2) );
24 this->
init(crate,efexnumber, fpga, quad, mgtin, dataword);
90 int fpga,
int quad,
int mgtchannel ,
int dataword){
105 using searchpairs = std::vector<std::pair<int,std::string>>;
110 auto tab4search = searchpairs();
111 tab4search.emplace_back(0,efexcords);
112 tab4search.emplace_back(1,std::to_string(fpga));
113 tab4search.emplace_back(2,std::to_string(quad));
114 tab4search.emplace_back(3,std::to_string(mgtchannel));
115 auto tab4line =
m_tables.GetTable(4)->FindLine(tab4search);
116 if ( tab4line->size() == 0 )
123 std::string mpod = tab4line->at(4);
124 auto tab3search = searchpairs();
125 tab3search.emplace_back(0,efexcords);
126 tab3search.emplace_back(1,mpod);
127 auto tab3line =
m_tables.GetTable(3)->FindLine(tab3search);
128 if ( tab3line->size() == 0 )
140 auto tab2search = searchpairs();
141 tab2search.emplace_back(0,efexcords);
144 tab2search.emplace_back(3,std::to_string(dataword ));
145 auto tab2line =
m_tables.GetTable(2)->FindLine(tab2search);
146 if ( tab2line->size() == 0 )
149 int globaleta = std::stoi( tab2line->at(4) );
150 int globalphi = std::stoi( tab2line->at(5) );
152 int layer = std::stoi( tab2line->at(6),
nullptr ,16 );
160 double supercelletawidth(0);
161 double supercellphiwidth(0.09817477);
162 int supercelletaoffset(0);
164 supercelletawidth = 0.1;
166 else if(1 <= layer && layer <= 4){
167 supercelletawidth = 0.025;
168 supercelletaoffset = (layer - 1 )%4;
170 else if(5 <= layer && layer <= 8){
171 supercelletawidth = 0.025;
172 supercelletaoffset = (layer - 1 )%4;
174 else if(layer == 9 || layer == 10){
175 supercelletawidth = 0.1;
177 double toweretalowside = (double)globaleta/10;
178 double towerphilowside = (double)globalphi*0.09817477;
179 double supercelletacoord = toweretalowside + 0.025*(double)supercelletaoffset +
180 0.5*supercelletawidth ;
181 double supercellphicoord = towerphilowside + 0.5*supercellphiwidth;
185 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
187 else if(1 <= layer && layer <= 4){
190 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
192 else if(5 <= layer && layer <= 8){
195 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
200 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
202 else if(layer == 10){
205 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
207 int globalEta =
m_region.getEtaIndex();
208 int globalPhi =
m_region.getPhiIndex();
209 std::string miniPodLabel =
m_hwinfo.getMpodLabel();
210 int moduleCBA = 2 - ( efexcords.at(0) -
'A' );
211 int octantNum = ( efexcords.at(1) -
'0' ) - 1;
212 int moduleBaseEta = -24 + (moduleCBA * 16);
213 int fpgaBaseEta = moduleBaseEta + (fpga * 4);
214 int fpgaLowerEta = fpgaBaseEta;
215 int fpgaUpperEta = fpgaBaseEta + 4;
216 if (moduleCBA == 0 && fpga == 0) { fpgaLowerEta--; }
217 else if (moduleCBA == 2 && fpga == 3) { fpgaUpperEta++; }
218 int shiftedPhi = (globalPhi + 62) % 64;
219 int lowerShiftedPhi = octantNum * 8;
220 int upperShiftedPhi = lowerShiftedPhi + 8;
222 if (shiftedPhi >= upperShiftedPhi || shiftedPhi < lowerShiftedPhi) {
225 if (octantNum == 0 || octantNum == 7) {
226 fpgaOverlap |= (shiftedPhi > 32) ? 1 : 2;
229 fpgaOverlap |= (shiftedPhi < lowerShiftedPhi) ? 1 : 2;
232 if (globalEta >= fpgaUpperEta || globalEta < fpgaLowerEta) {
233 fpgaOverlap |= (globalEta < fpgaLowerEta) ? 4 : 8;