CMS 3D CMS Logo

Classes | Functions
gctpf Namespace Reference

Classes

struct  GCTEtaHFStrip_t
 
struct  GCTEtaHFStripPeak_t
 
struct  GCTEtaStrip_t
 
struct  GCTEtaStripPeak_t
 
struct  GCTint_t
 
struct  GCTpfcluster_t
 
struct  PFcluster_t
 
struct  Region_t
 
struct  RegionHF_t
 

Functions

GCTint_t bestOf2 (const GCTint_t &t0, const GCTint_t &t1)
 
float getEt (float temp[nTowerEtaSLR][nTowerPhiSLR], int eta, int phi)
 
float getEtHF (float temp[nHfEta][nHfPhi/6], int eta, int phi)
 
GCTint_t getPeakBin (const GCTEtaStripPeak_t &etaStripPeak)
 
GCTint_t getPeakBinHF (const GCTEtaHFStripPeak_t &etaStripPeak)
 
GCTint_t getPeakOfHFStrip (const GCTEtaHFStrip_t &etaStrip)
 
GCTint_t getPeakOfStrip (const GCTEtaStrip_t &etaStrip)
 
GCTint_t getPeakPosition (const Region_t &region)
 
GCTint_t getPeakPositionHF (const RegionHF_t &region)
 
Region_t initStructure (float temp[nTowerEtaSLR][nTowerPhiSLR])
 
RegionHF_t initStructureHF (float temp[nHfEta][nHfPhi/6])
 
PFcluster_t pfcluster (float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset)
 
PFcluster_t pfclusterHF (float temporary[nHfEta][nHfPhi/6], int etaoffset, int phioffset)
 
GCTpfcluster_t recoPfcluster (float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset)
 
GCTpfcluster_t recoPfclusterHF (float temporary[nHfEta][nHfPhi/6], int etaoffset, int phioffset)
 
void RemoveTmp (float temp[nTowerEtaSLR][nTowerPhiSLR], int eta, int phi)
 
void RemoveTmpHF (float temp[nHfEta][nHfPhi/6], int eta, int phi)
 

Function Documentation

◆ bestOf2()

GCTint_t gctpf::bestOf2 ( const GCTint_t t0,
const GCTint_t t1 
)
inline

◆ getEt()

float gctpf::getEt ( float  temp[nTowerEtaSLR][nTowerPhiSLR],
int  eta,
int  phi 
)
inline

Definition at line 204 of file Phase2L1CaloPFClusterEmulator.h.

References PVValHelper::eta, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, nTowerEtaSLR, nTowerPhiSLR, and groupFilesInBlocks::temp.

Referenced by ReflectedIterator::calculatePedestal(), HLTGenericFilter< T1 >::hltFilter(), recoPfcluster(), and ReflectedIterator::subtractPedestal().

204  {
205  float et_sumEta[3] = {0., 0., 0.};
206 
207  for (int i = 0; i < (nTowerEtaSLR - 2); i++) {
208  for (int j = 0; j < (nTowerPhiSLR - 2); j++) {
209  if (i + 1 == eta && j + 1 == phi) {
210  for (int k = 0; k < 3; k++) {
211  et_sumEta[k] = temp[i + k][j] + temp[i + k][j + 1] + temp[i + k][j + 2];
212  }
213  }
214  }
215  }
216 
217  float pfcluster_et = et_sumEta[0] + et_sumEta[1] + et_sumEta[2];
218 
219  return pfcluster_et;
220  }
static constexpr int nTowerEtaSLR
static constexpr int nTowerPhiSLR

◆ getEtHF()

float gctpf::getEtHF ( float  temp[nHfEta][nHfPhi/6],
int  eta,
int  phi 
)
inline

Definition at line 222 of file Phase2L1CaloPFClusterEmulator.h.

References PVValHelper::eta, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, nHfEta, nHfPhi, and groupFilesInBlocks::temp.

Referenced by recoPfclusterHF().

