CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctJetFinderBase.cc
Go to the documentation of this file.
2 
6 
9 
11 
12 //DEFINE STATICS
13 const unsigned int L1GctJetFinderBase::MAX_JETS_OUT = 6;
14 const unsigned int L1GctJetFinderBase::N_EXTRA_REGIONS_ETA00 = 2;
15 const unsigned int L1GctJetFinderBase::COL_OFFSET = L1GctJetFinderParams::NUMBER_ETA_VALUES+N_EXTRA_REGIONS_ETA00;
17 
19 const unsigned int L1GctJetFinderBase::N_COLS = 2;
20 const unsigned int L1GctJetFinderBase::CENTRAL_COL0 = 0;
21 
22 
25  m_id(id),
26  m_neighbourJetFinders(2),
27  m_idInRange(false),
28  m_gotNeighbourPointers(false),
29  m_gotJetFinderParams(false),
30  m_gotJetEtCalLuts(false),
31  m_CenJetSeed(0), m_FwdJetSeed(0), m_TauJetSeed(0), m_EtaBoundry(0),
32  m_jetEtCalLuts(),
33  m_inputRegions(MAX_REGIONS_IN),
34  m_sentProtoJets(MAX_JETS_OUT), m_rcvdProtoJets(MAX_JETS_OUT), m_keptProtoJets(MAX_JETS_OUT),
35  m_outputJets(MAX_JETS_OUT), m_sortedJets(MAX_JETS_OUT),
36  m_HttSumJetThreshold(0), m_HtmSumJetThreshold(0),
37  m_outputHfSums(),
38  m_outputJetsPipe(MAX_JETS_OUT),
39  m_outputEtSumPipe(), m_outputExSumPipe(), m_outputEySumPipe(),
40  m_outputHtSumPipe(), m_outputHxSumPipe(), m_outputHySumPipe()
41 {
42  // Call reset to initialise vectors for input and output
43  this->reset();
44  //Check jetfinder setup
45  if(m_id < 0 || m_id >= static_cast<int>(L1CaloRegionDetId::N_PHI))
46  {
47  if (m_verbose) {
48  edm::LogWarning("L1GctSetupError")
49  << "L1GctJetFinderBase::L1GctJetFinderBase() : Jet Finder ID " << m_id << " has been incorrectly constructed!\n"
50  << "ID number should be between the range of 0 to " << L1CaloRegionDetId::N_PHI-1 << "\n";
51  }
52  } else { m_idInRange = true; }
53 
54 }
55 
57 {
58 }
59 
61 void L1GctJetFinderBase::setNeighbourJetFinders(std::vector<L1GctJetFinderBase*> neighbours)
62 {
64  if (neighbours.size()==2) {
65  m_neighbourJetFinders = neighbours;
66  } else {
67  m_gotNeighbourPointers = false;
68  if (m_verbose) {
69  edm::LogWarning("L1GctSetupError")
70  << "L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " << m_id
71  << " size of input vector should be 2, but is in fact " << neighbours.size() << "\n";
72  }
73  }
74  if (m_neighbourJetFinders.at(0) == 0) {
75  m_gotNeighbourPointers = false;
76  if (m_verbose) {
77  edm::LogWarning("L1GctSetupError")
78  << "L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " << m_id
79  << " first neighbour pointer is set to zero\n";
80  }
81  }
82  if (m_neighbourJetFinders.at(1) == 0) {
83  m_gotNeighbourPointers = false;
84  if (m_verbose) {
85  edm::LogWarning("L1GctSetupError")
86  << "L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " << m_id
87  << " second neighbour pointer is set to zero\n";
88  }
89  }
91  edm::LogError("L1GctSetupError") << "Jet Finder ID " << m_id << " has incorrect assignment of neighbour pointers";
92  }
93 }
94 
97 {
98  m_CenJetSeed = jfpars->getCenJetEtSeedGct();
99  m_FwdJetSeed = jfpars->getForJetEtSeedGct();
100  m_TauJetSeed = jfpars->getTauJetEtSeedGct();
105  m_gotJetFinderParams = true;
106 }
107 
110 {
111  m_jetEtCalLuts = jfluts;
113 }
114 
115 std::ostream& operator << (std::ostream& os, const L1GctJetFinderBase& algo)
116 {
117  using std::endl;
118  os << "ID = " << algo.m_id << endl;
119  os << "Calibration lut pointers stored for " << algo.m_jetEtCalLuts.size() << " eta bins" << endl;
120  for (unsigned ieta=0; ieta<algo.m_jetEtCalLuts.size(); ieta++) {
121  os << "Eta bin " << ieta << ", JetEtCalibrationLut* = " << algo.m_jetEtCalLuts.at(ieta) << endl;
122  }
123  os << "No of input regions " << algo.m_inputRegions.size() << endl;
124 // for(unsigned i=0; i < algo.m_inputRegions.size(); ++i)
125 // {
126 // os << algo.m_inputRegions.at(i);
127 // }
128  os << "No of output jets " << algo.m_outputJets.size() << endl;
129 // for(unsigned i=0; i < algo.m_outputJets.size(); ++i)
130 // {
131 // os << algo.m_outputJets.at(i);
132 // }
133  os << "Output total scalar Et " << algo.m_outputEtSum << endl;
134  os << "Output vector Et x component " << algo.m_outputExSum << endl;
135  os << "Output vector Et y component " << algo.m_outputEySum << endl;
136  os << "Output total scalar Ht " << algo.m_outputHtSum << endl;
137  os << "Output vector Ht x component " << algo.m_outputHxSum << endl;
138  os << "Output vector Ht y component " << algo.m_outputHySum << endl;
139  os << endl;
140 
141  return os;
142 }
143 
144 
146 {
147  m_inputRegions.clear();
148  m_inputRegions.resize(this->maxRegionsIn());
149  m_outputJets.clear();
150  m_outputJets.resize(MAX_JETS_OUT);
151  m_sortedJets.clear();
152  m_sortedJets.resize(MAX_JETS_OUT);
153 
154  m_sentProtoJets.clear();
156  m_rcvdProtoJets.clear();
158  m_keptProtoJets.clear();
160 
161  m_outputEtSum = 0;
162  m_outputExSum = 0;
163  m_outputEySum = 0;
164  m_outputHtSum = 0;
165  m_outputHxSum = 0;
166  m_outputHySum = 0;
167 
169 }
170 
172 {
173  m_outputJetsPipe.reset(numOfBx());
174  m_outputEtSumPipe.reset(numOfBx());
175  m_outputExSumPipe.reset(numOfBx());
176  m_outputEySumPipe.reset(numOfBx());
177  m_outputHtSumPipe.reset(numOfBx());
178  m_outputHxSumPipe.reset(numOfBx());
179  m_outputHySumPipe.reset(numOfBx());
180 }
181 
186 {
189  L1GctRegion tempRgn;
190  tempRgn.setBx(bxAbs());
191  m_inputRegions.assign(this->maxRegionsIn(), tempRgn);
192 
195  m_sentProtoJets.assign(MAX_JETS_OUT, tempRgn);
196  m_rcvdProtoJets.assign(MAX_JETS_OUT, tempRgn);
197  m_keptProtoJets.assign(MAX_JETS_OUT, tempRgn);
198 
200  L1GctJet tempJet;
201  tempJet.setBx(bxAbs());
202  m_outputJets.assign(MAX_JETS_OUT, tempJet);
203 }
204 
205 // This is how the regions from the RCT get into the GCT for processing
207 {
208  static const unsigned NPHI = L1CaloRegionDetId::N_PHI;
209  static const unsigned N_00 = N_EXTRA_REGIONS_ETA00;
210  unsigned crate = region.rctCrate();
211  // Find the column for this region in a global (eta,phi) array
212  // Note the column numbers here are not the same as region->gctPhi()
213  // because the RCT crates are not numbered from phi=0.
214  unsigned colAbsolute = (crate+1)*2 + region.rctPhi();
215  unsigned colRelative = ((colAbsolute+NPHI) - m_minColThisJf) % NPHI;
216  if (colRelative < this->nCols()) {
217  // We are in the right range in phi
218  // Now check we are in the right wheel (positive or negative eta)
219  if ( (crate/N_JF_PER_WHEEL) == (m_id/N_JF_PER_WHEEL) ) {
220  unsigned i = colRelative*COL_OFFSET + N_00 + region.rctEta();
222  } else {
223  // Accept neighbouring regions from the other wheel
224  if (region.rctEta() < N_00) {
225  unsigned i = colRelative*COL_OFFSET + N_00 - (region.rctEta()+1);
227  }
228  }
229  }
230 }
231 
233 std::vector< L1GctInternJetData > L1GctJetFinderBase::getInternalJets() const {
234 
235  std::vector< L1GctInternJetData > result;
236  for (RawJetVector::const_iterator jet=m_outputJetsPipe.contents.begin();
237  jet!=m_outputJetsPipe.contents.end(); jet++) {
238  result.push_back( L1GctInternJetData::fromEmulator(jet->id(),
239  jet->bx(),
240  jet->calibratedEt(m_jetEtCalLuts.at(jet->rctEta())),
241  jet->overFlow(),
242  jet->tauVeto(),
243  jet->hwEta(),
244  jet->hwPhi(),
245  jet->rank(m_jetEtCalLuts.at(jet->rctEta())) ) );
246  }
247  return result;
248 
249 }
250 
252 std::vector< L1GctInternEtSum > L1GctJetFinderBase::getInternalEtSums() const {
253 
254  std::vector< L1GctInternEtSum > result;
255  for (int bx=0; bx<numOfBx(); bx++) {
256  result.push_back( L1GctInternEtSum::fromEmulatorJetTotEt ( m_outputEtSumPipe.contents.at(bx).value(),
257  m_outputEtSumPipe.contents.at(bx).overFlow(),
258  static_cast<int16_t> (bx-bxMin()) ) );
259  result.push_back( L1GctInternEtSum::fromEmulatorJetMissEt( m_outputExSumPipe.contents.at(bx).value(),
260  m_outputExSumPipe.contents.at(bx).overFlow(),
261  static_cast<int16_t> (bx-bxMin()) ) );
262  result.push_back( L1GctInternEtSum::fromEmulatorJetMissEt( m_outputEySumPipe.contents.at(bx).value(),
263  m_outputEySumPipe.contents.at(bx).overFlow(),
264  static_cast<int16_t> (bx-bxMin()) ) );
265  result.push_back( L1GctInternEtSum::fromEmulatorJetTotHt ( m_outputHtSumPipe.contents.at(bx).value(),
266  m_outputHtSumPipe.contents.at(bx).overFlow(),
267  static_cast<int16_t> (bx-bxMin()) ) );
268  }
269  return result;
270 }
271 
272 std::vector< L1GctInternHtMiss > L1GctJetFinderBase::getInternalHtMiss() const {
273 
274  std::vector< L1GctInternHtMiss > result;
275  for (int bx=0; bx<numOfBx(); bx++) {
276  result.push_back( L1GctInternHtMiss::emulatorJetMissHt( m_outputHxSumPipe.contents.at(bx).value(),
277  m_outputHySumPipe.contents.at(bx).value(),
278  m_outputHxSumPipe.contents.at(bx).overFlow(),
279  static_cast<int16_t> (bx-bxMin()) ) );
280  }
281  return result;
282 
283 }
284 
285 
286 // PROTECTED METHODS BELOW
289 {
290  switch (ft) {
291  case TOP :
292  m_rcvdProtoJets = m_neighbourJetFinders.at(0)->getSentProtoJets(); break;
293  case BOT :
294  m_rcvdProtoJets = m_neighbourJetFinders.at(1)->getSentProtoJets(); break;
295  case TOPBOT :
296  // Copy half the jets from each neighbour
297  static const unsigned int MAX_TOPBOT_JETS = MAX_JETS_OUT/2;
298  unsigned j=0;
300  temp = m_neighbourJetFinders.at(0)->getSentProtoJets();
301  for ( ; j<MAX_TOPBOT_JETS; ++j) {
302  m_rcvdProtoJets.at(j) = temp.at(j);
303  }
304  temp = m_neighbourJetFinders.at(1)->getSentProtoJets();
305  for ( ; j<MAX_JETS_OUT; ++j) {
306  m_rcvdProtoJets.at(j) = temp.at(j);
307  }
308  break;
309  }
310 }
311 
314 {
315  JetVector tempJets(MAX_JETS_OUT);
316  for (unsigned j=0; j<MAX_JETS_OUT; j++) {
317  tempJets.at(j) = m_outputJets.at(j).jetCand(m_jetEtCalLuts);
318  }
319 
320  // Sort the jets
321  L1GctJetSorter jSorter(tempJets);
322  m_sortedJets = jSorter.getSortedJets();
323 
324  //store jets in "pipeline memory" for checking
326 }
327 
330 {
331 
332  // Refactored energy sums code - find scalar and vector sums
333  // of Et and Ht instead of strip stums
334  doEtSums();
335  doHtSums();
336 
337  //calculate the Hf tower Et sums and tower-over-threshold counts
339 
340  return;
341 }
342 
343 // Calculates scalar and vector sum of Et over input regions
345  unsigned et0 = 0;
346  unsigned et1 = 0;
347  bool of = false;
348 
349  // Add the Et values from regions 2 to 12 for strip 0,
350  // the Et values from regions 15 to 25 for strip 1.
351  unsigned offset = COL_OFFSET * centralCol0();
352  for (UShort i=offset+N_EXTRA_REGIONS_ETA00; i < offset+COL_OFFSET; ++i) {
353  et0 += m_inputRegions.at(i).et();
354  of |= m_inputRegions.at(i).overFlow();
355  et1 += m_inputRegions.at(i+COL_OFFSET).et();
356  of |= m_inputRegions.at(i+COL_OFFSET).overFlow();
357  }
358 
359  etTotalType etStrip0(et0);
360  etTotalType etStrip1(et1);
361  etStrip0.setOverFlow(etStrip0.overFlow() || of);
362  etStrip1.setOverFlow(etStrip1.overFlow() || of);
363  unsigned xfact0 = (4*m_id + 6) % 36;
364  unsigned xfact1 = (4*m_id + 8) % 36;
365  unsigned yfact0 = (4*m_id + 15) % 36;
366  unsigned yfact1 = (4*m_id + 17) % 36;
367  m_outputEtSum = etStrip0 + etStrip1;
369  m_outputExSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
370  (etStrip0, xfact0, etStrip1, xfact1);
371  m_outputEySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
372  (etStrip0, yfact0, etStrip1, yfact1);
373 
376  m_outputEySumPipe.store(m_outputEySum, bxRel());
377 }
378 
379 // Calculates scalar and vector sum of Ht over calibrated jets
381  unsigned htt = 0;
382  unsigned ht0 = 0;
383  unsigned ht1 = 0;
384  bool of = false;
385 
386  for(UShort i=0; i < MAX_JETS_OUT; ++i)
387  {
388  // Only sum Ht for valid jets
389  if (!m_outputJets.at(i).isNullJet()) {
390  unsigned ieta = m_outputJets.at(i).rctEta();
391  unsigned htJet = m_outputJets.at(i).calibratedEt(m_jetEtCalLuts.at(ieta));
392  // Scalar sum of Htt, with associated threshold
393  if (htJet >= m_HttSumJetThreshold) {
394  htt += htJet;
395  }
396  // Strip sums, for input to Htm calculation, with associated threshold
397  if (htJet >= m_HtmSumJetThreshold) {
398  if (m_outputJets.at(i).rctPhi() == 0) {
399  ht0 += htJet;
400  }
401  if (m_outputJets.at(i).rctPhi() == 1) {
402  ht1 += htJet;
403  }
404  of |= m_outputJets.at(i).overFlow();
405  }
406  }
407  }
408 
409  etHadType httTotal(htt);
410  etHadType htStrip0(ht0);
411  etHadType htStrip1(ht1);
412  httTotal.setOverFlow(httTotal.overFlow() || of);
413  if (httTotal.overFlow()) httTotal.setValue(htTotalMaxValue);
414  htStrip0.setOverFlow(htStrip0.overFlow() || of);
415  htStrip1.setOverFlow(htStrip1.overFlow() || of);
416  unsigned xfact0 = (4*m_id + 10) % 36;
417  unsigned xfact1 = (4*m_id + 4) % 36;
418  unsigned yfact0 = (4*m_id + 19) % 36;
419  unsigned yfact1 = (4*m_id + 13) % 36;
420  m_outputHtSum = httTotal;
421  m_outputHxSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
422  (htStrip0, xfact0, htStrip1, xfact1);
423  m_outputHySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
424  (htStrip0, yfact0, htStrip1, yfact1);
425 
426  // Common overflow for Ht components
427  bool htmOverFlow = m_outputHxSum.overFlow() || m_outputHySum.overFlow();
428  m_outputHxSum.setOverFlow(htmOverFlow);
429  m_outputHySum.setOverFlow(htmOverFlow);
430 
433  m_outputHySumPipe.store(m_outputHySum, bxRel());
434 }
435 
436 
437 // Calculates Hf inner rings Et sum, and counts number of "fineGrain" bits set
439 {
440  static const UShort NUMBER_OF_FRWRD_RINGS = 4;
441  static const UShort NUMBER_OF_INNER_RINGS = 2;
442  std::vector<unsigned> et(NUMBER_OF_INNER_RINGS, 0);
443  std::vector<bool> of(NUMBER_OF_INNER_RINGS, false);
444  std::vector<unsigned> nt(NUMBER_OF_INNER_RINGS, 0);
445 
447  for (UShort i=0; i < NUMBER_OF_FRWRD_RINGS; ++i) {
448  offset--;
449 
450  // Sum HF Et and count jets above threshold over "inner rings"
451  if (i<NUMBER_OF_INNER_RINGS) {
452  et.at(i) += m_inputRegions.at(offset).et();
453  of.at(i) = of.at(i) || m_inputRegions.at(offset).overFlow();
454 
455  et.at(i) += m_inputRegions.at(offset+COL_OFFSET).et();
456  of.at(i) = of.at(i) || m_inputRegions.at(offset+COL_OFFSET).overFlow();
457 
458  if (m_inputRegions.at(offset).fineGrain()) nt.at(i)++;
459  if (m_inputRegions.at(offset+COL_OFFSET).fineGrain()) nt.at(i)++;
460  }
461  }
462  hfTowerSumsType temp(et.at(0), et.at(1), nt.at(0), nt.at(1));
463  temp.etSum0.setOverFlow(temp.etSum0.overFlow() || of.at(0));
464  temp.etSum1.setOverFlow(temp.etSum1.overFlow() || of.at(1));
465  return temp;
466 }
467 
468 
469 // Here is where the rotations are actually done
470 // Procedure suitable for implementation in hardware, using
471 // integer multiplication and bit shifting operations
472 
473 template <int kBitsInput, int kBitsOutput>
476  const L1GctUnsignedInt<kBitsInput>& etStrip1, const unsigned& fact1) {
477 
478  // typedefs and constants
479  typedef L1GctTwosComplement<kBitsOutput> OutputType;
480 
481  // The sin(phi), cos(phi) factors are represented in 15 bits,
482  // as numbers in the range -2^14 to 2^14.
483  // We multiply each input strip Et by the required factor
484  // then shift, to divide by 2^13. This gives an extra bit
485  // of precision on the LSB of the output values.
486  // It's important to avoid systematically biasing the Ex, Ey
487  // component values because this results in an asymmetric
488  // distribution in phi for the final MEt.
489  // The extra LSB is required because one of the factors is 0.5.
490  // Applying this factor without the extra LSB corrects odd values
491  // systematically down by 0.5; or all values by 0.25
492  // on average, giving a shift of -2 units in Ex.
493 
494  static const int internalComponentSize = 15;
495  static const int maxEt = 1<<internalComponentSize;
496 
497  static const int kBitsFactor = internalComponentSize+kBitsInput+1;
498  static const int maxFactor = 1<<kBitsFactor;
499 
500  static const int bitsToShift = internalComponentSize-2;
501  static const int halfInputLsb = 1<<(bitsToShift-1);
502 
503  // These factors correspond to the sine of angles from -90 degrees to
504  // 90 degrees in 10 degree steps, multiplied by 16383 and written
505  // as a <kBitsFactor>-bit 2s-complement number.
506  const int factors[19] = {maxFactor-16383, maxFactor-16134, maxFactor-15395, maxFactor-14188, maxFactor-12550,
507  maxFactor-10531, maxFactor-8192, maxFactor-5603, maxFactor-2845, 0,
508  2845, 5603, 8192, 10531, 12550, 14188, 15395, 16134, 16383};
509 
510  int rotatedValue0, rotatedValue1, myFact;
511  int etComponentSum = 0;
512 
513  if (fact0 >= 36 || fact1 >= 36) {
514  if (m_verbose) {
515  edm::LogError("L1GctProcessingError")
516  << "L1GctJetLeafCard::rotateEtValue() has been called with factor numbers "
517  << fact0 << " and " << fact1 << "; should be less than 36 \n";
518  }
519  } else {
520 
521  // First strip - choose the required multiplication factor
522  if (fact0>18) { myFact = factors[(36-fact0)]; }
523  else { myFact = factors[fact0]; }
524 
525  // Multiply the Et value by the factor.
526  rotatedValue0 = static_cast<int>(etStrip0.value()) * myFact;
527 
528  // Second strip - choose the required multiplication factor
529  if (fact1>18) { myFact = factors[(36-fact1)]; }
530  else { myFact = factors[fact1]; }
531 
532  // Multiply the Et value by the factor.
533  rotatedValue1 = static_cast<int>(etStrip1.value()) * myFact;
534 
535  // Add the two scaled values together, with full resolution including
536  // fractional parts from the sin(phi), cos(phi) scaling.
537  // Adjust the value to avoid truncation errors since these
538  // accumulate and cause problems for the missing Et measurement.
539  // Then discard the 13 LSB and interpret the result as
540  // a 15-bit twos complement integer.
541  etComponentSum = ((rotatedValue0 + rotatedValue1) + halfInputLsb)>>bitsToShift;
542 
543  etComponentSum = etComponentSum & (maxEt-1);
544  if (etComponentSum >= (maxEt/2)) {
545  etComponentSum = etComponentSum - maxEt;
546  }
547  }
548 
549  // Store as a TwosComplement format integer and return
550  OutputType temp(etComponentSum);
551  temp.setOverFlow(temp.overFlow() || etStrip0.overFlow() || etStrip1.overFlow());
552  return temp;
553 }
554 
555 // Declare the specific versions we want to use, to help the linker out
556 // One for the MET components
557 template
559 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
560 (const L1GctJetFinderBase::etTotalType&, const unsigned&,
561  const L1GctJetFinderBase::etTotalType&, const unsigned&);
562 
563 // One for the MHT components
564 template
566 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
567 (const L1GctJetFinderBase::etTotalType&, const unsigned&,
568  const L1GctJetFinderBase::etTotalType&, const unsigned&);
bool m_idInRange
Remember whether range check on the input ID was ok.
bool overFlow() const
access overflow
void setOverFlow(bool oflow)
set the overflow bit
void reset()
complete reset of processor
etTotalType m_outputEtSum
output Et strip sums and Ht - refactored
int i
Definition: DBlmapReader.cc:9
static const unsigned int MAX_JETS_OUT
Max of 6 jets found per jetfinder in a 2*11 search area.
std::vector< L1GctJetCand > JetVector
void doEtSums()
Calculates scalar and vector sum of Et over input regions.
void setOverFlow(bool oflow)
set the overflow bit
RegionsVector m_sentProtoJets
List of pre-clustered jets to be sent to neighbour after the first stage of clustering.
htCompInternJfType m_outputHySum
static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx)
Emulator constructors.
hfTowerSumsType calcHfSums() const
Calculates Et sum and number of towers over threshold in Hf.
unsigned rctEta() const
get local eta index (within RCT crate)
Definition: L1CaloRegion.h:174
unsigned rctCrate() const
get RCT crate ID
Definition: L1CaloRegion.h:165
bool m_verbose
Flag to control output messages.
unsigned getCenJetEtSeedGct() const
unsigned getTauJetEtSeedGct() const
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
Gct version of a calorimeter region, used within GCT emulation.
Definition: L1GctRegion.h:17
void setBx(int16_t bx)
set bx
Pipeline< etCompInternJfType > m_outputExSumPipe
int bxRel() const
virtual void resetPipelines()
int bxMin() const
Support for multiple beam crossing operation.
fetchType
different ways of getting the neighbour data
htCompInternJfType m_outputHxSum
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void setupObjects()
Initialise inputs with null objects for the correct bunch crossing if required.
unsigned getTauIsoEtThresholdGct() const
Pipeline< htCompInternJfType > m_outputHySumPipe
int numOfBx() const
Pipeline< htCompInternJfType > m_outputHxSumPipe
L1GctJetFinderBase(int id)
id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
A Level-1 jet candidate, used within GCT emulation.
Definition: L1GctJet.h:27
void setNeighbourJetFinders(std::vector< L1GctJetFinderBase * > neighbours)
Set pointers to neighbours - needed to complete the setup.
void setBx(const int16_t bx)
Definition: L1GctJet.h:51
virtual unsigned centralCol0() const
JetVector getSortedJets() const
Base class to allow implementation of jetFinder algorithms.
static L1GctRegion makeJfInputRegion(const L1CaloRegion &)
Definition: L1GctRegion.cc:7
ABC for a GCT trigger data processing unit.
static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx)
unsigned value() const
access value as unsigned
unsigned getMHtJetEtThresholdGct() const
L1GctTwosComplement< kBitsOutput > etComponentForJetFinder(const L1GctUnsignedInt< kBitsInput > &etStrip0, const unsigned &fact0, const L1GctUnsignedInt< kBitsInput > &etStrip1, const unsigned &fact1)
Private method for calculating MEt and MHt components.
bool m_gotNeighbourPointers
Remember whether the neighbour pointers have been stored.
std::vector< L1GctInternJetData > getInternalJets() const
get output jets in raw format - to be stored in the event
void doHtSums()
Calculates scalar and vector sum of Ht over calibrated jets.
Definition of signed integer types with overflow.
tuple result
Definition: query.py:137
static L1GctInternHtMiss emulatorJetMissHt(const int htx, const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x &amp; y components object from emulator (jetFinder output)...
void sortJets()
Sort the found jets. All jetFinders should call this in process().
std::vector< L1GctInternEtSum > getInternalEtSums() const
get et sums in raw format - to be stored in the event
unsigned rctPhi() const
get local phi index (within RCT crate)
Definition: L1CaloRegion.h:177
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
Set pointer to calibration Lut - needed to complete the setup.
lutPtrVector m_jetEtCalLuts
Jet Et Conversion LUT pointer.
int j
Definition: DBlmapReader.cc:9
std::vector< L1GctJetFinderBase * > m_neighbourJetFinders
Store neighbour pointers.
Pipeline< etHadType > m_outputHtSumPipe
static const unsigned int N_EXTRA_REGIONS_ETA00
Number of additional regions to process on the &quot;wrong&quot; side of eta=0 (determines COL_OFFSET) ...
unsigned short int UShort
static const unsigned int CENTRAL_COL0
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
unsigned int offset(bool)
static const unsigned int MAX_REGIONS_IN
The real jetFinders must define these constants.
static const unsigned int COL_OFFSET
The index offset between columns.
RawJetVector m_outputJets
output jets
void setJetFinderParams(const L1GctJetFinderParams *jfpars)
Set pointer to parameters - needed to complete the setup.
RegionsVector m_inputRegions
input data required for jet finding
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
int nt
Definition: AMPTWrapper.h:32
Pipeline< etCompInternJfType > m_outputEySumPipe
RawJetPipeline m_outputJetsPipe
Output jets &quot;pipeline memory&quot; for checking.
virtual void resetProcessor()
Separate reset methods for the processor itself and any data stored in pipelines. ...
static L1GctInternJetData fromEmulator(L1CaloRegionDetId rgn, int16_t bx, uint16_t et, bool overFlow, bool tauVeto, uint8_t eta, uint8_t phi, uint16_t rank)
unsigned getCenForJetEtaBoundary() const
void setInputRegion(const L1CaloRegion &region)
Set input data.
unsigned m_CenJetSeed
jetFinder parameters (from EventSetup)
static const unsigned N_PHI
virtual unsigned nCols() const
std::vector< lutPtr > lutPtrVector
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
unsigned getHtJetEtThresholdGct() const
etCompInternJfType m_outputEySum
void setValue(unsigned value)
Set value from unsigned.
int bxAbs() const
Pipeline< etTotalType > m_outputEtSumPipe
&quot;Pipeline memories&quot; for energy sums
unsigned getForJetEtSeedGct() const
bool m_gotJetFinderParams
Remember whether jetfinder parameters have been stored.
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:22
virtual unsigned maxRegionsIn() const
static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx)
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
bool overFlow() const
access overflow
RegionsVector m_rcvdProtoJets
List of pre-clustered jets received from neighbour before the final stage of clustering.
static const unsigned int N_COLS
std::vector< L1GctRegion > RegionsVector
etCompInternJfType m_outputExSum
bool m_gotJetEtCalLuts
Remember whether jet Et calibration Lut pointers have been stored.
void doEnergySums()
Fill the Et strip sums and Ht sum. All jetFinders should call this in process().
hfTowerSumsType m_outputHfSums
static const unsigned int N_JF_PER_WHEEL
No of jetFinders per Wheel.