90 {
91
94
96
97
98
99
100
101
102
103
104
105 using searchpairs = std::vector<std::pair<int,std::string>>;
106
107
108
109
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 )
117 return;
118
119
120
121
122
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 )
129 return;
130
131
132
135
136
139
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 )
147 return;
148
149 int globaleta = std::stoi( tab2line->at(4) );
150 int globalphi = std::stoi( tab2line->at(5) );
151
152 int layer = std::stoi( tab2line->at(6),
nullptr ,16 );
154
155
156
157
159
160 double supercelletawidth(0);
161 double supercellphiwidth(0.09817477);
162 int supercelletaoffset(0);
163 if(layer == 0){
164 supercelletawidth = 0.1;
165 }
166 else if(1 <= layer && layer <= 4){
167 supercelletawidth = 0.025;
168 supercelletaoffset = (
layer - 1 )%4;
169 }
170 else if(5 <= layer && layer <= 8){
171 supercelletawidth = 0.025;
172 supercelletaoffset = (
layer - 1 )%4;
173 }
174 else if(layer == 9 || layer == 10){
175 supercelletawidth = 0.1;
176 }
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;
182 if(layer == 0){
183 m_region = L1CaloDetectorRegion( efexlabel,
185 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
186 }
187 else if(1 <= layer && layer <= 4){
188 m_region = L1CaloDetectorRegion( efexlabel,
190 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
191 }
192 else if(5 <= layer && layer <= 8){
193 m_region = L1CaloDetectorRegion( efexlabel,
195 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
196 }
197 else if(layer == 9){
198 m_region = L1CaloDetectorRegion( efexlabel,
200 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
201 }
202 else if(layer == 10){
203 m_region = L1CaloDetectorRegion( efexlabel,
205 supercelletawidth, supercellphiwidth , supercelletacoord, supercellphicoord);
206 }
207 int globalEta =
m_region.getEtaIndex();
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++; }
219 int lowerShiftedPhi = octantNum * 8;
220 int upperShiftedPhi = lowerShiftedPhi + 8;
221 int fpgaOverlap = 0;
222 if (shiftedPhi >= upperShiftedPhi || shiftedPhi < lowerShiftedPhi) {
223
224
225 if (octantNum == 0 || octantNum == 7) {
226 fpgaOverlap |= (shiftedPhi > 32) ? 1 : 2;
227 }
228 else {
229 fpgaOverlap |= (shiftedPhi < lowerShiftedPhi) ? 1 : 2;
230 }
231 }
232 if (globalEta >= fpgaUpperEta || globalEta < fpgaLowerEta) {
233 fpgaOverlap |= (globalEta < fpgaLowerEta) ? 4 : 8;
234 }
236
237}
std::string findModuleCords(int crate, int efexnumber) const