222  {
223  float tempX[nHfEta + 2][nHfPhi / 6 + 2];
224  float et_sumEta[3] = {0., 0., 0.};
225 
226  for (int i = 0; i < nHfEta + 2; i++) {
227  for (int k = 0; k < nHfPhi / 6 + 2; k++) {
228  tempX[i][k] = 0;
229  }
230  }
231 
232  for (int i = 0; i < nHfEta; i++) {
233  for (int k = 0; k < nHfPhi / 6; k++) {
234  tempX[i + 1][k + 1] = temp[i][k];
235  }
236  }
237 
238  for (int i = 0; i < nHfEta; i++) {
239  for (int j = 0; j < nHfPhi / 6; j++) {
240  if (i == eta && j == phi) {
241  for (int k = 0; k < 3; k++) {
242  et_sumEta[k] = tempX[i + k][j] + tempX[i + k][j + 1] + tempX[i + k][j + 2];
243  }
244  }
245  }
246  }
247 
248  float pfcluster_et = et_sumEta[0] + et_sumEta[1] + et_sumEta[2];
249 
250  return pfcluster_et;
251  }
static constexpr int nHfEta
static constexpr int nHfPhi

◆ getPeakBin()

GCTint_t gctpf::getPeakBin ( const GCTEtaStripPeak_t etaStripPeak)
inline

Definition at line 105 of file Phase2L1CaloPFClusterEmulator.h.

References bestOf2(), and gctpf::GCTEtaStripPeak_t::p.

Referenced by getPeakPosition().

105  {
106  GCTint_t best01 = bestOf2(etaStripPeak.p[0], etaStripPeak.p[1]);
107  GCTint_t best23 = bestOf2(etaStripPeak.p[2], etaStripPeak.p[3]);
108  GCTint_t best45 = bestOf2(etaStripPeak.p[4], etaStripPeak.p[5]);
109  GCTint_t best67 = bestOf2(etaStripPeak.p[6], etaStripPeak.p[7]);
110  GCTint_t best89 = bestOf2(etaStripPeak.p[8], etaStripPeak.p[9]);
111  GCTint_t best1011 = bestOf2(etaStripPeak.p[10], etaStripPeak.p[11]);
112  GCTint_t best1213 = bestOf2(etaStripPeak.p[12], etaStripPeak.p[13]);
113  GCTint_t best1415 = bestOf2(etaStripPeak.p[14], etaStripPeak.p[15]);
114  GCTint_t best1617 = bestOf2(etaStripPeak.p[16], etaStripPeak.p[17]);
115  GCTint_t best0123 = bestOf2(best01, best23);
116  GCTint_t best4567 = bestOf2(best45, best67);
117  GCTint_t best891011 = bestOf2(best89, best1011);
118  GCTint_t best12131415 = bestOf2(best1213, best1415);
119  GCTint_t best01234567 = bestOf2(best0123, best4567);
120  GCTint_t best01234567891011 = bestOf2(best01234567, best891011);
121  GCTint_t best121314151617 = bestOf2(best12131415, best1617);
122  GCTint_t best12131415161718 = bestOf2(best121314151617, etaStripPeak.p[18]);
123  GCTint_t bestAll = bestOf2(best01234567891011, best12131415161718);
124 
125  return bestAll;
126  }
GCTint_t bestOf2(const GCTint_t &t0, const GCTint_t &t1)

◆ getPeakBinHF()

GCTint_t gctpf::getPeakBinHF ( const GCTEtaHFStripPeak_t etaStripPeak)
inline

Definition at line 128 of file Phase2L1CaloPFClusterEmulator.h.

References bestOf2(), and gctpf::GCTEtaHFStripPeak_t::p.

Referenced by getPeakPositionHF().

