13 const int 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, 512, 587, 658, 723, 784, 838, 886, 927, 961, 988, 1007, 1019};
15 const int 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};
21 if (towers.size() > towerIndex) {
22 towers.at(towerIndex) = tower;
33 if(towerIndex<towers.size()){
34 if(towers[towerIndex].hwEta()!=iEta || towers[towerIndex].hwPhi()!=iPhi){
36 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
37 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
39 }
else return towers[towerIndex];
43 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
44 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
53 for(
size_t clusterNr=0;clusterNr<clusters.size();clusterNr++){
54 if(clusters[clusterNr].hwEta()==iEta && clusters[clusterNr].hwPhi()==iPhi)
return clusters[clusterNr];
67 if(!isValidIEtaIPhi(iEta,iPhi))
return caloTowerHashMax();
69 const int absIEta =
abs(iEta);
70 if(absIEta>kHFEnd)
return kNrTowers;
71 else if(absIEta<=kHBHEEnd){
73 if(iEta>0) iEtaNoZero--;
74 return (iEtaNoZero+kHBHEEnd)*kHBHENrPhi+iPhi-1;
76 int iEtaIndex = iEta+kHFEnd;
77 if(iEta>0) iEtaIndex= iEta-kHBHEEnd+(kHFEnd-kHBHEEnd)-1;
78 return iEtaIndex*kHFNrPhi+iPhi/kHFPhiSeg + kNrHBHETowers;
92 size_t absIEta =
abs(iEta);
93 if(iPhi<=0 || iPhi>kNPhi)
return false;
94 if(absIEta==0 || absIEta>kHFEnd)
return false;
101 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
105 return calHwEtSum(iEta,iPhi,towers,localEtaMin,localEtaMax,localPhiMin,localPhiMax,kHFEnd,etMode);
109 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
110 int iEtaAbsMax,
SubDet etMode)
113 for(
int etaNr=localEtaMin;etaNr<=localEtaMax;etaNr++){
114 for(
int phiNr=localPhiMin;phiNr<=localPhiMax;phiNr++){
118 if(
abs(towerIEta)<=iEtaAbsMax){
119 const l1t::CaloTower& tower = getTower(towers,towerIEta,towerIPhi);
122 else if(etMode==CALO) hwEtSum+=tower.
hwPt();
135 bool finishPhi =
false;
141 else if(etMode==CALO) towerHwEt+=tower.
hwPt();
142 if(towerHwEt>=minHwEt && towerHwEt<=maxHwEt) nrTowers++;
143 finishPhi = (nav.
currIPhi() == iPhiMax);
154 if(ieta==0) ieta = 1;
155 if(ieta>kHFEnd) ieta = kHFEnd;
156 if(ieta<(-1*kHFEnd)) ieta = -1*kHFEnd;
158 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};
159 return std::make_pair( towerEtas[
abs(ieta)-1],towerEtas[
abs(ieta)] );
164 std::pair<float,float> bounds = towerEtaBounds(ieta);
165 float eta = (bounds.second+bounds.first)/2.;
166 float sign = ieta>0 ? 1. : -1.;
172 float phi = (float(iphi)-0.5)*towerPhiSize(ieta);
173 if (phi >
M_PI) phi = phi - (2*
M_PI);
179 std::pair<float,float> bounds = towerEtaBounds(ieta);
180 float size = (bounds.second-bounds.first);
186 return 2.*
M_PI/kNPhi;
193 if (ieta>kHFBegin)
return ieta-1;
194 else if (ieta<-1*kHFBegin)
return ieta+1;
203 if (mpEta>=kHFBegin)
return mpEta+1;
204 else if (mpEta<=-1*kHFBegin)
return mpEta-1;
215 if (
abs(ieta) > kHFEnd)
216 return (ieta<0 ? 0 : 21);
219 if (
abs(ieta) <= kHFBegin)
222 return 11 - ceil(
double (
abs(ieta) /4.) );
224 return ceil(
double (
abs(ieta) /4.) ) + 10;
229 return 4 - ceil(
double (
abs(ieta)-29) /4. );
231 return ceil(
double (
abs(ieta)-29) /4. ) + 17;
238 double eta = towerEta(ieta);
239 return round ( eta / kGTEtaLSB );
245 double phi = towerPhi(ieta, iphi);
246 if (phi<0) phi = phi + 2*
M_PI;
247 return round ( phi / kGTPhiLSB );
259 cand->
hwEta() * kGTEtaLSB,
260 cand->
hwPhi() * kGTPhiLSB,
318 towerEta(cand->
hwEta()),
std::pair< int, int > north()
static int offsetIEta(int iEta, int offset)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
static int offsetIPhi(int iPhi, int offset)
Abs< T >::type abs(const T &t)
Geom::Phi< T > phi() const
std::pair< int, int > east()
EtSumType getType() const
tuple size
Write out results.