1 #ifndef L1TRIGGER_L1CALOTRIGGER_PHASE2L1CALOJETEMULATOR_H 2 #define L1TRIGGER_L1CALOTRIGGER_PHASE2L1CALOJETEMULATOR_H 118 float etSum = et0 + et1 + et2;
119 float iEtSum = 0.5 * et0 + 1.5 * et1 + 2.5 * et2;
123 else if (iEtSum <= 2 * etSum)
140 ex_et[
i][
j] = GCTintTowers[
i][
j];
149 stripEta[index_i][index_j][0] = ex_et[
i][
j] + ex_et[
i][
j + 1] + ex_et[
i][
j + 2];
150 stripEta[index_i][index_j][1] = ex_et[
i + 1][
j] + ex_et[
i + 1][
j + 1] + ex_et[
i + 1][
j + 2];
151 stripEta[index_i][index_j][2] = ex_et[
i + 2][
j] + ex_et[
i + 2][
j + 1] + ex_et[
i + 2][
j + 2];
152 stripPhi[index_i][index_j][0] = ex_et[
i][
j] + ex_et[
i + 1][
j] + ex_et[
i + 2][
j];
153 stripPhi[index_i][index_j][1] = ex_et[
i][
j + 1] + ex_et[
i + 1][
j + 1] + ex_et[
i + 2][
j + 1];
154 stripPhi[index_i][index_j][2] = ex_et[
i][
j + 2] + ex_et[
i + 1][
j + 2] + ex_et[
i + 2][
j + 2];
155 for (
int k = 0;
k < 3;
k++) {
156 et_sumEta[index_i][index_j][
k] = ex_et[
i +
k][
j] + ex_et[
i +
k][
j + 1] + ex_et[
i +
k][
j + 2];
174 float supertowerEt = et_sumEta[
i][
j][0] + et_sumEta[
i][
j][1] + et_sumEta[
i][
j][2];
175 temp.et = supertowerEt;
179 temp.towerEta = peakEta;
181 temp.towerPhi = peakPhi;
182 float peakEt = ex_et[
i * 3 + peakEta][
j * 3 + peakPhi];
183 temp.towerEt = peakEt;
185 temp.centerEta = cEta;
187 temp.centerPhi = cPhi;
189 supertower_return[
i][
j] =
temp;
211 for (
int k = 0;
k < 3;
k++) {
212 et_sumEta[index_i][index_j][
k] =
232 float supertowerEt = et_sumEta[
i][
j][0] + et_sumEta[
i][
j][1] + et_sumEta[
i][
j][2];
233 temp.et = supertowerEt;
237 temp.towerEta = peakEta;
239 temp.towerPhi = peakPhi;
240 float peakEt =
hgcalTowers[
i * 3 + peakEta][
j * 3 + peakPhi];
241 temp.towerEt = peakEt;
243 temp.centerEta = cEta;
245 temp.centerPhi = cPhi;
247 supertower_return[
i][
j] =
temp;
262 stripEta[index_i][index_j][0] = hfTowers[
i][
j] + hfTowers[
i][
j + 1] + hfTowers[
i][
j + 2];
263 stripEta[index_i][index_j][1] = hfTowers[
i + 1][
j] + hfTowers[
i + 1][
j + 1] + hfTowers[
i + 1][
j + 2];
264 stripEta[index_i][index_j][2] = hfTowers[
i + 2][
j] + hfTowers[
i + 2][
j + 1] + hfTowers[
i + 2][
j + 2];
265 stripPhi[index_i][index_j][0] = hfTowers[
i][
j] + hfTowers[
i + 1][
j] + hfTowers[
i + 2][
j];
266 stripPhi[index_i][index_j][1] = hfTowers[
i][
j + 1] + hfTowers[
i + 1][
j + 1] + hfTowers[
i + 2][
j + 1];
267 stripPhi[index_i][index_j][2] = hfTowers[
i][
j + 2] + hfTowers[
i + 1][
j + 2] + hfTowers[
i + 2][
j + 2];
268 for (
int k = 0;
k < 3;
k++) {
269 et_sumEta[index_i][index_j][
k] = hfTowers[
i +
k][
j] + hfTowers[
i +
k][
j + 1] + hfTowers[
i +
k][
j + 2];
287 float supertowerEt = et_sumEta[
i][
j][0] + et_sumEta[
i][
j][1] + et_sumEta[
i][
j][2];
288 temp.et = supertowerEt;
292 temp.towerEta = peakEta;
294 temp.towerPhi = peakPhi;
295 float peakEt = hfTowers[
i * 3 + peakEta][
j * 3 + peakPhi];
296 temp.towerEt = peakEt;
298 temp.centerEta = cEta;
300 temp.centerPhi = cPhi;
301 supertower_return[
i][
j] =
temp;
308 x = (calotp0.
et > calotp1.
et) ? calotp0 : calotp1;
355 x.energy = bestOf8.
et;
397 float eta_slice[3] = {0.};
408 temp[
i + 1][
k + 1] = tempX[
i][
k].et;
412 int seed_eta1, seed_phi1;
414 seed_eta1 = seed_eta;
415 seed_phi1 = seed_phi;
416 float tmp1, tmp2, tmp3;
420 if (
j == seed_eta1 &&
k == seed_phi1) {
421 for (
int m = 0;
m < 3;
m++) {
425 eta_slice[
m] = tmp1 + tmp2 + tmp3;
431 jet_tmp.
energy = eta_slice[0] + eta_slice[1] + eta_slice[2];
432 jet_tmp.
tauEt = eta_slice[1];
435 3 * seed_eta + tempX[seed_eta][seed_phi].centerEta;
437 3 * seed_phi + tempX[seed_eta][seed_phi].centerPhi;
438 jet_tmp.
etaMax = 3 * seed_eta + tempX[seed_eta][seed_phi].towerEta;
439 jet_tmp.
phiMax = 3 * seed_phi + tempX[seed_eta][seed_phi].towerPhi;
443 if (
i + 1 >= seed_eta &&
i <= seed_eta + 1) {
445 if (
k + 1 >= seed_phi &&
k <= seed_phi + 1)
457 int seed_phi = jet_tmp.
phi;
458 int seed_eta = jet_tmp.
eta;
459 float seed_tower_energy = jet_tmp.
energyMax;
461 if (seed_tower_energy > TTseedThreshold) {
GCTsupertower_t cr[nSTPhi]
static constexpr int nBarrelPhi
towerMax getPeakBin8N(const etaStripPeak_t &etaStrip)
void makeST_hf(const float hfTowers[nHfEta][nHfPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
static constexpr int nSTEta
GCTsupertower_t getPeakBin24N(const etaStrip_t &etaStrip)
static constexpr int nHgcalEta
GCTsupertower_t pk[nSTEta]
static constexpr int nJets
int getEtCenterOf3(float et0, float et1, float et2)
GCTsupertower_t bestOf2(const GCTsupertower_t &calotp0, const GCTsupertower_t &calotp1)
static constexpr int nHfPhi
static constexpr int nSTPhi
jetInfo getJetPosition(GCTsupertower_t temp[nSTEta][nSTPhi])
int getPeakBinOf3(float et0, float et1, float et2)
void makeST(const float GCTintTowers[nBarrelEta/2][nBarrelPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
static constexpr int nHgcalPhi
void makeST_hgcal(const float hgcalTowers[nHgcalEta/2][nHgcalPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
static constexpr int nBarrelEta
static constexpr int nHfEta
jetInfo getJetValues(GCTsupertower_t tempX[nSTEta][nSTPhi], int seed_eta, int seed_phi)
jetInfo getRegion(GCTsupertower_t temp[nSTEta][nSTPhi], float TTseedThreshold)
bool compareByEt(l1tp2::Phase2L1CaloJet i, l1tp2::Phase2L1CaloJet j)