128  {
129  GCTint_t best01 = bestOf2(etaStripPeak.p[0], etaStripPeak.p[1]);
130  GCTint_t best23 = bestOf2(etaStripPeak.p[2], etaStripPeak.p[3]);
131  GCTint_t best45 = bestOf2(etaStripPeak.p[4], etaStripPeak.p[5]);
132  GCTint_t best67 = bestOf2(etaStripPeak.p[6], etaStripPeak.p[7]);
133  GCTint_t best89 = bestOf2(etaStripPeak.p[8], etaStripPeak.p[9]);
134  GCTint_t best1011 = bestOf2(etaStripPeak.p[10], etaStripPeak.p[11]);
135  GCTint_t best1213 = bestOf2(etaStripPeak.p[12], etaStripPeak.p[13]);
136  GCTint_t best1415 = bestOf2(etaStripPeak.p[14], etaStripPeak.p[15]);
137  GCTint_t best1617 = bestOf2(etaStripPeak.p[16], etaStripPeak.p[17]);
138  GCTint_t best1819 = bestOf2(etaStripPeak.p[18], etaStripPeak.p[19]);
139  GCTint_t best2021 = bestOf2(etaStripPeak.p[20], etaStripPeak.p[21]);
140  GCTint_t best2223 = bestOf2(etaStripPeak.p[22], etaStripPeak.p[23]);
141  GCTint_t best0123 = bestOf2(best01, best23);
142  GCTint_t best4567 = bestOf2(best45, best67);
143  GCTint_t best891011 = bestOf2(best89, best1011);
144  GCTint_t best12131415 = bestOf2(best1213, best1415);
145  GCTint_t best16171819 = bestOf2(best1617, best1819);
146  GCTint_t best20212223 = bestOf2(best2021, best2223);
147  GCTint_t best0to7 = bestOf2(best0123, best4567);
148  GCTint_t best8to15 = bestOf2(best891011, best12131415);
149  GCTint_t best16to23 = bestOf2(best16171819, best20212223);
150  GCTint_t best0to15 = bestOf2(best0to7, best8to15);
151  GCTint_t bestAll = bestOf2(best0to15, best16to23);
152 
153  return bestAll;
154  }
GCTint_t bestOf2(const GCTint_t &t0, const GCTint_t &t1)

◆ getPeakOfHFStrip()

GCTint_t gctpf::getPeakOfHFStrip ( const GCTEtaHFStrip_t etaStrip)
inline

Definition at line 89 of file Phase2L1CaloPFClusterEmulator.h.

References bestOf2(), and gctpf::GCTEtaHFStrip_t::t.

Referenced by getPeakPositionHF().

89  {
90  GCTint_t best01 = bestOf2(etaStrip.t[0], etaStrip.t[1]);
91  GCTint_t best23 = bestOf2(etaStrip.t[2], etaStrip.t[3]);
92  GCTint_t best45 = bestOf2(etaStrip.t[4], etaStrip.t[5]);
93  GCTint_t best67 = bestOf2(etaStrip.t[6], etaStrip.t[7]);
94  GCTint_t best89 = bestOf2(etaStrip.t[8], etaStrip.t[9]);
95  GCTint_t best1011 = bestOf2(etaStrip.t[10], etaStrip.t[11]);
96  GCTint_t best0123 = bestOf2(best01, best23);
97  GCTint_t best4567 = bestOf2(best45, best67);
98  GCTint_t best891011 = bestOf2(best89, best1011);
99  GCTint_t best01234567 = bestOf2(best0123, best4567);
100  GCTint_t bestAll = bestOf2(best01234567, best891011);
101 
102  return bestAll;
103  }
GCTint_t bestOf2(const GCTint_t &t0, const GCTint_t &t1)

◆ getPeakOfStrip()

GCTint_t gctpf::getPeakOfStrip ( const GCTEtaStrip_t etaStrip)
inline

Definition at line 79 of file Phase2L1CaloPFClusterEmulator.h.

References bestOf2(), and gctpf::GCTEtaStrip_t::t.

Referenced by getPeakPosition().

79  {
80  GCTint_t best12 = bestOf2(etaStrip.t[1], etaStrip.t[2]);
81  GCTint_t best34 = bestOf2(etaStrip.t[3], etaStrip.t[4]);
82  GCTint_t best56 = bestOf2(etaStrip.t[5], etaStrip.t[6]);
83  GCTint_t best1234 = bestOf2(best12, best34);
84  GCTint_t bestAll = bestOf2(best1234, best56);
85 
86  return bestAll;
87  }
GCTint_t bestOf2(const GCTint_t &t0, const GCTint_t &t1)

◆ getPeakPosition()

GCTint_t gctpf::getPeakPosition ( const Region_t region)
inline

Definition at line 156 of file Phase2L1CaloPFClusterEmulator.h.

