1 #ifndef L1TRIGGER_L1CALOTRIGGER_PHASE2L1CALOJETEMULATOR_H 2 #define L1TRIGGER_L1CALOTRIGGER_PHASE2L1CALOJETEMULATOR_H 119 float etSum = et0 + et1 + et2;
120 float iEtSum = 0.5 * et0 + 1.5 * et1 + 2.5 * et2;
124 else if (iEtSum <= 2 * etSum)
141 ex_et[
i][
j] = GCTintTowers[
i][
j];
150 stripEta[index_i][index_j][0] = ex_et[
i][
j] + ex_et[
i][
j + 1] + ex_et[
i][
j + 2];
151 stripEta[index_i][index_j][1] = ex_et[
i + 1][
j] + ex_et[
i + 1][
j + 1] + ex_et[
i + 1][
j + 2];
152 stripEta[index_i][index_j][2] = ex_et[
i + 2][
j] + ex_et[
i + 2][
j + 1] + ex_et[
i + 2][
j + 2];
153 stripPhi[index_i][index_j][0] = ex_et[
i][
j] + ex_et[
i + 1][
j] + ex_et[
i + 2][
j];
154 stripPhi[index_i][index_j][1] = ex_et[
i][
j + 1] + ex_et[
i + 1][
j + 1] + ex_et[
i + 2][
j + 1];
155 stripPhi[index_i][index_j][2] = ex_et[
i][
j + 2] + ex_et[
i + 1][
j + 2] + ex_et[
i + 2][
j + 2];
156 for (
int k = 0;
k < 3;
k++) {
157 et_sumEta[index_i][index_j][
k] = ex_et[
i +
k][
j] + ex_et[
i +
k][
j + 1] + ex_et[
i +
k][
j + 2];
166 float supertowerEt = et_sumEta[
i][
j][0] + et_sumEta[
i][
j][1] + et_sumEta[
i][
j][2];
167 temp.et = supertowerEt;
171 temp.towerEta = peakEta;
173 temp.towerPhi = peakPhi;
174 float peakEt = ex_et[
i * 3 + peakEta][
j * 3 + peakPhi];
175 temp.towerEt = peakEt;
177 temp.centerEta = cEta;
179 temp.centerPhi = cPhi;
180 supertower_return[
i][
j] =
temp;
202 for (
int k = 0;
k < 3;
k++) {
203 et_sumEta[index_i][index_j][
k] =
222 float supertowerEt = et_sumEta[
i][
j][0] + et_sumEta[
i][
j][1] + et_sumEta[
i][
j][2];
223 temp.et = supertowerEt;
227 temp.towerEta = peakEta;
229 temp.towerPhi = peakPhi;
230 float peakEt =
hgcalTowers[
i * 3 + peakEta][
j * 3 + peakPhi];
231 temp.towerEt = peakEt;
233 temp.centerEta = cEta;
235 temp.centerPhi = cPhi;
236 supertower_return[
i][
j] =
temp;
248 for (
int i = 0;
i <
nHfEta / 2;
i += 3) {
251 stripEta[index_i][index_j][0] = hfTowers[
i][
j] + hfTowers[
i][
j + 1] + hfTowers[
i][
j + 2];
252 stripEta[index_i][index_j][1] = hfTowers[
i + 1][
j] + hfTowers[
i + 1][
j + 1] + hfTowers[
i + 1][
j + 2];
253 stripEta[index_i][index_j][2] = hfTowers[
i + 2][
j] + hfTowers[
i + 2][
j + 1] + hfTowers[
i + 2][
j + 2];
254 stripPhi[index_i][index_j][0] = hfTowers[
i][
j] + hfTowers[
i + 1][
j] + hfTowers[
i + 2][
j];
255 stripPhi[index_i][index_j][1] = hfTowers[
i][
j + 1] + hfTowers[
i + 1][
j + 1] + hfTowers[
i + 2][
j + 1];
256 stripPhi[index_i][index_j][2] = hfTowers[
i][
j + 2] + hfTowers[
i + 1][
j + 2] + hfTowers[
i + 2][
j + 2];
257 for (
int k = 0;
k < 3;
k++) {
258 et_sumEta[index_i][index_j][
k] = hfTowers[
i +
k][
j] + hfTowers[
i +
k][
j + 1] + hfTowers[
i +
k][
j + 2];
277 float supertowerEt = et_sumEta[
i][
j][0] + et_sumEta[
i][
j][1] + et_sumEta[
i][
j][2];
278 temp.et = supertowerEt;
282 temp.towerEta = peakEta;
284 temp.towerPhi = peakPhi;
285 float peakEt = hfTowers[
i * 3 + peakEta][
j * 3 + peakPhi];
286 temp.towerEt = peakEt;
288 temp.centerEta = cEta;
290 temp.centerPhi = cPhi;
292 supertower_return[
i][
j] =
temp;
299 x = (calotp0.
et > calotp1.
et) ? calotp0 : calotp1;
345 x.energy = bestOf6.
et;
398 temp[
i + 1][
k + 1] = tempX[
i][
k].et;
402 int seed_eta1, seed_phi1;
404 seed_eta1 = seed_eta;
405 seed_phi1 = seed_phi;
406 float tmp1, tmp2, tmp3;
410 if (
j == seed_eta1 &&
k == seed_phi1) {
411 for (
int m = 0;
m < 3;
m++) {
415 eta_slice[
m] = tmp1 + tmp2 + tmp3;
421 jet_tmp.
energy = eta_slice[0] + eta_slice[1] + eta_slice[2];
422 jet_tmp.
tauEt = eta_slice[1];
425 3 * seed_eta + tempX[seed_eta][seed_phi].centerEta;
427 3 * seed_phi + tempX[seed_eta][seed_phi].centerPhi;
428 jet_tmp.
etaMax = 3 * seed_eta + tempX[seed_eta][seed_phi].towerEta;
429 jet_tmp.
phiMax = 3 * seed_phi + tempX[seed_eta][seed_phi].towerPhi;
433 if (
i + 1 >= seed_eta &&
i <= seed_eta + 1) {
435 if (
k + 1 >= seed_phi &&
k <= seed_phi + 1)
447 int seed_phi = jet_tmp.
phi;
448 int seed_eta = jet_tmp.
eta;
451 if (seed_energy > 10.) {
static constexpr int nSTEta_hf
GCTsupertower_t cr[nSTPhi]
static constexpr int nBarrelPhi
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
void makeST_hf(const float hfTowers[nHfEta/2][nHfPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
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])
jetInfo getRegion(GCTsupertower_t temp[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
towerMax getPeakBin6N(const etaStripPeak_t &etaStrip)
jetInfo getJetValues(GCTsupertower_t tempX[nSTEta][nSTPhi], int seed_eta, int seed_phi)
bool compareByEt(l1tp2::Phase2L1CaloJet i, l1tp2::Phase2L1CaloJet j)