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 getPeakBin6N (const etaStripPeak_t &etaStrip)
 
int getPeakBinOf3 (float et0, float et1, float et2)
 
jetInfo getRegion (GCTsupertower_t temp[nSTEta][nSTPhi])
 
void makeST (const float GCTintTowers[nBarrelEta/2][nBarrelPhi], GCTsupertower_t supertower_return[nSTEta][nSTPhi])
 
void makeST_hf (const float hfTowers[nHfEta/2][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 323 of file Phase2L1CaloJetEmulator.h.

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

Referenced by getPeakBin24N(), and getPeakBin6N().

323  {
324  GCTsupertower_t x;
325  x = (calotp0.et > calotp1.et) ? calotp0 : calotp1;
326  return x;
327  }
float x

◆ compareByEt()

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

Definition at line 491 of file Phase2L1CaloJetEmulator.h.

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

Referenced by Phase2L1CaloJetEmulator::produce().

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

◆ getEtCenterOf3()

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

Definition at line 144 of file Phase2L1CaloJetEmulator.h.

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

144  {
145  float etSum = et0 + et1 + et2;
146  float iEtSum = 0.5 * et0 + 1.5 * et1 + 2.5 * et2;
147  int iAve = 0xEEF;
148  if (iEtSum <= etSum)
149  iAve = 0;
150  else if (iEtSum <= 2 * etSum)
151  iAve = 1;
152  else
153  iAve = 2;
154  return iAve;
155  }

◆ getJetPosition()

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

Definition at line 382 of file Phase2L1CaloJetEmulator.h.

References gctobj::towerMax::energy, gctobj::towerMax::energyMax, gctobj::towerMax::eta, gctobj::towerMax::etaCenter, gctobj::towerMax::etaMax, getPeakBin24N(), getPeakBin6N(), 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 ctpps_dqm_sourceclient-live_cfg::test.

Referenced by getRegion().

382  {
383  etaStripPeak_t etaStripPeak;
384  jetInfo jet;
385 
386  for (int i = 0; i < nSTEta; i++) {
387  etaStrip_t test;
388  for (int j = 0; j < nSTPhi; j++) {
389  test.cr[j] = temp[i][j];
390  }
391  etaStripPeak.pk[i] = getPeakBin24N(test);
392  }
393 
394  towerMax peakIn6;
395  peakIn6 = getPeakBin6N(etaStripPeak);
396 
397  jet.seedEnergy = peakIn6.energy;
398  jet.energy = 0;
399  jet.tauEt = 0;
400  jet.eta = peakIn6.eta;
401  jet.phi = peakIn6.phi;
402  jet.energyMax = peakIn6.energyMax;
403  jet.etaMax = peakIn6.etaMax; // overwritten in getJetValues
404  jet.phiMax = peakIn6.phiMax; // overwritten in getJetValues
405  jet.etaCenter = peakIn6.etaCenter; // overwritten in getJetValues
406  jet.phiCenter = peakIn6.phiCenter; // overwritten in getJetValues
407 
408  return jet;
409  }
static constexpr int nSTEta
GCTsupertower_t getPeakBin24N(const etaStrip_t &etaStrip)
static constexpr int nSTPhi
towerMax getPeakBin6N(const etaStripPeak_t &etaStrip)

◆ getJetValues()

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

Definition at line 411 of file Phase2L1CaloJetEmulator.h.

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

Referenced by getRegion().

411  {
412  float temp[nSTEta + 2][nSTPhi + 2];
413  float eta_slice[3];
414  jetInfo jet_tmp;
415 
416  for (int i = 0; i < nSTEta + 2; i++) {
417  for (int k = 0; k < nSTPhi + 2; k++) {
418  temp[i][k] = 0;
419  }
420  }
421 
422  for (int i = 0; i < nSTEta; i++) {
423  for (int k = 0; k < nSTPhi; k++) {
424  temp[i + 1][k + 1] = tempX[i][k].et;
425  }
426  }
427 
428  int seed_eta1, seed_phi1;
429 
430  seed_eta1 = seed_eta; //to start from corner
431  seed_phi1 = seed_phi; //to start from corner
432  float tmp1, tmp2, tmp3;
433 
434  for (int j = 0; j < nSTEta; j++) {
435  for (int k = 0; k < nSTPhi; k++) {
436  if (j == seed_eta1 && k == seed_phi1) {
437  for (int m = 0; m < 3; m++) {
438  tmp1 = temp[j + m][k];
439  tmp2 = temp[j + m][k + 1];
440  tmp3 = temp[j + m][k + 2];
441  eta_slice[m] = tmp1 + tmp2 + tmp3;
442  }
443  }
444  }
445  }
446 
447  jet_tmp.energy = eta_slice[0] + eta_slice[1] + eta_slice[2];
448  jet_tmp.tauEt = eta_slice[1]; //set tau Pt to be sum of ST energies in center eta slice */
449  // To find the jet centre: note that seed supertower is always (1, 1)
450  jet_tmp.etaCenter =
451  3 * seed_eta + tempX[seed_eta][seed_phi].centerEta; //this is the ET weighted eta centre of the ST
452  jet_tmp.phiCenter =
453  3 * seed_phi + tempX[seed_eta][seed_phi].centerPhi; //this is the ET weighted phi centre of the ST
454  jet_tmp.etaMax = 3 * seed_eta + tempX[seed_eta][seed_phi].towerEta;
455  jet_tmp.phiMax = 3 * seed_phi + tempX[seed_eta][seed_phi].towerPhi;
456 
457  // set the used supertower ets to 0
458  for (int i = 0; i < nSTEta; i++) {
459  if (i + 1 >= seed_eta && i <= seed_eta + 1) {
460  for (int k = 0; k < nSTPhi; k++) {
461  if (k + 1 >= seed_phi && k <= seed_phi + 1)
462  tempX[i][k].et = 0;
463  }
464  }
465  }
466 
467  return jet_tmp;
468  }
static constexpr int nSTEta
static constexpr int nSTPhi

◆ getPeakBin24N()

GCTsupertower_t gctobj::getPeakBin24N ( const etaStrip_t etaStrip)
inline

Definition at line 329 of file Phase2L1CaloJetEmulator.h.

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

Referenced by getJetPosition().

329  {
330  GCTsupertower_t best01 = bestOf2(etaStrip.cr[0], etaStrip.cr[1]);
331  GCTsupertower_t best23 = bestOf2(etaStrip.cr[2], etaStrip.cr[3]);
332  GCTsupertower_t best45 = bestOf2(etaStrip.cr[4], etaStrip.cr[5]);
333  GCTsupertower_t best67 = bestOf2(etaStrip.cr[6], etaStrip.cr[7]);
334  GCTsupertower_t best89 = bestOf2(etaStrip.cr[8], etaStrip.cr[9]);
335  GCTsupertower_t best1011 = bestOf2(etaStrip.cr[10], etaStrip.cr[11]);
336  GCTsupertower_t best1213 = bestOf2(etaStrip.cr[12], etaStrip.cr[13]);
337  GCTsupertower_t best1415 = bestOf2(etaStrip.cr[14], etaStrip.cr[15]);
338  GCTsupertower_t best1617 = bestOf2(etaStrip.cr[16], etaStrip.cr[17]);
339  GCTsupertower_t best1819 = bestOf2(etaStrip.cr[18], etaStrip.cr[19]);
340  GCTsupertower_t best2021 = bestOf2(etaStrip.cr[20], etaStrip.cr[21]);
341  GCTsupertower_t best2223 = bestOf2(etaStrip.cr[22], etaStrip.cr[23]);
342 
343  GCTsupertower_t best0123 = bestOf2(best01, best23);
344  GCTsupertower_t best4567 = bestOf2(best45, best67);
345  GCTsupertower_t best891011 = bestOf2(best89, best1011);
346  GCTsupertower_t best12131415 = bestOf2(best1213, best1415);
347  GCTsupertower_t best16171819 = bestOf2(best1617, best1819);
348  GCTsupertower_t best20212223 = bestOf2(best2021, best2223);
349 
350  GCTsupertower_t best01234567 = bestOf2(best0123, best4567);
351  GCTsupertower_t best89101112131415 = bestOf2(best891011, best12131415);
352  GCTsupertower_t best16to23 = bestOf2(best16171819, best20212223);
353 
354  GCTsupertower_t best0to15 = bestOf2(best01234567, best89101112131415);
355  GCTsupertower_t bestOf24 = bestOf2(best0to15, best16to23);
356 
357  return bestOf24;
358  }
GCTsupertower_t bestOf2(const GCTsupertower_t &calotp0, const GCTsupertower_t &calotp1)

◆ getPeakBin6N()

towerMax gctobj::getPeakBin6N ( const etaStripPeak_t etaStrip)
inline

Definition at line 360 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().

360  {
361  towerMax x;
362 
363  GCTsupertower_t best01 = bestOf2(etaStrip.pk[0], etaStrip.pk[1]);
364  GCTsupertower_t best23 = bestOf2(etaStrip.pk[2], etaStrip.pk[3]);
365  GCTsupertower_t best45 = bestOf2(etaStrip.pk[4], etaStrip.pk[5]);
366 
367  GCTsupertower_t best0123 = bestOf2(best01, best23);
368 
369  GCTsupertower_t bestOf6 = bestOf2(best0123, best45);
370 
371  x.energy = bestOf6.et;
372  x.phi = bestOf6.phi;
373  x.eta = bestOf6.eta;
374  x.energyMax = bestOf6.towerEt;
375  x.etaMax = bestOf6.towerEta;
376  x.phiMax = bestOf6.towerPhi;
377  x.etaCenter = bestOf6.centerEta;
378  x.phiCenter = bestOf6.centerPhi;
379  return x;
380  }
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 128 of file Phase2L1CaloJetEmulator.h.

References groupFilesInBlocks::temp, and x.

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

128  {
129  int x;
130  float temp;
131  if (et0 > et1) {
132  x = 0;
133  temp = et0;
134  } else {
135  x = 1;
136  temp = et1;
137  }
138  if (et2 > temp) {
139  x = 2;
140  }
141  return x;
142  }
float x

◆ getRegion()

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

Definition at line 470 of file Phase2L1CaloJetEmulator.h.

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

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

470  {
471  jetInfo jet_tmp, jet;
472  jet_tmp = getJetPosition(temp);
473  int seed_phi = jet_tmp.phi;
474  int seed_eta = jet_tmp.eta;
475  float seed_energy = jet_tmp.seedEnergy;
476  jet = getJetValues(temp, seed_eta, seed_phi);
477  if (seed_energy > 10.) { // suppress <= 10 GeV ST as seed
478  jet_tmp.energy = jet.energy;
479  jet_tmp.tauEt = jet.tauEt;
480  } else {
481  jet_tmp.energy = 0.;
482  jet_tmp.tauEt = 0.;
483  }
484  jet_tmp.etaCenter = jet.etaCenter; // this is the ET weighted eta centre of the ST
485  jet_tmp.phiCenter = jet.phiCenter; // this is the ET weighted eta centre of the ST
486  jet_tmp.etaMax = jet.etaMax; // this is the leading tower eta in the ST
487  jet_tmp.phiMax = jet.phiMax; // this is the leading tower phi in the ST
488  return jet_tmp;
489  }
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 157 of file Phase2L1CaloJetEmulator.h.

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

Referenced by Phase2L1CaloJetEmulator::produce().

158  {
159  float et_sumEta[nSTEta][nSTPhi][3];
160  float stripEta[nSTEta][nSTPhi][3];
161  float stripPhi[nSTEta][nSTPhi][3];
162 
163  float ex_et[nBarrelEta / 2 + 1][nBarrelPhi];
164  for (int j = 0; j < nBarrelPhi; j++) {
165  ex_et[nBarrelEta / 2][j] = 0;
166  for (int i = 0; i < nBarrelEta / 2; i++) {
167  ex_et[i][j] = GCTintTowers[i][j];
168  }
169  }
170 
171  int index_i = 0;
172  int index_j = 0;
173  for (int i = 0; i < nBarrelEta / 2 + 1; i += 3) { // 17+1 to divide into 6 super towers
174  index_j = 0;
175  for (int j = 0; j < nBarrelPhi; j += 3) { // 72 phi to 24 super towers
176  stripEta[index_i][index_j][0] = ex_et[i][j] + ex_et[i][j + 1] + ex_et[i][j + 2];
177  stripEta[index_i][index_j][1] = ex_et[i + 1][j] + ex_et[i + 1][j + 1] + ex_et[i + 1][j + 2];
178  stripEta[index_i][index_j][2] = ex_et[i + 2][j] + ex_et[i + 2][j + 1] + ex_et[i + 2][j + 2];
179  stripPhi[index_i][index_j][0] = ex_et[i][j] + ex_et[i + 1][j] + ex_et[i + 2][j];
180  stripPhi[index_i][index_j][1] = ex_et[i][j + 1] + ex_et[i + 1][j + 1] + ex_et[i + 2][j + 1];
181  stripPhi[index_i][index_j][2] = ex_et[i][j + 2] + ex_et[i + 1][j + 2] + ex_et[i + 2][j + 2];
182  for (int k = 0; k < 3; k++) {
183  et_sumEta[index_i][index_j][k] = ex_et[i + k][j] + ex_et[i + k][j + 1] + ex_et[i + k][j + 2];
184  }
185  index_j++;
186  }
187  index_i++;
188  }
189  for (int i = 0; i < nSTEta; i++) {
190  for (int j = 0; j < nSTPhi; j++) {
191  GCTsupertower_t temp;
192  float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
193  temp.et = supertowerEt;
194  temp.eta = i;
195  temp.phi = j;
196  int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
197  temp.towerEta = peakEta;
198  int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
199  temp.towerPhi = peakPhi;
200  float peakEt = ex_et[i * 3 + peakEta][j * 3 + peakPhi];
201  temp.towerEt = peakEt;
202  int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
203  temp.centerEta = cEta;
204  int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
205  temp.centerPhi = cPhi;
206  supertower_return[i][j] = temp;
207  }
208  }
209  }
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/2][nHfPhi],
GCTsupertower_t  supertower_return[nSTEta][nSTPhi] 
)
inline