References getPeakBin(), getPeakOfStrip(), mps_fire::i, WZElectronSkims53X_cff::max, nTowerEtaSLR, gctpf::GCTEtaStripPeak_t::p, and nano_mu_digi_cff::region.

Referenced by recoPfcluster().

156  {
157  GCTEtaStripPeak_t etaPeak;
158  for (int i = 0; i < nTowerEtaSLR - 2; i++) {
159  etaPeak.p[i] = getPeakOfStrip(region.s[i + 1]);
160  }
161  GCTint_t max = getPeakBin(etaPeak);
162 
163  return max;
164  }
GCTint_t getPeakBin(const GCTEtaStripPeak_t &etaStripPeak)
GCTint_t getPeakOfStrip(const GCTEtaStrip_t &etaStrip)
static constexpr int nTowerEtaSLR

◆ getPeakPositionHF()

GCTint_t gctpf::getPeakPositionHF ( const RegionHF_t region)
inline

Definition at line 166 of file Phase2L1CaloPFClusterEmulator.h.

References getPeakBinHF(), getPeakOfHFStrip(), mps_fire::i, WZElectronSkims53X_cff::max, nHfPhi, gctpf::GCTEtaHFStripPeak_t::p, and nano_mu_digi_cff::region.

Referenced by recoPfclusterHF().

166  {
167  GCTEtaHFStripPeak_t etaPeak;
168  for (int i = 0; i < nHfPhi / 6; i++) {
169  etaPeak.p[i] = getPeakOfHFStrip(region.s[i]);
170  }
171  GCTint_t max = getPeakBinHF(etaPeak);
172 
173  return max;
174  }
static constexpr int nHfPhi
GCTint_t getPeakBinHF(const GCTEtaHFStripPeak_t &etaStripPeak)
GCTint_t getPeakOfHFStrip(const GCTEtaHFStrip_t &etaStrip)

◆ initStructure()

Region_t gctpf::initStructure ( float  temp[nTowerEtaSLR][nTowerPhiSLR])
inline

Definition at line 176 of file Phase2L1CaloPFClusterEmulator.h.

References mps_fire::i, dqmiolumiharvest::j, nTowerEtaSLR, nTowerPhiSLR, and groupFilesInBlocks::temp.

Referenced by recoPfcluster().

176  {
177  Region_t r;
178 
179  for (int i = 0; i < nTowerPhiSLR; i++) {
180  for (int j = 0; j < nTowerEtaSLR; j++) {
181  r.s[j].t[i].et = temp[j][i];
182  r.s[j].t[i].eta = j;
183  r.s[j].t[i].phi = i;
184  }
185  }
186 
187  return r;
188  }
static constexpr int nTowerEtaSLR
static constexpr int nTowerPhiSLR

◆ initStructureHF()

RegionHF_t gctpf::initStructureHF ( float  temp[nHfEta][nHfPhi/6])
inline

Definition at line 190 of file Phase2L1CaloPFClusterEmulator.h.

References mps_fire::i, dqmiolumiharvest::j, nHfEta, nHfPhi, and groupFilesInBlocks::temp.

Referenced by recoPfclusterHF().

190  {
191  RegionHF_t r;
192 
193  for (int i = 0; i < nHfPhi / 6; i++) {
194  for (int j = 0; j < nHfEta; j++) {
195  r.s[j].t[i].et = temp[j][i];
196  r.s[j].t[i].eta = j;
197  r.s[j].t[i].phi = i;
198  }
199  }
200 
201  return r;
202  }
static constexpr int nHfEta
static constexpr int nHfPhi

◆ pfcluster()

PFcluster_t gctpf::pfcluster ( float  temporary[nTowerEtaSLR][nTowerPhiSLR],
int  etaoffset,
int  phioffset 
)
inline

Definition at line 327 of file Phase2L1CaloPFClusterEmulator.h.

References gctpf::GCTpfcluster_t::et, gctpf::GCTpfcluster_t::eta, gctpf::PFcluster_t::GCTpfclusters, mps_fire::i, nPFClusterSLR, gctpf::GCTpfcluster_t::phi, and recoPfcluster().

Referenced by pfclusterHF(), cms::PFClusterMETProducer::produce(), and Phase2L1CaloPFClusterEmulator::produce().

