13 const int64_t
l1t::CaloTools::cos_coeff[72] = {1023, 1019, 1007, 988, 961, 927, 886, 838, 784, 723, 658, 587, 512, 432, 350, 265, 178, 89, 0, -89, -178, -265, -350, -432, -512, -587, -658, -723, -784, -838, -886, -927, -961, -988, -1007, -1019, -1023, -1019, -1007, -988, -961, -927, -886, -838, -784, -723, -658, -587, -512, -432, -350, -265, -178, -89, 0, 89, 178, 265, 350, 432, 511, 587, 658, 723, 784, 838, 886, 927, 961, 988, 1007, 1019};
15 const int64_t
l1t::CaloTools::sin_coeff[72] = {0, 89, 178, 265, 350, 432, 512, 587, 658, 723, 784, 838, 886, 927, 961, 988, 1007, 1019, 1023, 1019, 1007, 988, 961, 927, 886, 838, 784, 723, 658, 587, 512, 432, 350, 265, 178, 89, 0, -89, -178, -265, -350, -432, -512, -587, -658, -723, -784, -838, -886, -927, -961, -988, -1007, -1019, -1023, -1019, -1007, -988, -961, -927, -886, -838, -784, -723, -658, -587, -512, -432, -350, -265, -178, -89};
19 9, 1, 19, 8, 0, 18, 10, 4, 6, 14,
20 28, 24, 13, 27, 23, 15, 5, 7, 22, 12,
21 3, 21, 11, 2, 20, 17, 30, 26, 16, 29,
28 if (towers.size() > towerIndex) {
29 towers.at(towerIndex) = tower;
42 if(towerIndex<towers.size()){
43 if(towers[towerIndex].hwEta()!=iEta || towers[towerIndex].hwPhi()!=iPhi){
45 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
46 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
48 }
else return towers[towerIndex];
52 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
53 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
62 for(
size_t clusterNr=0;clusterNr<clusters.size();clusterNr++){
63 if(clusters[clusterNr].hwEta()==iEta && clusters[clusterNr].hwPhi()==iPhi)
return clusters[clusterNr];
78 const int absIEta =
abs(iEta);
82 if(iEta>0) iEtaNoZero--;
85 int iEtaIndex = iEta+
kHFEnd;
101 size_t absIEta =
abs(iEta);
102 if(iPhi<=0 || iPhi>
kNPhi)
return false;
103 if(absIEta==0 || absIEta>
kHFEnd)
return false;
110 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
114 return calHwEtSum(iEta,iPhi,towers,localEtaMin,localEtaMax,localPhiMin,localPhiMax,
kHFEnd,etMode);
118 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
119 int iEtaAbsMax,
SubDet etMode)
122 for(
int etaNr=localEtaMin;etaNr<=localEtaMax;etaNr++){
123 for(
int phiNr=localPhiMin;phiNr<=localPhiMax;phiNr++){
127 if(
abs(towerIEta)<=iEtaAbsMax){
131 else if(etMode==
CALO) hwEtSum+=tower.
hwPt();
144 bool finishPhi =
false;
150 else if(etMode==
CALO) towerHwEt+=tower.
hwPt();
151 if(towerHwEt>=minHwEt && towerHwEt<=maxHwEt) nrTowers++;
152 finishPhi = (nav.
currIPhi() == iPhiMax);
163 if(ieta==0) ieta = 1;
167 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,0.957,1.044,1.131,1.218,1.305,1.392,1.479,1.566,1.653,1.740,1.830,1.930,2.043,2.172,2.322,2.5,2.650,2.853,3.139,3.314,3.489,3.664,3.839,4.013,4.191,4.363,4.538,4.716,4.889,5.191,5.191};
168 return std::make_pair( towerEtas[
abs(ieta)-1],towerEtas[
abs(ieta)] );
174 float eta = (bounds.second+bounds.first)/2.;
175 float sign = ieta>0 ? 1. : -1.;
182 if (phi >
M_PI) phi = phi - (2*
M_PI);
189 float size = (bounds.second-bounds.first);
203 else if (ieta<-1*
kHFBegin)
return ieta+1;
212 if (mpEta>=
kHFBegin)
return mpEta+1;
213 else if (mpEta<=-1*
kHFBegin)
return mpEta-1;
225 return (ieta<0 ? 0 : 21);
231 return 11 - ceil(
double (
abs(ieta) /4.) );
233 return ceil(
double (
abs(ieta) /4.) ) + 10;
238 return 4 - ceil(
double (
abs(ieta)-29) /4. );
240 return ceil(
double (
abs(ieta)-29) /4. ) + 17;
248 int absIEta =
abs(ieta);
250 if (absIEta>0 && absIEta<=5)
return 0;
251 else if (absIEta<=9)
return 1;
252 else if (absIEta<=13)
return 2;
253 else if (absIEta<=15)
return 3;
254 else if (absIEta<=17)
return 4;
255 else if (absIEta<=19)
return 5;
256 else if (absIEta<=21)
return 6;
257 else if (absIEta==22)
return 7;
258 else if (absIEta==23)
return 8;
259 else if (absIEta==24)
return 9;
260 else if (absIEta==25)
return 10;
261 else if (absIEta==26)
return 11;
262 else if (absIEta<=28)
return 12;
263 else if (absIEta<=32)
return 13;
264 else if (absIEta<=36)
return 14;
265 else if (absIEta<=41)
return 15;
280 if (phi<0) phi = phi + 2*
M_PI;
310 tmpEG.setRawEt(eg.
rawEt());
311 tmpEG.setIsoEt(eg.
isoEt());
313 tmpEG.setNTT(eg.
nTT());
314 tmpEG.setShape(eg.
shape());
332 tmpTau.setRawEt(tau.
rawEt());
333 tmpTau.setIsoEt(tau.
isoEt());
334 tmpTau.setNTT(tau.
nTT());
335 tmpTau.setHasEM(tau.
hasEM());
353 tmpJet.setRawEt(jet.
rawEt());
354 tmpJet.setSeedEt(jet.
seedEt());
355 tmpJet.setPUEt(jet.
puEt());
399 tmpEG.setRawEt(eg.
rawEt());
400 tmpEG.setIsoEt(eg.
isoEt());
402 tmpEG.setNTT(eg.
nTT());
403 tmpEG.setShape(eg.
shape());
421 tmpTau.setRawEt(tau.
rawEt());
422 tmpTau.setIsoEt(tau.
isoEt());
423 tmpTau.setNTT(tau.
nTT());
424 tmpTau.setHasEM(tau.
hasEM());
440 tmpJet.setRawEt(jet.
rawEt());
441 tmpJet.setSeedEt(jet.
seedEt());
442 tmpJet.setPUEt(jet.
puEt());
466 16777215, 4194304, 1864135, 1048576, 671089, 466034, 342392, 262144, 207126, 167772, 138655, 116508, 99273, 85598, 74565,
467 65536, 58053, 51782, 46474, 41943, 38044, 34664, 31715, 29127, 26844, 24818, 23014, 21400, 19949, 18641, 17458,
468 16384, 15406, 14513, 13696, 12945, 12255, 11619, 11030, 10486, 9980, 9511, 9074, 8666, 8285, 7929, 7595,
469 7282, 6988, 6711, 6450, 6205, 5973, 5754, 5546, 5350, 5164, 4987, 4820, 4660, 4509, 4365, 4227,
470 4096, 3971, 3852, 3737, 3628, 3524, 3424, 3328, 3236, 3148, 3064, 2983, 2905, 2830, 2758, 2688,
471 2621, 2557, 2495, 2435, 2378, 2322, 2268, 2217, 2166, 2118, 2071, 2026, 1982, 1940, 1899, 1859,
472 1820, 1783, 1747, 1712, 1678, 1645, 1613, 1581, 1551, 1522, 1493, 1465, 1438, 1412, 1387, 1362,
473 1337, 1314, 1291, 1269, 1247, 1226, 1205, 1185, 1165, 1146, 1127, 1109, 1091, 1074, 1057, 1040,
474 1024, 1008, 993, 978, 963, 948, 934, 921, 907, 894, 881, 868, 856, 844, 832, 820,
475 809, 798, 787, 776, 766, 756, 746, 736, 726, 717, 707, 698, 689, 681, 672, 664,
476 655, 647, 639, 631, 624, 616, 609, 602, 594, 587, 581, 574, 567, 561, 554, 548,
477 542, 536, 530, 524, 518, 512, 506, 501, 496, 490, 485, 480, 475, 470, 465, 460,
478 455, 450, 446, 441, 437, 432, 428, 424, 419, 415, 411, 407, 403, 399, 395, 392,
479 388, 384, 380, 377, 373, 370, 366, 363, 360, 356, 353, 350, 347, 344, 340, 337,
480 334, 331, 328, 326, 323, 320, 317, 314, 312, 309, 306, 304, 301, 299, 296, 294,
481 291, 289, 286, 284, 282, 280, 277, 275, 273, 271, 268, 266, 264, 262, 260, 258,
482 256, 254, 252, 250, 248, 246, 244, 243, 241, 239, 237, 235, 234, 232, 230, 228,
483 227, 225, 223, 222, 220, 219, 217, 216, 214, 212, 211, 209, 208, 207, 205, 204,
484 202, 201, 199, 198, 197, 195, 194, 193, 191, 190, 189, 188, 186, 185, 184, 183,
485 182, 180, 179, 178, 177, 176, 175, 173, 172, 171, 170, 169, 168, 167, 166, 165,
486 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149,
487 149, 148, 147, 146, 145, 144, 143, 143, 142, 141, 140, 139, 139, 138, 137, 136,
488 135, 135, 134, 133, 132, 132, 131, 130, 129, 129, 128, 127, 127, 126, 125, 125,
489 124, 123, 123, 122, 121, 121, 120, 119, 119, 118, 117, 117, 116, 116, 115, 114,
490 114, 113, 113, 112, 111, 111, 110, 110, 109, 109, 108, 108, 107, 106, 106, 105,
491 105, 104, 104, 103, 103, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97,
492 97, 96, 96, 96, 95, 95, 94, 94, 93, 93, 92, 92, 92, 91, 91, 90,
493 90, 89, 89, 89, 88, 88, 87, 87, 87, 86, 86, 85, 85, 85, 84, 84,
494 84, 83, 83, 82, 82, 82, 81, 81, 81, 80, 80, 80, 79, 79, 79, 78,
495 78, 78, 77, 77, 77, 76, 76, 76, 75, 75, 75, 74, 74, 74, 73, 73,
496 73, 73, 72, 72, 72, 71, 71, 71, 70, 70, 70, 70, 69, 69, 69, 68,
497 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65, 65, 64 };
500 aNumerator &= 0x3FFFF;
501 aDenominator &= 0x3FFFF;
505 uint32_t lBitShift(0);
506 for( ;lBitShift!=9 ; ++lBitShift )
508 if ( aDenominator & 0x20000 )
break;
513 uint64_t lInverseDenominator( ( ( aDenominator & 0x3FE00 ) - ( aDenominator & 0x001FF ) ) * ( lLut[ aDenominator >> 9 ] ) );
516 lInverseDenominator >>= 17;
519 uint64_t lResult( aNumerator * lInverseDenominator );
527 uint32_t aFractional = ( lResult >>= ( 9 - lBitShift) ) & 0x3FFFF;
532 unsigned int result = aFractional >> 10;
short int towerIEta() const
short int towerIPhi() const
std::pair< int, int > north()
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
static int offsetIPhi(int iPhi, int offset)
Abs< T >::type abs(const T &t)
short int towerIEta() const
unsigned long long uint64_t
std::pair< int, int > east()
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
void setTowerIPhi(short int iphi)