Definition at line 267 of file Phase2L1CaloJetEmulator.h.

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

Referenced by Phase2L1CaloJetEmulator::produce().

267  {
268  float et_sumEta[nSTEta][nSTPhi][3];
269  float stripEta[nSTEta][nSTPhi][3];
270  float stripPhi[nSTEta][nSTPhi][3];
271 
272  int index_i = 0; // 5th and 6th ST to be set 0
273  int index_j = 0;
274  for (int i = 0; i < nHfEta / 2; i += 3) { // 12 eta to 4 super towers
275  index_j = 0;
276  for (int j = 0; j < nHfPhi; j += 3) { // 72 phi to 24 super towers
277  stripEta[index_i][index_j][0] = hfTowers[i][j] + hfTowers[i][j + 1] + hfTowers[i][j + 2];
278  stripEta[index_i][index_j][1] = hfTowers[i + 1][j] + hfTowers[i + 1][j + 1] + hfTowers[i + 1][j + 2];
279  stripEta[index_i][index_j][2] = hfTowers[i + 2][j] + hfTowers[i + 2][j + 1] + hfTowers[i + 2][j + 2];
280  stripPhi[index_i][index_j][0] = hfTowers[i][j] + hfTowers[i + 1][j] + hfTowers[i + 2][j];
281  stripPhi[index_i][index_j][1] = hfTowers[i][j + 1] + hfTowers[i + 1][j + 1] + hfTowers[i + 2][j + 1];
282  stripPhi[index_i][index_j][2] = hfTowers[i][j + 2] + hfTowers[i + 1][j + 2] + hfTowers[i + 2][j + 2];
283  for (int k = 0; k < 3; k++) {
284  et_sumEta[index_i][index_j][k] = hfTowers[i + k][j] + hfTowers[i + k][j + 1] + hfTowers[i + k][j + 2];
285  }
286  index_j++;
287  }
288  index_i++;
289  }
290 
291  for (int i = 0; i < nSTEta; i++) {
292  for (int j = 0; j < nSTPhi; j++) {
293  GCTsupertower_t temp;
294  temp.et = 0;
295  temp.eta = 0;
296  temp.phi = 0;
297  temp.towerEta = 0;
298  temp.towerPhi = 0;
299  temp.towerEt = 0;
300  temp.centerEta = 0;
301  temp.centerPhi = 0;
302  if (i < 4) {
303  float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
304  temp.et = supertowerEt;
305  temp.eta = i;
306  temp.phi = j;
307  int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
308  temp.towerEta = peakEta;
309  int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
310  temp.towerPhi = peakPhi;
311  float peakEt = hfTowers[i * 3 + peakEta][j * 3 + peakPhi];
312  temp.towerEt = peakEt;
313  int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
314  temp.centerEta = cEta;
315  int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
316  temp.centerPhi = cPhi;
317  }
318  supertower_return[i][j] = temp;
319  }
320  }
321  }
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 211 of file Phase2L1CaloJetEmulator.h.

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