327  {
328  GCTpfcluster_t pfcluster[nPFClusterSLR];
329 
330  for (int i = 0; i < nPFClusterSLR; i++) {
331  pfcluster[i] = recoPfcluster(temporary, etaoffset, phioffset);
332  }
333 
334  PFcluster_t GCTPfclusters;
335 
336  for (int i = 0; i < nPFClusterSLR; i++) {
337  GCTPfclusters.GCTpfclusters[i].et = pfcluster[i].et;
338  GCTPfclusters.GCTpfclusters[i].eta = pfcluster[i].eta;
339  GCTPfclusters.GCTpfclusters[i].phi = pfcluster[i].phi;
340  }
341 
342  return GCTPfclusters;
343  }
GCTpfcluster_t recoPfcluster(float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset)
static constexpr int nPFClusterSLR
GCTpfcluster_t GCTpfclusters[nPFClusterSLR]
PFcluster_t pfcluster(float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset)

◆ pfclusterHF()

PFcluster_t gctpf::pfclusterHF ( float  temporary[nHfEta][nHfPhi/6],
int  etaoffset,
int  phioffset 
)
inline

Definition at line 345 of file Phase2L1CaloPFClusterEmulator.h.

References gctpf::GCTpfcluster_t::et, gctpf::GCTpfcluster_t::eta, gctpf::PFcluster_t::GCTpfclusters, mps_fire::i, nPFClusterSLR, pfcluster(), gctpf::GCTpfcluster_t::phi, and recoPfclusterHF().

Referenced by Phase2L1CaloPFClusterEmulator::produce().

345  {
346  GCTpfcluster_t pfcluster[nPFClusterSLR];
347 
348  for (int i = 0; i < nPFClusterSLR; i++) {
349  pfcluster[i] = recoPfclusterHF(temporary, etaoffset, phioffset);
350  }
351 
352  PFcluster_t GCTPfclusters;
353 
354  for (int i = 0; i < nPFClusterSLR; i++) {
355  GCTPfclusters.GCTpfclusters[i].et = pfcluster[i].et;
356  GCTPfclusters.GCTpfclusters[i].eta = pfcluster[i].eta;
357  GCTPfclusters.GCTpfclusters[i].phi = pfcluster[i].phi;
358  }
359 
360  return GCTPfclusters;
361  }
static constexpr int nPFClusterSLR
GCTpfcluster_t GCTpfclusters[nPFClusterSLR]
PFcluster_t pfcluster(float temporary[nTowerEtaSLR][nTowerPhiSLR], int etaoffset, int phioffset)
GCTpfcluster_t recoPfclusterHF(float temporary[nHfEta][nHfPhi/6], int etaoffset, int phioffset)

◆ recoPfcluster()

GCTpfcluster_t gctpf::recoPfcluster ( float  temporary[nTowerEtaSLR][nTowerPhiSLR],
int  etaoffset,
int  phioffset 
)
inline

Definition at line 281 of file Phase2L1CaloPFClusterEmulator.h.

References gctpf::GCTpfcluster_t::et, gctpf::GCTpfcluster_t::eta, gctpf::GCTint_t::eta, getEt(), getPeakPosition(), initStructure(), nTowerEtaSLR, nTowerPhiSLR, gctpf::GCTpfcluster_t::phi, gctpf::GCTint_t::phi, nano_mu_digi_cff::region, and RemoveTmp().

Referenced by pfcluster().

281  {
282  GCTpfcluster_t pfclusterReturn;
283 
284  Region_t region;
285 
286  region = initStructure(temporary);
287 
288  GCTint_t regionMax = getPeakPosition(region);
289 
290  float pfcluster_et = getEt(temporary, regionMax.eta, regionMax.phi);
291 
292  RemoveTmp(temporary, regionMax.eta, regionMax.phi);
293 
294  if (!(regionMax.eta >= 2 && regionMax.eta < (nTowerEtaSLR - 2) && regionMax.phi >= 2 &&
295  regionMax.phi < (nTowerPhiSLR - 2)))
296  pfcluster_et = 0;
297 
298  pfclusterReturn.et = pfcluster_et;
299  pfclusterReturn.eta = regionMax.eta - 2 + etaoffset;
300  pfclusterReturn.phi = regionMax.phi - 2 + phioffset;
301 
302  return pfclusterReturn;
303  }
GCTint_t getPeakPosition(const Region_t &region)
Region_t initStructure(float temp[nTowerEtaSLR][nTowerPhiSLR])
float getEt(float temp[nTowerEtaSLR][nTowerPhiSLR], int eta, int phi)
void RemoveTmp(float temp[nTowerEtaSLR][nTowerPhiSLR], int eta, int phi)
static constexpr int nTowerEtaSLR
static constexpr int nTowerPhiSLR

