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};
21 if (towers.size() > towerIndex) {
22 towers.at(towerIndex) = tower;
35 if(towerIndex<towers.size()){
36 if(towers[towerIndex].hwEta()!=iEta || towers[towerIndex].hwPhi()!=iPhi){
38 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
39 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
41 }
else return towers[towerIndex];
45 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
46 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
55 for(
size_t clusterNr=0;clusterNr<clusters.size();clusterNr++){
56 if(clusters[clusterNr].hwEta()==iEta && clusters[clusterNr].hwPhi()==iPhi)
return clusters[clusterNr];
69 if(!isValidIEtaIPhi(iEta,iPhi))
return caloTowerHashMax();
71 const int absIEta =
abs(iEta);
72 if(absIEta>kHFEnd)
return kNrTowers;
73 else if(absIEta<=kHBHEEnd){
75 if(iEta>0) iEtaNoZero--;
76 return (iEtaNoZero+kHBHEEnd)*kHBHENrPhi+iPhi-1;
78 int iEtaIndex = iEta+kHFEnd;
79 if(iEta>0) iEtaIndex= iEta-kHBHEEnd+(kHFEnd-kHBHEEnd)-1;
80 return iEtaIndex*kHFNrPhi+iPhi/kHFPhiSeg + kNrHBHETowers;
94 size_t absIEta =
abs(iEta);
95 if(iPhi<=0 || iPhi>kNPhi)
return false;
96 if(absIEta==0 || absIEta>kHFEnd)
return false;
103 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
107 return calHwEtSum(iEta,iPhi,towers,localEtaMin,localEtaMax,localPhiMin,localPhiMax,kHFEnd,etMode);
111 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
112 int iEtaAbsMax,
SubDet etMode)
115 for(
int etaNr=localEtaMin;etaNr<=localEtaMax;etaNr++){
116 for(
int phiNr=localPhiMin;phiNr<=localPhiMax;phiNr++){
120 if(
abs(towerIEta)<=iEtaAbsMax){
124 else if(etMode==CALO) hwEtSum+=tower.
hwPt();
137 bool finishPhi =
false;
143 else if(etMode==CALO) towerHwEt+=tower.
hwPt();
144 if(towerHwEt>=minHwEt && towerHwEt<=maxHwEt) nrTowers++;
145 finishPhi = (nav.
currIPhi() == iPhiMax);
156 if(ieta==0) ieta = 1;
157 if(ieta>kHFEnd) ieta = kHFEnd;
158 if(ieta<(-1*kHFEnd)) ieta = -1*kHFEnd;
160 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};
161 return std::make_pair( towerEtas[
abs(ieta)-1],towerEtas[
abs(ieta)] );
166 std::pair<float,float> bounds = towerEtaBounds(ieta);
167 float eta = (bounds.second+bounds.first)/2.;
168 float sign = ieta>0 ? 1. : -1.;
174 float phi = (float(iphi)-0.5)*towerPhiSize(ieta);
175 if (phi >
M_PI) phi = phi - (2*
M_PI);
181 std::pair<float,float> bounds = towerEtaBounds(ieta);
182 float size = (bounds.second-bounds.first);
188 return 2.*
M_PI/kNPhi;
195 if (ieta>kHFBegin)
return ieta-1;
196 else if (ieta<-1*kHFBegin)
return ieta+1;
205 if (mpEta>=kHFBegin)
return mpEta+1;
206 else if (mpEta<=-1*kHFBegin)
return mpEta-1;
217 if (
abs(ieta) > kHFEnd)
218 return (ieta<0 ? 0 : 21);
221 if (
abs(ieta) <= kHFBegin)
224 return 11 - ceil(
double (
abs(ieta) /4.) );
226 return ceil(
double (
abs(ieta) /4.) ) + 10;
231 return 4 - ceil(
double (
abs(ieta)-29) /4. );
233 return ceil(
double (
abs(ieta)-29) /4. ) + 17;
241 int absIEta =
abs(ieta);
243 if (absIEta>0 && absIEta<=5)
return 0;
244 else if (absIEta<=9)
return 1;
245 else if (absIEta<=13)
return 2;
246 else if (absIEta<=15)
return 3;
247 else if (absIEta<=17)
return 4;
248 else if (absIEta<=19)
return 5;
249 else if (absIEta<=21)
return 6;
250 else if (absIEta==22)
return 7;
251 else if (absIEta==23)
return 8;
252 else if (absIEta==24)
return 9;
253 else if (absIEta==25)
return 10;
254 else if (absIEta==26)
return 11;
255 else if (absIEta<=28)
return 12;
256 else if (absIEta<=32)
return 13;
257 else if (absIEta<=36)
return 14;
258 else if (absIEta<=41)
return 15;
265 double eta = towerEta(ieta);
266 return round ( eta / kGTEtaLSB );
272 double phi = towerPhi(ieta, iphi);
273 if (phi<0) phi = phi + 2*
M_PI;
274 return round ( phi / kGTPhiLSB );
286 cand->
hwEta() * kGTEtaLSB,
287 cand->
hwPhi() * kGTPhiLSB,
303 tmpEG.setRawEt(eg.
rawEt());
304 tmpEG.setIsoEt(eg.
isoEt());
306 tmpEG.setNTT(eg.
nTT());
307 tmpEG.setShape(eg.
shape());
325 tmpTau.setRawEt(tau.
rawEt());
326 tmpTau.setIsoEt(tau.
isoEt());
327 tmpTau.setNTT(tau.
nTT());
328 tmpTau.setHasEM(tau.
hasEM());
346 tmpJet.setRawEt(jet.
rawEt());
347 tmpJet.setSeedEt(jet.
seedEt());
348 tmpJet.setPUEt(jet.
puEt());
376 towerEta(cand->
hwEta()),
392 tmpEG.setRawEt(eg.
rawEt());
393 tmpEG.setIsoEt(eg.
isoEt());
395 tmpEG.setNTT(eg.
nTT());
396 tmpEG.setShape(eg.
shape());
413 tmpTau.setRawEt(tau.
rawEt());
414 tmpTau.setIsoEt(tau.
isoEt());
415 tmpTau.setNTT(tau.
nTT());
416 tmpTau.setHasEM(tau.
hasEM());
432 tmpJet.setRawEt(jet.
rawEt());
433 tmpJet.setSeedEt(jet.
seedEt());
434 tmpJet.setPUEt(jet.
puEt());
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
Geom::Phi< T > phi() const
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
tuple size
Write out results.
void setTowerIPhi(short int iphi)