8 #include "CLHEP/Random/RandGauss.h"
15 float value[4] = {value0, value0, value0, value0};
17 for (
int i = 0;
i < 4;
i++) {
19 CLHEP::RandGauss::shoot(value0,
width.getWidth(
i) / 100.);
21 value[
i] = CLHEP::RandGauss::shoot(value0,
width.getWidth(
i));
38 for (
int i = 0;
i < 4;
i++) {
40 for (
int j = 0;
j < 4;
j++) {
58 float value[4] = {value0, value0, value0, value0};
60 for (
int i = 0;
i < 4;
i++)
61 value[
i] = CLHEP::RandGauss::shoot(value0,
width.getValue(
i));
77 for (
unsigned capid = 0; capid < 4; capid++) {
88 for (
int i = 0;
i < 32;
i++)
89 lowEdges[
i] = -1.5 +
i * 0.35;
90 result.setMinCharges(lowEdges);
106 #define EMAP_NHBHECR 9
112 #define EMAP_NHSETS 4
113 #define EMAP_NTOPBOT 2
114 #define EMAP_NHTRSHO 4
115 #define EMAP_NHSETSHO 3
119 int hbhecrate[
EMAP_NHBHECR] = {0, 1, 4, 5, 10, 11, 14, 15, 17};
126 {702, 703}, {704, 705}, {700, 701}, {706, 707}, {716, 717}, {708, 709}, {714, 715}, {710, 711}, {712, 713}};
128 int fedhfnum[
EMAP_NHFCR][2] = {{718, 719}, {720, 721}, {722, 723}};
130 int fedhonum[
EMAP_NHOCR][2] = {{724, 725}, {726, 727}, {728, 729}, {730, 731}};
134 int ihslotho[
EMAP_NHSETSHO][
EMAP_NHTRSHO] = {{2, 3, 4, 5}, {6, 7, 13, 14}, {15, 16, 17, 18}};
136 int ihbhephis[
EMAP_NHBHECR] = {11, 19, 3, 27, 67, 35, 59, 43, 51};
143 {{{{11, 1}, {7, 1}, {3, 1}},
144 {{5, 1}, {1, 1}, {9, 1}},
145 {{11, 1}, {7, 1}, {3, 1}},
146 {{5, 1}, {1, 1}, {9, 1}},
147 {{10, 1}, {6, 1}, {2, 1}},
148 {{8, 1}, {4, 1}, {12, 1}},
149 {{10, 1}, {6, 1}, {2, 1}},
150 {{8, 1}, {4, 1}, {12, 1}}},
151 {{{11, 1}, {7, 1}, {3, 1}},
152 {{5, 1}, {1, 1}, {9, 1}},
153 {{11, 1}, {7, 1}, {3, 1}},
154 {{5, 1}, {1, 1}, {9, 1}},
155 {{10, 1}, {6, 1}, {2, 1}},
156 {{8, 1}, {4, 1}, {12, 1}},
157 {{10, 1}, {6, 1}, {2, 1}},
158 {{8, 1}, {4, 1}, {12, 1}}}},
159 {{{{16, 2}, {15, 2}, {14, 1}},
160 {{15, 1}, {13, 1}, {16, 1}},
161 {{16, 2}, {15, 2}, {14, 1}},
162 {{15, 1}, {13, 1}, {16, 1}},
163 {{17, 1}, {16, 3}, {26, 1}},
164 {{18, 1}, {18, 2}, {26, 2}},
165 {{17, 1}, {16, 3}, {25, 1}},
166 {{18, 1}, {18, 2}, {25, 2}}},
167 {{{16, 2}, {15, 2}, {14, 1}},
168 {{15, 1}, {13, 1}, {16, 1}},
169 {{16, 2}, {15, 2}, {14, 1}},
170 {{15, 1}, {13, 1}, {16, 1}},
171 {{17, 1}, {16, 3}, {25, 1}},
172 {{18, 1}, {18, 2}, {25, 2}},
173 {{17, 1}, {16, 3}, {26, 1}},
174 {{18, 1}, {18, 2}, {26, 2}}}},
175 {{{{28, 1}, {28, 2}, {29, 1}},
176 {{28, 3}, {24, 2}, {24, 1}},
177 {{27, 1}, {27, 2}, {29, 2}},
178 {{27, 3}, {23, 2}, {23, 1}},
179 {{19, 2}, {20, 1}, {22, 2}},
180 {{19, 1}, {20, 2}, {22, 1}},
181 {{19, 2}, {20, 1}, {21, 2}},
182 {{19, 1}, {20, 2}, {21, 1}}},
183 {{{27, 1}, {27, 2}, {29, 2}},
184 {{27, 3}, {23, 2}, {23, 1}},
185 {{28, 1}, {28, 2}, {29, 1}},
186 {{28, 3}, {24, 2}, {24, 1}},
187 {{19, 2}, {20, 1}, {21, 2}},
188 {{19, 1}, {20, 2}, {21, 1}},
189 {{19, 2}, {20, 1}, {22, 2}},
190 {{19, 1}, {20, 2}, {22, 1}}}}};
193 {{32, 1}, {30, 1}, {34, 1}},
194 {{33, 2}, {31, 2}, {29, 2}},
195 {{32, 2}, {30, 2}, {34, 2}},
196 {{34, 2}, {32, 2}, {30, 2}},
197 {{31, 2}, {29, 2}, {33, 2}},
198 {{34, 1}, {32, 1}, {30, 1}},
199 {{31, 1}, {29, 1}, {33, 1}}},
200 {{{41, 1}, {37, 1}, {35, 1}},
201 {{38, 1}, {36, 1}, {39, 1}},
202 {{41, 2}, {37, 2}, {35, 2}},
203 {{38, 2}, {36, 2}, {39, 2}},
204 {{40, 2}, {38, 2}, {36, 2}},
205 {{37, 2}, {35, 2}, {39, 2}},
206 {{40, 1}, {38, 1}, {36, 1}},
207 {{37, 1}, {35, 1}, {39, 1}}}};
210 {{{{1, -1, 0}, {2, -1, 0}, {3, -1, 0}},
211 {{1, -1, 1}, {2, -1, 1}, {3, -1, 1}},
212 {{1, -1, 2}, {2, -1, 2}, {3, -1, 2}},
213 {{1, -1, 3}, {2, -1, 3}, {3, -1, 3}},
214 {{1, -1, 4}, {2, -1, 4}, {3, -1, 4}},
215 {{1, -1, 5}, {2, -1, 5}, {3, -1, 5}},
216 {{14, 1, 0}, {14, 1, 1}, {14, 1, 2}},
217 {{14, 1, 3}, {14, 1, 4}, {14, 1, 5}}},
218 {{{1, 1, 0}, {2, 1, 0}, {3, 1, 0}},
219 {{1, 1, 1}, {2, 1, 1}, {3, 1, 1}},
220 {{1, 1, 2}, {2, 1, 2}, {3, 1, 2}},
221 {{1, 1, 3}, {2, 1, 3}, {3, 1, 3}},
222 {{1, 1, 4}, {2, 1, 4}, {3, 1, 4}},
223 {{1, 1, 5}, {2, 1, 5}, {3, 1, 5}},
224 {{15, 1, 0}, {15, 1, 1}, {15, 1, 2}},
225 {{15, 1, 3}, {15, 1, 4}, {15, 1, 5}}}},
226 {{{{6, 1, 0}, {6, 1, 1}, {6, 1, 2}},
227 {{6, 1, 3}, {6, 1, 4}, {6, 1, 5}},
228 {{7, 1, 0}, {7, 1, 1}, {7, 1, 2}},
229 {{7, 1, 3}, {7, 1, 4}, {7, 1, 5}},
230 {{8, 1, 0}, {8, 1, 1}, {8, 1, 2}},
231 {{8, 1, 3}, {8, 1, 4}, {8, 1, 5}},
232 {{9, 1, 0}, {9, 1, 1}, {9, 1, 2}},
233 {{9, 1, 3}, {9, 1, 4}, {9, 1, 5}}},
234 {{{10, 1, 0}, {10, 1, 1}, {10, 1, 2}},
235 {{10, 1, 3}, {10, 1, 4}, {10, 1, 5}},
236 {{11, 1, 0}, {11, 1, 1}, {11, 1, 2}},
237 {{11, 1, 3}, {11, 1, 4}, {11, 1, 5}},
238 {{12, 1, 0}, {12, 1, 1}, {12, 1, 2}},
239 {{12, 1, 3}, {12, 1, 4}, {12, 1, 5}},
240 {{13, 1, 0}, {13, 1, 1}, {13, 1, 2}},
241 {{13, 1, 3}, {13, 1, 4}, {13, 1, 5}}}},
242 {{{{4, -1, 0}, {4, -1, 1}, {0, 0, 0}},
243 {{4, -1, 2}, {4, -1, 3}, {0, 0, 0}},
244 {{4, -1, 4}, {4, -1, 5}, {0, 0, 0}},
245 {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
246 {{5, -1, 0}, {5, -1, 1}, {5, -1, 2}},
247 {{5, -1, 3}, {5, -1, 4}, {5, -1, 5}},
248 {{14, -1, 0}, {14, -1, 1}, {14, -1, 2}},
249 {{14, -1, 3}, {14, -1, 4}, {14, -1, 5}}},
250 {{{4, 1, 0}, {4, 1, 1}, {0, 0, 0}},
251 {{4, 1, 2}, {4, 1, 3}, {0, 0, 0}},
252 {{4, 1, 4}, {4, 1, 5}, {0, 0, 0}},
253 {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
254 {{5, 1, 0}, {5, 1, 1}, {5, 1, 2}},
255 {{5, 1, 3}, {5, 1, 4}, {5, 1, 5}},
256 {{15, -1, 0}, {15, -1, 1}, {15, -1, 2}},
257 {{15, -1, 3}, {15, -1, 4}, {15, -1, 5}}}},
258 {{{{6, -1, 0}, {6, -1, 1}, {6, -1, 2}},
259 {{6, -1, 3}, {6, -1, 4}, {6, -1, 5}},
260 {{7, -1, 0}, {7, -1, 1}, {7, -1, 2}},
261 {{7, -1, 3}, {7, -1, 4}, {7, -1, 5}},
262 {{8, -1, 0}, {8, -1, 1}, {8, -1, 2}},
263 {{8, -1, 3}, {8, -1, 4}, {8, -1, 5}},
264 {{9, -1, 0}, {9, -1, 1}, {9, -1, 2}},
265 {{9, -1, 3}, {9, -1, 4}, {9, -1, 5}}},
266 {{{10, -1, 0}, {10, -1, 1}, {10, -1, 2}},
267 {{10, -1, 3}, {10, -1, 4}, {10, -1, 5}},
268 {{11, -1, 0}, {11, -1, 1}, {11, -1, 2}},
269 {{11, -1, 3}, {11, -1, 4}, {11, -1, 5}},
270 {{12, -1, 0}, {12, -1, 1}, {12, -1, 2}},
271 {{12, -1, 3}, {12, -1, 4}, {12, -1, 5}},
272 {{13, -1, 0}, {13, -1, 1}, {13, -1, 2}},
273 {{13, -1, 3}, {13, -1, 4}, {13, -1, 5}}}}};
274 int ic, is, ih, itb, ifb, ifc, ifwtb, iphi_loc;
275 int iside,
ieta,
iphi, idepth, icrate, ihtr, ihtr_fi, ifi_ch, ispigot, idcc, ifed;
291 icrate = hbhecrate[ic];
293 ifwtb = (is / 2 + itb + 1) % 2;
294 ieta = ihbheetadepth[ih][ifwtb][ifb][ifc][0];
295 idepth = ihbheetadepth[ih][ifwtb][ifb][ifc][1];
296 ihtr = ihslot[is] + ih;
297 det = ((
ieta > 16 || idepth > 2) ? (
"HE") : (
"HB"));
298 fpga = ((itb % 2) == 1) ? (
"bot") : (
"top");
301 iphi = (
ieta > 20) ? (ihbhephis[ic] + (is % 2) * 4 + itb * 2 - 1) % 72 + 1
302 : (ihbhephis[ic] + (is % 2) * 4 + itb * 2 + (ifb / 2 + is / 2 + 1) % 2 - 1) % 72 + 1;
303 ispigot = (is % 2) * 6 + ih * 2 + itb;
306 ifed = fedhbhenum[ic][idcc - 1];
309 elId.
setHTR(icrate, ihtr, (fpga ==
"top") ? (1) : (0));
332 icrate = hfcrate[ic];
334 ieta = ihfetadepth[itb][ifb][ifc][0];
335 idepth = ihfetadepth[itb][ifb][ifc][1];
336 ihtr = ihslot[is] + ih;
338 fpga = ((itb % 2) == 1) ? (
"bot") : (
"top");
341 iphi = (
ieta > 39) ? (ihfphis[ic] + (is % 2) * 12 + ih * 4 - 3) % 72 + 1
342 : (ihfphis[ic] + (is % 2) * 12 + ih * 4 + (ifb / 4) * 2 - 1) % 72 + 1;
343 ispigot = (is % 2) * 6 + ih * 2 + itb;
346 ifed = fedhfnum[ic][idcc - 1];
348 elId.
setHTR(icrate, ihtr, (fpga ==
"top") ? (1) : (0));
370 icrate = hocrate[ic];
372 ieta = ihoetasidephi[ih][itb][ifb][ifc][0];
373 iside = ihoetasidephi[ih][itb][ifb][ifc][1];
374 iphi_loc = ihoetasidephi[ih][itb][ifb][ifc][2];
375 ihtr = ihslotho[is][ih];
377 fpga = ((itb % 2) == 1) ? (
"bot") : (
"top");
380 iphi = (ihophis[ic] + is * 6 + iphi_loc - 1) % 72 + 1;
381 ispigot = ihtr < 9 ? (ihtr - 2) * 2 + itb : (ihtr - 13) * 2 + itb;
382 idcc = ihtr < 9 ? 1 : 2;
384 ifed = fedhonum[ic][idcc - 1];
386 elId.
setHTR(icrate, ihtr, (fpga ==
"top") ? (1) : (0));