◆ recoPfclusterHF()

GCTpfcluster_t gctpf::recoPfclusterHF ( float  temporary[nHfEta][nHfPhi/6],
int  etaoffset,
int  phioffset 
)
inline

Definition at line 305 of file Phase2L1CaloPFClusterEmulator.h.

References gctpf::GCTpfcluster_t::et, gctpf::GCTpfcluster_t::eta, gctpf::GCTint_t::eta, getEtHF(), getPeakPositionHF(), initStructureHF(), nHfPhi, gctpf::GCTpfcluster_t::phi, gctpf::GCTint_t::phi, nano_mu_digi_cff::region, and RemoveTmpHF().

Referenced by pfclusterHF().

305  {
306  GCTpfcluster_t pfclusterReturn;
307 
308  RegionHF_t region;
309 
310  region = initStructureHF(temporary);
311 
312  GCTint_t regionMax = getPeakPositionHF(region);
313 
314  float pfcluster_et = getEtHF(temporary, regionMax.eta, regionMax.phi);
315 
316  RemoveTmpHF(temporary, regionMax.eta, regionMax.phi);
317 
318  pfclusterReturn.et = pfcluster_et;
319  pfclusterReturn.eta = regionMax.eta + etaoffset;
320  pfclusterReturn.phi = regionMax.phi + phioffset;
321  if (pfclusterReturn.phi < 0)
322  pfclusterReturn.phi += nHfPhi;
323 
324  return pfclusterReturn;
325  }
static constexpr int nHfPhi
void RemoveTmpHF(float temp[nHfEta][nHfPhi/6], int eta, int phi)
RegionHF_t initStructureHF(float temp[nHfEta][nHfPhi/6])
GCTint_t getPeakPositionHF(const RegionHF_t &region)
float getEtHF(float temp[nHfEta][nHfPhi/6], int eta, int phi)

◆ RemoveTmp()

void gctpf::RemoveTmp ( float  temp[nTowerEtaSLR][nTowerPhiSLR],
int  eta,
int  phi 
)
inline

Definition at line 253 of file Phase2L1CaloPFClusterEmulator.h.

References PVValHelper::eta, mps_fire::i, dqmiolumiharvest::j, nTowerEtaSLR, nTowerPhiSLR, and groupFilesInBlocks::temp.

Referenced by recoPfcluster().

253  {
254  for (int i = 0; i < nTowerEtaSLR; i++) {
255  if (i + 1 >= eta && i <= eta + 1) {
256  for (int j = 0; j < nTowerPhiSLR; j++) {
257  if (j + 1 >= phi && j <= phi + 1) {
258  temp[i][j] = 0;
259  }
260  }
261  }
262  }
263 
264  return;
265  }
static constexpr int nTowerEtaSLR
static constexpr int nTowerPhiSLR

◆ RemoveTmpHF()

void gctpf::RemoveTmpHF ( float  temp[nHfEta][nHfPhi/6],
int  eta,
int  phi 
)
inline

Definition at line 267 of file Phase2L1CaloPFClusterEmulator.h.

References PVValHelper::eta, mps_fire::i, dqmiolumiharvest::j, nHfEta, nHfPhi, and groupFilesInBlocks::temp.

Referenced by recoPfclusterHF().

267  {
268  for (int i = 0; i < nHfEta; i++) {
269  if (i + 1 >= eta && i <= eta + 1) {
270  for (int j = 0; j < nHfPhi / 6; j++) {
271  if (j + 1 >= phi && j <= phi + 1) {
272  temp[i][j] = 0;
273  }
274  }
275  }
276  }
277 
278  return;
279  }
static constexpr int nHfEta
static constexpr int nHfPhi