13 1023, 1019, 1007, 988, 961, 927, 886, 838, 784, 723, 658, 587, 512, 432, 350, 265, 178, 89,
14 0, -89, -178, -265, -350, -432, -512, -587, -658, -723, -784, -838, -886, -927, -961, -988, -1007, -1019,
15 -1023, -1019, -1007, -988, -961, -927, -886, -838, -784, -723, -658, -587, -512, -432, -350, -265, -178, -89,
16 0, 89, 178, 265, 350, 432, 511, 587, 658, 723, 784, 838, 886, 927, 961, 988, 1007, 1019};
19 0, 89, 178, 265, 350, 432, 512, 587, 658, 723, 784, 838, 886, 927, 961, 988, 1007, 1019,
20 1023, 1019, 1007, 988, 961, 927, 886, 838, 784, 723, 658, 587, 512, 432, 350, 265, 178, 89,
21 0, -89, -178, -265, -350, -432, -512, -587, -658, -723, -784, -838, -886, -927, -961, -988, -1007, -1019,
22 -1023, -1019, -1007, -988, -961, -927, -886, -838, -784, -723, -658, -587, -512, -432, -350, -265, -178, -89};
26 9, 1, 19, 8, 0, 18, 10, 4, 6, 14,
27 28, 24, 13, 27, 23, 15, 5, 7, 22, 12,
28 3, 21, 11, 2, 20, 17, 30, 26, 16, 29,
34 if (towers.size() > towerIndex) {
35 towers.at(towerIndex) =
tower;
48 if (towerIndex < towers.size()) {
49 if (towers[towerIndex].hwEta() != iEta ||
50 towers[towerIndex].hwPhi() !=
53 for (
size_t towerNr = 0; towerNr < towers.size(); towerNr++) {
54 if (towers[towerNr].hwEta() == iEta && towers[towerNr].hwPhi() == iPhi)
55 return towers[towerNr];
58 return towers[towerIndex];
61 for (
size_t towerNr = 0; towerNr < towers.size(); towerNr++) {
62 if (towers[towerNr].hwEta() == iEta && towers[towerNr].hwPhi() == iPhi)
63 return towers[towerNr];
71 for (
size_t clusterNr = 0; clusterNr < clusters.size(); clusterNr++) {
72 if (clusters[clusterNr].hwEta() == iEta && clusters[clusterNr].hwPhi() == iPhi)
73 return clusters[clusterNr];
82 if (!isValidIEtaIPhi(iEta, iPhi))
83 return caloTowerHashMax();
85 const int absIEta =
abs(iEta);
88 else if (absIEta <= kHBHEEnd) {
89 int iEtaNoZero = iEta;
92 return (iEtaNoZero + kHBHEEnd) * kHBHENrPhi + iPhi - 1;
94 int iEtaIndex = iEta + kHFEnd;
96 iEtaIndex = iEta - kHBHEEnd + (kHFEnd - kHBHEEnd) - 1;
97 return iEtaIndex * kHFNrPhi + iPhi / kHFPhiSeg + kNrHBHETowers;
105 size_t absIEta =
abs(iEta);
106 if (iPhi <= 0 || iPhi > kNPhi)
108 if (absIEta == 0 || absIEta > kHFEnd)
116 const std::vector<l1t::CaloTower>&
towers,
122 return calHwEtSum(iEta, iPhi, towers, localEtaMin, localEtaMax, localPhiMin, localPhiMax, kHFEnd, etMode);
127 const std::vector<l1t::CaloTower>&
towers,
135 for (
int etaNr = localEtaMin; etaNr <= localEtaMax; etaNr++) {
136 for (
int phiNr = localPhiMin; phiNr <= localPhiMax; phiNr++) {
139 if (
abs(towerIEta) <= iEtaAbsMax) {
142 hwEtSum += tower.
hwEtEm();
143 else if (etMode ==
HCAL)
145 else if (etMode == CALO)
146 hwEtSum += tower.
hwPt();
157 const std::vector<l1t::CaloTower>&
towers,
164 bool finishPhi =
false;
170 towerHwEt += tower.
hwEtEm();
171 else if (etMode ==
HCAL)
173 else if (etMode == CALO)
174 towerHwEt += tower.
hwPt();
175 if (towerHwEt >= minHwEt && towerHwEt <= maxHwEt)
177 finishPhi = (nav.
currIPhi() == iPhiMax);
191 if (ieta < (-1 * kHFEnd))
194 const float towerEtas[42] = {0, 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870,
195 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, 1.566, 1.653, 1.740, 1.830,
196 1.930, 2.043, 2.172, 2.322, 2.5, 2.650, 2.853, 3.139, 3.314, 3.489, 3.664,
197 3.839, 4.013, 4.191, 4.363, 4.538, 4.716, 4.889, 5.191, 5.191};
198 return std::make_pair(towerEtas[
abs(ieta) - 1], towerEtas[
abs(ieta)]);
202 std::pair<float, float> bounds = towerEtaBounds(ieta);
203 float eta = (bounds.second + bounds.first) / 2.;
204 float sign = ieta > 0 ? 1. : -1.;
209 float phi = (float(iphi) - 0.5) * towerPhiSize(ieta);
211 phi = phi - (2 *
M_PI);
216 std::pair<float, float> bounds = towerEtaBounds(ieta);
217 float size = (bounds.second - bounds.first);
227 else if (ieta < -1 * kHFBegin)
235 if (mpEta >= kHFBegin)
237 else if (mpEta <= -1 * kHFBegin)
246 if (
abs(ieta) > kHFEnd)
247 return (ieta < 0 ? 0 : 21);
250 if (
abs(ieta) <= kHFBegin) {
252 return 11 -
ceil(
double(
abs(ieta) / 4.));
254 return ceil(
double(
abs(ieta) / 4.)) + 10;
259 return 4 -
ceil(
double(
abs(ieta) - 29) / 4.);
261 return ceil(
double(
abs(ieta) - 29) / 4.) + 17;
266 int absIEta =
abs(ieta);
268 if (absIEta > 0 && absIEta <= 5)
270 else if (absIEta <= 9)
272 else if (absIEta <= 13)
274 else if (absIEta <= 15)
276 else if (absIEta <= 17)
278 else if (absIEta <= 19)
280 else if (absIEta <= 21)
282 else if (absIEta == 22)
284 else if (absIEta == 23)
286 else if (absIEta == 24)
288 else if (absIEta == 25)
290 else if (absIEta == 26)
292 else if (absIEta <= 28)
294 else if (absIEta <= 32)
296 else if (absIEta <= 36)
298 else if (absIEta <= 41)
305 double eta = towerEta(ieta);
306 return round(eta / kGTEtaLSB);
310 double phi = towerPhi(ieta, iphi);
312 phi = phi + 2 *
M_PI;
313 return round(phi / kGTPhiLSB);
319 cand->
hwPt() * kGTEtLSB + 1.E-6, cand->
hwEta() * kGTEtaLSB, cand->
hwPhi() * kGTPhiLSB, 0.);
326 tmpEG.setRawEt(eg.
rawEt());
327 tmpEG.setIsoEt(eg.
isoEt());
329 tmpEG.setNTT(eg.
nTT());
330 tmpEG.setShape(eg.
shape());
340 tmpTau.setRawEt(tau.
rawEt());
341 tmpTau.setIsoEt(tau.
isoEt());
342 tmpTau.setNTT(tau.
nTT());
343 tmpTau.setHasEM(tau.
hasEM());
353 tmpJet.setRawEt(jet.
rawEt());
354 tmpJet.setSeedEt(jet.
seedEt());
355 tmpJet.setPUEt(jet.
puEt());
356 tmpJet.setPUDonutEt(0, jet.
puDonutEt(0));
357 tmpJet.setPUDonutEt(1, jet.
puDonutEt(1));
358 tmpJet.setPUDonutEt(2, jet.
puDonutEt(2));
359 tmpJet.setPUDonutEt(3, jet.
puDonutEt(3));
371 cand->
hwPt() * 0.5 + 1.E-6, towerEta(cand->
hwEta()), towerPhi(cand->
hwEta(), cand->
hwPhi()), 0.);
378 tmpEG.setRawEt(eg.
rawEt());
379 tmpEG.setIsoEt(eg.
isoEt());
381 tmpEG.setNTT(eg.
nTT());
382 tmpEG.setShape(eg.
shape());
392 tmpTau.setRawEt(tau.
rawEt());
393 tmpTau.setIsoEt(tau.
isoEt());
394 tmpTau.setNTT(tau.
nTT());
395 tmpTau.setHasEM(tau.
hasEM());
405 tmpJet.setRawEt(jet.
rawEt());
406 tmpJet.setSeedEt(jet.
seedEt());
407 tmpJet.setPUEt(jet.
puEt());
408 tmpJet.setPUDonutEt(0, jet.
puDonutEt(0));
409 tmpJet.setPUDonutEt(1, jet.
puDonutEt(1));
410 tmpJet.setPUDonutEt(2, jet.
puDonutEt(2));
411 tmpJet.setPUDonutEt(3, jet.
puDonutEt(3));
421 0, 16777215, 4194304, 1864135, 1048576, 671089, 466034, 342392, 262144, 207126, 167772, 138655, 116508, 99273,
422 85598, 74565, 65536, 58053, 51782, 46474, 41943, 38044, 34664, 31715, 29127, 26844, 24818, 23014,
423 21400, 19949, 18641, 17458, 16384, 15406, 14513, 13696, 12945, 12255, 11619, 11030, 10486, 9980,
424 9511, 9074, 8666, 8285, 7929, 7595, 7282, 6988, 6711, 6450, 6205, 5973, 5754, 5546,
425 5350, 5164, 4987, 4820, 4660, 4509, 4365, 4227, 4096, 3971, 3852, 3737, 3628, 3524,
426 3424, 3328, 3236, 3148, 3064, 2983, 2905, 2830, 2758, 2688, 2621, 2557, 2495, 2435,
427 2378, 2322, 2268, 2217, 2166, 2118, 2071, 2026, 1982, 1940, 1899, 1859, 1820, 1783,
428 1747, 1712, 1678, 1645, 1613, 1581, 1551, 1522, 1493, 1465, 1438, 1412, 1387, 1362,
429 1337, 1314, 1291, 1269, 1247, 1226, 1205, 1185, 1165, 1146, 1127, 1109, 1091, 1074,
430 1057, 1040, 1024, 1008, 993, 978, 963, 948, 934, 921, 907, 894, 881, 868,
431 856, 844, 832, 820, 809, 798, 787, 776, 766, 756, 746, 736, 726, 717,
432 707, 698, 689, 681, 672, 664, 655, 647, 639, 631, 624, 616, 609, 602,
433 594, 587, 581, 574, 567, 561, 554, 548, 542, 536, 530, 524, 518, 512,
434 506, 501, 496, 490, 485, 480, 475, 470, 465, 460, 455, 450, 446, 441,
435 437, 432, 428, 424, 419, 415, 411, 407, 403, 399, 395, 392, 388, 384,
436 380, 377, 373, 370, 366, 363, 360, 356, 353, 350, 347, 344, 340, 337,
437 334, 331, 328, 326, 323, 320, 317, 314, 312, 309, 306, 304, 301, 299,
438 296, 294, 291, 289, 286, 284, 282, 280, 277, 275, 273, 271, 268, 266,
439 264, 262, 260, 258, 256, 254, 252, 250, 248, 246, 244, 243, 241, 239,
440 237, 235, 234, 232, 230, 228, 227, 225, 223, 222, 220, 219, 217, 216,
441 214, 212, 211, 209, 208, 207, 205, 204, 202, 201, 199, 198, 197, 195,
442 194, 193, 191, 190, 189, 188, 186, 185, 184, 183, 182, 180, 179, 178,
443 177, 176, 175, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163,
444 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149,
445 149, 148, 147, 146, 145, 144, 143, 143, 142, 141, 140, 139, 139, 138,
446 137, 136, 135, 135, 134, 133, 132, 132, 131, 130, 129, 129, 128, 127,
447 127, 126, 125, 125, 124, 123, 123, 122, 121, 121, 120, 119, 119, 118,
448 117, 117, 116, 116, 115, 114, 114, 113, 113, 112, 111, 111, 110, 110,
449 109, 109, 108, 108, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102,
450 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 96,
451 95, 95, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90, 90, 89,
452 89, 89, 88, 88, 87, 87, 87, 86, 86, 85, 85, 85, 84, 84,
453 84, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79,
454 79, 78, 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74,
455 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70, 70,
456 70, 70, 69, 69, 69, 68, 68, 68, 68, 67, 67, 67, 67, 66,
457 66, 66, 66, 65, 65, 65, 65, 64};
460 aNumerator &= 0x3FFFF;
461 aDenominator &= 0x3FFFF;
465 uint32_t lBitShift(0);
466 for (; lBitShift != 9; ++lBitShift) {
467 if (aDenominator & 0x20000)
473 uint64_t lInverseDenominator(((aDenominator & 0x3FE00) - (aDenominator & 0x001FF)) * (lLut[aDenominator >> 9]));
476 lInverseDenominator >>= 17;
479 uint64_t lResult(aNumerator * lInverseDenominator);
487 uint32_t aFractional = (lResult >>= (9 - lBitShift)) & 0x3FFFF;
492 unsigned int result = aFractional >> 10;
constexpr int32_t ceil(float num)
short int towerIEta() const
short int towerIPhi() const
static int offsetIEta(int iEta, int offset)
short int footprintEt() const
short int towerIEta() const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
short int towerHoE() const
std::pair< int, int > north()
static int offsetIPhi(int iPhi, int offset)
Abs< T >::type abs(const T &t)
std::pair< int, int > east()
short int towerIEta() const
unsigned long long uint64_t
short int towerIPhi() const
void setTowerIPhi(short int iphi)
void setTowerIPhi(short int iphi)
short int puDonutEt(int i) const
short int towerIPhi() const
EtSumType getType() const
tuple size
Write out results.
void setTowerIPhi(short int iphi)