14 if(towerIndex<towers.size()){
15 if(towers[towerIndex].hwEta()!=iEta || towers[towerIndex].hwPhi()!=iPhi){
17 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
18 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
20 }
else return towers[towerIndex];
28 for(
size_t clusterNr=0;clusterNr<clusters.size();clusterNr++){
29 if(clusters[clusterNr].hwEta()==iEta && clusters[clusterNr].hwPhi()==iPhi)
return clusters[clusterNr];
42 if(!isValidIEtaIPhi(iEta,iPhi))
return caloTowerHashMax();
44 const int absIEta =
abs(iEta);
45 if(absIEta>kHFEnd)
return kNrTowers;
46 else if(absIEta<=kHBHEEnd){
48 if(iEta>0) iEtaNoZero--;
49 return (iEtaNoZero+kHBHEEnd)*kHBHENrPhi+iPhi-1;
51 int iEtaIndex = iEta+kHFEnd;
52 if(iEta>0) iEtaIndex= iEta-kHBHEEnd+(kHFEnd-kHBHEEnd)-1;
53 return iEtaIndex*kHFNrPhi+iPhi/kHFPhiSeg + kNrHBHETowers;
67 size_t absIEta =
abs(iEta);
68 if(iPhi<=0 || iPhi>kHBHENrPhi)
return false;
69 if(absIEta==0 || absIEta>kHFEnd)
return false;
70 if(absIEta>kHBHEEnd && iPhi%kHFPhiSeg!=1)
return false;
76 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
80 return calHwEtSum(iEta,iPhi,towers,localEtaMin,localEtaMax,localPhiMin,localPhiMax,kHFEnd,etMode);
84 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
85 int iEtaAbsMax,
SubDet etMode)
88 for(
int etaNr=localEtaMin;etaNr<=localEtaMax;etaNr++){
89 for(
int phiNr=localPhiMin;phiNr<=localPhiMax;phiNr++){
93 if(
abs(towerIEta)<=iEtaAbsMax){
94 const l1t::CaloTower& tower = getTower(towers,towerIEta,towerIPhi);
115 if(etMode&CALO) towerHwEt+=tower.
hwPt();
116 if(towerHwEt>=minHwEt && towerHwEt<=maxHwEt) nrTowers++;
126 if(ieta==0) ieta = 1;
127 if(ieta>32) ieta = 32;
128 if(ieta<-32) ieta = -32;
129 const float towerEtas[33] = {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,3.000,3.5,4.0,4.5,5.0};
130 return std::make_pair( towerEtas[
abs(ieta)-1],towerEtas[
abs(ieta)] );
135 std::pair<float,float> bounds = towerEtaBounds(ieta);
136 float eta = (bounds.second+bounds.first)/2.;
137 float sign = ieta>0 ? 1. : -1.;
143 return (
float(iphi)-0.5)*towerPhiSize(ieta);
148 std::pair<float,float> bounds = towerEtaBounds(ieta);
149 float size = (bounds.second-bounds.first);
155 if(
abs(ieta)<=28)
return 2.*
M_PI/72.;
156 else return 2.*
M_PI/18.;
std::pair< int, int > north()
static int offsetIEta(int iEta, int offset)
static int offsetIPhi(int iPhi, int offset)
Abs< T >::type abs(const T &t)
std::pair< int, int > east()
tuple size
Write out results.