17 if (towers.size() > towerIndex) {
18 towers.at(towerIndex) = tower;
29 if(towerIndex<towers.size()){
30 if(towers[towerIndex].hwEta()!=iEta || towers[towerIndex].hwPhi()!=iPhi){
32 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
33 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
35 }
else return towers[towerIndex];
39 for(
size_t towerNr=0;towerNr<towers.size();towerNr++){
40 if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi)
return towers[towerNr];
49 for(
size_t clusterNr=0;clusterNr<clusters.size();clusterNr++){
50 if(clusters[clusterNr].hwEta()==iEta && clusters[clusterNr].hwPhi()==iPhi)
return clusters[clusterNr];
63 if(!isValidIEtaIPhi(iEta,iPhi))
return caloTowerHashMax();
65 const int absIEta =
abs(iEta);
66 if(absIEta>kHFEnd)
return kNrTowers;
67 else if(absIEta<=kHBHEEnd){
69 if(iEta>0) iEtaNoZero--;
70 return (iEtaNoZero+kHBHEEnd)*kHBHENrPhi+iPhi-1;
72 int iEtaIndex = iEta+kHFEnd;
73 if(iEta>0) iEtaIndex= iEta-kHBHEEnd+(kHFEnd-kHBHEEnd)-1;
74 return iEtaIndex*kHFNrPhi+iPhi/kHFPhiSeg + kNrHBHETowers;
88 size_t absIEta =
abs(iEta);
89 if(iPhi<=0 || iPhi>kNPhi)
return false;
90 if(absIEta==0 || absIEta>kHFEnd)
return false;
97 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
101 return calHwEtSum(iEta,iPhi,towers,localEtaMin,localEtaMax,localPhiMin,localPhiMax,kHFEnd,etMode);
105 int localEtaMin,
int localEtaMax,
int localPhiMin,
int localPhiMax,
106 int iEtaAbsMax,
SubDet etMode)
109 for(
int etaNr=localEtaMin;etaNr<=localEtaMax;etaNr++){
110 for(
int phiNr=localPhiMin;phiNr<=localPhiMax;phiNr++){
114 if(
abs(towerIEta)<=iEtaAbsMax){
115 const l1t::CaloTower& tower = getTower(towers,towerIEta,towerIPhi);
118 else if(etMode==CALO) hwEtSum+=tower.
hwPt();
131 bool finishPhi =
false;
137 else if(etMode==CALO) towerHwEt+=tower.
hwPt();
138 if(towerHwEt>=minHwEt && towerHwEt<=maxHwEt) nrTowers++;
139 finishPhi = (nav.
currIPhi() == iPhiMax);
150 if(ieta==0) ieta = 1;
151 if(ieta>kHFEnd) ieta = kHFEnd;
152 if(ieta<(-1*kHFEnd)) ieta = -1*kHFEnd;
154 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};
155 return std::make_pair( towerEtas[
abs(ieta)-1],towerEtas[
abs(ieta)] );
160 std::pair<float,float> bounds = towerEtaBounds(ieta);
161 float eta = (bounds.second+bounds.first)/2.;
162 float sign = ieta>0 ? 1. : -1.;
168 float phi = (float(iphi)-0.5)*towerPhiSize(ieta);
169 if (phi >
M_PI) phi = phi - (2*
M_PI);
175 std::pair<float,float> bounds = towerEtaBounds(ieta);
176 float size = (bounds.second-bounds.first);
182 return 2.*
M_PI/kNPhi;
189 if (ieta>kHFBegin)
return ieta-1;
190 else if (ieta<-1*kHFBegin)
return ieta+1;
199 if (mpEta>kHFBegin)
return mpEta+1;
200 else if (mpEta<-1*kHFBegin)
return mpEta-1;
211 if (
abs(ieta) > kHFEnd)
212 return (ieta<0 ? 0 : 21);
215 if (
abs(ieta) <= kHFBegin)
218 return 11 - ceil(
double (
abs(ieta) /4.) );
220 return ceil(
double (
abs(ieta) /4.) ) + 10;
225 return 4 - ceil(
double (
abs(ieta)-29) /4. );
227 return ceil(
double (
abs(ieta)-29) /4. ) + 17;
234 double eta = towerEta(ieta);
235 return round ( eta / kGTEtaLSB );
241 double phi = towerPhi(ieta, iphi);
242 if (phi<0) phi = phi + 2*
M_PI;
243 return round ( phi / kGTPhiLSB );
255 cand->
hwEta() * kGTEtaLSB,
256 cand->
hwPhi() * kGTPhiLSB,
314 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.