CMS 3D CMS Logo

Classes | Functions
gctobj Namespace Reference

Classes

struct  etaStrip_t
 
struct  etaStripPeak_t
 
struct  GCTintTowers_t
 
struct  GCTsupertower_t
 
struct  GCTtower_t
 
struct  hgcalRegion_t
 
class  jetInfo
 
class  towerMax
 

Functions

GCTsupertower_t bestOf2 (const GCTsupertower_t &calotp0, const GCTsupertower_t &calotp1)
 
bool compareByEt (l1tp2::Phase2L1CaloJet i, l1tp2::Phase2L1CaloJet j)
 
int getEtCenterOf3 (float et0, float et1, float et2)
 
jetInfo getJetPosition (GCTsupertower_t temp[nSTEta][nSTPhi])
 
jetInfo getJetValues (GCTsupertower_t tempX[nSTEta][nSTPhi], int seed_eta, int seed_phi)
 
GCTsupertower_t getPeakBin24N (const etaStrip_t &etaStrip)
 
towerMax getPeakBin8N (const etaStripPeak_t &etaStrip)
 
int getPeakBinOf3 (float et0, float et1, float et2)
 
jetInfo getRegion (GCTsupertower_t temp[nSTEta][nSTPhi], float TTseedThreshold)
 
void makeST (const float GCTintTowers[nBarrelEta/2][nBarrelPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
 
void makeST_hf (const float hfTowers[nHfEta][nHfPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
 
void makeST_hgcal (const float hgcalTowers[nHgcalEta/2][nHgcalPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
 

Function Documentation

◆ bestOf2()

GCTsupertower_t gctobj::bestOf2 ( const GCTsupertower_t calotp0,
const GCTsupertower_t calotp1 
)
inline

Definition at line 306 of file Phase2L1CaloJetEmulator.h.

References gctobj::GCTsupertower_t::et, and x.

Referenced by getPeakBin24N(), and getPeakBin8N().

306  {
307  GCTsupertower_t x;
308  x = (calotp0.et > calotp1.et) ? calotp0 : calotp1;
309  return x;
310  }
float x

◆ compareByEt()

bool gctobj::compareByEt ( l1tp2::Phase2L1CaloJet  i,
l1tp2::Phase2L1CaloJet  j 
)
inline

Definition at line 475 of file Phase2L1CaloJetEmulator.h.

References mps_fire::i, and dqmiolumiharvest::j.

Referenced by Phase2L1CaloJetEmulator::produce().

475 { return (i.jetEt() > j.jetEt()); };

◆ getEtCenterOf3()

int gctobj::getEtCenterOf3 ( float  et0,
float  et1,
float  et2 
)
inline

Definition at line 117 of file Phase2L1CaloJetEmulator.h.

Referenced by makeST(), makeST_hf(), and makeST_hgcal().

117  {
118  float etSum = et0 + et1 + et2;
119  float iEtSum = 0.5 * et0 + 1.5 * et1 + 2.5 * et2;
120  int iAve = 0xEEF;
121  if (iEtSum <= etSum)
122  iAve = 0;
123  else if (iEtSum <= 2 * etSum)
124  iAve = 1;
125  else
126  iAve = 2;
127  return iAve;
128  }

◆ getJetPosition()

jetInfo gctobj::getJetPosition ( GCTsupertower_t  temp[nSTEta][nSTPhi])
inline

Definition at line 366 of file Phase2L1CaloJetEmulator.h.

References gctobj::towerMax::energy, gctobj::towerMax::energyMax, gctobj::towerMax::eta, gctobj::towerMax::etaCenter, gctobj::towerMax::etaMax, getPeakBin24N(), getPeakBin8N(), mps_fire::i, dqmiolumiharvest::j, metsig::jet, nSTEta, nSTPhi, gctobj::towerMax::phi, gctobj::towerMax::phiCenter, gctobj::towerMax::phiMax, gctobj::etaStripPeak_t::pk, groupFilesInBlocks::temp, and builder_last_value_cfg::test.

Referenced by getRegion().

366  {
367  etaStripPeak_t etaStripPeak;
368  jetInfo jet;
369 
370  for (int i = 0; i < nSTEta; i++) {
371  etaStrip_t test;
372  for (int j = 0; j < nSTPhi; j++) {
373  test.cr[j] = temp[i][j];
374  }
375  etaStripPeak.pk[i] = getPeakBin24N(test);
376  }
377 
378  towerMax peakIn8;
379  peakIn8 = getPeakBin8N(etaStripPeak);
380 
381  jet.seedEnergy = peakIn8.energy;
382  jet.energy = 0;
383  jet.tauEt = 0;
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
391 
392  return jet;
393  }
towerMax getPeakBin8N(const etaStripPeak_t &etaStrip)
static constexpr int nSTEta
GCTsupertower_t getPeakBin24N(const etaStrip_t &etaStrip)
static constexpr int nSTPhi

◆ getJetValues()

jetInfo gctobj::getJetValues ( GCTsupertower_t  tempX[nSTEta][nSTPhi],
int  seed_eta,
int  seed_phi 
)
inline

Definition at line 395 of file Phase2L1CaloJetEmulator.h.

References gctobj::jetInfo::energy, gctobj::jetInfo::etaCenter, gctobj::jetInfo::etaMax, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, visualization-live-secondInstance_cfg::m, nSTEta, nSTPhi, gctobj::jetInfo::phiCenter, gctobj::jetInfo::phiMax, gctobj::jetInfo::tauEt, and groupFilesInBlocks::temp.

Referenced by getRegion().

395  {
396  float temp[nSTEta + 2][nSTPhi + 2];
397  float eta_slice[3] = {0.};
398  jetInfo jet_tmp;
399 
400  for (int i = 0; i < nSTEta + 2; i++) {
401  for (int k = 0; k < nSTPhi + 2; k++) {
402  temp[i][k] = 0;
403  }
404  }
405 
406  for (int i = 0; i < nSTEta; i++) {
407  for (int k = 0; k < nSTPhi; k++) {
408  temp[i + 1][k + 1] = tempX[i][k].et;
409  }
410  }
411 
412  int seed_eta1, seed_phi1;
413 
414  seed_eta1 = seed_eta; //to start from corner
415  seed_phi1 = seed_phi; //to start from corner
416  float tmp1, tmp2, tmp3;
417 
418  for (int j = 0; j < nSTEta; j++) {
419  for (int k = 0; k < nSTPhi; k++) {
420  if (j == seed_eta1 && k == seed_phi1) {
421  for (int m = 0; m < 3; m++) {
422  tmp1 = temp[j + m][k];
423  tmp2 = temp[j + m][k + 1];
424  tmp3 = temp[j + m][k + 2];
425  eta_slice[m] = tmp1 + tmp2 + tmp3;
426  }
427  }
428  }
429  }
430 
431  jet_tmp.energy = eta_slice[0] + eta_slice[1] + eta_slice[2];
432  jet_tmp.tauEt = eta_slice[1]; //set tau Pt to be sum of ST energies in center eta slice
433  // To find the jet centre: note that seed supertower is always (1, 1)
434  jet_tmp.etaCenter =
435  3 * seed_eta + tempX[seed_eta][seed_phi].centerEta; //this is the ET weighted eta centre of the ST
436  jet_tmp.phiCenter =
437  3 * seed_phi + tempX[seed_eta][seed_phi].centerPhi; //this is the ET weighted phi centre of the ST
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;
440 
441  // set the used supertower ets to 0
442  for (int i = 0; i < nSTEta; i++) {
443  if (i + 1 >= seed_eta && i <= seed_eta + 1) {
444  for (int k = 0; k < nSTPhi; k++) {
445  if (k + 1 >= seed_phi && k <= seed_phi + 1)
446  tempX[i][k].et = 0;
447  }
448  }
449  }
450 
451  return jet_tmp;
452  }
static constexpr int nSTEta
static constexpr int nSTPhi

◆ getPeakBin24N()

GCTsupertower_t gctobj::getPeakBin24N ( const etaStrip_t etaStrip)
inline

Definition at line 312 of file Phase2L1CaloJetEmulator.h.

References bestOf2(), and gctobj::etaStrip_t::cr.

Referenced by getJetPosition().

312  {
313  GCTsupertower_t best01 = bestOf2(etaStrip.cr[0], etaStrip.cr[1]);
314  GCTsupertower_t best23 = bestOf2(etaStrip.cr[2], etaStrip.cr[3]);
315  GCTsupertower_t best45 = bestOf2(etaStrip.cr[4], etaStrip.cr[5]);
316  GCTsupertower_t best67 = bestOf2(etaStrip.cr[6], etaStrip.cr[7]);
317  GCTsupertower_t best89 = bestOf2(etaStrip.cr[8], etaStrip.cr[9]);
318  GCTsupertower_t best1011 = bestOf2(etaStrip.cr[10], etaStrip.cr[11]);
319  GCTsupertower_t best1213 = bestOf2(etaStrip.cr[12], etaStrip.cr[13]);
320  GCTsupertower_t best1415 = bestOf2(etaStrip.cr[14], etaStrip.cr[15]);
321  GCTsupertower_t best1617 = bestOf2(etaStrip.cr[16], etaStrip.cr[17]);
322  GCTsupertower_t best1819 = bestOf2(etaStrip.cr[18], etaStrip.cr[19]);
323  GCTsupertower_t best2021 = bestOf2(etaStrip.cr[20], etaStrip.cr[21]);
324  GCTsupertower_t best2223 = bestOf2(etaStrip.cr[22], etaStrip.cr[23]);
325 
326  GCTsupertower_t best0123 = bestOf2(best01, best23);
327  GCTsupertower_t best4567 = bestOf2(best45, best67);
328  GCTsupertower_t best891011 = bestOf2(best89, best1011);
329  GCTsupertower_t best12131415 = bestOf2(best1213, best1415);
330  GCTsupertower_t best16171819 = bestOf2(best1617, best1819);
331  GCTsupertower_t best20212223 = bestOf2(best2021, best2223);
332 
333  GCTsupertower_t best01234567 = bestOf2(best0123, best4567);
334  GCTsupertower_t best89101112131415 = bestOf2(best891011, best12131415);
335  GCTsupertower_t best16to23 = bestOf2(best16171819, best20212223);
336 
337  GCTsupertower_t best0to15 = bestOf2(best01234567, best89101112131415);
338  GCTsupertower_t bestOf24 = bestOf2(best0to15, best16to23);
339 
340  return bestOf24;
341  }
GCTsupertower_t bestOf2(const GCTsupertower_t &calotp0, const GCTsupertower_t &calotp1)

◆ getPeakBin8N()

towerMax gctobj::getPeakBin8N ( const etaStripPeak_t etaStrip)
inline

Definition at line 343 of file Phase2L1CaloJetEmulator.h.

References bestOf2(), gctobj::GCTsupertower_t::centerEta, gctobj::GCTsupertower_t::centerPhi, gctobj::GCTsupertower_t::et, gctobj::GCTsupertower_t::eta, gctobj::GCTsupertower_t::phi, gctobj::etaStripPeak_t::pk, gctobj::GCTsupertower_t::towerEt, gctobj::GCTsupertower_t::towerEta, gctobj::GCTsupertower_t::towerPhi, and x.

Referenced by getJetPosition().

343  {
344  towerMax x;
345 
346  GCTsupertower_t best01 = bestOf2(etaStrip.pk[0], etaStrip.pk[1]);
347  GCTsupertower_t best23 = bestOf2(etaStrip.pk[2], etaStrip.pk[3]);
348  GCTsupertower_t best45 = bestOf2(etaStrip.pk[4], etaStrip.pk[5]);
349  GCTsupertower_t best67 = bestOf2(etaStrip.pk[6], etaStrip.pk[7]);
350 
351  GCTsupertower_t best0123 = bestOf2(best01, best23);
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;
363  return x;
364  }
GCTsupertower_t bestOf2(const GCTsupertower_t &calotp0, const GCTsupertower_t &calotp1)
float x

◆ getPeakBinOf3()

int gctobj::getPeakBinOf3 ( float  et0,
float  et1,
float  et2 
)
inline

Definition at line 101 of file Phase2L1CaloJetEmulator.h.

References groupFilesInBlocks::temp, and x.

Referenced by makeST(), makeST_hf(), and makeST_hgcal().

101  {
102  int x;
103  float temp;
104  if (et0 > et1) {
105  x = 0;
106  temp = et0;
107  } else {
108  x = 1;
109  temp = et1;
110  }
111  if (et2 > temp) {
112  x = 2;
113  }
114  return x;
115  }
float x

◆ getRegion()

jetInfo gctobj::getRegion ( GCTsupertower_t  temp[nSTEta][nSTPhi],
float  TTseedThreshold 
)
inline

Definition at line 454 of file Phase2L1CaloJetEmulator.h.

References gctobj::jetInfo::energy, gctobj::jetInfo::energyMax, gctobj::jetInfo::eta, gctobj::jetInfo::etaCenter, gctobj::jetInfo::etaMax, getJetPosition(), getJetValues(), metsig::jet, gctobj::jetInfo::phi, gctobj::jetInfo::phiCenter, gctobj::jetInfo::phiMax, gctobj::jetInfo::tauEt, and groupFilesInBlocks::temp.

Referenced by Phase2L1CaloJetEmulator::produce(), and L1RCT::shareNeighbors().

454  {
455  jetInfo jet_tmp, jet;
456  jet_tmp = getJetPosition(temp);
457  int seed_phi = jet_tmp.phi;
458  int seed_eta = jet_tmp.eta;
459  float seed_tower_energy = jet_tmp.energyMax;
460  jet = getJetValues(temp, seed_eta, seed_phi);
461  if (seed_tower_energy > TTseedThreshold) { // suppress ST seeds with max TT <=5 GeV (3 GeV) in barrel (endcap/HF)
462  jet_tmp.energy = jet.energy;
463  jet_tmp.tauEt = jet.tauEt;
464  } else {
465  jet_tmp.energy = 0.;
466  jet_tmp.tauEt = 0.;
467  }
468  jet_tmp.etaCenter = jet.etaCenter; // this is the ET weighted eta centre of the ST
469  jet_tmp.phiCenter = jet.phiCenter; // this is the ET weighted phi centre of the ST
470  jet_tmp.etaMax = jet.etaMax; // this is the leading tower eta in the ST
471  jet_tmp.phiMax = jet.phiMax; // this is the leading tower phi in the ST
472  return jet_tmp;
473  }
jetInfo getJetPosition(GCTsupertower_t temp[nSTEta][nSTPhi])
jetInfo getJetValues(GCTsupertower_t tempX[nSTEta][nSTPhi], int seed_eta, int seed_phi)

◆ makeST()

void gctobj::makeST ( const float  GCTintTowers[nBarrelEta/2][nBarrelPhi],
GCTsupertower_t  supertower_return[nSTEta][nSTPhi] 
)
inline

Definition at line 130 of file Phase2L1CaloJetEmulator.h.

References getEtCenterOf3(), getPeakBinOf3(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, nBarrelEta, nBarrelPhi, nSTEta, nSTPhi, and groupFilesInBlocks::temp.

Referenced by Phase2L1CaloJetEmulator::produce().

131  {
132  float et_sumEta[nSTEta][nSTPhi][3];
133  float stripEta[nSTEta][nSTPhi][3];
134  float stripPhi[nSTEta][nSTPhi][3];
135 
136  float ex_et[nBarrelEta / 2 + 1][nBarrelPhi];
137  for (int j = 0; j < nBarrelPhi; j++) {
138  ex_et[nBarrelEta / 2][j] = 0;
139  for (int i = 0; i < nBarrelEta / 2; i++) {
140  ex_et[i][j] = GCTintTowers[i][j];
141  }
142  }
143 
144  int index_i = 0;
145  int index_j = 0;
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
147  index_j = 0;
148  for (int j = 0; j < nBarrelPhi; j += 3) { // 72 phi to 24 supertowers
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];
157  }
158  index_j++;
159  }
160  index_i++;
161  }
162  for (int i = 0; i < nSTEta; i++) {
163  for (int j = 0; j < nSTPhi; j++) {
164  GCTsupertower_t temp;
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  }
189  supertower_return[i][j] = temp;
190  }
191  }
192  }
static constexpr int nBarrelPhi
static constexpr int nSTEta
int getEtCenterOf3(float et0, float et1, float et2)
static constexpr int nSTPhi
int getPeakBinOf3(float et0, float et1, float et2)
static constexpr int nBarrelEta

◆ makeST_hf()

void gctobj::makeST_hf ( const float  hfTowers[nHfEta][nHfPhi],
GCTsupertower_t  supertower_return[nSTEta][nSTPhi] 
)
inline

Definition at line 252 of file Phase2L1CaloJetEmulator.h.

References getEtCenterOf3(), getPeakBinOf3(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, nHfEta, nHfPhi, nSTEta, nSTPhi, and groupFilesInBlocks::temp.

Referenced by Phase2L1CaloJetEmulator::produce().

252  {
253  float et_sumEta[nSTEta][nSTPhi][3];
254  float stripEta[nSTEta][nSTPhi][3];
255  float stripPhi[nSTEta][nSTPhi][3];
256 
257  int index_i = 0;
258  int index_j = 0;
259  for (int i = 0; i < nHfEta; i += 3) { // 24 eta to 8 supertowers
260  index_j = 0;
261  for (int j = 0; j < nHfPhi; j += 3) { // 72 phi to 24 supertowers
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];
270  }
271  index_j++;
272  }
273  index_i++;
274  }
275 
276  for (int i = 0; i < nSTEta; i++) {
277  for (int j = 0; j < nSTPhi; j++) {
278  GCTsupertower_t temp;
279  temp.et = 0;
280  temp.eta = 0;
281  temp.phi = 0;
282  temp.towerEta = 0;
283  temp.towerPhi = 0;
284  temp.towerEt = 0;
285  temp.centerEta = 0;
286  temp.centerPhi = 0;
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;
301  supertower_return[i][j] = temp;
302  }
303  }
304  }
static constexpr int nSTEta
int getEtCenterOf3(float et0, float et1, float et2)
static constexpr int nHfPhi
static constexpr int nSTPhi
int getPeakBinOf3(float et0, float et1, float et2)
static constexpr int nHfEta

◆ makeST_hgcal()

void gctobj::makeST_hgcal ( const float  hgcalTowers[nHgcalEta/2][nHgcalPhi],
GCTsupertower_t  supertower_return[nSTEta][nSTPhi] 
)
inline

Definition at line 194 of file Phase2L1CaloJetEmulator.h.

References getEtCenterOf3(), getPeakBinOf3(), l1tPhase2CaloJetEmulator_cff::hgcalTowers, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, nHgcalEta, nHgcalPhi, nSTEta, nSTPhi, and groupFilesInBlocks::temp.

Referenced by Phase2L1CaloJetEmulator::produce().

195  {
196  float et_sumEta[nSTEta][nSTPhi][3];
197  float stripEta[nSTEta][nSTPhi][3];
198  float stripPhi[nSTEta][nSTPhi][3];
199 
200  int index_i = 0;
201  int index_j = 0;
202  for (int i = 0; i < nHgcalEta / 2; i += 3) { // 18 eta to 6 supertowers, 7th and 8th to be set 0
203  index_j = 0;
204  for (int j = 0; j < nHgcalPhi; j += 3) { // 72 phi to 24 supertowers
205  stripEta[index_i][index_j][0] = hgcalTowers[i][j] + hgcalTowers[i][j + 1] + hgcalTowers[i][j + 2];
206  stripEta[index_i][index_j][1] = hgcalTowers[i + 1][j] + hgcalTowers[i + 1][j + 1] + hgcalTowers[i + 1][j + 2];
207  stripEta[index_i][index_j][2] = hgcalTowers[i + 2][j] + hgcalTowers[i + 2][j + 1] + hgcalTowers[i + 2][j + 2];
208  stripPhi[index_i][index_j][0] = hgcalTowers[i][j] + hgcalTowers[i + 1][j] + hgcalTowers[i + 2][j];
209  stripPhi[index_i][index_j][1] = hgcalTowers[i][j + 1] + hgcalTowers[i + 1][j + 1] + hgcalTowers[i + 2][j + 1];
210  stripPhi[index_i][index_j][2] = hgcalTowers[i][j + 2] + hgcalTowers[i + 1][j + 2] + hgcalTowers[i + 2][j + 2];
211  for (int k = 0; k < 3; k++) {
212  et_sumEta[index_i][index_j][k] =
213  hgcalTowers[i + k][j] + hgcalTowers[i + k][j + 1] + hgcalTowers[i + k][j + 2];
214  }
215  index_j++;
216  }
217  index_i++;
218  }
219 
220  for (int i = 0; i < nSTEta; i++) {
221  for (int j = 0; j < nSTPhi; j++) {
222  GCTsupertower_t temp;
223  temp.et = 0;
224  temp.eta = 0;
225  temp.phi = 0;
226  temp.towerEta = 0;
227  temp.towerPhi = 0;
228  temp.towerEt = 0;
229  temp.centerEta = 0;
230  temp.centerPhi = 0;
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  }
247  supertower_return[i][j] = temp;
248  }
249  }
250  }
static constexpr int nSTEta
static constexpr int nHgcalEta
int getEtCenterOf3(float et0, float et1, float et2)
static constexpr int nSTPhi
int getPeakBinOf3(float et0, float et1, float et2)
static constexpr int nHgcalPhi