Referenced by Phase2L1CaloJetEmulator::produce().

212  {
213  float et_sumEta[nSTEta][nSTPhi][3];
214  float stripEta[nSTEta][nSTPhi][3];
215  float stripPhi[nSTEta][nSTPhi][3];
216 
217  int index_i = 0;
218  int index_j = 0;
219  for (int i = 0; i < nHgcalEta / 2; i += 3) { // 18 eta to 6 super towers
220  index_j = 0;
221  for (int j = 0; j < nHgcalPhi; j += 3) { // 72 phi to 24 super towers
222  stripEta[index_i][index_j][0] = hgcalTowers[i][j] + hgcalTowers[i][j + 1] + hgcalTowers[i][j + 2];
223  stripEta[index_i][index_j][1] = hgcalTowers[i + 1][j] + hgcalTowers[i + 1][j + 1] + hgcalTowers[i + 1][j + 2];
224  stripEta[index_i][index_j][2] = hgcalTowers[i + 2][j] + hgcalTowers[i + 2][j + 1] + hgcalTowers[i + 2][j + 2];
225  stripPhi[index_i][index_j][0] = hgcalTowers[i][j] + hgcalTowers[i + 1][j] + hgcalTowers[i + 2][j];
226  stripPhi[index_i][index_j][1] = hgcalTowers[i][j + 1] + hgcalTowers[i + 1][j + 1] + hgcalTowers[i + 2][j + 1];
227  stripPhi[index_i][index_j][2] = hgcalTowers[i][j + 2] + hgcalTowers[i + 1][j + 2] + hgcalTowers[i + 2][j + 2];
228  for (int k = 0; k < 3; k++) {
229  et_sumEta[index_i][index_j][k] =
230  hgcalTowers[i + k][j] + hgcalTowers[i + k][j + 1] + hgcalTowers[i + k][j + 2];
231  }
232  index_j++;
233  }
234  index_i++;
235  }
236 
237  for (int i = 0; i < nSTEta; i++) {
238  for (int j = 0; j < nSTPhi; j++) {
239  GCTsupertower_t temp;
240  temp.et = 0;
241  temp.eta = 0;
242  temp.phi = 0;
243  temp.towerEta = 0;
244  temp.towerPhi = 0;
245  temp.towerEt = 0;
246  temp.centerEta = 0;
247  temp.centerPhi = 0;
248  float supertowerEt = et_sumEta[i][j][0] + et_sumEta[i][j][1] + et_sumEta[i][j][2];
249  temp.et = supertowerEt;
250  temp.eta = i;
251  temp.phi = j;
252  int peakEta = getPeakBinOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
253  temp.towerEta = peakEta;
254  int peakPhi = getPeakBinOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
255  temp.towerPhi = peakPhi;
256  float peakEt = hgcalTowers[i * 3 + peakEta][j * 3 + peakPhi];
257  temp.towerEt = peakEt;
258  int cEta = getEtCenterOf3(stripEta[i][j][0], stripEta[i][j][1], stripEta[i][j][2]);
259  temp.centerEta = cEta;
260  int cPhi = getEtCenterOf3(stripPhi[i][j][0], stripPhi[i][j][1], stripPhi[i][j][2]);
261  temp.centerPhi = cPhi;
262  supertower_return[i][j] = temp;
263  }
264  }
265  }
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