Skip to content

Commit 15ea9bb

Browse files
authored
Merge pull request #45540 from pallabidas/Phase-2_GCT_HF_updates
[Phase 2 L1T] Updates to GCT objects in HF
2 parents 8cb60b7 + dc5f6b8 commit 15ea9bb

File tree

6 files changed

+441
-118
lines changed

6 files changed

+441
-118
lines changed

L1Trigger/L1CaloTrigger/interface/Phase2L1CaloJetEmulator.h

Lines changed: 89 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ static constexpr int nHgcalEta = 36;
1010
static constexpr int nHgcalPhi = 72;
1111
static constexpr int nHfEta = 24;
1212
static constexpr int nHfPhi = 72;
13-
static constexpr int nSTEta = 6;
14-
static constexpr int nSTEta_hf = 4;
13+
static constexpr int nSTEta = 8;
1514
static constexpr int nSTPhi = 24;
1615
static constexpr int nJets = 10;
1716

@@ -144,9 +143,9 @@ namespace gctobj {
144143

145144
int index_i = 0;
146145
int index_j = 0;
147-
for (int i = 0; i < nBarrelEta / 2 + 1; i += 3) { // 17+1 to divide into 6 super towers
146+
for (int i = 0; i < nBarrelEta / 2 + 1; i += 3) { // 17+1 to divide into 6 supertowers, 7th and 8th to be set 0
148147
index_j = 0;
149-
for (int j = 0; j < nBarrelPhi; j += 3) { // 72 phi to 24 super towers
148+
for (int j = 0; j < nBarrelPhi; j += 3) { // 72 phi to 24 supertowers
150149
stripEta[index_i][index_j][0] = ex_et[i][j] + ex_et[i][j + 1] + ex_et[i][j + 2];
151150
stripEta[index_i][index_j][1] = ex_et[i + 1][j] + ex_et[i + 1][j + 1] + ex_et[i + 1][j + 2];
152151
stripEta[index_i][index_j][2] = ex_et[i + 2][j] + ex_et[i + 2][j + 1] + ex_et[i + 2][j + 2];
@@ -163,20 +162,30 @@ namespace gctobj {
163162
for (int i = 0; i < nSTEta; i++) {
164163
for (int j = 0; j < nSTPhi; j++) {
165164
GCTsupertower_t temp;
166-
float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
167-
temp.et = supertowerEt;
168-
temp.eta = i;
169-
temp.phi = j;
170-
int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
171-
temp.towerEta = peakEta;
172-
int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
173-
temp.towerPhi = peakPhi;
174-
float peakEt = ex_et[i * 3 + peakEta][j * 3 + peakPhi];
175-
temp.towerEt = peakEt;
176-
int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
177-
temp.centerEta = cEta;
178-
int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
179-
temp.centerPhi = cPhi;
165+
temp.et = 0;
166+
temp.eta = 0;
167+
temp.phi = 0;
168+
temp.towerEta = 0;
169+
temp.towerPhi = 0;
170+
temp.towerEt = 0;
171+
temp.centerEta = 0;
172+
temp.centerPhi = 0;
173+
if (i < 6) {
174+
float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
175+
temp.et = supertowerEt;
176+
temp.eta = i;
177+
temp.phi = j;
178+
int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
179+
temp.towerEta = peakEta;
180+
int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
181+
temp.towerPhi = peakPhi;
182+
float peakEt = ex_et[i * 3 + peakEta][j * 3 + peakPhi];
183+
temp.towerEt = peakEt;
184+
int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
185+
temp.centerEta = cEta;
186+
int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
187+
temp.centerPhi = cPhi;
188+
}
180189
supertower_return[i][j] = temp;
181190
}
182191
}
@@ -190,9 +199,9 @@ namespace gctobj {
190199

191200
int index_i = 0;
192201
int index_j = 0;
193-
for (int i = 0; i < nHgcalEta / 2; i += 3) { // 18 eta to 6 super towers
202+
for (int i = 0; i < nHgcalEta / 2; i += 3) { // 18 eta to 6 supertowers, 7th and 8th to be set 0
194203
index_j = 0;
195-
for (int j = 0; j < nHgcalPhi; j += 3) { // 72 phi to 24 super towers
204+
for (int j = 0; j < nHgcalPhi; j += 3) { // 72 phi to 24 supertowers
196205
stripEta[index_i][index_j][0] = hgcalTowers[i][j] + hgcalTowers[i][j + 1] + hgcalTowers[i][j + 2];
197206
stripEta[index_i][index_j][1] = hgcalTowers[i + 1][j] + hgcalTowers[i + 1][j + 1] + hgcalTowers[i + 1][j + 2];
198207
stripEta[index_i][index_j][2] = hgcalTowers[i + 2][j] + hgcalTowers[i + 2][j + 1] + hgcalTowers[i + 2][j + 2];
@@ -219,35 +228,37 @@ namespace gctobj {
219228
temp.towerEt = 0;
220229
temp.centerEta = 0;
221230
temp.centerPhi = 0;
222-
float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
223-
temp.et = supertowerEt;
224-
temp.eta = i;
225-
temp.phi = j;
226-
int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
227-
temp.towerEta = peakEta;
228-
int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
229-
temp.towerPhi = peakPhi;
230-
float peakEt = hgcalTowers[i * 3 + peakEta][j * 3 + peakPhi];
231-
temp.towerEt = peakEt;
232-
int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
233-
temp.centerEta = cEta;
234-
int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
235-
temp.centerPhi = cPhi;
231+
if (i < 6) {
232+
float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
233+
temp.et = supertowerEt;
234+
temp.eta = i;
235+
temp.phi = j;
236+
int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
237+
temp.towerEta = peakEta;
238+
int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
239+
temp.towerPhi = peakPhi;
240+
float peakEt = hgcalTowers[i * 3 + peakEta][j * 3 + peakPhi];
241+
temp.towerEt = peakEt;
242+
int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
243+
temp.centerEta = cEta;
244+
int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
245+
temp.centerPhi = cPhi;
246+
}
236247
supertower_return[i][j] = temp;
237248
}
238249
}
239250
}
240251

241-
inline void makeST_hf(const float hfTowers[nHfEta / 2][nHfPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi]) {
252+
inline void makeST_hf(const float hfTowers[nHfEta][nHfPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi]) {
242253
float et_sumEta[nSTEta][nSTPhi][3];
243254
float stripEta[nSTEta][nSTPhi][3];
244255
float stripPhi[nSTEta][nSTPhi][3];
245256

246-
int index_i = 0; // 5th and 6th ST to be set 0
257+
int index_i = 0;
247258
int index_j = 0;
248-
for (int i = 0; i < nHfEta / 2; i += 3) { // 12 eta to 4 super towers
259+
for (int i = 0; i < nHfEta; i += 3) { // 24 eta to 8 supertowers
249260
index_j = 0;
250-
for (int j = 0; j < nHfPhi; j += 3) { // 72 phi to 24 super towers
261+
for (int j = 0; j < nHfPhi; j += 3) { // 72 phi to 24 supertowers
251262
stripEta[index_i][index_j][0] = hfTowers[i][j] + hfTowers[i][j + 1] + hfTowers[i][j + 2];
252263
stripEta[index_i][index_j][1] = hfTowers[i + 1][j] + hfTowers[i + 1][j + 1] + hfTowers[i + 1][j + 2];
253264
stripEta[index_i][index_j][2] = hfTowers[i + 2][j] + hfTowers[i + 2][j + 1] + hfTowers[i + 2][j + 2];
@@ -273,22 +284,20 @@ namespace gctobj {
273284
temp.towerEt = 0;
274285
temp.centerEta = 0;
275286
temp.centerPhi = 0;
276-
if (i < 4) {
277-
float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
278-
temp.et = supertowerEt;
279-
temp.eta = i;
280-
temp.phi = j;
281-
int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
282-
temp.towerEta = peakEta;
283-
int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
284-
temp.towerPhi = peakPhi;
285-
float peakEt = hfTowers[i * 3 + peakEta][j * 3 + peakPhi];
286-
temp.towerEt = peakEt;
287-
int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
288-
temp.centerEta = cEta;
289-
int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
290-
temp.centerPhi = cPhi;
291-
}
287+
float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
288+
temp.et = supertowerEt;
289+
temp.eta = i;
290+
temp.phi = j;
291+
int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
292+
temp.towerEta = peakEta;
293+
int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
294+
temp.towerPhi = peakPhi;
295+
float peakEt = hfTowers[i * 3 + peakEta][j * 3 + peakPhi];
296+
temp.towerEt = peakEt;
297+
int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
298+
temp.centerEta = cEta;
299+
int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
300+
temp.centerPhi = cPhi;
292301
supertower_return[i][j] = temp;
293302
}
294303
}
@@ -331,25 +340,26 @@ namespace gctobj {
331340
return bestOf24;
332341
}
333342

334-
inline towerMax getPeakBin6N(const etaStripPeak_t& etaStrip) {
343+
inline towerMax getPeakBin8N(const etaStripPeak_t& etaStrip) {
335344
towerMax x;
336345

337346
GCTsupertower_t best01 = bestOf2(etaStrip.pk[0], etaStrip.pk[1]);
338347
GCTsupertower_t best23 = bestOf2(etaStrip.pk[2], etaStrip.pk[3]);
339348
GCTsupertower_t best45 = bestOf2(etaStrip.pk[4], etaStrip.pk[5]);
349+
GCTsupertower_t best67 = bestOf2(etaStrip.pk[6], etaStrip.pk[7]);
340350

341351
GCTsupertower_t best0123 = bestOf2(best01, best23);
342-
343-
GCTsupertower_t bestOf6 = bestOf2(best0123, best45);
344-
345-
x.energy = bestOf6.et;
346-
x.phi = bestOf6.phi;
347-
x.eta = bestOf6.eta;
348-
x.energyMax = bestOf6.towerEt;
349-
x.etaMax = bestOf6.towerEta;
350-
x.phiMax = bestOf6.towerPhi;
351-
x.etaCenter = bestOf6.centerEta;
352-
x.phiCenter = bestOf6.centerPhi;
352+
GCTsupertower_t best4567 = bestOf2(best45, best67);
353+
GCTsupertower_t bestOf8 = bestOf2(best0123, best4567);
354+
355+
x.energy = bestOf8.et;
356+
x.phi = bestOf8.phi;
357+
x.eta = bestOf8.eta;
358+
x.energyMax = bestOf8.towerEt;
359+
x.etaMax = bestOf8.towerEta;
360+
x.phiMax = bestOf8.towerPhi;
361+
x.etaCenter = bestOf8.centerEta;
362+
x.phiCenter = bestOf8.centerPhi;
353363
return x;
354364
}
355365

@@ -365,26 +375,26 @@ namespace gctobj {
365375
etaStripPeak.pk[i] = getPeakBin24N(test);
366376
}
367377

368-
towerMax peakIn6;
369-
peakIn6 = getPeakBin6N(etaStripPeak);
378+
towerMax peakIn8;
379+
peakIn8 = getPeakBin8N(etaStripPeak);
370380

371-
jet.seedEnergy = peakIn6.energy;
381+
jet.seedEnergy = peakIn8.energy;
372382
jet.energy = 0;
373383
jet.tauEt = 0;
374-
jet.eta = peakIn6.eta;
375-
jet.phi = peakIn6.phi;
376-
jet.energyMax = peakIn6.energyMax;
377-
jet.etaMax = peakIn6.etaMax; // overwritten in getJetValues
378-
jet.phiMax = peakIn6.phiMax; // overwritten in getJetValues
379-
jet.etaCenter = peakIn6.etaCenter; // overwritten in getJetValues
380-
jet.phiCenter = peakIn6.phiCenter; // overwritten in getJetValues
384+
jet.eta = peakIn8.eta;
385+
jet.phi = peakIn8.phi;
386+
jet.energyMax = peakIn8.energyMax;
387+
jet.etaMax = peakIn8.etaMax; // overwritten in getJetValues
388+
jet.phiMax = peakIn8.phiMax; // overwritten in getJetValues
389+
jet.etaCenter = peakIn8.etaCenter; // overwritten in getJetValues
390+
jet.phiCenter = peakIn8.phiCenter; // overwritten in getJetValues
381391

382392
return jet;
383393
}
384394

385395
inline jetInfo getJetValues(GCTsupertower_t tempX[nSTEta][nSTPhi], int seed_eta, int seed_phi) {
386396
float temp[nSTEta + 2][nSTPhi + 2];
387-
float eta_slice[3] = {0.f, 0.f, 0.f};
397+
float eta_slice[3] = {0.};
388398
jetInfo jet_tmp;
389399

390400
for (int i = 0; i < nSTEta + 2; i++) {
@@ -419,7 +429,7 @@ namespace gctobj {
419429
}
420430

421431
jet_tmp.energy = eta_slice[0] + eta_slice[1] + eta_slice[2];
422-
jet_tmp.tauEt = eta_slice[1]; //set tau Pt to be sum of ST energies in center eta slice */
432+
jet_tmp.tauEt = eta_slice[1]; //set tau Pt to be sum of ST energies in center eta slice
423433
// To find the jet centre: note that seed supertower is always (1, 1)
424434
jet_tmp.etaCenter =
425435
3 * seed_eta + tempX[seed_eta][seed_phi].centerEta; //this is the ET weighted eta centre of the ST
@@ -446,12 +456,9 @@ namespace gctobj {
446456
jet_tmp = getJetPosition(temp);
447457
int seed_phi = jet_tmp.phi;
448458
int seed_eta = jet_tmp.eta;
449-
float seed_energy = jet_tmp.seedEnergy;
450459
float seed_tower_energy = jet_tmp.energyMax;
451460
jet = getJetValues(temp, seed_eta, seed_phi);
452-
if (seed_energy > 10. &&
453-
seed_tower_energy >
454-
TTseedThreshold) { // suppress <= 10 GeV ST as ST seed and <=5 GeV (3 GeV) as max TT in ST barrel/HF (endcap)
461+
if (seed_tower_energy > TTseedThreshold) { // suppress ST seeds with max TT <=5 GeV (3 GeV) in barrel (endcap/HF)
455462
jet_tmp.energy = jet.energy;
456463
jet_tmp.tauEt = jet.tauEt;
457464
} else {

0 commit comments

Comments
 (0)